From 295a58afdfb1d3debac183776c352e5190a94b65 Mon Sep 17 00:00:00 2001 From: Robin Kertels Date: Sun, 16 Jul 2023 15:20:33 +0200 Subject: [PATCH] [d3d9] Check depth bounds test when deciding to bind DSV --- src/d3d9/d3d9_device.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/d3d9/d3d9_device.cpp b/src/d3d9/d3d9_device.cpp index 91b61a39..0d883c8d 100644 --- a/src/d3d9/d3d9_device.cpp +++ b/src/d3d9/d3d9_device.cpp @@ -2308,6 +2308,9 @@ namespace dxvk { case D3DRS_ADAPTIVETESS_W: if (states[D3DRS_ADAPTIVETESS_X] == uint32_t(D3D9Format::NVDB) || oldNVDB) { m_flags.set(D3D9DeviceFlag::DirtyDepthBounds); + + if (m_state.depthStencil != nullptr && m_state.renderStates[D3DRS_ZENABLE]) + m_flags.set(D3D9DeviceFlag::DirtyFramebuffer); break; } [[fallthrough]]; @@ -5885,7 +5888,8 @@ namespace dxvk { if (m_state.depthStencil != nullptr && (m_state.renderStates[D3DRS_ZENABLE] || m_state.renderStates[D3DRS_ZWRITEENABLE] - || m_state.renderStates[D3DRS_STENCILENABLE])) { + || m_state.renderStates[D3DRS_STENCILENABLE] + || m_state.renderStates[D3DRS_ADAPTIVETESS_X] == uint32_t(D3D9Format::NVDB))) { const DxvkImageCreateInfo& dsImageInfo = m_state.depthStencil->GetCommonTexture()->GetImage()->info(); const bool depthWrite = m_state.renderStates[D3DRS_ZWRITEENABLE];