Always consider non-buffer-backed uniform blocks as used

This commit is contained in:
baldurk
2014-08-14 14:29:20 +01:00
parent 6f35d1fb27
commit e54aed0c2b
+13 -6
View File
@@ -650,16 +650,23 @@ void GLReplay::GetMapping(WrappedOpenGL &gl, GLuint curProg, int shadIdx, Shader
mapping.ConstantBlocks[i].bind = -1;
}
GLuint idx = gl.glGetProgramResourceIndex(curProg, eGL_UNIFORM_BLOCK, refl->ConstantBlocks.elems[i].name.elems);
if(idx == GL_INVALID_INDEX)
if(!refl->ConstantBlocks.elems[i].bufferBacked)
{
mapping.ConstantBlocks[i].used = false;
mapping.ConstantBlocks[i].used = true;
}
else
{
GLint used = 0;
gl.glGetProgramResourceiv(curProg, eGL_UNIFORM_BLOCK, idx, 1, &refEnum[shadIdx], 1, NULL, &used);
mapping.ConstantBlocks[i].used = (used != 0);
GLuint idx = gl.glGetProgramResourceIndex(curProg, eGL_UNIFORM_BLOCK, refl->ConstantBlocks.elems[i].name.elems);
if(idx == GL_INVALID_INDEX)
{
mapping.ConstantBlocks[i].used = false;
}
else
{
GLint used = 0;
gl.glGetProgramResourceiv(curProg, eGL_UNIFORM_BLOCK, idx, 1, &refEnum[shadIdx], 1, NULL, &used);
mapping.ConstantBlocks[i].used = (used != 0);
}
}
}