From 37ccd81985a16bb9790ba26cd3a54a9536b39a81 Mon Sep 17 00:00:00 2001 From: refractionpcsx2 Date: Tue, 14 Dec 2021 10:23:22 +0000 Subject: [PATCH] GS: Avoid some unnecessary flushes CLUT only updates if valid index type used in PSM --- pcsx2/GS/GSClut.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pcsx2/GS/GSClut.cpp b/pcsx2/GS/GSClut.cpp index 53f7380765..d8046bb330 100644 --- a/pcsx2/GS/GSClut.cpp +++ b/pcsx2/GS/GSClut.cpp @@ -148,7 +148,8 @@ bool GSClut::WriteTest(const GIFRegTEX0& TEX0, const GIFRegTEXCLUT& TEXCLUT) __assume(0); } - return m_write.IsDirty(TEX0, TEXCLUT); + // CLUT only reloads if PSM is a valid index type, avoid unnecessary flushes + return ((TEX0.PSM & 0x7) >= 3) && m_write.IsDirty(TEX0, TEXCLUT); } void GSClut::Write(const GIFRegTEX0& TEX0, const GIFRegTEXCLUT& TEXCLUT) @@ -157,7 +158,7 @@ void GSClut::Write(const GIFRegTEX0& TEX0, const GIFRegTEXCLUT& TEXCLUT) m_write.TEXCLUT = TEXCLUT; m_read.dirty = true; m_write.dirty = false; - + (this->*m_wc[TEX0.CSM][TEX0.CPSM][TEX0.PSM])(TEX0, TEXCLUT); }