From 294aca82c43acc9380b119d586e957cec400a5ae Mon Sep 17 00:00:00 2001 From: refractionpcsx2 Date: Sun, 26 Mar 2023 21:01:41 +0100 Subject: [PATCH] GS-TC: Give option to match target on exact memory addresses Chances of it being the wrong thing but having the same start/end address is pretty slim. Hopefully --- pcsx2/GS/Renderers/HW/GSTextureCache.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pcsx2/GS/Renderers/HW/GSTextureCache.cpp b/pcsx2/GS/Renderers/HW/GSTextureCache.cpp index 261817f303..0c86be78aa 100644 --- a/pcsx2/GS/Renderers/HW/GSTextureCache.cpp +++ b/pcsx2/GS/Renderers/HW/GSTextureCache.cpp @@ -2255,7 +2255,8 @@ void GSTextureCache::InvalidateLocalMem(const GSOffset& off, const GSVector4i& r // Check exact match first const bool bpp_match = GSLocalMemory::m_psm[t->m_TEX0.PSM].bpp == GSLocalMemory::m_psm[psm].bpp; const u32 page_mask = ((1 << 5) - 1); - const bool expecting_this_tex = bpp_match && bw == t->m_TEX0.TBW && (((read_start & ~page_mask) == t->m_TEX0.TBP0) || (bp >= t->m_TEX0.TBP0 && ((read_end + page_mask) & ~page_mask) <= ((t->m_end_block + page_mask) & ~page_mask))); + const bool exact_mem_match = (read_start & ~page_mask) == (t->m_TEX0.TBP0 & ~page_mask) && ((read_end + page_mask) & ~page_mask) == ((t->m_end_block + page_mask) & ~page_mask); + const bool expecting_this_tex = exact_mem_match || (bpp_match && bw == t->m_TEX0.TBW && (((read_start & ~page_mask) == t->m_TEX0.TBP0) || (bp >= t->m_TEX0.TBP0 && ((read_end + page_mask) & ~page_mask) <= ((t->m_end_block + page_mask) & ~page_mask)))); if (!expecting_this_tex) continue;