From 7478873b8b974785f385c660364fdba455088463 Mon Sep 17 00:00:00 2001 From: refractionpcsx2 Date: Wed, 3 Apr 2024 11:41:14 +0100 Subject: [PATCH 1/2] GS/TC: Read indexed texture from GS memory if complete dirty overlap --- pcsx2/GS/Renderers/HW/GSTextureCache.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pcsx2/GS/Renderers/HW/GSTextureCache.cpp b/pcsx2/GS/Renderers/HW/GSTextureCache.cpp index 6ac2095e1ecce..52294535b8469 100644 --- a/pcsx2/GS/Renderers/HW/GSTextureCache.cpp +++ b/pcsx2/GS/Renderers/HW/GSTextureCache.cpp @@ -1308,6 +1308,9 @@ GSTextureCache::Source* GSTextureCache::LookupSource(const bool is_color, const const u32 dirty_end = GSLocalMemory::GetUnwrappedEndBlockAddress(t->m_TEX0.TBP0, t->m_TEX0.TBW, t->m_TEX0.PSM, dirty_rect); overlapping_dirty = read_start <= dirty_end && read_end >= dirty_start; + + if (overlapping_dirty && (psm == PSMT8 || psm == PSMT4)) + continue; } const bool t_clean = ((t->m_dirty.GetDirtyChannels() & GSUtil::GetChannelMask(psm)) == 0) || rect_clean; From ff803af74e661aa5ce0e0b62977a61474998bc47 Mon Sep 17 00:00:00 2001 From: refractionpcsx2 Date: Wed, 3 Apr 2024 13:03:40 +0100 Subject: [PATCH 2/2] GS/HW: Fix operator precedence warning --- pcsx2/GS/Renderers/HW/GSRendererHW.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pcsx2/GS/Renderers/HW/GSRendererHW.cpp b/pcsx2/GS/Renderers/HW/GSRendererHW.cpp index a81b17b28ad82..7f933dad3b51e 100644 --- a/pcsx2/GS/Renderers/HW/GSRendererHW.cpp +++ b/pcsx2/GS/Renderers/HW/GSRendererHW.cpp @@ -4381,7 +4381,7 @@ void GSRendererHW::EmulateBlending(int rt_alpha_min, int rt_alpha_max, bool& DAT { const bool afail_always_fb_alpha = m_cached_ctx.TEST.AFAIL == AFAIL_FB_ONLY || (m_cached_ctx.TEST.AFAIL == AFAIL_RGB_ONLY && GSLocalMemory::m_psm[m_cached_ctx.FRAME.PSM].trbpp != 32); const bool always_passing_alpha = !m_cached_ctx.TEST.ATE || afail_always_fb_alpha || (m_cached_ctx.TEST.ATE && m_cached_ctx.TEST.ATST == ATST_ALWAYS); - const bool full_cover = (rt->m_valid.rintersect(m_r).eq(rt->m_valid) && PrimitiveCoversWithoutGaps() && !(DATE_PRIMID || DATE_BARRIER || !always_passing_alpha || (m_cached_ctx.TEST.ZTE && m_cached_ctx.TEST.ZTST != ZTST_ALWAYS)) || m_channel_shuffle); + const bool full_cover = rt->m_valid.rintersect(m_r).eq(rt->m_valid) && PrimitiveCoversWithoutGaps() && !(DATE_PRIMID || DATE_BARRIER || !always_passing_alpha || !IsDepthAlwaysPassing()); if (!full_cover) {