diff --git a/src/d3d9/d3d9_device.cpp b/src/d3d9/d3d9_device.cpp index 8acb57089..e7a9b814a 100644 --- a/src/d3d9/d3d9_device.cpp +++ b/src/d3d9/d3d9_device.cpp @@ -5782,26 +5782,13 @@ namespace dxvk { pConstantData, Count); - auto DetermineMaxCount = [&](const auto& shader) { - if (unlikely(shader == nullptr)) - return 0u; + if constexpr (ConstantType != D3D9ConstantType::Bool) { + uint32_t maxCount = ConstantType == D3D9ConstantType::Float + ? m_consts[ProgramType].meta.maxConstIndexF + : m_consts[ProgramType].meta.maxConstIndexI; - const auto& meta = GetCommonShader(shader)->GetMeta(); - - if constexpr (ConstantType == D3D9ConstantType::Float) - return meta.maxConstIndexF; - else if constexpr (ConstantType == D3D9ConstantType::Int) - return meta.maxConstIndexI; - else - return meta.maxConstIndexB; - }; - - uint32_t maxCount = ProgramType == DxsoProgramTypes::VertexShader - ? DetermineMaxCount(m_state.vertexShader) - : DetermineMaxCount(m_state.pixelShader); - - if constexpr (ConstantType != D3D9ConstantType::Bool) m_consts[ProgramType].dirty |= StartRegister < maxCount; + } UpdateStateConstants( &m_state,