Root views per list state: VICTORY_ROOT_SAME binds a root SRV or CBV the list bound before at the same epoch and buffer count without looking it up and asking its refresh again #1722

Manually merged
github merged 4 commits from github-bot/gh-1722 into main 2026-11-29 08:21:24 +00:00 AGit
Owner

@⁠101Leafy on GitHub · 2026-11-28 23:43 UTC · original
101Leafy:nv/root-same → main · +78 −21 · 13 files · 4 commits · merged 2026-11-29 08:16 UTC

Every root SRV or CBV a draw binds goes through root_view: it finds the buffer's host copy, works out the length, and asks for that range to be brought up to date. Most draws bind the same root views the draw before them bound, so the list does that same lookup and the same refresh request over and over.

With VICTORY_ROOT_SAME=1 the list state remembers each root view it bound at an aligned address, keyed by address and kind, together with the list epoch and the count of buffer table changes. If the same view comes again while both are unchanged, it gets the same GPU address back without a lookup, because the refresh it already asked for still covers it. Constant buffers that go to scratch or a placed constant are never remembered. The memory is cleared on every reset. Two diagnostics counters show the hits and the lookups.

It is off by default. With the switch unset, every root view is looked up as before.

**@⁠101Leafy** on GitHub · 2026-11-28 23:43 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1722) `101Leafy:nv/root-same` → `main` · +78 −21 · 13 files · 4 commits · merged 2026-11-29 08:16 UTC Every root SRV or CBV a draw binds goes through root_view: it finds the buffer's host copy, works out the length, and asks for that range to be brought up to date. Most draws bind the same root views the draw before them bound, so the list does that same lookup and the same refresh request over and over. With VICTORY_ROOT_SAME=1 the list state remembers each root view it bound at an aligned address, keyed by address and kind, together with the list epoch and the count of buffer table changes. If the same view comes again while both are unchanged, it gets the same GPU address back without a lookup, because the refresh it already asked for still covers it. Constant buffers that go to scratch or a placed constant are never remembered. The memory is cleared on every reset. Two diagnostics counters show the hits and the lookups. It is off by default. With the switch unset, every root view is looked up as before.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 23:47:08 +00:00
github-bot force-pushed github-bot/gh-1722 from 265e1461d2 to 2fd6a418db 2026-11-29 01:47:17 +00:00 Compare
Author
Owner

@⁠eleboucher on GitHub · 2026-11-29 04:18 UTC · original

PC result: RTX 4070 Ti SUPER 16 GB, Ryzen 7 9800X3D, 16 GB RAM, Windows 11, native 1440p, VICTORY_BVH_BUILDER=1 VICTORY_ACTIVATE_RAYS=1, diagnostics build of main 568c5e5d plus this PR and a few others, 10-minute run each, medians after 200 s.

fps preparing
switch off 24.8 29.3 ms
VICTORY_ROOT_SAME=1 24.8 30.4 ms

With the switch on, the counters stay at 0 for the whole run: root views, per frame: 0 bound as the list bound them before, 0 looked up. So State::root_view is never reached in this title. Its root views seem to go through root_srv_table (the tabled branch in draw.rs, just before the self.root_view call), so the cache has nothing to do here.

**@⁠eleboucher** on GitHub · 2026-11-29 04:18 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1722#issuecomment-7250578750) PC result: RTX 4070 Ti SUPER 16 GB, Ryzen 7 9800X3D, 16 GB RAM, Windows 11, native 1440p, `VICTORY_BVH_BUILDER=1 VICTORY_ACTIVATE_RAYS=1`, diagnostics build of main 568c5e5d plus this PR and a few others, 10-minute run each, medians after 200 s. | | fps | preparing | |---|---|---| | switch off | 24.8 | 29.3 ms | | `VICTORY_ROOT_SAME=1` | 24.8 | 30.4 ms | With the switch on, the counters stay at 0 for the whole run: `root views, per frame: 0 bound as the list bound them before, 0 looked up`. So `State::root_view` is never reached in this title. Its root views seem to go through `root_srv_table` (the `tabled` branch in `draw.rs`, just before the `self.root_view` call), so the cache has nothing to do here.
github manually merged commit 87439d52c2 into main 2026-11-29 08:21:24 +00:00
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/trustno1-coder--VIctory-NVIDIA!1722
No description provided.