mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-07-31 03:41:01 +00:00
"Implement" shader/program binary functions, but don't allow them
* We want the application to pass us real GLSL shaders so we can do all kinds of juicy things to them. This is generally indicated by the program having a LINK_STATUS of FALSE or similar, and we can pretty much get that by just not passing through the call.
This commit is contained in:
@@ -517,6 +517,8 @@ class WrappedOpenGL
|
||||
IMPLEMENT_FUNCTION_SERIALISED(void, glUseProgram(GLuint program));
|
||||
IMPLEMENT_FUNCTION_SERIALISED(void, glUseProgramStages(GLuint pipeline, GLbitfield stages, GLuint program));
|
||||
IMPLEMENT_FUNCTION_SERIALISED(void, glValidateProgram(GLuint program));
|
||||
IMPLEMENT_FUNCTION_SERIALISED(void, glShaderBinary(GLsizei count, const GLuint *shaders, GLenum binaryformat, const void *binary, GLsizei length));
|
||||
IMPLEMENT_FUNCTION_SERIALISED(void, glProgramBinary(GLuint program, GLenum binaryFormat, const void *binary, GLsizei length));
|
||||
IMPLEMENT_FUNCTION_SERIALISED(void, glGenProgramPipelines(GLsizei n, GLuint *pipelines));
|
||||
IMPLEMENT_FUNCTION_SERIALISED(void, glBindProgramPipeline(GLuint pipeline));
|
||||
IMPLEMENT_FUNCTION_SERIALISED(void, glActiveShaderProgram(GLuint pipeline, GLuint program));
|
||||
|
||||
@@ -266,6 +266,8 @@ struct GLHookSet
|
||||
PFNGLLINKPROGRAMPROC glLinkProgram;
|
||||
PFNGLPROGRAMPARAMETERIPROC glProgramParameteri;
|
||||
PFNGLUSEPROGRAMPROC glUseProgram;
|
||||
PFNGLSHADERBINARYPROC glShaderBinary;
|
||||
PFNGLPROGRAMBINARYPROC glProgramBinary;
|
||||
PFNGLUSEPROGRAMSTAGESPROC glUseProgramStages;
|
||||
PFNGLVALIDATEPROGRAMPROC glValidateProgram;
|
||||
PFNGLGENPROGRAMPIPELINESPROC glGenProgramPipelines;
|
||||
|
||||
@@ -286,6 +286,8 @@
|
||||
HookExtension(PFNGLLINKPROGRAMPROC, glLinkProgram); \
|
||||
HookExtension(PFNGLPROGRAMPARAMETERIPROC, glProgramParameteri); \
|
||||
HookExtension(PFNGLUSEPROGRAMPROC, glUseProgram); \
|
||||
HookExtension(PFNGLSHADERBINARYPROC, glShaderBinary); \
|
||||
HookExtension(PFNGLPROGRAMBINARYPROC, glProgramBinary); \
|
||||
HookExtension(PFNGLUSEPROGRAMSTAGESPROC, glUseProgramStages); \
|
||||
HookExtension(PFNGLVALIDATEPROGRAMPROC, glValidateProgram); \
|
||||
HookExtension(PFNGLGENPROGRAMPIPELINESPROC, glGenProgramPipelines); \
|
||||
@@ -962,6 +964,8 @@
|
||||
HookWrapper1(void, glLinkProgram, GLuint, program); \
|
||||
HookWrapper3(void, glProgramParameteri, GLuint, program, GLenum, pname, GLint, value); \
|
||||
HookWrapper1(void, glUseProgram, GLuint, program); \
|
||||
HookWrapper5(void, glShaderBinary, GLsizei, count, const GLuint *, shaders, GLenum, binaryformat, const void *, binary, GLsizei, length); \
|
||||
HookWrapper4(void, glProgramBinary, GLuint, program, GLenum, binaryFormat, const void *, binary, GLsizei, length); \
|
||||
HookWrapper3(void, glUseProgramStages, GLuint, pipeline, GLbitfield, stages, GLuint, program); \
|
||||
HookWrapper1(void, glValidateProgram, GLuint, program); \
|
||||
HookWrapper2(void, glGenProgramPipelines, GLsizei, n, GLuint *, pipelines); \
|
||||
|
||||
@@ -690,6 +690,24 @@ void WrappedOpenGL::glValidateProgramPipeline(GLuint pipeline)
|
||||
m_Real.glValidateProgramPipeline(pipeline);
|
||||
}
|
||||
|
||||
void WrappedOpenGL::glShaderBinary(GLsizei count, const GLuint *shaders, GLenum binaryformat, const void *binary, GLsizei length)
|
||||
{
|
||||
// deliberately don't forward on this call when writing, since we want to coax the app into providing non-binary shaders.
|
||||
if(m_State < WRITING)
|
||||
{
|
||||
m_Real.glShaderBinary(count, shaders, binaryformat, binary, length);
|
||||
}
|
||||
}
|
||||
|
||||
void WrappedOpenGL::glProgramBinary(GLuint program, GLenum binaryFormat, const void *binary, GLsizei length)
|
||||
{
|
||||
// deliberately don't forward on this call when writing, since we want to coax the app into providing non-binary shaders.
|
||||
if(m_State < WRITING)
|
||||
{
|
||||
m_Real.glProgramBinary(program, binaryFormat, binary, length);
|
||||
}
|
||||
}
|
||||
|
||||
#pragma endregion
|
||||
|
||||
#pragma region Program Pipelines
|
||||
|
||||
Reference in New Issue
Block a user