From 43335cd729a2ffcfedf5ea869b55afc148096bbc Mon Sep 17 00:00:00 2001 From: refractionpcsx2 Date: Sun, 27 Aug 2023 21:57:38 +0100 Subject: [PATCH] GS/HW: Always calculate valid area + end block on new targets --- pcsx2/GS/Renderers/HW/GSTextureCache.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pcsx2/GS/Renderers/HW/GSTextureCache.cpp b/pcsx2/GS/Renderers/HW/GSTextureCache.cpp index e8584d1544..0c26e96e6b 100644 --- a/pcsx2/GS/Renderers/HW/GSTextureCache.cpp +++ b/pcsx2/GS/Renderers/HW/GSTextureCache.cpp @@ -2218,10 +2218,8 @@ bool GSTextureCache::PreloadTarget(GIFRegTEX0 TEX0, const GSVector2i& size, cons AddDirtyRectTarget(dst, newrect, TEX0.PSM, TEX0.TBW, rgba, GSLocalMemory::m_psm[TEX0.PSM].trbpp >= 16); } } - else - { - dst->UpdateValidity(GSVector4i::loadh(valid_size)); - } + + dst->UpdateValidity(GSVector4i::loadh(valid_size)); for (int type = 0; type < 2; type++) { @@ -2262,6 +2260,8 @@ bool GSTextureCache::PreloadTarget(GIFRegTEX0 TEX0, const GSVector2i& size, cons const int old_height = (dst->m_valid.w - y_reduction) * dst->m_scale; GL_INS("RT double buffer copy from FBP 0x%x, %dx%d => %d,%d", t->m_TEX0.TBP0, copy_width, copy_height, 0, old_height); + pxAssert(old_height > 0); + // Clear the dirty first dst->Update(); // Invalidate has been moved to after DrawPrims(), because we might kill the current sources' backing.