mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-17 22:19: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:
@@ -811,11 +811,13 @@
|
||||
# are made inaccessible until their first read or write, which is logged with its instruction ("mem: write-back
|
||||
# probe"). The bytes are there all along; the probe only watches, at the cost of the faults it takes.
|
||||
# wb_probe = 0
|
||||
# 1: what the GPU wrote goes back to the game's memory in a GPU submission of its own, and the wait after each frame's
|
||||
# first submission ends when that submission's passes are through, without waiting for the copy back (3 to 4 ms of
|
||||
# every frame). 0: the copy back is part of the submission, and the wait covers it. With shadow storage (Linux, Wine)
|
||||
# the wait covers the copy back either way: the game must not go on before it.
|
||||
# wb_split = 1
|
||||
# 0: after each frame's first GPU submission the game waits until the video card has run it and everything before it
|
||||
# has reached the game's memory, the last frame's visibility results among them. 1: the wait ends as soon as the card
|
||||
# has run the submission, and what the card wrote goes back to the game's memory in a submission of its own. That is
|
||||
# about 0.7 ms less of every frame in the open (6 % at 85 frames a second), but the game then reads visibility
|
||||
# results that may be a frame old, and things near the camera can come and go from frame to frame. With shadow
|
||||
# storage (Linux, Wine) 1 changes nothing; 2 forces it there as well, for tests.
|
||||
# wb_split = 0
|
||||
# 1: what the game's shaders write into its memory is copied back from the video card once, and after that only when
|
||||
# the game's CPU code touches it (most of it never is: 66 MiB a frame in Hyrule Field), for about a third more frames
|
||||
# a second in open areas. 0: copied back at the end of every GPU submission, as in 0.7.0.
|
||||
|
||||
Reference in New Issue
Block a user