From 653c036ac8f09d510bb06f937c5a71622dcbc550 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 16 Jan 2022 21:00:53 -0800 Subject: [PATCH] Debugger: Fix crash in software renderer. The clut isn't set by sampler state, it's set normally by the binner. --- GPU/Software/FuncId.h | 6 +++--- GPU/Software/Rasterizer.cpp | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/GPU/Software/FuncId.h b/GPU/Software/FuncId.h index 0d18ac4a05..f847522e25 100644 --- a/GPU/Software/FuncId.h +++ b/GPU/Software/FuncId.h @@ -174,9 +174,9 @@ struct SamplerID { uint32_t texBlendColor; uint32_t clutFormat; union { - uint8_t *clut; - uint16_t *clut16; - uint32_t *clut32; + const uint8_t *clut; + const uint16_t *clut16; + const uint32_t *clut32; }; } cached; diff --git a/GPU/Software/Rasterizer.cpp b/GPU/Software/Rasterizer.cpp index b4bc93c5b4..d442149731 100644 --- a/GPU/Software/Rasterizer.cpp +++ b/GPU/Software/Rasterizer.cpp @@ -1277,6 +1277,8 @@ bool GetCurrentTexture(GPUDebugBuffer &buffer, int level) SamplerID id; ComputeSamplerID(&id); + id.cached.clut = (const u8 *)clut; + Sampler::FetchFunc sampler = Sampler::GetFetchFunc(id); u8 *texptr = Memory::GetPointer(texaddr);