mirror of
https://github.com/RetroPortingToolKit/psxrecomp
synced 2026-10-26 02:11:36 -04:00
b35892fc16
The geometry side cache was an 8192-entry HASHED table with no ambiguity check. Unrelated screen positions shared a slot, so a vertex could be handed a different vertex's sub-pixel fraction, and eviction changed which triangles got corrected from frame to frame — moving seams across every mesh. Both references index this table exactly, one slot per reachable SXY (beetle-psx vertexCache[0x800*2][0x800*2]; DuckStation 2048x2048), and gate it on an ambiguity flag so a pixel that two DIFFERENT projections rounded to is never used. Do the same: direct index, first writer wins, flag on a conflicting value, allocate lazily on enable so the faithful default costs nothing, and fail closed to the faithful path if the allocation fails. Adds a lookup census (attempted / hit / miss_unrecorded / miss_ambiguous) on geom_correction. With an exact table a miss_unrecorded is a genuine tracking coverage gap rather than a cache artifact, which is what distinguishes 'the cache was lossy' from 'the vertex path never reaches us in a matchable form'. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>