mirror of
https://github.com/valentderah/totk-pc-recomp.git
synced 2026-11-22 05:05: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
@@ -78,6 +78,10 @@ int vk_selftest(void); // 0 on success
|
||||
// the blit). All its writes must be submitted to gfx_queue before the call (queue order does the rest). Starts the
|
||||
// window on first use. A minimised window or a lost swapchain skips the frame. Calls serialise on an internal lock.
|
||||
void vk_present_image(VkImage src, VkImageLayout layout, VkFormat fmt, int w, int h, const int crop[4]);
|
||||
// vk_present_image split in two: vk_present_blit submits the blit and leaves the present waiting, vk_present_flip
|
||||
// queues it. The next blit or a swapchain rebuild queues a waiting present first.
|
||||
void vk_present_blit(VkImage src, VkImageLayout layout, int w, int h, const int crop[4]);
|
||||
void vk_present_flip(void);
|
||||
// Every submission to ctx->gfx_queue (and xfer_queue when shared) takes this lock; vk_present_image and the swapchain
|
||||
// rebuild do. Recursive.
|
||||
void vk_queue_lock(void);
|
||||
|
||||
Reference in new issue
Block a user