mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-17 22:19:57 -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:
@@ -699,10 +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 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).
|
||||
// The wait (exec_wait, vk_sync.c vk_sync_exec_wait) ends when the GPU has run the submission's passes and the
|
||||
// results the game reads once it goes on are in its memory, the last frame's occlusion counts among them; the
|
||||
// write-backs and the completion thread's other side effects are not waited for. NX2NAVI_WB_SPLIT=0 makes it
|
||||
// the fence's wait, which covers those too (vk_sync.c "the executed timeline" has what each leaves out and costs).
|
||||
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