mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-17 20:09:57 -04:00
Make the frame limit count the frames the game draws, with frame generation on top.
The limit counted the frames on screen, so the game was paced at the limit over frame generation's multiplier: 60 at 4x drew 15 frames a second, and each step up of the multiplier took drawn frames away. Now a limit of 60 at 4x is 60 drawn and 240 shown. Only the display choice still counts the screen's frames, since a frame past the monitor's refresh is never seen, and with no limit set the default is 60 drawn rather than the monitor's rate. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
@@ -32,8 +32,9 @@ int ov_movie_live(void) { return 0; }
|
||||
int vk_fg_generating(void) { return 0; }
|
||||
int vk_fg_active(void) { return 0; }
|
||||
int vk_fg_wanted(void) { return 0; }
|
||||
int vk_dlssg_multiplier(void) { return 1; }
|
||||
int vk_dlssg_active(void) { return 0; }
|
||||
static int fg_mult = 1; // frames on screen per game frame
|
||||
int vk_dlssg_multiplier(void) { return fg_mult; }
|
||||
int vk_dlssg_active(void) { return fg_mult > 1; }
|
||||
void rtss_limit_want(int64_t millihz) { (void)millihz; }
|
||||
int rtss_limit_active(void) { return 0; }
|
||||
int plat_mem_read(uint64_t a, void *out, size_t n) { (void)a, (void)out, (void)n; return 0; }
|
||||
@@ -135,6 +136,21 @@ int main(int argc, char **argv) {
|
||||
float g = present(0.0011); // 900 fps, as a quick menu without the pacer would run
|
||||
CHECK(g >= 0.125f, "short frames: %.4f frames", g);
|
||||
}
|
||||
// The limit counts the frames the game draws: frame generation's multiplier leaves the pace of a numeric limit and
|
||||
// of unlimited alone, and divides only the monitor's rate (144 Hz here), which is a rate on the screen.
|
||||
static const struct { const char *l; int gen; double hz, game_hz; } caps[] = {
|
||||
{"60", 1, 60, 60}, {"60", 4, 60, 60}, {"120", 2, 120, 120}, {"240", 4, 240, 240},
|
||||
{"display", 1, 144, 144}, {"display", 4, 36, 36}, {"unlimited", 1, 240, 0}, {"unlimited", 4, 240, 0}};
|
||||
for (unsigned i = 0; i < sizeof caps / sizeof *caps; i++) {
|
||||
set_limit(caps[i].l);
|
||||
fg_mult = caps[i].gen;
|
||||
double hz = 1e9 / (double)frame_step_cap_ns(), game = frame_step_game_hz();
|
||||
CHECK(fabs(hz - caps[i].hz) < 0.01, "limit %s at %dx paces the game at %.3f fps, not %.0f", caps[i].l, caps[i].gen,
|
||||
hz, caps[i].hz);
|
||||
CHECK(fabs(game - caps[i].game_hz) < 0.01, "limit %s at %dx reports %.3f game fps, not %.0f", caps[i].l,
|
||||
caps[i].gen, game, caps[i].game_hz);
|
||||
}
|
||||
fg_mult = 1;
|
||||
printf("frame_step_check: %s\n", fails ? "FAILED" : "ok");
|
||||
return fails != 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user