mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-19 04:19:57 -04:00
Pace DLSS Frame Generation with Reflex from the frame's start, so it no longer halves the game's frame rate.
Reflex's markers sat at the host present with frame numbers unlike the frame's tags, slReflexSleep was never called, and the low-latency mode was set before any swapchain existed, so it never applied. GfxBackend.frame_start, called from nvnWindowAcquireTexture, now sets the simulation and submit-start markers after Reflex's sleep (skipped once nothing was presented for 200 ms); submit end is set when the frame's submissions went out; the mode is set again after each swapchain (NX2NAVI_REFLEX: 1 on, 0 off, 2 boost); frames are numbered by the game's presents; and the fps counter counts what was shown. NX2SL_VERSION is 3, so nx2navi_dlssg.dll must be rebuilt. From a tester's fixes: 42-45 fps game, 84-90 on screen (was 24). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -794,12 +794,13 @@ static int put_picture(VkCommandBuffer cb, unsigned slot, VkImage src, VkFormat
|
||||
return fsr;
|
||||
}
|
||||
|
||||
// The display's frame rate with frame generation: the swapchain's present count (generated frames included, vk_fg.cpp)
|
||||
// over half a second, sampled at each of the game's presents (gfx_output_fps).
|
||||
// The display's frame rate with frame generation: the frames the display got (generated ones included: vk_fg.cpp
|
||||
// vk_fg_presents, vk_dlssg.c vk_dlssg_shown) over half a second, sampled at each of the game's presents
|
||||
// (gfx_output_fps).
|
||||
static volatile double g_out_fps;
|
||||
static void output_rate(void) {
|
||||
static uint64_t t0, n0;
|
||||
uint64_t n = vk_fg_presents(g_sc), t = plat_now_ns();
|
||||
uint64_t n = vk_dlssg_active() ? vk_dlssg_shown() : vk_fg_presents(g_sc), t = plat_now_ns();
|
||||
if (!n) { g_out_fps = 0, t0 = 0; return; }
|
||||
if (!t0 || n < n0) { t0 = t, n0 = n; return; }
|
||||
if (t - t0 >= 500000000ull) g_out_fps = (double)(n - n0) * 1e9 / (double)(t - t0), t0 = t, n0 = n;
|
||||
|
||||
Reference in New Issue
Block a user