mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-17 17:59:58 -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:
@@ -699,11 +699,10 @@ NVN_API(nvnQueueSubmitCommands) {
|
||||
// point). Copies of the data at submit made it worse, a mix of two frames' versions.
|
||||
// NX2NAVI_SUBMIT_FINISH=<mask>: bit i waits after the i-th submission of a frame (default 0x1); a plain 1 waits
|
||||
// after every submission, 0 never.
|
||||
// The wait is for the submission's passes, which is what the rewrite races with: exec_wait leaves out the
|
||||
// write-backs of what they wrote (vk_sync.c exec_tl), which nothing here needs before the game goes on where the
|
||||
// pools are imports or mirrors. With shadow storage the write-backs reach guest memory later and the game must
|
||||
// not rewrite a pool before them, so there the wait covers them (vk_sync_exec_wait). The fences the game itself
|
||||
// waits on cover them as before.
|
||||
// The wait is the fence's (exec_wait, vk_sync.c vk_sync_exec_wait): besides the submission's passes it covers the
|
||||
// completion thread's side effects for it and for the submissions before it, the last frame's occlusion counts
|
||||
// among them, which the game reads once it goes on. NX2NAVI_WB_SPLIT=1 ends it when the GPU has run the passes
|
||||
// (vk_sync.c "the executed timeline" has what that left out and what it cost).
|
||||
static long long finish_mask = -2;
|
||||
if (finish_mask == -2) {
|
||||
const char *e = cfg_get("NX2NAVI_SUBMIT_FINISH");
|
||||
|
||||
Reference in New Issue
Block a user