From 9b4cd8aa87722789739cc5a36ce23ac37641be48 Mon Sep 17 00:00:00 2001 From: Joshua Ashton Date: Thu, 9 Apr 2020 15:59:55 +0100 Subject: [PATCH] [d3d9] Remove texMask from UpdateActiveHazardsRT This is an invalid optimization and leads to render hazards being dropped Our hazard tracking for render targets is done in render target indices as opposed to texture indices for depth stencil tracking so `texMask` doesn't work for that reason, and the fact that even if it did, there is no relationship to an individual texture and a render target index that has a hazard. --- src/d3d9/d3d9_device.cpp | 10 +++++----- src/d3d9/d3d9_device.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/d3d9/d3d9_device.cpp b/src/d3d9/d3d9_device.cpp index afd6b13f..25a05736 100644 --- a/src/d3d9/d3d9_device.cpp +++ b/src/d3d9/d3d9_device.cpp @@ -3025,7 +3025,7 @@ namespace dxvk { m_psShaderMasks = FixedFunctionMask; } - UpdateActiveHazardsRT(UINT32_MAX, UINT32_MAX); + UpdateActiveHazardsRT(UINT32_MAX); return D3D_OK; } @@ -4714,7 +4714,7 @@ namespace dxvk { m_state.renderStates[ColorWriteIndex(index)]) m_activeRTs |= bit; - UpdateActiveHazardsRT(bit, UINT32_MAX); + UpdateActiveHazardsRT(bit); } @@ -4740,15 +4740,15 @@ namespace dxvk { m_activeTexturesToUpload |= bit; } - UpdateActiveHazardsRT(UINT32_MAX, bit); + UpdateActiveHazardsRT(UINT32_MAX); UpdateActiveHazardsDS(bit); } - inline void D3D9DeviceEx::UpdateActiveHazardsRT(uint32_t rtMask, uint32_t texMask) { + inline void D3D9DeviceEx::UpdateActiveHazardsRT(uint32_t rtMask) { auto masks = m_psShaderMasks; masks.rtMask &= m_activeRTs & rtMask; - masks.samplerMask &= m_activeRTTextures & texMask; + masks.samplerMask &= m_activeRTTextures; m_activeHazardsRT = m_activeHazardsRT & (~rtMask); for (uint32_t rt = masks.rtMask; rt; rt &= rt - 1) { diff --git a/src/d3d9/d3d9_device.h b/src/d3d9/d3d9_device.h index 3fa555a8..4cd20a9e 100644 --- a/src/d3d9/d3d9_device.h +++ b/src/d3d9/d3d9_device.h @@ -742,7 +742,7 @@ namespace dxvk { void UpdateActiveTextures(uint32_t index); - void UpdateActiveHazardsRT(uint32_t rtMask, uint32_t texMask); + void UpdateActiveHazardsRT(uint32_t rtMask); void UpdateActiveHazardsDS(uint32_t texMask);