mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-05 17:40:39 +00:00
Only process program pipeline being bound if it's non-zero
* Unbinding the pipeline by setting 0 should still be serialised, but there's nothing to reference or query for.
This commit is contained in:
@@ -1756,20 +1756,25 @@ void WrappedOpenGL::glBindProgramPipeline(GLuint pipeline)
|
||||
Serialise_glBindProgramPipeline(ser, pipeline);
|
||||
|
||||
GetContextRecord()->AddChunk(scope.Get());
|
||||
GetResourceManager()->MarkResourceFrameReferenced(ProgramPipeRes(GetCtx(), pipeline),
|
||||
eFrameRef_Read);
|
||||
// mark all the sub programs referenced
|
||||
GLenum programBinds[] = {
|
||||
eGL_VERTEX_SHADER, eGL_FRAGMENT_SHADER, eGL_GEOMETRY_SHADER,
|
||||
eGL_TESS_CONTROL_SHADER, eGL_TESS_EVALUATION_SHADER, eGL_COMPUTE_SHADER,
|
||||
};
|
||||
|
||||
for(GLenum progbind : programBinds)
|
||||
if(pipeline != 0)
|
||||
{
|
||||
GLuint prog = 0;
|
||||
GL.glGetProgramPipelineiv(pipeline, progbind, (GLint *)&prog);
|
||||
if(prog)
|
||||
GetResourceManager()->MarkResourceFrameReferenced(ProgramRes(GetCtx(), prog), eFrameRef_Read);
|
||||
GetResourceManager()->MarkResourceFrameReferenced(ProgramPipeRes(GetCtx(), pipeline),
|
||||
eFrameRef_Read);
|
||||
// mark all the sub programs referenced
|
||||
GLenum programBinds[] = {
|
||||
eGL_VERTEX_SHADER, eGL_FRAGMENT_SHADER, eGL_GEOMETRY_SHADER,
|
||||
eGL_TESS_CONTROL_SHADER, eGL_TESS_EVALUATION_SHADER, eGL_COMPUTE_SHADER,
|
||||
};
|
||||
|
||||
for(GLenum progbind : programBinds)
|
||||
{
|
||||
GLuint prog = 0;
|
||||
GL.glGetProgramPipelineiv(pipeline, progbind, (GLint *)&prog);
|
||||
if(prog)
|
||||
GetResourceManager()->MarkResourceFrameReferenced(ProgramRes(GetCtx(), prog),
|
||||
eFrameRef_Read);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user