From 7f302fc350d25a112d6fbbbe1f286bb1aedac353 Mon Sep 17 00:00:00 2001 From: Joshua Ashton Date: Sat, 24 Jun 2023 02:53:14 +0100 Subject: [PATCH] [d3d9] Don't mark DS hazards if not used by shader --- src/d3d9/d3d9_device.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/d3d9/d3d9_device.cpp b/src/d3d9/d3d9_device.cpp index 16f44606..0254d3c9 100644 --- a/src/d3d9/d3d9_device.cpp +++ b/src/d3d9/d3d9_device.cpp @@ -5576,11 +5576,13 @@ namespace dxvk { inline void D3D9DeviceEx::UpdateActiveHazardsDS(uint32_t texMask) { + auto masks = m_psShaderMasks; + masks.samplerMask &= m_activeDSTextures & texMask; + m_activeHazardsDS = m_activeHazardsDS & (~texMask); if (m_state.depthStencil != nullptr && m_state.depthStencil->GetBaseTexture() != nullptr) { - uint32_t samplerMask = m_activeDSTextures & texMask; - for (uint32_t samplerIdx : bit::BitMask(samplerMask)) { + for (uint32_t samplerIdx : bit::BitMask(masks.samplerMask)) { IDirect3DBaseTexture9* dsBase = m_state.depthStencil->GetBaseTexture(); IDirect3DBaseTexture9* texBase = m_state.textures[samplerIdx];