glUniformBlockBinding should be serialised mid-frame only, not in init

* glUniformBlockBinding can be changed at runtime and previously pushing all
  instances of it into the resource record means it would be overwritten by any
  bindings retrieved by the initial contents. That's fine (if redundant) if they
  aren't changed afterwards, but if they are changed then this will be wrong.
This commit is contained in:
baldurk
2019-05-14 17:13:23 +01:00
parent 73a909995a
commit d3d85fff1f
@@ -955,19 +955,15 @@ void WrappedOpenGL::glUniformBlockBinding(GLuint program, GLuint uniformBlockInd
{
SERIALISE_TIME_CALL(GL.glUniformBlockBinding(program, uniformBlockIndex, uniformBlockBinding));
if(IsCaptureMode(m_State))
// we should only capture this while active, since the initial states will grab everything at the
// start of the frame and we only want to pick up dynamic changes after that.
if(IsActiveCapturing(m_State))
{
GLResourceRecord *record = GetResourceManager()->GetResourceRecord(ProgramRes(GetCtx(), program));
RDCASSERTMSG("Couldn't identify object passed to function. Mismatched or bad GLuint?", record,
program);
if(record)
{
USE_SCRATCH_SERIALISER();
SCOPED_SERIALISE_CHUNK(gl_CurChunk);
Serialise_glUniformBlockBinding(ser, program, uniformBlockIndex, uniformBlockBinding);
USE_SCRATCH_SERIALISER();
SCOPED_SERIALISE_CHUNK(gl_CurChunk);
Serialise_glUniformBlockBinding(ser, program, uniformBlockIndex, uniformBlockBinding);
record->AddChunk(scope.Get());
}
GetContextRecord()->AddChunk(scope.Get());
}
}