Leave enum alone for passing to glGetProgramStageiv

* We can't pass GL_COMPUTE_SHADER to glGetProgramPipelineiv in some cases,
  but if we have a program (not pipeline) and want to query, we need the
  enum intact even if the AMD bug workaround is active.
This commit is contained in:
baldurk
2014-12-23 23:11:25 +00:00
parent 3caef1cb8e
commit ed3c50db87
+7 -3
View File
@@ -154,15 +154,19 @@ void GLRenderState::FetchState(void *ctx, WrappedOpenGL *gl)
eGL_TESS_EVALUATION_SHADER,
eGL_GEOMETRY_SHADER,
eGL_FRAGMENT_SHADER,
VendorCheck[VendorCheck_AMD_pipeline_compute_query] ? eGL_NONE : eGL_COMPUTE_SHADER,
eGL_COMPUTE_SHADER,
};
RDCCOMPILE_ASSERT(ARRAY_COUNT(shs) == ARRAY_COUNT(Subroutines), "Subroutine array not the right size");
for(size_t s=0; s < ARRAY_COUNT(shs); s++)
{
GLuint prog = Program;
if(prog == 0 && Pipeline != 0 && shs[s] != eGL_NONE)
m_Real->glGetProgramPipelineiv(Pipeline, shs[s], (GLint *)&prog);
if(prog == 0 && Pipeline != 0)
{
// can't query for GL_COMPUTE_SHADER on some AMD cards
if(shs[s] != eGL_COMPUTE_SHADER || !VendorCheck[VendorCheck_AMD_pipeline_compute_query])
m_Real->glGetProgramPipelineiv(Pipeline, shs[s], (GLint *)&prog);
}
if(prog == 0) continue;