Treat read-only DSVs as depth writes disabled for overlays on D3D

This commit is contained in:
baldurk
2025-07-08 13:37:48 +01:00
parent 82e963550a
commit ff711346f3
2 changed files with 10 additions and 0 deletions
+4
View File
@@ -1570,6 +1570,10 @@ ResourceId D3D11Replay::RenderOverlay(ResourceId texid, FloatVector clearCol, De
d.FrontFace = cur.FrontFace;
d.BackFace = cur.BackFace;
}
if(dsViewDesc.Flags & D3D11_DSV_READ_ONLY_DEPTH)
d.DepthWriteMask = D3D11_DEPTH_WRITE_MASK_ZERO;
if(dsViewDesc.Flags & D3D11_DSV_READ_ONLY_STENCIL)
d.StencilWriteMask = 0;
SAFE_RELEASE(os);
hr = m_pDevice->CreateDepthStencilState(&d, &os);
+6
View File
@@ -2210,6 +2210,12 @@ ResourceId D3D12Replay::RenderOverlay(ResourceId texid, FloatVector clearCol, De
}
}
if(dsViewDesc.Flags & D3D12_DSV_FLAG_READ_ONLY_DEPTH)
psoDesc.DepthStencilState.DepthWriteMask = D3D12_DEPTH_WRITE_MASK_ZERO;
if(dsViewDesc.Flags & D3D12_DSV_FLAG_READ_ONLY_STENCIL)
psoDesc.DepthStencilState.FrontFace.StencilWriteMask =
psoDesc.DepthStencilState.BackFace.StencilWriteMask = 0;
RDCEraseEl(psoDesc.RTVFormats.RTFormats);
psoDesc.RTVFormats.RTFormats[0] = DXGI_FORMAT_R16G16B16A16_FLOAT;
psoDesc.RTVFormats.NumRenderTargets = 1;