Offer DLSS multi frame generation at 2x, 3x and 4x.

framegen_multiplier (2, 3 or 4, live) sets how many frames the display gets per rendered frame while NVIDIA DLSS frame generation runs, and a DLSS multiplier row under Frame generation in the Screen tab sets it. nx2navi_dlssg.dll now passes that count to Streamline and reports the GPU's limit (numFramesToGenerateMax) through a new optional export, nx2sl_frames_max; with an older DLL the game keeps to 2x. A value above the limit is clamped to it with a log line, and the menu lists only what the GPU and driver allow, with a note saying why the rest are missing. The Frame generation row now says "in use: off" and why when DLSS frame generation was set but does not run.

The pacer divides the frame limit by the multiplier in effect, as it already halved it for FSR 3.1, so the display gets the limit and VSync at the display's rate drops no generated frames; RivaTuner Statistics Server stays out while DLSS frame generation runs, since it counts generated frames. With DLSS 2x a limit of 60 now shows 60 on screen instead of 120.

nx2navi_dlssg.dll has to be rebuilt (tools/build_dlssg.py) for 3x and 4x.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
chrg6
2026-11-09 11:58:47 -05:00
parent 26eb249026
commit c745a9ef2f
13 changed files with 244 additions and 31 deletions

View File

@@ -29,3 +29,22 @@ void vk_dlssg_submitted(uint64_t frame);
void vk_dlssg_present_frame(uint64_t frame); // the present thread's next blit and present are of this frame
uint64_t vk_dlssg_shown(void); // the frames the display got, generated ones included (present thread); 0 when off
void vk_dlssg_release(void);
// The multiplier: the frames the display gets per rendered frame, 2, 3 or 4 (one to three generated), set by
// NX2NAVI_FRAMEGEN_MULTIPLIER and applied at once.
// What a setting value gives where the GPU and driver allow up to max (2 to 4): the value when it is 2, 3 or 4 ("3x"
// too) and at most max, else the nearest that is; unset or empty, 2. *why (may be NULL): the reason the value was not
// taken as it is, for the log, or NULL.
int vk_dlssg_multiplier_of(const char *value, int max, const char **why);
// The highest multiplier while DLSS-G runs: 2 to 4 from Streamline's numFramesToGenerateMax; 0 while DLSS-G does not
// run, or before Streamline reported its limit (the first frames; one frame is generated until then). *old_dll (may be
// NULL): 1 when the limit of 2 is nx2navi_dlssg.dll's, a build older than its nx2sl_frames_max, not the GPU's.
int vk_dlssg_multiplier_max(int *old_dll);
// The frames the display gets per game frame now: the multiplier while generation runs, 1 while it is off or paused
// (the menu). frame_rate.c paces the game at the frame limit over it. Any thread.
int vk_dlssg_multiplier(void);
// Why DLSS-G runs or not: DLSSG_NOT_WANTED (NX2NAVI_FRAMEGEN was not dlss at start, or no DLSS or FSR 3.1 upscaling),
// DLSSG_NO_FILES (nx2navi_dlssg.dll, Streamline or its swapchain hooks missing or failing), DLSSG_NO_GPU (Streamline
// loaded, but DLSS-G does not run on this GPU or driver).
enum { DLSSG_NOT_WANTED, DLSSG_RUNS, DLSSG_NO_FILES, DLSSG_NO_GPU };
int vk_dlssg_status(void);