From 9425d0670a9280110972ee17a010ee704f2ba98a Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 27 Nov 2022 21:24:02 -0800 Subject: [PATCH] GPU: Prevent decimating CLUT framebuffers. Fixes color changing after a few moments in Kurohyo. --- GPU/Common/TextureCacheCommon.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/GPU/Common/TextureCacheCommon.cpp b/GPU/Common/TextureCacheCommon.cpp index 6234740d50..a6c1582606 100644 --- a/GPU/Common/TextureCacheCommon.cpp +++ b/GPU/Common/TextureCacheCommon.cpp @@ -1274,6 +1274,8 @@ void TextureCacheCommon::LoadClut(u32 clutAddr, u32 loadBytes) { if (matchRange && !inMargin && offset < (int)clutRenderOffset_) { WARN_LOG_N_TIMES(clutfb, 5, G3D, "Detected LoadCLUT(%d bytes) from framebuffer %08x (%s), byte offset %d", loadBytes, fb_address, GeBufferFormatToString(framebuffer->fb_format), offset); framebuffer->last_frame_clut = gpuStats.numFlips; + // Also mark used so it's not decimated. + framebuffer->last_frame_used = gpuStats.numFlips; framebuffer->usageFlags |= FB_USAGE_CLUT; bestClutAddress = framebuffer->fb_address; clutRenderOffset_ = (u32)offset;