mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-18 06:59:57 -04:00
Let the game's pacer hold a movie while RivaTuner Statistics Server holds the limit, and keep the play limit in RTSS's profile through it.
During a movie frame_step_cap_ns wanted the movie's rate and returned 0 once RTSS held it, so pace() kept none of the
movie's slots while ocarina_step still gave one movie frame per update: each late frame put the picture behind the
sound for good, the fall-behind d3e50328 fixed for the game's pacer. Each movie start and end also rewrote RTSS's
profile (two saves and two UpdateProfiles per movie in lane A's probe). Now frame_step_cap_ns wants the play limit
through the movie and tells RTSS of the movie (rtss_limit_movie); rtss_pace_period keeps the movie's period from its
first frame, and the worker leaves the movie to the pacer (RTSS_WHY_MOVIE) with the profile as it is. Under a limit
below the movie's rate (30, 40, 45) the profile has no limit for the movie's length (rtss_decide.h rtss_target), since
RTSS at the movie's rate would space out the frames the pacer sends at once to catch up; that is still two writes per
movie there, and none at 60 or more.
Not reproduced before the change. rtss_limit_check (the movie case at 144 and 40, rtss_target, rtss_pace_period),
rtss_worker_check (movie_run, new movie_low_run) and frame_step_check (the want and period through a movie under RTSS)
pass.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -277,7 +277,8 @@ double frame_step_game_hz(void) {
|
||||
// RivaTuner Statistics Server (rtss_limit.c) gets the same limit; while it limits this process the pacer holds the
|
||||
// frames only to LIMIT_FREE_MAX_HZ, the ceiling the game's code needs, so the two never stack, and it takes the limit
|
||||
// back once no picture went out for 200 ms (rtss_decide.h rtss_pace_period): a minimised window or a frame hold leaves
|
||||
// RTSS no present to hold. NX2NAVI_RTSS=0 and frame generation (RTSS would count the generated frames) keep it
|
||||
// RTSS no present to hold. While a movie plays the pacer holds the movie's rate and keeps its slots whatever RTSS does.
|
||||
// NX2NAVI_RTSS=0 and frame generation (RTSS would count the generated frames) keep it
|
||||
// out, and so does a driver's low latency while it is in effect (vk_lowlat.c): the driver holds the limit where the
|
||||
// frame starts, and RTSS would hold the finished picture, the wait that mode is there to remove. RTSS gets the reason
|
||||
// (RTSS_OUT_*), for the log and for its check of a limit set in RTSS itself.
|
||||
@@ -311,6 +312,7 @@ uint64_t frame_step_cap_ns(void) {
|
||||
else rt_log("frame rate: the movie ended: the frame limit again");
|
||||
}
|
||||
}
|
||||
rtss_limit_movie(movie_hz);
|
||||
if (limit_hz == -2 && !movie_hz && !frame_free_running()) { // unlimited: the pacer does not hold frames
|
||||
rtss_limit_want(rtss_out); // kept out (RTSS_OUT_*), or 0: RTSS's limit is cleared
|
||||
paced_hz = 0;
|
||||
@@ -327,11 +329,15 @@ uint64_t frame_step_cap_ns(void) {
|
||||
rt_log("frame rate: the game draws up to %.0f frames a second and frame generation shows %d for each (%.0f on "
|
||||
"screen)", hz, gen, hz * gen);
|
||||
}
|
||||
// RTSS keeps the play limit through a movie and the pacer holds the movie (rtss_decide.h rtss_target): the movie's
|
||||
// rate as the want rewrote RTSS's profile at each start and end, and with the pacer aside under RTSS no movie slot
|
||||
// was kept, so each late frame put the picture behind the sound for good
|
||||
int64_t play_mhz = (int64_t)(hz * 1000 + 0.5);
|
||||
if (movie_hz) hz = movie_hz;
|
||||
paced_hz = hz;
|
||||
rtss_limit_want(rtss_out ? rtss_out : (int64_t)(hz * 1000 + 0.5));
|
||||
return rtss_pace_period(rtss_limit_active(), kern_now_ns(), gfx_window_hosted_ns(), (uint64_t)(1e9 / hz + 0.5),
|
||||
(uint64_t)(1e9 / LIMIT_FREE_MAX_HZ + 0.5));
|
||||
rtss_limit_want(rtss_out ? rtss_out : play_mhz);
|
||||
return rtss_pace_period(rtss_limit_active(), movie_hz, kern_now_ns(), gfx_window_hosted_ns(),
|
||||
(uint64_t)(1e9 / hz + 0.5), (uint64_t)(1e9 / LIMIT_FREE_MAX_HZ + 0.5));
|
||||
}
|
||||
|
||||
// The limit as it is set, for the performance overlay: the setting, the monitor's rate for "display", 60 at
|
||||
|
||||
Reference in New Issue
Block a user