Skip to content

Commit

Permalink
[d3d9] Don't mark DS as hazardous if depth write is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
misyltoad committed Jun 24, 2023
1 parent ff65599 commit 0e36a07
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/d3d9/d3d9_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2131,8 +2131,11 @@ namespace dxvk {
m_flags.set(D3D9DeviceFlag::DirtyMultiSampleState);
break;

case D3DRS_STENCILENABLE:
case D3DRS_ZWRITEENABLE:
if (likely(!old != !Value))
UpdateActiveHazardsDS(UINT32_MAX);
[[fallthrough]];
case D3DRS_STENCILENABLE:
case D3DRS_ZENABLE:
if (likely(m_state.depthStencil != nullptr))
m_flags.set(D3D9DeviceFlag::DirtyFramebuffer);
Expand Down Expand Up @@ -5584,7 +5587,8 @@ namespace dxvk {

m_activeHazardsDS = m_activeHazardsDS & (~texMask);
if (m_state.depthStencil != nullptr &&
m_state.depthStencil->GetBaseTexture() != nullptr) {
m_state.depthStencil->GetBaseTexture() != nullptr &&
m_state.renderStates[D3DRS_ZWRITEENABLE]) {
for (uint32_t samplerIdx : bit::BitMask(masks.samplerMask)) {
IDirect3DBaseTexture9* dsBase = m_state.depthStencil->GetBaseTexture();
IDirect3DBaseTexture9* texBase = m_state.textures[samplerIdx];
Expand Down

0 comments on commit 0e36a07

Please sign in to comment.