From f3ab63b90e0abdd951fa53a94b978021dcf25cf3 Mon Sep 17 00:00:00 2001 From: refractionpcsx2 Date: Sun, 11 Oct 2026 17:48:04 +0100 Subject: [PATCH] GS/TC: Use drawn area when available for checking overlap --- 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 81110bb24b..537eaa9272 100644 --- a/pcsx2/GS/Renderers/HW/GSTextureCache.cpp +++ b/pcsx2/GS/Renderers/HW/GSTextureCache.cpp @@ -2345,8 +2345,10 @@ void GSTextureCache::CombineAlignedInsideTargets(Target* target, GSTextureCache: if (t != target) { + GSVector4i t_check_rect = t->m_drawn_since_read.eq(GSVector4i::zero()) ? t->m_valid : t->m_drawn_since_read; // Target not contained, skip it. - if (t->m_TEX0.TBP0 < target->m_TEX0.TBP0 || t->UnwrappedEndBlock() > target->UnwrappedEndBlock()) + // Go from the drawn rect rather than valid as this can be false if expanded by LookupDisplayTarget, we use this metric for the copy anyway. + if (t->m_TEX0.TBP0 < target->m_TEX0.TBP0 || GSLocalMemory::GetUnwrappedEndBlockAddress(t->m_TEX0.TBP0, t->m_TEX0.TBW, t->m_TEX0.PSM, t_check_rect) > target->UnwrappedEndBlock()) { i++; continue; @@ -2422,7 +2424,8 @@ void GSTextureCache::CombineAlignedInsideTargets(Target* target, GSTextureCache: GSTextureCache::RescaleHelper::RescaleHelper(const GSVector2i& size, float scale) : m_size(size) - , m_scale(scale) + , m_scale(scale) + { }