mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-17 07:09:57 -04:00
Name the game's frame-rate ceiling as a period of its own, frame_step_ceiling_ns, for a pacer that hands the limit over.
When Reflex holds the frame limit with DLSS Frame Generation, the game's pacer is to keep only the rate the game's code survives (240 a second; the quick menu read address 0 at 640 to 700), so that a limiter that lets go, or one that counts other frames than the game's, cannot run the game past it. frame_step_ceiling_ns gives that period from LIMIT_FREE_MAX_HZ, or LIMIT_MAX_HZ for a build with the fps60 or realtime patch set; frame_step_cap_ns is left as it is. tests/frame_step_check.c checks 4166666 ns for a game stepping by the clock; frame_step_check passes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -180,6 +180,13 @@ static double shown_hz(double hz) { return hz <= 0 ? 60 : hz < LIMIT_MIN_HZ ? LI
|
||||
#define LIMIT_FREE_MAX_HZ 240
|
||||
int frame_free_running(void) { return rt_patch_set("fps60") < 0 && rt_patch_set("realtime") < 0; }
|
||||
int frame_limit_adjustable(void) { return 1; }
|
||||
|
||||
// The period the pacer keeps while something else holds the frame limit where the frame starts (Reflex with DLSS Frame
|
||||
// Generation, vk_dlssg.c vk_dlssg_pace): a limiter that lets go, or counts other frames than the game's, still leaves
|
||||
// the game no faster than the rate its code survives.
|
||||
uint64_t frame_step_ceiling_ns(void) {
|
||||
return 1000000000ull / (frame_free_running() ? LIMIT_FREE_MAX_HZ : LIMIT_MAX_HZ);
|
||||
}
|
||||
static unsigned limit_seen;
|
||||
static int limit_read;
|
||||
static int limit_hz = -1; // 0: display; -2: unlimited (free-running builds); -1 before the first read
|
||||
|
||||
Reference in New Issue
Block a user