From d427db4a1571e358b1edbd7caa0b4d2089b9b293 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Fri, 12 Jan 2024 19:18:19 +1000 Subject: [PATCH] GS/HW: Fix drawing with mismatched target sizes --- pcsx2/GS/Renderers/HW/GSRendererHW.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pcsx2/GS/Renderers/HW/GSRendererHW.cpp b/pcsx2/GS/Renderers/HW/GSRendererHW.cpp index 7a4e8d3315..7afc5a92fa 100644 --- a/pcsx2/GS/Renderers/HW/GSRendererHW.cpp +++ b/pcsx2/GS/Renderers/HW/GSRendererHW.cpp @@ -2799,6 +2799,16 @@ void GSRendererHW::Draw() } } } + else + { + // RT and DS sizes need to match, even if we're not doing any resizing. + const int new_w = std::max(rt ? rt->m_unscaled_size.x : 0, ds ? ds->m_unscaled_size.x : 0); + const int new_h = std::max(rt ? rt->m_unscaled_size.y : 0, ds ? ds->m_unscaled_size.y : 0); + if (rt) + rt->ResizeTexture(new_w, new_h); + if (ds) + ds->ResizeTexture(new_w, new_h); + } if (rt) {