From c9fdd0197f11b2fc2cbf00a245367c7ed76f562d Mon Sep 17 00:00:00 2001 From: Stenzek Date: Mon, 1 Apr 2024 00:46:44 +1000 Subject: [PATCH] GS/TextureCache: Fix incorrect alpha min/max read on block offsets --- pcsx2/GS/Renderers/HW/GSTextureCache.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/pcsx2/GS/Renderers/HW/GSTextureCache.cpp b/pcsx2/GS/Renderers/HW/GSTextureCache.cpp index 50bd6617f5..24bff4d63b 100644 --- a/pcsx2/GS/Renderers/HW/GSTextureCache.cpp +++ b/pcsx2/GS/Renderers/HW/GSTextureCache.cpp @@ -7119,11 +7119,10 @@ void GSTextureCache::PreloadTexture(const GIFRegTEX0& TEX0, const GIFRegTEXA& TE { rtx(mem, off, block_rect, map.bits, map.pitch, TEXA); tex->Unmap(); + // Temporary, can't read the texture here so we need to come up with a smarter solution, but this will get around it being broken. if (alpha_minmax) - { *alpha_minmax = std::make_pair(0, 255); - } } else { @@ -7134,11 +7133,10 @@ void GSTextureCache::PreloadTexture(const GIFRegTEX0& TEX0, const GIFRegTEXA& TE const u8* ptr = buff + (pitch * static_cast(rect.top - block_rect.top)) + (static_cast(rect.left - block_rect.left) << (paltex ? 0 : 2)); + if (alpha_minmax) - { - pxAssert(GSLocalMemory::m_psm[TEX0.PSM].pal == 0); - *alpha_minmax = GSGetRGBA8AlphaMinMax(buff, unoffset_rect.width(), unoffset_rect.height(), pitch); - } + *alpha_minmax = GSGetRGBA8AlphaMinMax(ptr, unoffset_rect.width(), unoffset_rect.height(), pitch); + tex->Update(unoffset_rect, ptr, pitch, level); } }