Add compat flag to not load CLUTs from old framebuffers

This commit is contained in:
Henrik Rydgård committed 2023-08-24 10:30:37 +02:00
1 parent 044624e218
commit 16d073c4ad
4 files changed
+15 -1

No files matched your search

+2 -1
View File
@@ -1355,7 +1355,8 @@ void TextureCacheCommon::LoadClut(u32 clutAddr, u32 loadBytes) {
// the framebuffer with the smallest offset. This is yet another framebuffer matching
// loop with its own rules, eventually we'll probably want to do something
// more systematic.
if (matchRange && !inMargin && offset < (int)clutRenderOffset_) {
bool okAge = !PSP_CoreParameter().compat.flags().LoadCLUTFromCurrentFrameOnly || framebuffer->last_frame_used == gpuStats.numFlips;
if (matchRange && !inMargin && offset < (int)clutRenderOffset_ && okAge) {
WARN_LOG_N_TIMES(clutfb, 5, G3D, "Detected LoadCLUT(%d bytes) from framebuffer %08x (%s), byte offset %d, pixel offset %d",
loadBytes, fb_address, GeBufferFormatToString(framebuffer->fb_format), offset, offset / fb_bpp);
framebuffer->last_frame_clut = gpuStats.numFlips;