draw: a texture without a write watch is not looked at again every frame #163
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/lobomfz--VIctory-xmem!163
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-163"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@victorizando-byte on GitHub · 2026-12-02 05:34 UTC · original
victorizando-byte:draw/recheck-without-watch→main· +10 −0 · 1 files · 1 commits · merged 2026-12-02 19:14 UTCTextures in title memory on the card stop being read back every frame
A texture picked by index that a look found changed is looked at again the next frame. While the look finds it unchanged, it is scheduled for the next frame again, on the assumption that the write watch answers that look without reading anything.
Title memory on the card has no write watch:
watch::writesanswers nothing there, and the watch was kept as0. So each of those looks read the texture's 48 KiB fingerprint from the card's memory, every frame, for the rest of the run. That memory comes back through the BAR at 20-45 MB/s, or by a copy of the card's at about 7 ms a read.Now a look that finds the texture unchanged goes back to the next frame only when the watch actually answered (
since != 0). Otherwise the texture continues with the usual later looks (RECHECK_FRAMES: 12, 40, 120, 400 frames), as a texture without a watch did before it changed. Textures where the watch answers behave as before.Measured
Same save and the same still dialogue scene, 30 s each (Series X profile, 1706x960 to 2560x1440):
The card is busy about 92 % of each frame in that scene either way, so the frame rate gains little there. The saving is CPU time spent preparing submissions. The waiting time was measured with temporary per-caller counters that are not part of this change.
Also tried, not included
RADV_EXPERIMENTAL=transfer_queue) for the read-back copies inpull.rs: each read took longer (9.9 ms against 6.7 ms on average).@GreemSC on GitHub · 2026-12-02 11:21 UTC · original · edited 2026-12-02 11:52 UTC
Result on an RX 7900 XT 20 GB (RDNA 3), i7-12700K, 24 GB RAM, CachyOS kernel 7.3.6, Proton-CachyOS Wine, this repo's patched Mesa 26.3.1 and vkd3d-proton
71cae09. Series X, 2560x1440 output, render scale 0.75, ray tracing on, same save and scripted drive for both runs, pipeline cache warm, swap off for the game's cgroup.On this machine the CPU reads the card's memory slowly (
rep_movsb_mb_s=51 streaming_mb_s=2fromum::calibrate_reads; 65 / 35 MB/s in a native Vulkan test outside Wine), so #93's card pull stays on in both runs.d044248d044248+ #163 + #164 + #166 + local GPU detilestats: framemedians: preparing / copy / gpu_waitThe CPU side of the frame almost disappears and the card becomes the only limit (gpu_wait goes up by what preparing loses). This matches @DecayingEagle's numbers in #173 (copy 20.7 → 0.67 ms, preparing 22.5 → 2.7 ms), which also included #163 and #164; since #93's pull is still on here, most of the copy drop seems to come from #163 rather than from #173's switch.
Edit: repeated: a second run of the candidate (with #149 also in, which does not touch the frame) gave 29.2 fps over the whole world part, median 33.9 ms, p95 57.3 ms (first run: 29.0 / 33.9 / 58.2), so the gain holds over 2 runs.
Caveats: one run for the baseline, and the candidate also had a local GPU detile patch turned on (
VICTORY_GPU_DETILE=1, not in this repo); on the previous base that patch alone did not move the median. No crash, no artefact noticed.AI assistance: Claude Code (Claude Opus 5.5) ran the builds and measurements, read the logs and wrote this report on the hardware above.