mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-20 23:19:57 -04:00
End the wait after a frame's first submission when its passes are through, not its write-backs.
Every frame the render thread waited about 5 ms for the GPU after the frame's first submission, with the game CPU-bound in every area. The wait is there so that the GPU has run that submission's passes before the game rewrites what they read. But the submission also ends with the write-backs of what its shaders wrote, 60 MiB merged into guest memory in 3 to 4 ms of GPU time, and the wait covered those too. The write-backs now go into a part of their own. The part before them signals a second timeline, the executed timeline, and the first-submission wait waits on that; the write-back part signals the timeline as before, so every fence the game asks for still covers them, in the same queue order. wb_split = 0 keeps one part and the old wait. Not measured in the game yet. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
@@ -145,6 +145,9 @@ typedef struct {
|
||||
uint64_t (*submit)(const uint64_t *handles, int n); // replays; returns this submission's fence value
|
||||
// (gfx_submit_queue names the game's queue)
|
||||
int (*fence_wait)(uint64_t value, uint64_t timeout_ns); // 1 reached; caller has given its core up
|
||||
// As fence_wait, but only until the GPU has executed the submission's own commands: its write-backs to guest
|
||||
// memory and its fence's side effects may follow (vk_sync.c exec_tl). The same as fence_wait where there is no split.
|
||||
int (*exec_wait)(uint64_t value, uint64_t timeout_ns);
|
||||
uint64_t (*fence_done)(void); // highest value whose side effects are written
|
||||
// Queues the present and returns at once; the host present goes out at at_ns (kern_now_ns clock), at once when that
|
||||
// has passed or at_ns is 0.
|
||||
|
||||
Reference in New Issue
Block a user