From e863da9490a26ff7872d59594c1eaa5be2406dc4 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Sun, 26 May 2024 13:42:11 +1000 Subject: [PATCH] GS/HW: Fix unscaled rect in CopyRGBFromDepthToColor() Fixes fade transitions when upscaling in GT3. --- pcsx2/GS/Renderers/HW/GSTextureCache.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pcsx2/GS/Renderers/HW/GSTextureCache.cpp b/pcsx2/GS/Renderers/HW/GSTextureCache.cpp index 96c3a7fa28..db65007e1c 100644 --- a/pcsx2/GS/Renderers/HW/GSTextureCache.cpp +++ b/pcsx2/GS/Renderers/HW/GSTextureCache.cpp @@ -2924,8 +2924,9 @@ bool GSTextureCache::CopyRGBFromDepthToColor(Target* dst, Target* depth_src) { if (dst->m_valid_alpha_low || dst->m_valid_alpha_high) { - g_gs_device->StretchRect(dst->m_texture, GSVector4::cxpr(0.0f, 0.0f, 1.0f, 1.0f), tex, - GSVector4(GSVector4i::loadh(dst->m_unscaled_size)), false, false, false, true); + const GSVector4 copy_rect = GSVector4(tex->GetRect().rintersect(dst->m_texture->GetRect())); + g_gs_device->StretchRect(dst->m_texture, copy_rect / GSVector4(GSVector4i(dst->m_texture->GetSize()).xyxy()), tex, + copy_rect, false, false, false, true); g_perfmon.Put(GSPerfMon::TextureCopies, 1); }