mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-18 23:59:59 -04:00
Keep a small buffer clear and the counter reports of the same record in the order of the stream.
A ClearBuffer or ReportValue is a fill the GPU makes where it stands in the stream, and guest memory has its bytes once the GPU got there. A counter report reaches guest memory as a CPU write after its submission's fence, and a render condition reads the record when it is replayed. So a report followed by a clear of the same record ended as the report (in one submission always, across two when the completion thread was behind the GPU), and a condition replayed after the clear read what memory held before the fill, or the 0 of the report the clear had overwritten. A clear of at most 256 bytes into CPU-visible memory is now also applied at its place in the replay to the records it covers that a counter report went into: the covered bytes get the value in guest memory at once, reports replayed before the clear leave those bytes alone when their write comes, a condition reads them from memory, and a report replayed after the clear writes the whole record as before. The GPU's fill is recorded as before. Other small clears stay the GPU's fill alone: the GPU reads guest memory too, at once in an imported pool and through the next upload of the written page in a mirrored one, so a write ahead of it into a draw count or an atomic counter would reach passes that still want the old value. NX2NAVI_CLEAR_SMALL_CPU=0 turns it off. Whether the game clears counter records is not known. The pass timing captures of 75 scripted runs show one buffer fill a frame and nothing else about it, and the frame dump does not list buffer fills. The periodic vk_usnap line now counts the small clears, the last one's size, value and address, how many covered a record with a report, the reports into bytes cleared before, and the report writes that left cleared bytes alone. Checked with a build of the dev exe, the launcher tests, the device address table check, and a scratch link of vk_exec_xfer.c against stubs that replays reports and clears in both orders. Not run in the game. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
@@ -96,6 +96,11 @@
|
||||
# Occlusion query results are read back from the video card in batches, 0 or 1. Default: on. 0 reads each query with a
|
||||
# call of its own, as before, which on AMD's Windows driver held every frame's "GPU done" back by about 4 ms.
|
||||
# oq_batch = 1
|
||||
# The game clears small ranges of its buffers on the video card. Where such a range holds a counter the video card
|
||||
# also reports into (a timestamp or an occlusion count), the clear and the reports reach the game's memory in the
|
||||
# order the game issued them, 0 or 1. Default: on. 0 leaves the clear to the video card alone, as before, and a
|
||||
# report issued before the clear can then be written after it.
|
||||
# clear_small_cpu = 1
|
||||
# EXPERIMENT, 0 or 1. Default: off. The game asks the video card how much of an object would show behind what is
|
||||
# already drawn (an occlusion query) and leaves hidden objects out. With 1 it asks nothing and draws them all: more
|
||||
# draws in a frame, and no queries to issue or results to wait for and read back. Whether that gains or loses frames
|
||||
|
||||
Reference in New Issue
Block a user