From 71a5d3dae05ce7640d8a949c9d9764a27eaa7a32 Mon Sep 17 00:00:00 2001 From: Jovan Ristic Date: Sun, 31 Dec 2023 14:44:52 -0800 Subject: [PATCH] Fix D3D12 pixel history on MSAA depth stencils. * Performing pixel history on an MSAA depth target caused a memory stomp due to the depth and stencil copies being mis-identified as a 4-component operation, stomping the following 12 bytes. For the depth, this stomped the stencil and the following padding, but when the missing stencil copy was added in 4815ada it stomped dsWithoutShaderDiscard as well. This triggered an assert due to a clear event appearing to have frags associated with it. --- renderdoc/driver/d3d12/d3d12_pixelhistory.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/renderdoc/driver/d3d12/d3d12_pixelhistory.cpp b/renderdoc/driver/d3d12/d3d12_pixelhistory.cpp index 242521c00..8ab8b0d0e 100644 --- a/renderdoc/driver/d3d12/d3d12_pixelhistory.cpp +++ b/renderdoc/driver/d3d12/d3d12_pixelhistory.cpp @@ -1087,6 +1087,7 @@ private: ? D3D12_RESOURCE_STATE_DEPTH_READ : D3D12_RESOURCE_STATE_DEPTH_WRITE; targetCopyParams.srcImageFormat = GetDepthSRVFormat(m_CallbackInfo.targetDesc.Format, 0); + targetCopyParams.depthcopy = true; targetCopyParams.copyFormat = DXGI_FORMAT_R32_TYPELESS; offset += offsetof(struct D3D12PixelHistoryValue, depth); }