[d3d9] Check depth bounds test when deciding to bind DSV

This commit is contained in:
Robin Kertels 2023-07-16 15:20:33 +02:00 committed by Joshie
parent 0746a3b91a
commit 295a58afdf
1 changed files with 5 additions and 1 deletions

View File

@ -2308,6 +2308,9 @@ namespace dxvk {
case D3DRS_ADAPTIVETESS_W: case D3DRS_ADAPTIVETESS_W:
if (states[D3DRS_ADAPTIVETESS_X] == uint32_t(D3D9Format::NVDB) || oldNVDB) { if (states[D3DRS_ADAPTIVETESS_X] == uint32_t(D3D9Format::NVDB) || oldNVDB) {
m_flags.set(D3D9DeviceFlag::DirtyDepthBounds); m_flags.set(D3D9DeviceFlag::DirtyDepthBounds);
if (m_state.depthStencil != nullptr && m_state.renderStates[D3DRS_ZENABLE])
m_flags.set(D3D9DeviceFlag::DirtyFramebuffer);
break; break;
} }
[[fallthrough]]; [[fallthrough]];
@ -5885,7 +5888,8 @@ namespace dxvk {
if (m_state.depthStencil != nullptr && if (m_state.depthStencil != nullptr &&
(m_state.renderStates[D3DRS_ZENABLE] (m_state.renderStates[D3DRS_ZENABLE]
|| m_state.renderStates[D3DRS_ZWRITEENABLE] || 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 DxvkImageCreateInfo& dsImageInfo = m_state.depthStencil->GetCommonTexture()->GetImage()->info();
const bool depthWrite = m_state.renderStates[D3DRS_ZWRITEENABLE]; const bool depthWrite = m_state.renderStates[D3DRS_ZWRITEENABLE];