From 7a5f63e0f5925ff29f589883e04d3c66779f4f17 Mon Sep 17 00:00:00 2001 From: lightningterror <18107717+lightningterror@users.noreply.github.com> Date: Fri, 5 Aug 2022 22:52:48 +0200 Subject: [PATCH] GS-metal: Move PABE shader bit to the top of sw blending. Early return when there is no sw blending, no need to run the blend code. Optimization. --- pcsx2/GS/Renderers/Metal/tfx.metal | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pcsx2/GS/Renderers/Metal/tfx.metal b/pcsx2/GS/Renderers/Metal/tfx.metal index a0e6119577..5ed97ce421 100644 --- a/pcsx2/GS/Renderers/Metal/tfx.metal +++ b/pcsx2/GS/Renderers/Metal/tfx.metal @@ -725,6 +725,13 @@ struct PSMain { if (SW_BLEND) { + // PABE + if (PS_PABE) + { + // No blending so early exit + if (As < 1.0f) + return; + } float Ad = PS_DFMT == FMT_24 ? 1.f : trunc(current_color.a * 255.5f) / 128.f; @@ -743,9 +750,6 @@ struct PSMain Color.rgb = D; else Color.rgb = trunc((A - B) * C + D); - - if (PS_PABE) - Color.rgb = (As >= 1.f) ? Color.rgb : Cs; } else {