mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-31 14:52:11 +01:00
[d3d9] Simplify dirty check for shader constants
This commit is contained in:
parent
aa70369671
commit
88147e19d2
@ -5782,26 +5782,13 @@ namespace dxvk {
|
|||||||
pConstantData,
|
pConstantData,
|
||||||
Count);
|
Count);
|
||||||
|
|
||||||
auto DetermineMaxCount = [&](const auto& shader) {
|
if constexpr (ConstantType != D3D9ConstantType::Bool) {
|
||||||
if (unlikely(shader == nullptr))
|
uint32_t maxCount = ConstantType == D3D9ConstantType::Float
|
||||||
return 0u;
|
? 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;
|
m_consts[ProgramType].dirty |= StartRegister < maxCount;
|
||||||
|
}
|
||||||
|
|
||||||
UpdateStateConstants<ProgramType, ConstantType, T>(
|
UpdateStateConstants<ProgramType, ConstantType, T>(
|
||||||
&m_state,
|
&m_state,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user