From b8bd7559d59fd37b67ef595943fbb289eb9801dd Mon Sep 17 00:00:00 2001 From: baldurk Date: Thu, 8 Sep 2016 14:43:51 +0200 Subject: [PATCH] Make sure unmap chunks for textures are saved in the base record * Putting chunks in the subresource chunks is a no-no as these are never actually referenced and pulled into the frame capture, they're just used for locating the right data pointer. Putting an unmap in here could lead to texture data going missing on replay if the texture was never actually marked as dirty. --- renderdoc/driver/d3d11/d3d11_context_wrap.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/renderdoc/driver/d3d11/d3d11_context_wrap.cpp b/renderdoc/driver/d3d11/d3d11_context_wrap.cpp index 02f1347f3..79082164f 100644 --- a/renderdoc/driver/d3d11/d3d11_context_wrap.cpp +++ b/renderdoc/driver/d3d11/d3d11_context_wrap.cpp @@ -7897,6 +7897,8 @@ void WrappedID3D11DeviceContext::Unmap(ID3D11Resource *pResource, UINT Subresour m_pDevice->GetResourceManager()->GetResourceRecord(GetIDForResource(pResource)); RDCASSERT(record); + D3D11ResourceRecord *baserecord = record; + if(record->NumSubResources > (int)Subresource) record = (D3D11ResourceRecord *)record->SubResources[Subresource]; @@ -7912,7 +7914,7 @@ void WrappedID3D11DeviceContext::Unmap(ID3D11Resource *pResource, UINT Subresour Chunk *chunk = scope.Get(); - record->AddChunk(chunk); + baserecord->AddChunk(chunk); record->SetDataPtr(chunk->GetData()); record->DataInSerialiser = true;