From c65eb3c3ee71b728033542bde79fdbb36ef76d6a Mon Sep 17 00:00:00 2001 From: Stenzek Date: Fri, 10 Feb 2023 22:51:10 +1000 Subject: [PATCH] GS/HW: Fix crash with AVX2 due to unaligned pitch --- pcsx2/GS/Renderers/HW/GSTextureCache.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pcsx2/GS/Renderers/HW/GSTextureCache.cpp b/pcsx2/GS/Renderers/HW/GSTextureCache.cpp index 03b2461da2..f99cd0acf3 100644 --- a/pcsx2/GS/Renderers/HW/GSTextureCache.cpp +++ b/pcsx2/GS/Renderers/HW/GSTextureCache.cpp @@ -3116,7 +3116,7 @@ void GSTextureCache::Target::Update(bool reset_age) } else { - int pitch = ((r.width()+3) & ~3) * 4; + const int pitch = Common::AlignUpPow2(r.width() * sizeof(u32), 32); g_gs_renderer->m_mem.ReadTexture(off, r, s_unswizzle_buffer, pitch, TEXA); t->Update(r, s_unswizzle_buffer, pitch);