Keep the fallback blit's scratch images for the sizes in use, and let the tonemap pass's views go with their image.

The scratch images of the fallback blit, one per size and format, were kept for the process, the first eight ever
asked for. Their sizes follow the scene's resolution, which DLSS modes, the dynamic resolution and a window or
picture size change move, at up to 32 MiB each at 2160 lines; a ninth size got no scratch and its blit was left out.
A new size now takes the place of the one used longest ago, which goes once the GPU is past the submission being
recorded, and never one the submission being recorded uses. The cache is under a lock, since replay workers record
blits side by side.

The tonemap pass's views were kept by image handle for the process, a game image's view naming a destroyed image that
a new image could get the handle of, and no view at all past sixteen. A view now goes with its image: at a scratch
image's replacement, and with a game image through the replay's image-gone hook.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
chrg6
2026-11-13 00:41:47 -05:00
parent 4882623ce7
commit ad58dfcddb
3 changed files with 71 additions and 12 deletions

View File

@@ -687,6 +687,8 @@ VkDescriptorSetLayout vk_empty_set_layout(void); // set 1 of layouts without
// image, which it returns for the caller to blit into the target; VK_NULL_HANDLE when it cannot. edge: 1 lets it scale
// with the edge-adaptive filter (NX2NAVI_STANDIN_FILTER), 0 keeps the linear one (another upscaler's picture replaces
// this one). The caller binds its own compute pipeline again afterwards.
// The tonemap pass's views of img go (vk_defer_view): img is destroyed or replaced. Any thread.
void vk_tonemap_image_gone(VkImage img);
VkImage vk_tonemap_record(VkCommandBuffer cb, VkImage src, VkFormat sf, uint32_t sw, uint32_t sh, uint32_t dw,
uint32_t dh, int edge);
// What vk_texture_by_id(id) returns can change only when this does: the slot is registered again, or a texture entry at