From 87aa7bbb76342fadef3a8c3b2d8ffcf815fb2c0e Mon Sep 17 00:00:00 2001 From: refractionpcsx2 Date: Thu, 3 Nov 2022 11:45:29 +0000 Subject: [PATCH] GS: Restrict age of targets for GS Download invalidation. --- 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 1aaa56878b..50a1804dba 100644 --- a/pcsx2/GS/Renderers/HW/GSTextureCache.cpp +++ b/pcsx2/GS/Renderers/HW/GSTextureCache.cpp @@ -1072,7 +1072,8 @@ void GSTextureCache::InvalidateLocalMem(const GSOffset& off, const GSVector4i& r // Checking for targets that overlap with the requested memory region // instead of just comparing TBPs should fix that. // For example, this fixes Judgement ring rendering in Shadow Hearts 2. - if (t->Overlaps(bp, bw, psm, r) && t->m_TEX0.TBP0 >= bp && GSUtil::HasSharedBits(psm, t->m_TEX0.PSM)) + // Be wary of old targets being misdetected, set a sensible range of 30 frames (like Display source lookups). + if (t->Overlaps(bp, bw, psm, r) && t->m_TEX0.TBP0 >= bp && GSUtil::HasSharedBits(psm, t->m_TEX0.PSM) && t->m_age <= 30) { // Enforce full invalidation if BP's don't match. const GSVector4i targetr = (bp == t->m_TEX0.TBP0) ? r : t->m_valid;