Add a vendor check to avoid glGetProgramPipelineiv+GL_COMPUTE_SHADER

This commit is contained in:
baldurk
2014-12-14 12:17:42 +00:00
parent 7c663de948
commit 7d293ddd76
3 changed files with 30 additions and 3 deletions
+25
View File
@@ -215,6 +215,31 @@ void DoVendorChecks(const GLHookSet &gl, GLWindowingData context)
gl.glDeleteTextures(2, texs);
}
if(gl.glGetError && gl.glGenProgramPipelines && gl.glDeleteProgramPipelines && gl.glGetProgramPipelineiv)
{
GLuint pipe = 0;
gl.glGenProgramPipelines(1, &pipe);
// clear all error flags.
GLenum err = gl.glGetError();
while(err != eGL_NONE) err = gl.glGetError();
GLint dummy = 0;
gl.glGetProgramPipelineiv(pipe, eGL_COMPUTE_SHADER, &dummy);
err = gl.glGetError();
if(err != eGL_NONE)
{
// if we got an error trying to query that, we should enable this hack
VendorCheck[VendorCheck_AMD_pipeline_compute_query] = true;
RDCWARN("Using hack to avoid glGetProgramPipelineiv with GL_COMPUTE_SHADER");
}
gl.glDeleteProgramPipelines(1, &pipe);
}
// only do this when we have a proper context e.g. on windows where an old
// context is first created. Check to see if FBOs or VAOs are shared between
// contexts.