mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-11-14 01:41:10 +00:00
Don't serialise anything in between serialising buffer & fetching offset
This commit is contained in:
2 files changed
+6
-3
No files matched your search
@@ -201,7 +201,6 @@ bool WrappedID3D11DeviceContext::Serialise_UpdateSubresource1(
|
||||
Contents = new byte[(size_t)ContentsLength];
|
||||
|
||||
SERIALISE_ELEMENT_ARRAY(Contents, ContentsLength);
|
||||
SERIALISE_ELEMENT(ContentsLength);
|
||||
|
||||
// the automatic deserialisation only happens when reading, when writing we need to
|
||||
// free this data
|
||||
@@ -213,6 +212,8 @@ bool WrappedID3D11DeviceContext::Serialise_UpdateSubresource1(
|
||||
record->SetDataOffset(ser.GetWriter()->GetOffset() - ContentsLength);
|
||||
}
|
||||
|
||||
SERIALISE_ELEMENT(ContentsLength);
|
||||
|
||||
// nothing more to do here during write - the parent function will handle setting the record's
|
||||
// data pointer and either marking the resource as dirty or updating the backing store with
|
||||
// pSrcData passed in
|
||||
|
||||
@@ -71,7 +71,6 @@ bool WrappedID3D11Device::Serialise_CreateBuffer(SerialiserType &ser, const D3D1
|
||||
}
|
||||
|
||||
SERIALISE_ELEMENT_ARRAY(InitialData, InitialDataLength);
|
||||
SERIALISE_ELEMENT(InitialDataLength);
|
||||
|
||||
if(ser.IsWriting())
|
||||
{
|
||||
@@ -87,6 +86,8 @@ bool WrappedID3D11Device::Serialise_CreateBuffer(SerialiserType &ser, const D3D1
|
||||
record->Length = Descriptor.ByteWidth;
|
||||
}
|
||||
|
||||
SERIALISE_ELEMENT(InitialDataLength);
|
||||
|
||||
SERIALISE_CHECK_READ_ERRORS();
|
||||
|
||||
if(IsReplayingAndReading())
|
||||
@@ -330,7 +331,6 @@ std::vector<D3D11_SUBRESOURCE_DATA> WrappedID3D11Device::Serialise_CreateTexture
|
||||
}
|
||||
|
||||
SERIALISE_ELEMENT_ARRAY(SubresourceContents, SubresourceContentsLength);
|
||||
SERIALISE_ELEMENT(SubresourceContentsLength);
|
||||
|
||||
if(ser.IsWriting())
|
||||
{
|
||||
@@ -339,6 +339,8 @@ std::vector<D3D11_SUBRESOURCE_DATA> WrappedID3D11Device::Serialise_CreateTexture
|
||||
record->SubResources[i]->SetDataOffset(ser.GetWriter()->GetOffset() - SubresourceContentsLength);
|
||||
}
|
||||
|
||||
SERIALISE_ELEMENT(SubresourceContentsLength);
|
||||
|
||||
if(IsReplayingAndReading())
|
||||
{
|
||||
// we 'steal' the SubresourceContents buffer so it doesn't get de-serialised and free'd
|
||||
|
||||
Reference in new issue
Block a user