From c14988150cb92a489bd03c047bc80f7d6ce03f87 Mon Sep 17 00:00:00 2001 From: chrg6 Date: Fri, 13 Nov 2026 18:57:53 -0500 Subject: [PATCH] Keep the prebloom images' last use when they are made again for another picture size. vk_dlaa.c pb_images noted the present count in PB.used and then, for a new picture size, pb_destroy cleared the whole struct with the old images, PB.used with it. The new images were made with PB.used 0, so at the next present idle_release took them for 600 presents unused (once the run was 600 presents old) and destroyed them without a wait for the GPU, while the frame that had just drawn into them could still be in flight; the frame after made them again. With dlss_prebloom = 1 (off by default) that happened at every change of the picture's size, with the log line "prebloom: the picture-size images went unused for 600 presents: freed" right after it. PB.used is now set again once the new images are made. Not reproduced before the change (found by reading the code). Every runtime file compiles, vk_dlaa.c with -Wall -Wextra and no warning. Co-Authored-By: Claude Opus 5.5 --- runtime/vk_dlaa.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/runtime/vk_dlaa.c b/runtime/vk_dlaa.c index 9b3bea1d..e20bf06c 100644 --- a/runtime/vk_dlaa.c +++ b/runtime/vk_dlaa.c @@ -2633,7 +2633,9 @@ static int pb_images(VkCommandBuffer cb, uint32_t w, uint32_t h) { VkDependencyInfo di = {.sType = VK_STRUCTURE_TYPE_DEPENDENCY_INFO, .imageMemoryBarrierCount = 2, .pImageMemoryBarriers = ib}; vkCmdPipelineBarrier2(cb, &di); - PB.w = w, PB.h = h; + // used again: pb_destroy above cleared it with the old images, and idle_release took the new ones, which this frame + // uses, for 600 presents unused and freed them at the next present, without a wait for the GPU + PB.w = w, PB.h = h, PB.used = D.presents; rt_log("dlaa: prebloom: the passes after the upscaler draw at %ux%u (two B10G11R11 images, %.0f MiB)", w, h, 2.0 * w * h * 4 / 1048576.0); return 1;