Stamp a retired texture as used when it is taken back.

While retired it got no use stamp, so it counted as idle the moment it came back, and a sweep over the video memory budget could evict it as idle in the same call that took it back: on the cards that are over budget, which are the ones the take-back is for.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
chrg6
2026-11-10 14:22:52 -05:00
parent be136d8d3b
commit 834b36a6d9

View File

@@ -1474,6 +1474,11 @@ static void retire_cancel(Tex *e) {
retiring_bytes -= e->bytes;
if (holds.n) nvn_hm_del(&holds, &e->key);
n_retire_cancel++, n_disuse_back++;
// In use as of now: while retired the pool refresh left it out, so it carries no use stamp of that time and
// counted as idle the moment it came back. A sweep over the budget (sweep_pressure calls retire_sweep and then
// evict_idle) could evict it in the same call that took it back.
e->use_round = look_round;
e->use_frame = __atomic_load_n(&gfx_counters.frames, __ATOMIC_RELAXED);
tex_gen_bump(e->key.addr);
}