Skip to content

Commit

Permalink
GS/HW: Merge blend ad a mask separate conditions in to one.
Browse files Browse the repository at this point in the history
Duplicate code.
  • Loading branch information
lightningterror committed Sep 18, 2024
1 parent d172136 commit 5486eed
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions pcsx2/GS/Renderers/HW/GSRendererHW.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4208,14 +4208,8 @@ void GSRendererHW::EmulateBlending(int rt_alpha_min, int rt_alpha_max, const boo
const bool alpha_mask = (m_cached_ctx.FRAME.FBMSK & 0xFF000000) == 0xFF000000;
bool blend_ad_alpha_masked = blend_ad && alpha_mask;
const bool is_basic_blend = GSConfig.AccurateBlendingUnit >= AccBlendLevel::Basic;
if ((is_basic_blend || (COLCLAMP.CLAMP == 0)) && features.texture_barrier && blend_ad_alpha_masked)
{
// Swap Ad with As for hw blend.
m_conf.ps.a_masked = 1;
m_conf.ps.blend_c = 0;
m_conf.require_one_barrier |= true;
}
else if (((GSConfig.AccurateBlendingUnit >= AccBlendLevel::Medium) || m_conf.require_one_barrier) && blend_ad_alpha_masked)
if (blend_ad_alpha_masked && (((is_basic_blend || (COLCLAMP.CLAMP == 0)) && features.texture_barrier)
|| ((GSConfig.AccurateBlendingUnit >= AccBlendLevel::Medium) || m_conf.require_one_barrier)))
{
// Swap Ad with As for hw blend.
m_conf.ps.a_masked = 1;
Expand Down

0 comments on commit 5486eed

Please sign in to comment.