From ca8736fc6afa709544811287f16605a14d4b0e57 Mon Sep 17 00:00:00 2001 From: ChrisF <3870029+chrisfand@users.noreply.github.com> Date: Fri, 6 Mar 2026 14:07:03 -0500 Subject: [PATCH] Adds one more image size (128x128) option for DXT1 block skipping in texture replacement --- GPU/Common/TextureReplacer.cpp | 4 ++++ GPU/Common/TextureReplacer.h | 1 + 2 files changed, 5 insertions(+) diff --git a/GPU/Common/TextureReplacer.cpp b/GPU/Common/TextureReplacer.cpp index 26266ce09c..660f00678b 100644 --- a/GPU/Common/TextureReplacer.cpp +++ b/GPU/Common/TextureReplacer.cpp @@ -308,6 +308,7 @@ bool TextureReplacer::LoadIniValues(IniFile &ini, VFSBackend *dir, bool isOverri options->Get("reduceHash", &reduceHash_); options->Get("ignoreMipmap", &ignoreMipmap_); options->Get("skipLastDXT1Blocks128x64", &skipLastDXT1Blocks128x64_); + options->Get("skipLastDXT1Blocks128x128", &skipLastDXT1Blocks128x128_); if (reduceHash_ && hash_ == ReplacedTextureHash::QUICK) { reduceHash_ = false; ERROR_LOG(Log::TexReplacement, "Texture Replacement: reduceHash option requires safer hash, use xxh32 or xxh64 instead."); @@ -540,6 +541,9 @@ u32 TextureReplacer::ComputeHash(u32 addr, int bufw, int w, int h, bool swizzled // Skip the last few blocks as specified. sizeInRAM -= 8 * skipLastDXT1Blocks128x64_; } + if (skipLastDXT1Blocks128x128_ && fmt == GE_TFMT_DXT1 && w == 128 && h == 128) { + sizeInRAM -= 8 * skipLastDXT1Blocks128x128_; + } switch (hash_) { case ReplacedTextureHash::QUICK: diff --git a/GPU/Common/TextureReplacer.h b/GPU/Common/TextureReplacer.h index 9410dac6dd..1bef81fd78 100644 --- a/GPU/Common/TextureReplacer.h +++ b/GPU/Common/TextureReplacer.h @@ -150,6 +150,7 @@ protected: bool reduceHash_ = false; bool ignoreMipmap_ = false; int skipLastDXT1Blocks128x64_ = 0; + int skipLastDXT1Blocks128x128_ = 0; float reduceHashGlobalValue = 0.5f; // Global value for textures dump pngs of all sizes, 0.5 by default but can be set in textures.ini