mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-19 02:09:57 -04:00
Make the wait after a frame's first submission the fence's wait again.
For a day that wait ended on a second timeline, when the GPU had run the submission's own commands (wb_split = 1, then the default), on the thought that it only left out write-backs nothing needed yet. It left out the completion thread's side effects for the submissions before it as well, and the game reads some of those next: the occlusion counts, counter reports and event values, and the stamps the texture checks read. A frame's first submission is small and runs right behind the last frame's large one, so the game went on while that one's callbacks were still running. Measured in Hyrule Field with the camera turning (RTX 5090, lazy write-back on): 2,267 of 2,320 such waits returned before those side effects had run; they were through 0.45 to 0.8 ms later on average, 12.6 ms at most, and in that time 770 to 1,015 occlusion counts, 21 to 28 counter reports and 17 event values a frame reached guest memory. The submission the game waits for wrote nothing back in any of 14 runs, so its own write-backs were never the matter. A player saw a patch of grass near the camera change from frame to frame there and less of it with the fence's wait. No scripted run showed such a frame with either wait, so the link to what the player saw is not shown. The fence's wait takes 0.65 to 0.7 ms more of a frame there, about 6 % at 85 frames a second (single runs beside other work). wb_split = 1 still gives the other wait, and 2 forces it with shadow storage. NX2NAVI_TRACE=perf now counts what a wait on that timeline leaves behind and the completion thread's time by callback. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> (cherry picked from commit 4d108b706e72c001ddbe20608f06469885df584b)
This commit is contained in:
@@ -661,6 +661,13 @@ int vk_sync_fence_wait(uint64_t value, uint64_t timeout_ns); // 1 when done; 0
|
||||
// The executed timeline (vk_sync.c): a submission's own commands are through the GPU, its write-backs maybe not yet.
|
||||
int vk_sync_exec_wait(uint64_t value, uint64_t timeout_ns);
|
||||
int vk_sync_wb_split(void); // NX2NAVI_WB_SPLIT: the write-backs go into a part of their own
|
||||
// NX2NAVI_TRACE=perf (vk_sync.c "the executed timeline"): what a wait on that timeline left behind since the last call,
|
||||
// whether the completion thread's callback running now belongs to a value whose waiter went on already, and the
|
||||
// completion thread's time by callback.
|
||||
void vk_sync_exec_stats(uint64_t *waits, uint64_t *early, uint64_t *lag_ns, uint64_t *lag_max_ns);
|
||||
int vk_sync_effect_late(void);
|
||||
void vk_sync_cb_stats(char *out, size_t n);
|
||||
void vk_exec_late_stats(uint64_t *events, uint64_t *counters, uint64_t *counts); // vk_exec_xfer.c: such callbacks since the last call
|
||||
VkCommandBuffer vk_sync_split_exec(void); // vk_sync_split for the part before a submission's write-backs
|
||||
int vk_mem_mirror_wb_pending(void); // vk_memory.c: vk_mem_mirror_end has write-backs to record
|
||||
uint64_t vk_sync_fence_done(void); // highest done value
|
||||
|
||||
Reference in New Issue
Block a user