mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-11-07 13:39:55 +00:00
An unwritten column was vouched for run by run: ShaderMemory::unchangedSince, with its pending write query, flush hook, collect and tracker lock, once per contiguous run of the words the column read. A heap whose records are wider than the descriptor they hold, like Resident Evil Village's T#s of 8 dwords at a 48-byte stride, makes every record its own run: 32,768 calls per reuse there. Each capture also took a new stamp before it looked at the memo, so a hit paid the pending query, flush and collect twice. The memo's words now carry the range their runs span, and a reuse vouches for that range in one call. The range covers more than the runs (the bytes between records), so a store between two records refuses the vouch and the column is compared instead: still exact, never stale. A hit is tried before the capture stamps the column; the stamp is taken only when the memo cannot be reused unwritten. ShaderMemory::Vouches counts the vouch calls. The test reads a strided table of 4,096 records and checks that its reuse vouches in one call, that a store between records compares and keeps the column, and that a store into a record reads it again.