mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-10-21 11:31:13 +00:00
Add glColorMask
This commit is contained in:
1 parent
a37dc952e0
commit
f707e85d03
6 files changed
+76
No files matched your search
@@ -134,6 +134,8 @@ enum GLChunkType
|
||||
BLEND_FUNC_SEPI,
|
||||
BLEND_EQ_SEP,
|
||||
BLEND_EQ_SEPI,
|
||||
COLOR_MASK,
|
||||
COLOR_MASKI,
|
||||
DEPTH_FUNC,
|
||||
VIEWPORT,
|
||||
VIEWPORT_ARRAY,
|
||||
|
||||
@@ -393,6 +393,63 @@ void WrappedOpenGL::glHint(GLenum target, GLenum mode)
|
||||
RDCUNIMPLEMENTED();
|
||||
}
|
||||
|
||||
bool WrappedOpenGL::Serialise_glColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
|
||||
{
|
||||
SERIALISE_ELEMENT(uint8_t, r, red);
|
||||
SERIALISE_ELEMENT(uint8_t, g, green);
|
||||
SERIALISE_ELEMENT(uint8_t, b, blue);
|
||||
SERIALISE_ELEMENT(uint8_t, a, alpha);
|
||||
|
||||
if(m_State <= EXECUTING)
|
||||
{
|
||||
m_Real.glColorMask(r, g, b, a);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void WrappedOpenGL::glColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
|
||||
{
|
||||
m_Real.glColorMask(red, green, blue, alpha);
|
||||
|
||||
if(m_State == WRITING_CAPFRAME)
|
||||
{
|
||||
SCOPED_SERIALISE_CONTEXT(COLOR_MASK);
|
||||
Serialise_glColorMask(red, green, blue, alpha);
|
||||
|
||||
m_ContextRecord->AddChunk(scope.Get());
|
||||
}
|
||||
}
|
||||
|
||||
bool WrappedOpenGL::Serialise_glColorMaski(GLuint buf, GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
|
||||
{
|
||||
SERIALISE_ELEMENT(uint32_t, buffer, buf);
|
||||
SERIALISE_ELEMENT(uint8_t, r, red);
|
||||
SERIALISE_ELEMENT(uint8_t, g, green);
|
||||
SERIALISE_ELEMENT(uint8_t, b, blue);
|
||||
SERIALISE_ELEMENT(uint8_t, a, alpha);
|
||||
|
||||
if(m_State <= EXECUTING)
|
||||
{
|
||||
m_Real.glColorMaski(buffer, r, g, b, a);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void WrappedOpenGL::glColorMaski(GLuint buf, GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
|
||||
{
|
||||
m_Real.glColorMaski(buf, red, green, blue, alpha);
|
||||
|
||||
if(m_State == WRITING_CAPFRAME)
|
||||
{
|
||||
SCOPED_SERIALISE_CONTEXT(COLOR_MASKI);
|
||||
Serialise_glColorMaski(buf, red, green, blue, alpha);
|
||||
|
||||
m_ContextRecord->AddChunk(scope.Get());
|
||||
}
|
||||
}
|
||||
|
||||
bool WrappedOpenGL::Serialise_glViewport(GLint x, GLint y, GLsizei width, GLsizei height)
|
||||
{
|
||||
SERIALISE_ELEMENT(GLint, X, x);
|
||||
|
||||
@@ -91,6 +91,8 @@ const char *GLChunkNames[] =
|
||||
"glBlendFuncSeparatei",
|
||||
"glBlendEquationSeparate",
|
||||
"glBlendEquationSeparatei",
|
||||
"glColorMask",
|
||||
"glColorMaski",
|
||||
"glDepthFunc",
|
||||
"glViewport",
|
||||
"glViewportArrayv",
|
||||
@@ -1024,6 +1026,12 @@ void WrappedOpenGL::ProcessChunk(uint64_t offset, GLChunkType context)
|
||||
case BLEND_EQ_SEPI:
|
||||
glBlendEquationSeparatei(0, eGL_UNKNOWN_ENUM, eGL_UNKNOWN_ENUM);
|
||||
break;
|
||||
case COLOR_MASK:
|
||||
glColorMask(0, 0, 0, 0);
|
||||
break;
|
||||
case COLOR_MASKI:
|
||||
glColorMaski(0, 0, 0, 0, 0);
|
||||
break;
|
||||
case DEPTH_FUNC:
|
||||
Serialise_glDepthFunc(eGL_UNKNOWN_ENUM);
|
||||
break;
|
||||
|
||||
@@ -271,6 +271,8 @@ class WrappedOpenGL
|
||||
IMPLEMENT_FUNCTION_SERIALISED(void, glBlendFuncSeparatei(GLuint buf, GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha));
|
||||
IMPLEMENT_FUNCTION_SERIALISED(void, glBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha));
|
||||
IMPLEMENT_FUNCTION_SERIALISED(void, glBlendEquationSeparatei(GLuint buf, GLenum modeRGB, GLenum modeAlpha));
|
||||
IMPLEMENT_FUNCTION_SERIALISED(void, glColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha));
|
||||
IMPLEMENT_FUNCTION_SERIALISED(void, glColorMaski(GLuint buf, GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha));
|
||||
IMPLEMENT_FUNCTION_SERIALISED(void, glClear(GLbitfield mask));
|
||||
IMPLEMENT_FUNCTION_SERIALISED(void, glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha));
|
||||
IMPLEMENT_FUNCTION_SERIALISED(void, glClearDepth(GLclampd depth));
|
||||
|
||||
@@ -37,6 +37,7 @@ struct GLHookSet
|
||||
PFNGLCLEARPROC glClear;
|
||||
PFNGLCLEARCOLORPROC glClearColor;
|
||||
PFNGLCLEARDEPTHPROC glClearDepth;
|
||||
PFNGLCOLORMASKPROC glColorMask;
|
||||
PFNGLCULLFACEPROC glCullFace;
|
||||
PFNGLDEPTHFUNCPROC glDepthFunc;
|
||||
PFNGLDISABLEPROC glDisable;
|
||||
@@ -101,6 +102,7 @@ struct GLHookSet
|
||||
PFNGLBLENDFUNCSEPARATEIPROC glBlendFuncSeparatei;
|
||||
PFNGLBLENDEQUATIONSEPARATEPROC glBlendEquationSeparate;
|
||||
PFNGLBLENDEQUATIONSEPARATEIPROC glBlendEquationSeparatei;
|
||||
PFNGLCOLORMASKIPROC glColorMaski;
|
||||
PFNGLCREATESHADERPROC glCreateShader;
|
||||
PFNGLDELETESHADERPROC glDeleteShader;
|
||||
PFNGLSHADERSOURCEPROC glShaderSource;
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
HookInit(glClear); \
|
||||
HookInit(glClearColor); \
|
||||
HookInit(glClearDepth); \
|
||||
HookInit(glColorMask); \
|
||||
HookInit(glCullFace); \
|
||||
HookInit(glDepthFunc); \
|
||||
HookInit(glDisable); \
|
||||
@@ -112,6 +113,7 @@
|
||||
HookExtension(PFNGLBLENDFUNCSEPARATEIPROC, glBlendFuncSeparatei); \
|
||||
HookExtension(PFNGLBLENDEQUATIONSEPARATEPROC, glBlendEquationSeparate); \
|
||||
HookExtension(PFNGLBLENDEQUATIONSEPARATEIPROC, glBlendEquationSeparatei); \
|
||||
HookExtension(PFNGLCOLORMASKIPROC, glColorMaski); \
|
||||
HookExtension(PFNGLCREATESHADERPROC, glCreateShader); \
|
||||
HookExtension(PFNGLDELETESHADERPROC, glDeleteShader); \
|
||||
HookExtension(PFNGLSHADERSOURCEPROC, glShaderSource); \
|
||||
@@ -178,6 +180,7 @@
|
||||
HookExtension(PFNGLCLEARPROC, glClear); \
|
||||
HookExtension(PFNGLCLEARCOLORPROC, glClearColor); \
|
||||
HookExtension(PFNGLCLEARDEPTHPROC, glClearDepth); \
|
||||
HookExtension(PFNGLCOLORMASKPROC, glColorMask); \
|
||||
HookExtension(PFNGLCULLFACEPROC, glCullFace); \
|
||||
HookExtension(PFNGLDEPTHFUNCPROC, glDepthFunc); \
|
||||
HookExtension(PFNGLDISABLEPROC, glDisable); \
|
||||
@@ -233,6 +236,7 @@
|
||||
HookWrapper1(void, glClear, GLbitfield, mask); \
|
||||
HookWrapper4(void, glClearColor, GLfloat, red, GLfloat, green, GLfloat, blue, GLfloat, alpha); \
|
||||
HookWrapper1(void, glClearDepth, GLdouble, depth); \
|
||||
HookWrapper4(void, glColorMask, GLboolean, red, GLboolean, green, GLboolean, blue, GLboolean, alpha); \
|
||||
HookWrapper1(void, glCullFace, GLenum, mode); \
|
||||
HookWrapper1(void, glDepthFunc, GLenum, func); \
|
||||
HookWrapper1(void, glDisable, GLenum, cap); \
|
||||
@@ -308,6 +312,7 @@
|
||||
HookWrapper5(void, glBlendFuncSeparatei, GLuint, buf, GLenum, srcRGB, GLenum, dstRGB, GLenum, srcAlpha, GLenum, dstAlpha); \
|
||||
HookWrapper2(void, glBlendEquationSeparate, GLenum, modeRGB, GLenum, modeAlpha); \
|
||||
HookWrapper3(void, glBlendEquationSeparatei, GLuint, buf, GLenum, modeRGB, GLenum, modeAlpha); \
|
||||
HookWrapper5(void, glColorMaski, GLuint, index, GLboolean, r, GLboolean, g, GLboolean, b, GLboolean, a); \
|
||||
HookWrapper1(GLuint, glCreateShader, GLenum, type); \
|
||||
HookWrapper1(void, glDeleteShader, GLuint, shader); \
|
||||
HookWrapper4(void, glShaderSource, GLuint, shader, GLsizei, count, const GLchar *const*, string, const GLint *, length); \
|
||||
|
||||
Reference in new issue
Block a user