Duplicate chunk if glBufferData creates a buffer mid-frame. Closes #1307

This commit is contained in:
baldurk
2019-03-11 16:09:50 +00:00
parent 8e8fd8545b
commit 5ec6da1e6e
@@ -827,6 +827,15 @@ void WrappedOpenGL::glBufferData(GLenum target, GLsizeiptr size, const void *dat
record->Length = size;
record->usage = usage;
record->DataInSerialiser = true;
// if we're active capturing then we need to add a duplicate call in so that the data is
// uploaded mid-frame, even if this is *also* the creation-type call.
if(IsActiveCapturing(m_State))
{
GetContextRecord()->AddChunk(chunk->Duplicate());
GetResourceManager()->MarkResourceFrameReferenced(record->GetResourceID(),
eFrameRef_PartialWrite);
}
}
}
else