mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-15 19:19:58 -04:00
vk_ffx.cpp context_for (two places) and vk_ffx4.cpp context_for (three) waited for the whole device to be idle, with the queue lock held, on the thread that replays the game's submissions, before they destroyed an upscale context of another render size, the least recently used one for a new output size, or (FSR 4) every idle one after a refused creation: a stall of the present's flip, the completion thread and upload submits at every pause-screen size, reload, window size, dynamic resolution step or mode change with FSR on. A context that goes is now let go of (retire_up): it goes into a list (vk_up_defer.h) with the timeline value of the submission of its last upscale (Up.fence, set after each dispatch) and is destroyed on the same thread once the GPU is past it, at the points where vk_dlaa.c takes its own list (every evaluation, every pass while none runs, and after something is let go of). The 90-second trims, vk_ffx_trim_idle and vk_ffx_release_idle (the upscaler off, which no longer needs retire_idle's wait) let go of theirs the same way. FSR 4's create descriptors, which the API asks to stay live until the context is destroyed, move from the slot into a calloc'd Made that goes with the context, so the slot can take a new context while the old one waits. A refused FSR 4 creation now waits on the timeline from the host for the contexts let go of, no queue touched (vk_upscaler_gpu_wait), and tries again when any went; with NX2NAVI_UPSCALER_IDLE_WAIT=1 that wait and every let go wait for the device as before. docs/architecture.md says where the upscalers' releases go. C-5 is narrowed: on the default path no upscaler waits for the device any more, so these waits no longer touch the frame generation swapchain's own queues; vk_fg.cpp, vk_fg4.cpp, gfx_present.c, vk_hdr.c, vk_fsr.c and vk_color.c keep theirs. Not reproduced before the change (no FSR session log here). Every runtime file compiles, vk_dlaa.c, vk_ffx.cpp and vk_ffx4.cpp with -Wall -Wextra and no warning; vk_ffx4.cpp's non-Windows stubs compile against vk_ffx.h; up_defer_check passes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>