Keep DLSS Frame Generation's resources while it is suspended, which stops the 100 to 150 ms frames after menus and cutscenes.

Generation is switched off for every menu, cutscene and frame without depth and motion, and on again after it. Off freed the generator's resources and on allocated them again inside the present, which holds the queue lock for its whole flip, so the submitting thread waited there: four of five slow frames profiled in a session with frame generation on had the log line "frame generation on" right before them and nothing else blocked. nx2navi_dlssg.dll now sets Streamline's retain flag, so off only suspends; whether frame generation runs is fixed for the run, and Streamline frees the resources at shutdown. The DLL has to be rebuilt (tools/build_dlssg.py).

The wait for the queue lock in vk_sync.c queue_submit is counted as a present wait, so a frame held up by a slow present no longer shows in the slow-frame line with every blocked time at zero.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
(cherry picked from commit 94a0da9f7694cfe4d65777f9efe8eff837ba2bc8)
This commit is contained in:
chrg6
2026-11-09 20:46:54 -05:00
committed by tangerineturtle1
parent bab143e1a2
commit 14969fc671
2 changed files with 11 additions and 0 deletions

View File

@@ -99,7 +99,12 @@ static void queue_submit(VkCtx *c, const VkSubmitInfo2 *si, uint64_t value) {
hold_max = v < 1 ? 1 : v > HOLD_CAP ? HOLD_CAP : v;
rt_log("vk: up to %d submissions handed to the queue together (NX2NAVI_SUBMIT_BATCH)", hold_max);
}
// The present holds this lock for its whole flip. A slow flip (frame generation allocating, a swapchain remade) makes
// the submitting thread wait here; counted as a present wait, so the slow-frame line no longer shows such a frame
// with nothing blocked.
uint64_t p0 = perf_begin();
vk_queue_lock_raw();
perf_end(PERF_FENCE, p0);
if (H.n == HOLD_CAP) hold_flush_locked(c);
int i = H.n++;
H.si[i] = *si;