Let the upscaler stand-in's scratch images make room for a new size instead of refusing it.

The cache kept the first eight sizes and formats for the whole run and refused every other one, so after a few
window, resolution or DLSS mode changes the stand-in's blit of a new size was left out, while the old sizes' images
stayed. A new size now takes a free entry or the one used longest ago, whose image goes through the deferred
destruction after the tonemap pass drops its views of it (vk_tonemap_forget), before another image can take its
handle. tests/scratch_lru_check.py checks the choice.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
chrg6
2026-11-12 23:17:36 -05:00
parent d77572c69c
commit a4310491de
7 changed files with 173 additions and 7 deletions

View File

@@ -702,6 +702,9 @@ VkDescriptorSetLayout vk_empty_set_layout(void); // set 1 of layouts without
// this one). The caller binds its own compute pipeline again afterwards.
VkImage vk_tonemap_record(VkCommandBuffer cb, VkImage src, VkFormat sf, uint32_t sw, uint32_t sh, uint32_t dw,
uint32_t dh, int edge);
// A source image of the stand-in goes (vk_exec_draw.c fallback_scratch): its views go through the deferred destruction,
// before another image can take its handle. Called on the replaying thread, as vk_tonemap_record.
void vk_tonemap_forget(VkImage src);
// What vk_texture_by_id(id) returns can change only when this does: the slot is registered again, or a texture entry at
// its storage address is created, dropped, released or taken back into use. Unlocked; read it before the lookup it
// guards (a lookup may create an entry). 0 when the slot was never registered: nothing is kept under 0.