diff --git a/runtime/vk_dlaa.c b/runtime/vk_dlaa.c index a116a994..8abd8911 100644 --- a/runtime/vk_dlaa.c +++ b/runtime/vk_dlaa.c @@ -1399,8 +1399,11 @@ static void evaluate(VkExec *ex, const VkExecTarget *dst) { struct Size *e = size_for(cb, w, h, ow, oh); if (!e) return dl_fail("work image creation", 0); if (e != D.last) D.reset = 1, D.why[0]++, e->chars_ok = 0; // another size's history is from another moment - if (!use_fsr() && !N.ngx_up) return; // neither runs this frame: vk_dlaa_frame turns DLAA off at the next present - if (!use_fsr() && !D.params && !NGX_OK(N.alloc_params(&D.params))) return dl_fail("parameter allocation", 0); + // Read once: vk_dlaa_frame runs on the present's thread and can clear fsr_frame while this replay is between the + // checks below, which would send the rest of this function to DLSS's path without NGX after all. + const int fsr = use_fsr(); + if (!fsr && !N.ngx_up) return; // neither runs this frame: vk_dlaa_frame turns DLAA off at the next present + if (!fsr && !D.params && !NGX_OK(N.alloc_params(&D.params))) return dl_fail("parameter allocation", 0); NgxParam *p = D.params; VkImageView zv = vk_exec_target_view(z->img, z->format, VK_IMAGE_VIEW_TYPE_2D, VK_IMAGE_ASPECT_DEPTH_BIT, z->level, z->base_layer, 1, 0); @@ -1424,7 +1427,7 @@ static void evaluate(VkExec *ex, const VkExecTarget *dst) { uint64_t c0 = timed ? kern_now_ns() : 0; rec_drain(); // NGX records into the command buffer itself: the recorder thread must have made every call so far if (timed) T.cpu_drain += kern_now_ns() - c0; - if (use_fsr()) { // FSR 3.1 (vk_ffx.cpp) in DLSS's place: the same images, then the same blit below + if (fsr) { // FSR 3.1 (vk_ffx.cpp) in DLSS's place: the same images, then the same blit below if (t->level || t->base_layer || z->level || z->base_layer) return dl_fail("FSR 3.1 on a target that is not level 0, layer 0", 0); if (D.last_color != t->image) target_changed(t); uint64_t now = plat_now_ns();