From 708281f00b33b8c41460761ba4615d3943965959 Mon Sep 17 00:00:00 2001 From: refractionpcsx2 Date: Thu, 10 Mar 2022 14:09:04 +0000 Subject: [PATCH] GS: Properly detect 16bit format on Texture Shuffle + Convert --- pcsx2/GS/Renderers/HW/GSTextureCache.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pcsx2/GS/Renderers/HW/GSTextureCache.cpp b/pcsx2/GS/Renderers/HW/GSTextureCache.cpp index 13e5af4d3f..cd87c8c244 100644 --- a/pcsx2/GS/Renderers/HW/GSTextureCache.cpp +++ b/pcsx2/GS/Renderers/HW/GSTextureCache.cpp @@ -546,7 +546,9 @@ GSTextureCache::Target* GSTextureCache::LookupTarget(const GIFRegTEX0& TEX0, con dst = CreateTarget(TEX0, new_size.x, new_size.y, type, clear); dst->m_32_bits_fmt = dst_match->m_32_bits_fmt; ShaderConvert shader; - bool fmt_16_bits = (psm_s.bpp == 16 && GSLocalMemory::m_psm[dst_match->m_TEX0.PSM].bpp == 16); + // m_32_bits_fmt gets set on a shuffle or if the format isn't 16bit. + // In this case it needs to make sure it isn't part of a shuffle, where it needs to be interpreted as 32bits. + const bool fmt_16_bits = (psm_s.bpp == 16 && GSLocalMemory::m_psm[dst_match->m_TEX0.PSM].bpp == 16 && !dst->m_32_bits_fmt); if (type == DepthStencil) { GL_CACHE("TC: Lookup Target(Depth) %dx%d, hit Color (0x%x, %s was %s)", new_size.x, new_size.y, bp, psm_str(TEX0.PSM), psm_str(dst_match->m_TEX0.PSM));