mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-17 15:49: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:
@@ -255,20 +255,20 @@ keeps per-core data without locks and relies on that, so the host models it (`ru
|
||||
free again one period after its slot, and its acquire also waits for the GPU to finish the image's previous frame
|
||||
(`NX2NAVI_ACQUIRE_WAIT`); `frame_step_present` gives `ocarina_step` the slot times, snapped to the paced rate within
|
||||
3%.
|
||||
- One limiter is the goal: the driver's low latency (`vk_lowlat.c`), RivaTuner Statistics Server (`rtss_limit.c`) or
|
||||
the game's pacer holds the frame limit, and the log's "frame rate:" and "lowlat:" lines name the one in charge.
|
||||
The pacer is the fallback wherever the other limiter's hold is not proven: before the first host present, while a
|
||||
movie plays (the pacer keeps the movie's slots, which no other limiter knows), once no picture went out for 200 ms (a
|
||||
minimised window, `frame_hold`), for the rest of the run once the frames show the other limiter letting them through
|
||||
faster than the limit or once it was not seen holding them for 30 s, and after any failure. While RTSS holds the
|
||||
limit the pacer keeps only the 240-frame ceiling
|
||||
the game's code needs (`rtss_decide.h` `rtss_pace_period`). Frame generation keeps RTSS out (it would count the
|
||||
generated frames), and the game's pacer holds the drawn frames beside it. The exceptions as they stand: `pace_smooth`
|
||||
still waits on the present thread while RTSS holds the limit; DLSS Frame Generation's Reflex sleeps where the frame
|
||||
starts while the pacer holds the limit; at a play limit equal to a movie's rate (60, the default, for the game's 60
|
||||
fps movies) RTSS's profile keeps that limit and RTSS holds the movie beside the pacer; once RTSS hooks the game with
|
||||
the limit in its profile it holds the frames beside the pacer until it is seen holding them, for 30 s at most, after
|
||||
which the profile goes back for the run; and a limit set in RTSS itself
|
||||
- One limiter is the goal: the driver's low latency (`vk_lowlat.c`), Reflex with DLSS Frame Generation (`vk_dlssg.c`),
|
||||
RivaTuner Statistics Server (`rtss_limit.c`) or the game's pacer holds the frame limit, and the log's "frame rate:"
|
||||
and "lowlat:" lines name the one in charge. The pacer is the fallback wherever the other limiter's hold is not
|
||||
proven: before the first host present, while a movie plays (the pacer keeps the movie's slots, which no other
|
||||
limiter knows), once no picture went out for 200 ms (a minimised window, `frame_hold`), for the rest of the run once
|
||||
the frames show the other limiter letting them through faster than the limit (for RTSS also once it was not seen
|
||||
holding them for 30 s), and after any failure. While RTSS or Reflex holds the limit the pacer keeps only the
|
||||
240-frame ceiling the game's code needs (`rtss_decide.h` `rtss_pace_period`, `frame_rate.c` `frame_step_ceiling_ns`).
|
||||
Frame generation keeps RTSS out (it would count the generated frames); with AMD's frame generation the game's pacer
|
||||
holds the drawn frames beside it. The exceptions as they stand: `pace_smooth` still waits on the present thread while
|
||||
RTSS holds the limit; at a play limit equal to a movie's rate (60, the default, for the game's 60 fps movies) RTSS's
|
||||
profile keeps that limit and RTSS holds the movie beside the pacer; once RTSS hooks the game with the limit in its
|
||||
profile it holds the frames beside the pacer until it is seen holding them, for 30 s at most, after which the
|
||||
profile goes back for the run; and a limit set in RTSS itself
|
||||
still holds the game where the game keeps RTSS out, which the log ("two limiters") and the
|
||||
frame rate row of the menu point out, and the same where RTSS is out of it for the run because its profile cannot be
|
||||
written, its hooks library does not load or it never showed its hold, which the log points out the same way (the
|
||||
@@ -327,7 +327,14 @@ keeps per-core data without locks and relies on that, so the host models it (`ru
|
||||
limit and the pacer holds nothing (`nvn_api_obj.c` `nvnQueuePresentTexture`, `vk_lowlat_pace`); the pacer takes the
|
||||
limit back while a movie plays, while no present goes out, and for the rest of the run when the frames show that the
|
||||
driver does not hold it. DLSS Frame Generation brings its own low latency (`vk_dlssg.c`), and the direct path is off
|
||||
in such a run; NVIDIA's is also off while another frame generation presents the frames.
|
||||
in such a run; NVIDIA's is also off while another frame generation presents the frames. There Reflex's sleep holds
|
||||
the frame limit the same way, through Streamline's frame limit (`nx2_sl.cpp` `nx2sl_reflex2`), with the same
|
||||
exceptions, a DLL older than that export and a limit Streamline refuses besides (`vk_dlssg.c` `vk_dlssg_pace`,
|
||||
`dlssg_pace.h`); the pacer stands aside only once Streamline took the limit and keeps the game's ceiling of 240
|
||||
(`frame_rate.c` `frame_step_ceiling_ns`). Since the SDK does not say whether the driver's interval counts the frames
|
||||
the game draws or every frame on screen, the frames are checked: about the multiplier periods apart switches Reflex
|
||||
to the period over the multiplier once, and the same again or frames too soon give the limit to the pacer for the
|
||||
run.
|
||||
The device gets the drivers' extensions only in a run that starts with the setting on (`vk_device.c`
|
||||
`create_device`): turning it on takes a restart, and with it off the device is made as it was before the mode.
|
||||
- ASTC textures are uploaded as they are where the device samples ASTC, and decoded by a compute shader everywhere
|
||||
|
||||
Reference in New Issue
Block a user