From cf5602466cecdc46129347c5bf37f3d4e2d168ce Mon Sep 17 00:00:00 2001 From: Samuliak Date: Sat, 7 Sep 2024 11:05:13 +0200 Subject: [PATCH] optimize rasterization kill --- .../HW/Latte/Renderer/Metal/MetalPipelineCache.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Cafe/HW/Latte/Renderer/Metal/MetalPipelineCache.cpp b/src/Cafe/HW/Latte/Renderer/Metal/MetalPipelineCache.cpp index 931b6149..a3b82615 100644 --- a/src/Cafe/HW/Latte/Renderer/Metal/MetalPipelineCache.cpp +++ b/src/Cafe/HW/Latte/Renderer/Metal/MetalPipelineCache.cpp @@ -206,14 +206,15 @@ void SetFragmentState(T* desc, CachedFBOMtl* lastUsedFBO, CachedFBOMtl* activeFB if (cullFront && cullBack) rasterizationEnabled = false; - desc->setRasterizationEnabled(rasterizationEnabled); - - if (rasterizationEnabled) + if (!rasterizationEnabled) { - auto pixelShaderMtl = static_cast(pixelShader->shader); - desc->setFragmentFunction(pixelShaderMtl->GetFunction()); + desc->setRasterizationEnabled(false); + return; } + auto pixelShaderMtl = static_cast(pixelShader->shader); + desc->setFragmentFunction(pixelShaderMtl->GetFunction()); + // Color attachments const Latte::LATTE_CB_COLOR_CONTROL& colorControlReg = lcr.CB_COLOR_CONTROL; uint32 blendEnableMask = colorControlReg.get_BLEND_MASK();