mirror of
https://github.com/valentderah/totk-pc-recomp.git
synced 2026-11-25 06:05:56 +00:00
Log the replay queue's run totals at game exit and accept replay_async in totk.ini
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
14af7e7347
commit
1c1b3cf073
4 files changed
+16
-3
No files matched your search
+1
-1
@@ -34,7 +34,7 @@ static const char *const known[] = {
|
||||
"MOVIE_PACE", "OPERATION_MODE", "PERF_SLOW_MS", "PIPELINE_CACHE", "PIPE_PREBUILD", "PIPE_SKIP", "PIPE_SYNC", "PIPE_WAIT",
|
||||
"PREWARM_XLATE",
|
||||
"PROBE_MOVIE", "PROBE_MOVIE_SHOT", "PROFILE", "PROFILE_CHAINS", "PROFILE_DIR", "PROFILE_FRAMES", "PROFILE_RENDER", "PUSH_SKIP", "PUSH_STAGE", "RDOC",
|
||||
"RDOC_DIR", "RDOC_DLL", "REALTIME", "REEXEC", "RESOLVE_CHECK", "ROMFS", "ROMFS_INDEX", "ROMFS_MMAP", "ROMFS_MODS", "ROMFS_PATCHES",
|
||||
"RDOC_DIR", "RDOC_DLL", "REALTIME", "REEXEC", "REPLAY_ASYNC", "RESOLVE_CHECK", "ROMFS", "ROMFS_INDEX", "ROMFS_MMAP", "ROMFS_MODS", "ROMFS_PATCHES",
|
||||
"ROMFS_PROOF_DIR", "ROMFS_VERIFY", "RUMBLE", "RUMBLE_CURVE", "RUMBLE_STRENGTH", "RUMBLE_TRIGGERS",
|
||||
"SHADER_CACHE", "SHADER_MEMO", "SHARED_FONTS", "SHOTS", "SHOTS_DIR", "SHOTS_FULL",
|
||||
"SPEED_PROBE", "SPLIT_DRAWS", "SWKBD_ANSWER", "SWKBD_TEST", "TEST_PREPARE_SHADERS", "TEX_ALIAS", "TIMER_1MS",
|
||||
|
||||
@@ -42,6 +42,7 @@ enum { PERF_CNT_PIPE_ASYNC, PERF_CNT_PIPE_SKIP, PERF_CNT_TEX_UP, PERF_CNT_TEX_RE
|
||||
void perf_count(int kind);
|
||||
void perf_present(uint64_t frame);
|
||||
void perf_summary_flush(void); // prints the frame-time summary of the running period (exit); the 60 s lines come from perf_present
|
||||
void gfx_exit_log(void); // back end's lines for the exit summary (weak no-op in prof_win.c)
|
||||
void perf_gpu_wait(uint64_t t0); // a wait for a GPU fence ended (any thread; the render thread's also counts as PERF_FENCE)
|
||||
// GPU side of the 60-frame perf line, filled by the graphics back end when it set perf_gpu_stats. gpu_ns: GPU busy time
|
||||
// since the previous call (timestamp queries, overlaps counted once), have_gpu 0 when the device has no timestamps.
|
||||
|
||||
+6
-1
@@ -350,8 +350,13 @@ static void ft_report(uint64_t now, const char *tag) {
|
||||
ft.t0 = now;
|
||||
}
|
||||
|
||||
__attribute__((weak)) void gfx_exit_log(void) {}
|
||||
|
||||
void perf_summary_flush(void) { // at exit (prof_write)
|
||||
if (summary_t0) ft_report(kern_now_ns(), "exit");
|
||||
if (summary_t0) {
|
||||
ft_report(kern_now_ns(), "exit");
|
||||
gfx_exit_log();
|
||||
}
|
||||
summary_t0 = 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -284,6 +284,13 @@ static void replay_log(uint64_t frame, int total) {
|
||||
k ? buf : " no waits");
|
||||
}
|
||||
|
||||
// The run total, once: the game exits through prof_write (boot.c _exit, the window close), probes through
|
||||
// vk_backend_shutdown.
|
||||
void gfx_exit_log(void) {
|
||||
static LONG done;
|
||||
if (gfx_replay_async() && r_started && !InterlockedExchange(&done, 1)) replay_log(game_frames, 1);
|
||||
}
|
||||
|
||||
static void vk_be_present(const tex_t *t, const int crop[4], uint64_t at_ns) {
|
||||
vk_sync_start();
|
||||
if (!gfx_replay_async()) {
|
||||
@@ -400,7 +407,7 @@ const GfxBackend gfx_vulkan_backend = {
|
||||
|
||||
void vk_backend_shutdown(void) {
|
||||
replay_drain(DR_FINISH);
|
||||
if (gfx_replay_async() && r_started) replay_log(game_frames, 1);
|
||||
gfx_exit_log();
|
||||
vk_present_drain();
|
||||
vk_sync_shutdown();
|
||||
vk_mem_shutdown();
|
||||
|
||||
Reference in new issue
Block a user