From fef3f272505043be319989bc7e174c69ad29a8f9 Mon Sep 17 00:00:00 2001 From: baldurk Date: Mon, 3 Nov 2025 11:34:07 +0000 Subject: [PATCH] Fix D3D12 pixel history error if bound target is not declared in PSO --- renderdoc/driver/d3d12/d3d12_pixelhistory.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/renderdoc/driver/d3d12/d3d12_pixelhistory.cpp b/renderdoc/driver/d3d12/d3d12_pixelhistory.cpp index 76b208e35..d764bdae7 100644 --- a/renderdoc/driver/d3d12/d3d12_pixelhistory.cpp +++ b/renderdoc/driver/d3d12/d3d12_pixelhistory.cpp @@ -1725,6 +1725,9 @@ private: { uint32_t rtIndex = GetPixelHistoryRenderTargetIndex(pipeState); + if(rtIndex >= pipeDesc.RTVFormats.NumRenderTargets) + flags |= UnboundFragmentShader; + bool found = false; for(const SigParameter &o : origPSO->PS()->GetDetails().outputSignature) { @@ -2121,6 +2124,9 @@ struct D3D12PixelHistoryPerFragmentCallback : D3D12PixelHistoryCallback D3D12_EXPANDED_PIPELINE_STATE_STREAM_DESC origPipeDesc; origPSO->Fill(origPipeDesc); + if(renderTargetIndex >= origPipeDesc.RTVFormats.NumRenderTargets) + return; + PerFragmentPipelines pipes = CreatePerFragmentPipelines(state, eid, 0, renderTargetIndex); ID3D12PipelineState *psosIter[2];