GPU: reuse indexed buffer spans and retain bound heaps on recorded lists #149
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/149"
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?
Imported from Zettrox/ztrx. Originally posted by syrrath-creator on 2026-11-25T14:54:28Z.
When a shader picks a buffer from the descriptor heap by index, the renderer refreshes the byte ranges covered by the possible views. Today it rebuilds those ranges from every known slot on every indexed pass. The map of resolved slots is process-global and indexed by the host heap's address.
This change stores the slot map on the heap and reuses the grouped ranges while the resolved resources and byte bounds match. A changed or removed resource invalidates the ranges. The existing full rescan every 16 passes and the actual buffer refresh calls still run. A recorded command list now owns each shader-visible host heap it actually bound until reset. This also keeps the current native descriptor targets and stride table alive through delayed submission.
These are three-process release measurements on a Ryzen 7 7800X3D, pinned to one logical processor and including the usual full rescans. They cover CPU range bookkeeping. The number of changed slots affects the result. Three seeds checked 6,336 complete range sets against the baseline implementation.
On a physical RTX 4090, three fresh processes ran 69 compute dispatches and checked all 552 output DWORDs. Cases include slot replacement, removal, periodic rescans, a second command list submitted after the first one was reset, and updating a volatile descriptor after recording. The CPU unit test separately covers a new backing allocation with identical byte bounds.
Reproduce the NVIDIA check with synthetic resources. Developed and tested with Codex.
Imported from Zettrox/ztrx. Originally posted by Artking175 on 2026-11-25T15:16:41Z.
Independent retest on Windows 10 22H2, RTX 2060, driver 531.41, Rust 1.98.1 MSVC, DXC 1.8.2505.32, and app-local Agility SDK 1.608.2. I used the synthetic fixture from
298dfd2on90b529fande8f64e5.The fixture's
Weak<Shadow>check was true on both revisions at the point where the title heap was released. I added a native descriptor-heap reference check after the first list was reset and before the second list was submitted.90b529f: native heap references 3 → 2 on title heap release. The assertion stopped the control before deferred submission.e8f64e5: native heap references 2 → 2. After the observer was dropped, the fixture completed all 23 dispatches, matching 184 dwords, including the volatile replacement after recording.The
victory-gpulibrary suite had 113 passed, 0 failed, and 2 ignored. The hardware fixture was run separately. All inputs were synthetic.Imported from Zettrox/ztrx. Originally posted by syrrath-creator on 2026-11-25T15:32:39Z.
Thank you for checking the deferred list on the RTX 2060 and for isolating the native descriptor heap. I added your COM reference check to the shared hardware fixture, with attribution. On the RTX 4090, upstream now stops before submitting the deferred list at 3 → 2 references. The PR keeps 2 → 2 in three fresh runs. After the observer is dropped, all 23 dispatches in each run return the expected eight dwords. Updated fixture
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.