GS-hw: Cleanup hw blend clr cases.

Cleanup redundant Blend C sets, they are already set properly beforehand.
Cleanup multiple barrier sets for Ad cases, set one at the end instead.
Cleanup conditions, reduce and cleanup the code.
This commit is contained in:
lightningterror 2023-03-09 07:58:21 +01:00
parent 59aba9f757
commit e95b60d527
1 changed files with 8 additions and 19 deletions

View File

@ -3198,33 +3198,21 @@ void GSRendererHW::EmulateBlending(bool& DATE_PRIMID, bool& DATE_BARRIER, bool&
if (blend_flag & BLEND_C_CLR1)
{
if (blend_ad_alpha_masked)
{
m_conf.ps.blend_c = 1;
m_conf.ps.clr_hw = 5;
m_conf.require_one_barrier |= true;
}
else
{
m_conf.ps.clr_hw = 1;
}
}
else if (blend_flag & (BLEND_C_CLR2_AF | BLEND_C_CLR2_AS))
else if (blend_flag & (BLEND_C_CLR2_AS | BLEND_C_CLR2_AF))
{
if (blend_ad_alpha_masked)
{
m_conf.ps.blend_c = 1;
m_conf.ps.clr_hw = 4;
m_conf.require_one_barrier |= true;
}
else if (m_conf.ps.blend_c == 2)
else
{
m_conf.ps.blend_c = 2;
m_conf.cb_ps.TA_MaxDepth_Af.a = static_cast<float>(AFIX) / 128.0f;
m_conf.ps.clr_hw = 2;
}
else // m_conf.ps.blend_c == 0
{
m_conf.ps.blend_c = 0;
if (m_conf.ps.blend_c == 2)
m_conf.cb_ps.TA_MaxDepth_Af.a = static_cast<float>(AFIX) / 128.0f;
m_conf.ps.clr_hw = 2;
}
}
@ -3234,10 +3222,11 @@ void GSRendererHW::EmulateBlending(bool& DATE_PRIMID, bool& DATE_BARRIER, bool&
}
else if (blend_ad_alpha_masked)
{
m_conf.ps.blend_c = 1;
m_conf.ps.clr_hw = 6;
m_conf.require_one_barrier |= true;
}
m_conf.require_one_barrier |= blend_ad_alpha_masked;
const HWBlend blend(GSDevice::GetBlend(blend_index, replace_dual_src));
m_conf.blend = {true, blend.src, blend.dst, blend.op, m_conf.ps.blend_c == 2, AFIX};