mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-18 00:29:58 -04:00
Let the wait after a frame's first submission write the results the game reads before it returns.
That wait ends when the GPU has run the submission's own commands (wb_split = 1). The completion thread was then still at the last frame's submissions, so the occlusion counts, counter reports and event values the game reads next reached its memory after it had gone on. A player's capture in Hyrule Field shows the result: trees, ground and walls lose their direct light for single frames about every 36 frames, 57 of 1,800 frames, and with the fence's wait (wb_split = 0) the same place showed none. The fence's wait also covers the rest of what the completion thread does for those submissions, 0.23 to 0.40 ms a frame of page stamps the game does not read. So those results now have a queue of their own (vk_completion_add_result), and the waiter runs the ones due for its submission and the ones before it as soon as the GPU's signal is there; the completion thread runs them the same way, ahead of its other callbacks, one runner at a time and in the order they were queued. wb_split = 3 is the bare wait as it was, to measure against. Checked: it builds, the launcher tests and the address table check pass, and the player's hand test of this wait at that place showed no such frame. Not measured: no scripted run of it was made (the one scripted run with the bare wait in that field shows 1,170 occlusion counts a frame written late and no dark frame, so the script does not reproduce the fault), and its cost against the bare wait is not known. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
@@ -864,12 +864,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
|
||||
# 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.
|
||||
# The wait after each frame's first GPU submission. 1 (default): it ends when the video card has run the submission
|
||||
# and the results the game reads next are in its memory (the last frame's visibility counts above all); what the card
|
||||
# wrote besides goes back to the game's memory in a submission of its own, behind the wait. 0: the game waits until
|
||||
# everything before it has reached its memory, about 0.7 ms more of every frame in the open. 3: the wait ends as soon
|
||||
# as the card has run the submission, without the visibility counts: the game then reads counts that may be a frame
|
||||
# old, and lit things near the camera can lose their light for single frames. With shadow storage (Linux, Wine) 1
|
||||
# and 3 change nothing; 2 forces 1 there as well, for tests.
|
||||
# wb_split = 1
|
||||
# 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
|
||||
|
||||
Reference in New Issue
Block a user