From 4e1ee5bf399a10993d68da5f57d5c74b0235c808 Mon Sep 17 00:00:00 2001 From: Joshua Ashton Date: Mon, 25 May 2020 06:12:51 +0100 Subject: [PATCH] [d3d9] Normalize projection spec constant further Only include those used in the pixel shader and are bound. --- src/d3d9/d3d9_device.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/d3d9/d3d9_device.cpp b/src/d3d9/d3d9_device.cpp index 4e2ac349a..d91c3d342 100644 --- a/src/d3d9/d3d9_device.cpp +++ b/src/d3d9/d3d9_device.cpp @@ -5627,12 +5627,15 @@ namespace dxvk { if (likely(UseProgrammablePS())) { UploadConstants(); - uint32_t fetch4 = m_fetch4Enabled & (m_activeTextures & m_psShaderMasks.samplerMask); + const uint32_t psTextureMask = m_activeTextures & m_psShaderMasks.samplerMask; + + uint32_t fetch4 = m_fetch4Enabled & psTextureMask; + uint32_t projected = m_projectionBitfield & psTextureMask; if (GetCommonShader(m_state.pixelShader)->GetInfo().majorVersion() >= 2) UpdateSamplerTypes(m_d3d9Options.forceSamplerTypeSpecConstants ? m_samplerTypeBitfield : 0u, 0u, fetch4); else - UpdateSamplerTypes(m_samplerTypeBitfield, m_projectionBitfield, fetch4); // For implicit samplers... + UpdateSamplerTypes(m_samplerTypeBitfield, projected, fetch4); // For implicit samplers... UpdateBoolSpecConstantPixel( m_state.psConsts.bConsts[0] &