Serialise out calls to MakeCurrent mid-frame-capture.

* We need to serialise out the new state vector that's applied when we
  change context.
* Note we still have very hacky incomplete support of contexts, and no
  support of true threading. We currently assume all contexts share with
  all others, and if any actual parallel rendering happened it would break.
This commit is contained in:
baldurk
2014-12-06 18:41:52 +00:00
parent 06dd044ed3
commit e9bd9ef497
+14
View File
@@ -678,6 +678,14 @@ void WrappedOpenGL::ActivateContext(void *windowHandle, void *contextHandle)
if(contextHandle)
{
// if we're capturing, we need to serialise out the changed state vector
if(m_State == WRITING_CAPFRAME)
{
SCOPED_SERIALISE_CONTEXT(CONTEXT_CAPTURE_HEADER);
Serialise_BeginCaptureFrame(false);
m_ContextRecord->AddChunk(scope.Get());
}
ContextData &font = m_ContextData[contextHandle];
if(!font.built)
@@ -2408,6 +2416,12 @@ void WrappedOpenGL::ProcessChunk(uint64_t offset, GLChunkType context)
case CAPTURE_SCOPE:
Serialise_CaptureScope(offset);
break;
case CONTEXT_CAPTURE_HEADER:
// normally this would be handled as a special case when we start processing the frame,
// but it can be emitted mid-frame if MakeCurrent is called on a different context.
// when processed here, we always want to apply the contents
Serialise_BeginCaptureFrame(true);
break;
case CONTEXT_CAPTURE_FOOTER:
{
bool HasCallstack = false;