mirror of
https://github.com/ARMSX2/ARMSX2.git
synced 2026-08-24 16:50:16 -07:00
GS/TC: cross-version probe for the texture-hash divergence (diagnostic)
The two builds ask for disjoint TEX0 hashes for the same on-screen font -- nine values on 2.6.6, eight now, no overlap, same palette hash, same PSMT4. Every function feeding the hash is byte-identical between them, so what differs is the DATA, and HashCacheKey records only the region's width and height: never where it starts, never which address it came from, never whether mips were folded in. Print exactly what the key discards -- TBP0, TBW, TW/TH, the full region rect including its origin, whether lod was present, and the first bytes actually hashed -- so two logs can be diffed instead of theorised about.
This commit is contained in:
@@ -9459,6 +9459,31 @@ GSTextureCache::HashCacheKey GSTextureCache::HashCacheKey::Create(const GIFRegTE
|
||||
|
||||
ret.TEX0Hash = FinishBlockHash(hash_st);
|
||||
|
||||
// ★ CROSS-VERSION PROBE (diagnostic builds only).
|
||||
//
|
||||
// Two builds ask for completely disjoint TEX0 hashes for the same on-screen font: nine values
|
||||
// on 2.6.6, eight now, no overlap, same palette hash, same 32x32 PSMT4. Every hashing function
|
||||
// involved is byte-identical between them, so the DATA being hashed differs -- and the key
|
||||
// records only the region's width and height, never where it starts or which address it came
|
||||
// from. Print the things the key throws away, so the two logs can be diffed directly instead
|
||||
// of guessed at.
|
||||
if (psm.pal != 0) // any paletted texture; the cap below keeps the volume sane
|
||||
{
|
||||
static u32 probes = 0;
|
||||
if (probes < 12)
|
||||
{
|
||||
probes++;
|
||||
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),
|
||||
static_cast<u32>(TEX0.PSM), static_cast<u32>(TEX0.TW), static_cast<u32>(TEX0.TH),
|
||||
region.GetMinX(), region.GetMinY(), region.GetMaxX(), region.GetMaxY(),
|
||||
lod ? 1 : 0,
|
||||
s_unswizzle_buffer[0], s_unswizzle_buffer[1], s_unswizzle_buffer[2], s_unswizzle_buffer[3],
|
||||
s_unswizzle_buffer[4], s_unswizzle_buffer[5], s_unswizzle_buffer[6], s_unswizzle_buffer[7]);
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user