mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-18 17:29:57 -04:00
Give back only the touched piece of a lazily written range, and say in the log why ranges are written back.
With the lazy write-back on, a village and Hyrule Field still merged 20 to 29 MiB a frame back into guest memory at the end of every submission, inside the GPU work the game's fence waits for. The new log line (mem: lazy write-back at frame N: written back and not armed since the last line) names the reason by bytes: none of it lay in frozen regions or on pages that could not be armed; it lay in regions held after a touch. The game's CPU reads a few words at the start of buffers its shaders fill (12 bytes into ranges of 6.3 and 15.2 MiB among others), about once a second. Each read gave back the whole armed range and held every 2 MiB region it reached for 1 s, doubling to 32 s, and nothing was armed in a held region. A touch now gives back the 64 KiB around its address, fetched alone, and holds only that piece; the rest of the range stays armed (wb_lazy_chunk, default 1; 0 is the old rule). More than four touches in one region within a second are taken as a reader going through the range: that range goes whole and its regions are held as before, and the region's touches go that way at once while it keeps being touched within a minute. Each of the first eight touches of a log window is logged under the perf trace with its thread, address, range and what was given back. Measured on one machine (NVIDIA, uncapped, frame generation off, scripted walks, medians over the windows of 46 s of world clock): - village: 121.8, 124.1 and 124.4 fps before; 138.0 and 135.4 with this change; GPU busy 4.8 to 4.15 ms a frame - Hyrule Field: 101.1 and 113.1 fps before; 131.5 and 131.3 after; GPU busy 6.5 to 4.7 ms - merged a frame: 20 to 29 MiB before, 1.7 to 2.0 MiB after - faults on armed pages in 1,000 frames: 14 and 16 before, 17 to 18 after in the village; 19 and 23 before, 17 to 21 after in Hyrule Field; time spent fetching the same (4 to 5 ms in 1,000 frames) A run with synthetic reads of four armed ranges per log window (wb_lazy_touch = 4, 769 faults) ended without an error. The picture of every presented frame of a village walk and a field walk (thumbnails, 10,131 and 9,531 frames) had no black frame. The village walk has single frames whose brightness jumps: 14 with the change and 28 without it in about 10,000 frames each; the two looked at, one of each, are jumps of the camera. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
@@ -741,6 +741,11 @@
|
||||
# "mem: lazy write-back" line says which is in effect and why). 0 elsewhere. With shadow storage (Linux, Wine) it
|
||||
# stays off whatever is set.
|
||||
# wb_lazy = 1
|
||||
# With wb_lazy: 1: when the game's CPU code touches such memory, only the 64 KiB around the place it touched are copied
|
||||
# back and kept up to date from then on; the rest of that buffer stays on the video card. The game reads a few words
|
||||
# at the start of buffers of several MiB about twice a second. 0: the whole buffer comes back and everything near it
|
||||
# is copied back every frame for up to 32 seconds, as before (a tenth fewer frames a second in a village).
|
||||
# wb_lazy_chunk = 1
|
||||
# Barriers between the game's draw passes and compute dispatches. 1: only where the game itself asks for one, or where
|
||||
# the work changes between drawing and compute; this takes about a tenth off the graphics card's time for a frame.
|
||||
# 0: a full barrier before every pass and every dispatch. Default: 1 on NVIDIA graphics cards, 0 on all others, where it
|
||||
|
||||
Reference in New Issue
Block a user