mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-19 15:09:58 -04:00
Test an event wait against the value the event had when the submission took its copies, so a frame is no longer drawn from data the game had not finished writing.
Each frame the game sets one of two events to 0 from the CPU, submits its worker queues and the main queue, whose first command waits for that event to be 1, and signals 1 with nvnEventSignal once it has written what the frame's commands read. The recording of a submission takes the VRAM mirror sync and the uniform snapshot at its start and tested the wait a moment later, so a signal that arrived in between passed the wait and the frame was drawn from copies taken before the signal: single frames with the whole scene's shadowing missing (6 to 7 of 255 brighter, the sky and the interface unchanged) or a black scene, more of them the busier the CPU. Every nvnEventSignal is now numbered and keeps the value it replaced, the recording notes the number before it takes its copies, and a signal with a later number does not count for that submission. The submission stops at the wait like any wait reached before its signal and goes on at once in a submission of its own, whose copies are taken after the signal. NX2NAVI_EVENT_AT_SYNC=0 gives the earlier test. NX2NAVI_EVO_TRACE=1 logs the order in which every frame's submissions, waits and signals were replayed, which is how the frames were found. Measured with the flight recorder's thumbnails, 1,800 presented frames a run, standing in Hyrule Field by day with the lazy write-back on, DLSS Performance, frame generation 4x and HDR: the build before this change showed 34 single-frame spikes with eight busy threads beside the game, 20 with four and 8 with six, most of them in frames whose signal came during the replay; with this change two runs with eight busy threads showed 0 and 0, with 667 and 724 such frames. A session of the user's with the lazy write-back off ran 25,200 frames without a spike in its three automatic dumps while the change stopped 4,744 wait tests. Not measured: runs of this same build with the switch off (the two tried failed for other reasons, a device loss during the boot beside another game and a load with cold caches), any run with the lazy write-back off under load, the frame rate and GPU time against the switch off, and the differential tests, which this change does not touch. The flicker with the lazy write-back off that was reported has not been reproduced in a capture; its mechanism is the same signal and occurs there too. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
@@ -83,6 +83,12 @@ keeps per-core data without locks and relies on that, so the host models it (`ru
|
||||
- Uniform snapshot. The game rewrites per-object uniform blocks soon after it submits the frame that reads them; at
|
||||
the start of a submission's replay every uniform range it binds from CPU-written pools is copied, and the draws bind
|
||||
the copy (`vk_usnap.c`).
|
||||
- Event order. Ocarina's queues hand work to each other with events, and its main queue waits each frame for a
|
||||
signal the game gives from the CPU once it has written the frame's data. The replay stops a submission at a wait
|
||||
whose signal has not been replayed and lets it go on after the signal (`vk_exec.c`, "event order across the game's
|
||||
queues"); a CPU signal counts for a submission only when it came before the copies above were taken, and a
|
||||
submission it comes too late for goes on at once in one of its own (`vk_exec_xfer.c`, "events the CPU signals").
|
||||
`NX2NAVI_EVO_TRACE=1` logs the order every frame was replayed in.
|
||||
- Driver data. The NVN driver keeps a per-stage constant bank (c0). The back end fills it as the driver does: storage
|
||||
and uniform tables, push constants and, for NVN 2 compute, the dispatch's group counts in bytes 0-0xb.
|
||||
- Storage buffers the shaders reach through pointer tables in memory are bound at the address the table holds
|
||||
|
||||
Reference in New Issue
Block a user