1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-12 13:08:50 +01:00

[d3d9] Use new flat shading state for fixed-function pipelines

This commit is contained in:
Philip Rebohle 2022-08-08 03:51:10 +02:00 committed by Philip Rebohle
parent 8f1024c094
commit 7789fd53ff
3 changed files with 5 additions and 7 deletions

View File

@ -2098,9 +2098,7 @@ namespace dxvk {
break;
case D3DRS_SHADEMODE:
m_flags.set(
D3D9DeviceFlag::DirtyFFPixelShader,
D3D9DeviceFlag::DirtyRasterizerState);
m_flags.set(D3D9DeviceFlag::DirtyRasterizerState);
break;
case D3DRS_TWEENFACTOR:
@ -6653,7 +6651,6 @@ namespace dxvk {
}
stage0.GlobalSpecularEnable = m_state.renderStates[D3DRS_SPECULARENABLE];
stage0.GlobalFlatShade = m_state.renderStates[D3DRS_SHADEMODE] == D3DSHADE_FLAT;
// The last stage *always* writes to current.
if (idx >= 1)

View File

@ -627,6 +627,7 @@ namespace dxvk {
uint32_t m_inputMask = 0u;
uint32_t m_outputMask = 0u;
uint32_t m_flatShadingMask = 0u;
uint32_t m_pushConstOffset = 0u;
uint32_t m_pushConstSize = 0u;
@ -737,6 +738,7 @@ namespace dxvk {
info.bindings = m_bindings.data();
info.inputMask = m_inputMask;
info.outputMask = m_outputMask;
info.flatShadingInputs = m_flatShadingMask;
info.pushConstOffset = m_pushConstOffset;
info.pushConstSize = m_pushConstSize;
@ -788,8 +790,8 @@ namespace dxvk {
bool diffuseOrSpec = semantic == DxsoSemantic{ DxsoUsage::Color, 0 }
|| semantic == DxsoSemantic{ DxsoUsage::Color, 1 };
if (diffuseOrSpec && m_fsKey.Stages[0].Contents.GlobalFlatShade)
m_module.decorate(ptr, spv::DecorationFlat);
if (diffuseOrSpec)
m_flatShadingMask |= 1u << slot;
std::string name = str::format(input ? "in_" : "out_", semantic.usage, semantic.usageIndex);
m_module.setDebugName(ptr, name.c_str());

View File

@ -159,7 +159,6 @@ namespace dxvk {
// Included in here, read from Stage 0 for packing reasons
// Affects all stages.
uint32_t GlobalSpecularEnable : 1;
uint32_t GlobalFlatShade : 1;
} Contents;
uint32_t Primitive[2];