mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-19 04:19:57 -04:00
Let Reflex hold the frame limit with DLSS Frame Generation, and the game's pacer keep only its ceiling while it does.
With DLSS-G, Reflex's sleep held each frame's start with no limit while the game's pacer still held the limit on the present thread and at the window image's acquire (A-16, P-16): the pacer's wait came after the picture was drawn, so the pad was read up to a period before the picture left, on top of Reflex's own wait for the GPU. vk_dlssg.c vk_dlssg_pace, on the presenting guest thread in nvnQueuePresentTexture, asks dlssg_pace.h which limit Reflex should hold and stores it; vk_dlssg_frame on the present thread hands a changed limit to Streamline before its present (reflex_apply, under the present lock, which keeps Streamline's options calls on one thread at a time), as does each new swapchain, which has neither mode nor limit. GfxBackend.frame_paced now returns the period the pacer still holds: vk_backend.c vk_be_frame_paced gives the game's ceiling (frame_step_ceiling_ns, 240) while Reflex holds the limit, 0 where a driver's low latency holds it (vk_lowlat_pace, unchanged), else the period; during a movie the back ends get 0 and the pacer keeps the movie's period and catch-up slots as before. The pacer takes the limit back before the first host present, after 200 ms without one, with a DLL older than nx2sl_reflex2 (one log line at start), for a limit Streamline refused, and for the run when the frames show Reflex does not hold it; the "frame rate:" lines name who holds it, the "dlssg: present N" line counts the frame starts Reflex held, and Reflex's sleep now counts as pacing (perf_end_any, on whichever thread acquires). No wait is added on a drawing thread: the limiter's wait moves from the acquire's sleep_until and the present thread's slot to Reflex's sleep a few lines later in the same acquire, and the present thread's options call returns at once. docs/architecture.md names Reflex as a limiter. Not reproduced before the change (no RTX 40 or 50 here); vk_dlssg.c, vk_backend.c and nvn_api_obj.c compile clean with the dev build's flags, and dlssg_pace_check, fg_reset_check and frame_step_check pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -962,6 +962,14 @@ static void vk_be_frame_start(void) {
|
||||
}
|
||||
static void vk_be_input_read(void) { vk_lowlat_frame_start(1); }
|
||||
|
||||
// The period nvnQueuePresentTexture's pacer keeps (GfxBackend.frame_paced). At most one of the two holds the limit in a
|
||||
// run: DLSS Frame Generation's Reflex, which leaves the pacer its ceiling, or a driver's low latency, which leaves it
|
||||
// nothing. Each lets go of the limit when given 0 (a movie plays).
|
||||
static uint64_t vk_be_frame_paced(uint64_t period_ns) {
|
||||
if (vk_dlssg_pace(period_ns)) return frame_step_ceiling_ns();
|
||||
return vk_lowlat_pace(period_ns) ? 0 : period_ns;
|
||||
}
|
||||
|
||||
const GfxBackend gfx_vulkan_backend = {
|
||||
.name = "vulkan",
|
||||
.pool_init = vk_be_pool_init,
|
||||
@@ -979,7 +987,7 @@ const GfxBackend gfx_vulkan_backend = {
|
||||
.present = vk_be_present,
|
||||
.frame_start = vk_be_frame_start,
|
||||
.input_read = vk_be_input_read,
|
||||
.frame_paced = vk_lowlat_pace,
|
||||
.frame_paced = vk_be_frame_paced,
|
||||
.finish = vk_be_finish,
|
||||
.read_texels = vk_be_read_texels,
|
||||
.write_texels = vk_be_write_texels,
|
||||
|
||||
Reference in New Issue
Block a user