create helper function for rasterization kill

This commit is contained in:
Samuliak 2025-01-28 16:41:30 +01:00
parent 05518c01fb
commit 1fb9cfd783
No known key found for this signature in database
5 changed files with 37 additions and 65 deletions

View file

@ -295,19 +295,7 @@ void MetalPipelineCompiler::InitFromState(const LatteFetchShader* fetchShader, c
m_usesGeometryShader = (geometryShader != nullptr || isPrimitiveRect);
// Rasterization
m_rasterizationEnabled = !lcr.PA_CL_CLIP_CNTL.get_DX_RASTERIZATION_KILL();
// HACK
// TODO: include this in the hash?
if (!lcr.PA_CL_VTE_CNTL.get_VPORT_X_OFFSET_ENA())
m_rasterizationEnabled = true;
// Culling both front and back faces effectively disables rasterization
const auto& polygonControlReg = lcr.PA_SU_SC_MODE_CNTL;
uint32 cullFront = polygonControlReg.get_CULL_FRONT();
uint32 cullBack = polygonControlReg.get_CULL_BACK();
if (cullFront && cullBack)
m_rasterizationEnabled = false;
m_rasterizationEnabled = lcr.IsRasterizationEnabled();
// Shaders
m_vertexShaderMtl = static_cast<RendererShaderMtl*>(vertexShader->shader);