From e6b1e1948e38ffead23626463e8e9b0644ffba0e Mon Sep 17 00:00:00 2001 From: lightningterror <18107717+lightningterror@users.noreply.github.com> Date: Tue, 7 Dec 2021 15:01:34 +0100 Subject: [PATCH] GS-d3d11: Add a condition to not enable blend_mix if sw blending is already enabled. Not yet needed but will be useful for sw blending when prims don't overlap. --- pcsx2/GS/Renderers/DX11/GSRendererDX11.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pcsx2/GS/Renderers/DX11/GSRendererDX11.cpp b/pcsx2/GS/Renderers/DX11/GSRendererDX11.cpp index 59fef1052c..68fb8d5ed8 100644 --- a/pcsx2/GS/Renderers/DX11/GSRendererDX11.cpp +++ b/pcsx2/GS/Renderers/DX11/GSRendererDX11.cpp @@ -467,7 +467,7 @@ void GSRendererDX11::EmulateBlending(u8& afix) const bool blend_mix1 = !!(blend_flag & BLEND_MIX1); const bool blend_mix2 = !!(blend_flag & BLEND_MIX2); const bool blend_mix3 = !!(blend_flag & BLEND_MIX3); - const bool blend_mix = (blend_mix1 || blend_mix2 || blend_mix3) + bool blend_mix = (blend_mix1 || blend_mix2 || blend_mix3) // Do not enable if As > 128 or F > 128, hw blend clamps to 1 && !((ALPHA.C == 0 && m_vt.m_alpha.max > 128) || (ALPHA.C == 2 && ALPHA.FIX > 128u)); @@ -477,12 +477,19 @@ void GSRendererDX11::EmulateBlending(u8& afix) case ACC_BLEND_HIGH_D3D11: case ACC_BLEND_MEDIUM_D3D11: case ACC_BLEND_BASIC_D3D11: - sw_blending |= accumulation_blend || blend_non_recursive || blend_mix; + sw_blending |= accumulation_blend || blend_non_recursive; [[fallthrough]]; default: break; } + // Do not run BLEND MIX if sw blending is already present, it's less accurate + if (m_sw_blending) + { + blend_mix &= !sw_blending; + sw_blending |= blend_mix; + } + // Color clip if (m_env.COLCLAMP.CLAMP == 0) {