GS/TC: split the base-level hash from the mip chain in the probe

Both builds report identical TBP0, TBW, PSM, TW/TH, region and lod for the same
font glyph, and identical leading bytes -- yet different TEX0 hashes. Since
HashTextureLevel reads straight out of GS local memory, the bytes at that address
differ; the shipped hash folds the base level and every mip into one value, so it
cannot say which of them moved.

Recompute the base level alone for the probed textures and log it beside the
combined hash, plus the actual mip range rather than the bool the first probe
recorded. Base matching with the combined differing means the mip chain moved;
base differing means the glyph data itself did. Those are different bugs.
This commit is contained in:
jpolo1224
2026-08-21 21:01:28 -04:00
parent 6375594405
commit a4f6fb0bd9
+17
View File
@@ -9473,6 +9473,23 @@ GSTextureCache::HashCacheKey GSTextureCache::HashCacheKey::Create(const GIFRegTE
if (probes < 12)
{
probes++;
// Base level ALONE, recomputed for the probed textures only. The shipped hash folds
// the base and every mip into one value, so a mismatch cannot say which moved. Same
// address, same extent, same lod flag and same leading bytes in both builds -- so the
// bytes differ somewhere, and this splits "the glyph data differs" from "the mip chain
// differs", which are different bugs in different places.
u64 base_only = 0;
int nmips_dbg = 0;
{
BlockHashState base_st;
BlockHashReset(base_st);
HashTextureLevel(TEX0, TEXA, region, base_st, s_unswizzle_buffer);
base_only = FinishBlockHash(base_st);
if (lod)
nmips_dbg = lod->y - lod->x + 1;
}
Console.WriteLnFmt("TCPROBE base={:016x} nmips={} lodx={} lody={}", base_only, nmips_dbg,
lod ? lod->x : -1, lod ? lod->y : -1);
Console.WriteLnFmt("TCPROBE tex0hash={:016x} clut={:016x} TBP0={:05x} TBW={} PSM={} TW={} TH={} "
"region=({},{})-({},{}) lod={} first={:02x}{:02x}{:02x}{:02x}{:02x}{:02x}{:02x}{:02x}",
ret.TEX0Hash, ret.CLUTHash, static_cast<u32>(TEX0.TBP0), static_cast<u32>(TEX0.TBW),