Repository navigation
GPU: bind explicitly null root buffers to null SRV and UAV descriptors - #192
Merged
pragyaangaur merged 1 commit intoNov 26, 2026
Merged
Conversation
Keep the SRV and UAV in range even on hosts with capped heaps. Skip the address-zero shadow in title-memory lookup. Exercise zero reads and discarded writes using the existing GPU readback fixture.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
An optional root buffer can be explicitly set to guest GPU address zero. The translated root SRV/UAV path currently asks for a shadow of that address and can allocate a 4 MiB loose buffer at zero. The shader then receives a descriptor for writable storage. An optional input in a BVH compute workload motivated this change.
Use the active heap’s null raw SRV or UAV and supply a zero byte offset. Skip the zero address when collecting shadows for the title-memory page table. When the host caps the heap below the usual permanent null slots, reserve a pair inside that heap for these bindings. Unset root slots still follow their existing diagnostic path.
The GPU fixture dispatches against a real output, then checks a null SRV reads sixteen zeros and rebinding a null UAV discards writes from a populated source. It also checks that only the real buffer takes a dynamic root view. On unmodified main at
485b230e, the same test fails with two dynamic views instead of one.PR #158 separately distinguishes ordinary root constants from descriptor offsets. The gameplay comparison motivating this work used both changes alongside other address checks. The performance and visual effects of this patch alone have not been measured.
Verification
cargo xtask policyandgit diff --checkpassed. All test inputs are synthetic.