From 132377b4f684f1f2c0539e33c10bcccb43d6f142 Mon Sep 17 00:00:00 2001 From: lightningterror <18107717+lightningterror@users.noreply.github.com> Date: Wed, 11 Dec 2024 22:39:35 +0100 Subject: [PATCH 1/2] GS/TC: Use proper alpha min max for palettes. If it's an old source made from target make sure it isn't a palette, alphas need to be used from the palette then. --- pcsx2/GS/Renderers/HW/GSTextureCache.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pcsx2/GS/Renderers/HW/GSTextureCache.cpp b/pcsx2/GS/Renderers/HW/GSTextureCache.cpp index d116d7ae57151..25a7df769a28d 100644 --- a/pcsx2/GS/Renderers/HW/GSTextureCache.cpp +++ b/pcsx2/GS/Renderers/HW/GSTextureCache.cpp @@ -1742,9 +1742,12 @@ GSTextureCache::Source* GSTextureCache::LookupSource(const bool is_color, const TEX0.TBP0, psm_s.pal > 0 ? TEX0.CBP : 0, psm_str(TEX0.PSM)); - // If it's from a target, we need to make sure the alpha information is up to date, especially in 16/24 bit formats where it can change draw to draw. + // If it's an old source made from target make sure it isn't a palette, + // alphas need to be used from the palette then. + // If it's from a target, we need to make sure the alpha information is up to date, + // especially in 16/24 bit formats where it can change draw to draw. // Guard against merged targets which don't actually link. - if (src->m_target && src->m_from_target) + if (!src->m_palette && src->m_target && src->m_from_target) { src->m_valid_alpha_minmax = true; if (src->m_target_direct) From 15a9dda6f5c494dfcf43b38a2a18e0c75db119ca Mon Sep 17 00:00:00 2001 From: lightningterror <18107717+lightningterror@users.noreply.github.com> Date: Thu, 12 Dec 2024 11:49:25 +0100 Subject: [PATCH 2/2] GS/HW: Adjust how we handle dithering on blend mix. Allow dither adjust regardless of alpha. usually it is clamed to 1 anyway so we can expand it if alpha max is higher than 128. Expand dither adjust to work in rev subtract conditions. --- pcsx2/GS/Renderers/HW/GSRendererHW.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pcsx2/GS/Renderers/HW/GSRendererHW.cpp b/pcsx2/GS/Renderers/HW/GSRendererHW.cpp index 7fbe8ab0db25c..e593c3be43f3f 100644 --- a/pcsx2/GS/Renderers/HW/GSRendererHW.cpp +++ b/pcsx2/GS/Renderers/HW/GSRendererHW.cpp @@ -4553,7 +4553,8 @@ void GSRendererHW::EmulateBlending(int rt_alpha_min, int rt_alpha_max, const boo // Disable dithering on blend mix if needed. if (m_conf.ps.dither) { - const bool can_dither = (m_conf.ps.blend_a == 0 && m_conf.ps.blend_b == 1 && alpha_eq_less_one); + // TODO: Either exclude BMIX1_ALPHA_HIGH_ONE case or allow alpha > 1.0 on dither adjust, case is currently disabled. + const bool can_dither = (m_conf.ps.blend_a == 0 && m_conf.ps.blend_b == 1) || (m_conf.ps.blend_a == 1 && m_conf.ps.blend_b == 0); m_conf.ps.dither = can_dither; m_conf.ps.dither_adjust = can_dither; }