Skip to content

Commit

Permalink
GS/HW: Minor optimization on color dest blend.
Browse files Browse the repository at this point in the history
Add early return, no need to run the rest of the code.
  • Loading branch information
lightningterror committed Oct 26, 2023
1 parent e9ead0d commit b53ffb6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pcsx2/GS/Renderers/HW/GSRendererHW.cpp
Expand Up @@ -3484,8 +3484,7 @@ __ri bool GSRendererHW::EmulateChannelShuffle(GSTextureCache::Target* src, bool
void GSRendererHW::EmulateBlending(int rt_alpha_min, int rt_alpha_max, bool& DATE_PRIMID, bool& DATE_BARRIER, bool& blending_alpha_pass)
{
{
// AA1: Don't enable blending on AA1, not yet implemented on hardware mode,
// it requires coverage sample so it's safer to turn it off instead.
// AA1: Blending needs to be enabled on draw.
const bool AA1 = PRIM->AA1 && (m_vt.m_primclass == GS_LINE_CLASS || m_vt.m_primclass == GS_TRIANGLE_CLASS);
// PABE: Check condition early as an optimization.
const bool PABE = PRIM->ABE && m_draw_env->PABE.PABE && (GetAlphaMinMax().max < 128);
Expand All @@ -3498,6 +3497,7 @@ void GSRendererHW::EmulateBlending(int rt_alpha_min, int rt_alpha_max, bool& DAT
{
m_conf.blend = {};
m_conf.ps.no_color1 = true;

return;
}
}
Expand Down Expand Up @@ -3921,6 +3921,8 @@ void GSRendererHW::EmulateBlending(int rt_alpha_min, int rt_alpha_max, bool& DAT

// Output is Cd, set rgb write to 0.
m_conf.colormask.wrgba &= 0x8;

return;
}
else if (sw_blending)
{
Expand Down

0 comments on commit b53ffb6

Please sign in to comment.