GS-hw: Don't enable blending when only alpha is written.

Optimization.
This commit is contained in:
lightningterror 2022-01-08 05:20:21 +01:00
parent 8e8b9a3cff
commit d041df8254
1 changed files with 3 additions and 1 deletions

View File

@ -517,9 +517,11 @@ void GSRendererNew::EmulateBlending(bool& DATE_PRIMID, bool& DATE_BARRIER)
const bool AA1 = PRIM->AA1 && (m_vt.m_primclass == GS_LINE_CLASS); const bool AA1 = PRIM->AA1 && (m_vt.m_primclass == GS_LINE_CLASS);
// PABE: Check condition early as an optimization. // PABE: Check condition early as an optimization.
const bool PABE = PRIM->ABE && m_env.PABE.PABE && (GetAlphaMinMax().max < 128); const bool PABE = PRIM->ABE && m_env.PABE.PABE && (GetAlphaMinMax().max < 128);
// FBMASK: Only alpha is written, no need to do blending.
const bool FBMASK = m_context->FRAME.FBMSK == 0x00FFFFFF;
// No blending or coverage anti-aliasing so early exit // No blending or coverage anti-aliasing so early exit
if (PABE || !(PRIM->ABE || AA1)) if (FBMASK || PABE || !(PRIM->ABE || AA1))
{ {
m_conf.blend = {}; m_conf.blend = {};
return; return;