mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-15 19:19:58 -04:00
Under VRAM pressure or a standing mirror room request, sweep_pressure runs every eighth submission. evict_idle walked the whole texture table and, when it found no idle candidate, returned before it set evict_wait, so the next check walked it all again. The released-list loop before it started from the head each time and passed every stale entry it could not drop (up to RELEASED_HARD) until PRESSURE_STEP drops. evict_idle now keeps a wait of its own after an empty walk: no new walk for EVICT_EMPTY_WAIT (16) submissions. It is a separate idle_empty_wait, because evict_disused, which sweep_pressure calls right after evict_idle when it freed too little, stops while evict_wait is ahead, and sharing that wait would have stopped disuse eviction for as long as the idle walk stayed empty. The released loop looks at up to EVICT_LOOK (1024) entries a check from a cursor (press_at) that rel_unlink moves off a leaving entry, as for sweep_at and aged_at. It starts from the oldest again at the first entry released less than STALE_FRAMES ago or at the list's end. The trace=perf eviction line counts the empty walks and their time. Not reproduced before the change: the 0.10.0 session had no VRAM pressure. Checks that passed: pass_cc_check on vk_texture.c, no new -Wall -Wextra warnings, tex_release_check, tex_compact_check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
406 KiB
406 KiB