From bfa1a90ffff3269c9d4718cbaff05f38c63637ff Mon Sep 17 00:00:00 2001 From: refractionpcsx2 Date: Sat, 21 Oct 2023 18:34:59 +0100 Subject: [PATCH] GS/TC: Invalidate alpha on overlapping targets with no alpha --- pcsx2/GS/Renderers/HW/GSTextureCache.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pcsx2/GS/Renderers/HW/GSTextureCache.cpp b/pcsx2/GS/Renderers/HW/GSTextureCache.cpp index 4ce5380f865d4b..62f8f10d57c271 100644 --- a/pcsx2/GS/Renderers/HW/GSTextureCache.cpp +++ b/pcsx2/GS/Renderers/HW/GSTextureCache.cpp @@ -2847,6 +2847,13 @@ void GSTextureCache::InvalidateVideoMem(const GSOffset& off, const GSVector4i& r } } } + // This is a situation where it is uploading in to the alpha channel but that is not part of the mask for the target format. + // So we need to make sure the alpha is not marked as valid. (Juiced does a shuffle on the Z24 depth, making the alpha valid data). + else if (bp == t->m_TEX0.TBP0 && GSUtil::GetChannelMask(psm) == 0x8 && GSUtil::GetChannelMask(t->m_TEX0.PSM) == 0x7) + { + t->m_valid_alpha_high &= !(psm == PSMT8H || psm == PSMT4HH); + t->m_valid_alpha_low &= !(psm == PSMT8H || psm == PSMT4HL); + } } } }