If a program is linked mid-capture, inject new initial contents chunk

* This is only intended to handle the case where a new program is created mid
  frame and linked for the first time, and we need the initial contents chunk to
  get location translation among other things. We don't yet handle programs
  being re-linked multiple times mid-frame.
This commit is contained in:
baldurk
2019-05-14 17:13:23 +01:00
parent d3d85fff1f
commit af14d2f0ce
@@ -887,6 +887,15 @@ void WrappedOpenGL::glLinkProgram(GLuint program)
record->AddChunk(scope.Get());
}
// we need initial contents for programs to know any initial bindings potentially if they change
// over the frame, and for uniform location remapping.
// We just inject a call to prepare the initial contents now, any other post-link data setting
// will be replayed as expected.
if(IsActiveCapturing(m_State))
{
GetResourceManager()->ContextPrepare_InitialState(ProgramRes(GetCtx(), program));
}
}
{