mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-18 23:59:59 -04:00
Copy what shaders write into the game's memory back only when the CPU touches it, which takes Hyrule Field from 51 to 71 fps.
Standing in Hyrule Field the GPU spent 13 ms a frame, of which 2.4 ms were the game's passes and 7 to 9 ms the copy of 66 MiB of shader-written buffers back into guest memory at the end of every submission, in case the CPU reads them. The write-back probe found no CPU access to them in 40 s. Now a range goes back once and its pages are made inaccessible; while they stay so, later writes stay in the mirror. The first CPU access faults, the bytes are fetched with a GPU copy of their own after everything submitted so far, the pages are given back, and the range is written back every submission again for a while (1 s, doubling to 32 s while it keeps being touched). Thaws before kernel reads and writes and before mapping changes release armed ranges the same way, and so does a mirror that goes away. Dev build, same spot, 80 s each: 51.5 to 71.0 fps median, 1% low 43.5 to 56.3, GPU time 13.1 to 7.5 ms a frame, fence waits 9.8 to 4.4 ms. In that run the game faulted on armed pages 226 times and 124 fetches took 51 ms in all; a walk into a fight made 283 faults and 186 fetches, and a test that touches eight armed ranges every 60 frames (wb_lazy_touch) 480 faults and 364 fetches, none with a fault of its own. wb_lazy = 0 is the old behaviour. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
@@ -640,6 +640,10 @@
|
||||
# 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.
|
||||
# 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). 0: copied back at the end of
|
||||
# every GPU submission, as before.
|
||||
# wb_lazy = 1
|
||||
# 1: the game's flushes of mirrored memory are copied into the mirrors even where the write watch already sees every
|
||||
# page the game wrote; 0 (default) copies only the written pages there, which saved 47-57 MiB of copies a frame in
|
||||
# Kokiri Forest.
|
||||
|
||||
Reference in New Issue
Block a user