1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-02-21 22:54:16 +01:00

[dxso] Don't create shader object for redundant PS permutations

This commit is contained in:
Philip Rebohle 2022-07-30 22:14:26 +02:00 committed by Joshie
parent 76ddd2a35a
commit 0eaad2eb5b
2 changed files with 5 additions and 2 deletions

View File

@ -90,7 +90,7 @@ namespace dxvk {
pDevice->GetDXVKDevice()->registerShader(m_shaders[0]); pDevice->GetDXVKDevice()->registerShader(m_shaders[0]);
if (m_shaders[1] != nullptr) if (m_shaders[1] != nullptr && m_shaders[1] != m_shaders[0])
pDevice->GetDXVKDevice()->registerShader(m_shaders[1]); pDevice->GetDXVKDevice()->registerShader(m_shaders[1]);
} }

View File

@ -236,7 +236,10 @@ namespace dxvk {
if (m_ps.specularColorIn) if (m_ps.specularColorIn)
m_module.decorate(m_ps.specularColorIn, spv::DecorationFlat); m_module.decorate(m_ps.specularColorIn, spv::DecorationFlat);
permutations[D3D9ShaderPermutations::FlatShade] = compileShader(); if (m_ps.diffuseColorIn || m_ps.specularColorIn)
permutations[D3D9ShaderPermutations::FlatShade] = compileShader();
else
permutations[D3D9ShaderPermutations::FlatShade] = permutations[D3D9ShaderPermutations::None];
} }
return permutations; return permutations;