mirror of
https://github.com/valentderah/totk-pc-recomp.git
synced 2026-11-20 20:55:56 +00:00
Pace presents at the back edge, just before the host present
The pacer gave each frame its display time but the present thread queued vkQueuePresentKHR as soon as the game handed the frame over, so every present shifted with the frame's replay time: at 60.0 fps mean, 17-18 ms intervals alternated with 15-16 ms ones. The present thread now submits the blit at once (vk_present_blit, so vk_present_drain and queue order are unchanged) and holds the host present until the pacer's slot (vk_present_flip). Acquire keeps waiting until the image's slot plus one period, which is now the time the next frame really goes out. TOTK_TRACE=present logs one line per present: host interval, the game's present-call interval, wait and lateness. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2d714537e7
commit
ebdba400df
9 files changed
+97
-26
No files matched your search
+3
-2
@@ -50,13 +50,14 @@ static void parse_trace(void) {
|
||||
if (!e) return;
|
||||
static const struct { const char *name; unsigned bit; } names[] = {
|
||||
{"svc", RT_TRACE_SVC}, {"host", RT_TRACE_HOSTCALL}, {"ipc", RT_TRACE_IPC}, {"fs", RT_TRACE_FS},
|
||||
{"gfx", RT_TRACE_GFX}, {"perf", RT_TRACE_PERF}, {"sched", RT_TRACE_SCHED}, {"audio", RT_TRACE_AUDIO}, {"all", ~0u}};
|
||||
{"gfx", RT_TRACE_GFX}, {"perf", RT_TRACE_PERF}, {"sched", RT_TRACE_SCHED}, {"audio", RT_TRACE_AUDIO},
|
||||
{"present", RT_TRACE_PRESENT}, {"all", ~0u}};
|
||||
for (const char *p = e; *p;) {
|
||||
size_t n = strcspn(p, ",");
|
||||
int known = 0;
|
||||
for (unsigned i = 0; i < sizeof names / sizeof *names; i++)
|
||||
if (strlen(names[i].name) == n && !strncmp(p, names[i].name, n)) rt_trace |= names[i].bit, known = 1;
|
||||
if (!known && n) rt_log("TOTK_TRACE: unknown item '%.*s' (svc, host, ipc, fs, gfx, perf, sched, audio, all)", (int)n, p);
|
||||
if (!known && n) rt_log("TOTK_TRACE: unknown item '%.*s' (svc, host, ipc, fs, gfx, perf, sched, audio, present, all)", (int)n, p);
|
||||
p += n + (p[n] == ',');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user