mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-21 10:09:59 -04:00
Round a fractional limit down for a RivaTuner Statistics Server without the denominator field, so "display" never holds the game above the refresh.
apply() rounded the millihertz to the nearest whole frame where RTSS has no FramerateLimitDenominator, so "display" on a 59.94 Hz monitor wrote 60 and on a 143.856 Hz one 144: above the refresh, one frame more than the monitor shows every 17 s and every 7 s. Only "display" asks a fractional rate under RTSS (fixed limits and movie rates are whole, frame generation keeps RTSS out), so the new rtss_decide.h rtss_limit_value rounds every fraction down when the denominator is missing (59/1, 143/1), and keeps a whole rate over 1 and a fraction over 1000 where RTSS knows the denominator. VRR and present-wait handling stay to be measured. Not reproduced before the change. rtss_limit_check (T15: rtss_limit_value at 59940, 60000, 143856, 0 and 240000 with and without the denominator) and rtss_worker_check (round_logged_whole now 59/1 and 143/1, round_logged) pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -578,6 +578,20 @@ static void saved(void) {
|
||||
"the denominator is compared too");
|
||||
}
|
||||
|
||||
// The profile's values for a limit (T15): whole rates as they are, a fraction over 1000 where RTSS knows the
|
||||
// denominator, else rounded down, so "display" at 59.94 Hz never holds the game above the refresh.
|
||||
static void limit_value(void) {
|
||||
static const struct { int64_t mhz; int has_den; uint32_t limit, den; } cases[] = {
|
||||
{59940, 0, 59, 1}, {59940, 1, 59940, 1000}, {60000, 0, 60, 1}, {60000, 1, 60, 1},
|
||||
{143856, 0, 143, 1}, {143856, 1, 143856, 1000}, {0, 0, 0, 1}, {240000, 1, 240, 1}};
|
||||
for (unsigned i = 0; i < sizeof cases / sizeof *cases; i++) {
|
||||
uint32_t l = 7, d = 7;
|
||||
rtss_limit_value(cases[i].mhz, cases[i].has_den, &l, &d);
|
||||
CHECK(l == cases[i].limit && d == cases[i].den, "%lld mHz, denominator %d: %u/%u, not %u/%u",
|
||||
(long long)cases[i].mhz, cases[i].has_den, l, d, cases[i].limit, cases[i].den);
|
||||
}
|
||||
}
|
||||
|
||||
int main(void) {
|
||||
settings();
|
||||
reasons();
|
||||
@@ -595,6 +609,7 @@ int main(void) {
|
||||
two();
|
||||
pace_period();
|
||||
saved();
|
||||
limit_value();
|
||||
printf("rtss_limit_check: %s\n", fails ? "FAIL" : "ok");
|
||||
return fails != 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user