From 7de7b2d76b24ca0dac9fa84f4c974da024504ba3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Tue, 29 Sep 2026 13:10:28 -0600 Subject: [PATCH] TextureCache: Use XXH3 instead of the quick hash for texture data With xxhash 0.8.4, XXH3 is faster than StableQuickTexHash on ARM64 (about 37 vs 24 GB/s on a Snapdragon X), and its scalar path, which RISC-V builds get, is about as fast as the quick hash's. It doesn't collide the way the quick hash does (#8249). Texture replacement still uses its own hash setting, so texture packs are unaffected. Co-Authored-By: Claude Opus 5.5 (1M context) --- GPU/Common/TextureCacheCommon.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/GPU/Common/TextureCacheCommon.cpp b/GPU/Common/TextureCacheCommon.cpp index ded34b7a93..43f34a3680 100644 --- a/GPU/Common/TextureCacheCommon.cpp +++ b/GPU/Common/TextureCacheCommon.cpp @@ -431,8 +431,9 @@ static u32 ComputeTextureHash(TextureReplacer &replacer, u32 addr, int bufw, int if (Memory::IsValidRange(addr, sizeInRAM)) { gpuStats.perFrame.numTextureDataBytesHashed += sizeInRAM; - // return XXH64(checkp, sizeInRAM, 0xBACD7814); - return StableQuickTexHash(checkp, sizeInRAM); + // XXH3 is faster than StableQuickTexHash on ARM64 and doesn't collide the way it did (#8249). + // Texture replacement keeps its own hash setting above, so this doesn't affect texture packs. + return (u32)XXH3_64bits(checkp, sizeInRAM); } else { return 0; }