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:
parent
8f1024c094
commit
7789fd53ff
@ -2098,9 +2098,7 @@ namespace dxvk {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case D3DRS_SHADEMODE:
|
case D3DRS_SHADEMODE:
|
||||||
m_flags.set(
|
m_flags.set(D3D9DeviceFlag::DirtyRasterizerState);
|
||||||
D3D9DeviceFlag::DirtyFFPixelShader,
|
|
||||||
D3D9DeviceFlag::DirtyRasterizerState);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case D3DRS_TWEENFACTOR:
|
case D3DRS_TWEENFACTOR:
|
||||||
@ -6653,7 +6651,6 @@ namespace dxvk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
stage0.GlobalSpecularEnable = m_state.renderStates[D3DRS_SPECULARENABLE];
|
stage0.GlobalSpecularEnable = m_state.renderStates[D3DRS_SPECULARENABLE];
|
||||||
stage0.GlobalFlatShade = m_state.renderStates[D3DRS_SHADEMODE] == D3DSHADE_FLAT;
|
|
||||||
|
|
||||||
// The last stage *always* writes to current.
|
// The last stage *always* writes to current.
|
||||||
if (idx >= 1)
|
if (idx >= 1)
|
||||||
|
@ -627,6 +627,7 @@ namespace dxvk {
|
|||||||
|
|
||||||
uint32_t m_inputMask = 0u;
|
uint32_t m_inputMask = 0u;
|
||||||
uint32_t m_outputMask = 0u;
|
uint32_t m_outputMask = 0u;
|
||||||
|
uint32_t m_flatShadingMask = 0u;
|
||||||
uint32_t m_pushConstOffset = 0u;
|
uint32_t m_pushConstOffset = 0u;
|
||||||
uint32_t m_pushConstSize = 0u;
|
uint32_t m_pushConstSize = 0u;
|
||||||
|
|
||||||
@ -737,6 +738,7 @@ namespace dxvk {
|
|||||||
info.bindings = m_bindings.data();
|
info.bindings = m_bindings.data();
|
||||||
info.inputMask = m_inputMask;
|
info.inputMask = m_inputMask;
|
||||||
info.outputMask = m_outputMask;
|
info.outputMask = m_outputMask;
|
||||||
|
info.flatShadingInputs = m_flatShadingMask;
|
||||||
info.pushConstOffset = m_pushConstOffset;
|
info.pushConstOffset = m_pushConstOffset;
|
||||||
info.pushConstSize = m_pushConstSize;
|
info.pushConstSize = m_pushConstSize;
|
||||||
|
|
||||||
@ -788,8 +790,8 @@ namespace dxvk {
|
|||||||
bool diffuseOrSpec = semantic == DxsoSemantic{ DxsoUsage::Color, 0 }
|
bool diffuseOrSpec = semantic == DxsoSemantic{ DxsoUsage::Color, 0 }
|
||||||
|| semantic == DxsoSemantic{ DxsoUsage::Color, 1 };
|
|| semantic == DxsoSemantic{ DxsoUsage::Color, 1 };
|
||||||
|
|
||||||
if (diffuseOrSpec && m_fsKey.Stages[0].Contents.GlobalFlatShade)
|
if (diffuseOrSpec)
|
||||||
m_module.decorate(ptr, spv::DecorationFlat);
|
m_flatShadingMask |= 1u << slot;
|
||||||
|
|
||||||
std::string name = str::format(input ? "in_" : "out_", semantic.usage, semantic.usageIndex);
|
std::string name = str::format(input ? "in_" : "out_", semantic.usage, semantic.usageIndex);
|
||||||
m_module.setDebugName(ptr, name.c_str());
|
m_module.setDebugName(ptr, name.c_str());
|
||||||
|
@ -159,7 +159,6 @@ namespace dxvk {
|
|||||||
// Included in here, read from Stage 0 for packing reasons
|
// Included in here, read from Stage 0 for packing reasons
|
||||||
// Affects all stages.
|
// Affects all stages.
|
||||||
uint32_t GlobalSpecularEnable : 1;
|
uint32_t GlobalSpecularEnable : 1;
|
||||||
uint32_t GlobalFlatShade : 1;
|
|
||||||
} Contents;
|
} Contents;
|
||||||
|
|
||||||
uint32_t Primitive[2];
|
uint32_t Primitive[2];
|
||||||
|
Loading…
Reference in New Issue
Block a user