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.
This commit is contained in:
lightningterror 2022-08-05 22:52:48 +02:00
parent c0e325dfbf
commit 7a5f63e0f5
1 changed files with 7 additions and 3 deletions

View File

@ -725,6 +725,13 @@ struct PSMain
{ {
if (SW_BLEND) 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; 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; Color.rgb = D;
else else
Color.rgb = trunc((A - B) * C + D); Color.rgb = trunc((A - B) * C + D);
if (PS_PABE)
Color.rgb = (As >= 1.f) ? Color.rgb : Cs;
} }
else else
{ {