From 9f1483f01b7b756ae1ac00a7864ff700255daff2 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Tue, 23 Apr 2024 17:32:34 +1000 Subject: [PATCH] GS/HW: Check for format combinations that make sense for CSBW True Crime: New York City strikes again... --- pcsx2/GS/Renderers/HW/GSRendererHW.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pcsx2/GS/Renderers/HW/GSRendererHW.cpp b/pcsx2/GS/Renderers/HW/GSRendererHW.cpp index c1f4fd88be..e420005706 100644 --- a/pcsx2/GS/Renderers/HW/GSRendererHW.cpp +++ b/pcsx2/GS/Renderers/HW/GSRendererHW.cpp @@ -6222,6 +6222,14 @@ bool GSRendererHW::CanUseSwPrimRender(bool no_rt, bool no_ds, bool draw_sprite_t if (!rc.GetDirtyRect(m_cached_ctx.TEX0, false).rintersect(tr).rempty()) return true; } + + // Make sure it actually makes sense to use this target as a source, given the formats, and it wouldn't just sample as garbage. + // We can't rely exclusively on the dirty rect check above, because sometimes the targets are from older frames and too large. + if (!GSUtil::HasSameSwizzleBits(m_cached_ctx.TEX0.PSM, src_target->m_TEX0.PSM) && + (!src_target->m_32_bits_fmt || GSLocalMemory::m_psm[m_cached_ctx.TEX0.PSM].bpp != 16)) + { + return true; + } } return false;