From 3625c5d481cea4beec003d5b3b9774d6c8733841 Mon Sep 17 00:00:00 2001 From: Joshua Ashton Date: Thu, 22 Jun 2023 14:55:54 +0100 Subject: [PATCH] [d3d9] Optimize DS active hazard check There can only be one DS, so no need to loop over. --- src/d3d9/d3d9_device.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/d3d9/d3d9_device.cpp b/src/d3d9/d3d9_device.cpp index b6bd6141..9400d26c 100644 --- a/src/d3d9/d3d9_device.cpp +++ b/src/d3d9/d3d9_device.cpp @@ -5624,9 +5624,9 @@ namespace dxvk { } } - for (uint32_t samplerIdx : bit::BitMask(m_activeHazardsDS)) { + if (m_activeHazardsDS != 0) { // Guaranteed to not be nullptr... - auto tex = GetCommonTexture(m_state.textures[samplerIdx]); + auto tex = m_state.depthStencil->GetCommonTexture(); if (unlikely(!tex->MarkHazardous())) { TransitionImage(tex, m_hazardLayout); m_flags.set(D3D9DeviceFlag::DirtyFramebuffer);