GPU: a list that binds no view heap sets a root signature indexing the view heap directly with none bound (the other half of #1778) #2894

Open
opened 2026-11-26 05:16:54 +00:00 by github-bot · 1 comment
Owner

@⁠BastienRodz on GitHub · 2026-11-25 23:18 UTC · original

Every root signature the host makes sets both CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED and SAMPLER_HEAP_DIRECTLY_INDEXED (pipeline/host.rs). D3D12 then requires heaps of both kinds to be bound before the signature is set. DirectX-Specs, SM 6.6 Dynamic Resources: "SetDescriptorHeaps must be called, passing the corresponding heaps, before a call to SetGraphicsRootSignature or SetComputeRootSignature that uses either CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED or SAMPLER_HEAP_DIRECTLY_INDEXED flags."

#1778 fixed the sampler half: a list that binds no sampler heap gets ours. The view half is still open. State::wanted gives a list our view heap (MEMORY_HEAP) only when its shaders read title memory or root views (memory_heap). Otherwise it keeps title[0], which is 0 when the title binds no view heap.

Input. A list that binds no view heap, with or without a sampler heap, and draws or dispatches with shaders that read only constants from their user data.

What happens on main 842b0cb. wanted([0, 0], false) is [0, SAMPLERS_OURS], so bind_heaps binds only our sampler heap. The root signature is then set with no view heap bound. That is the same rule as the debug layer's id 1419, whose sampler half removed the device on NVIDIA in #1754.

Expected. Our view heap is bound for a list that binds none. root_view and the write-mark table already use that heap when the title binds no view heap.

Found by reading the code and checked with a unit test; I have no in-game observation of this case. No game data. Analysis assisted by Claude Code.

**@⁠BastienRodz** on GitHub · 2026-11-25 23:18 UTC · [original](https://github.com/Marvisak/VIctory/issues/2894) Every root signature the host makes sets both `CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED` and `SAMPLER_HEAP_DIRECTLY_INDEXED` (`pipeline/host.rs`). D3D12 then requires heaps of both kinds to be bound before the signature is set. DirectX-Specs, SM 6.6 Dynamic Resources: "SetDescriptorHeaps must be called, passing the corresponding heaps, before a call to SetGraphicsRootSignature or SetComputeRootSignature that uses either CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED or SAMPLER_HEAP_DIRECTLY_INDEXED flags." #1778 fixed the sampler half: a list that binds no sampler heap gets ours. The view half is still open. `State::wanted` gives a list our view heap (`MEMORY_HEAP`) only when its shaders read title memory or root views (`memory_heap`). Otherwise it keeps `title[0]`, which is 0 when the title binds no view heap. **Input.** A list that binds no view heap, with or without a sampler heap, and draws or dispatches with shaders that read only constants from their user data. **What happens on main 842b0cb.** `wanted([0, 0], false)` is `[0, SAMPLERS_OURS]`, so `bind_heaps` binds only our sampler heap. The root signature is then set with no view heap bound. That is the same rule as the debug layer's id 1419, whose sampler half removed the device on NVIDIA in #1754. **Expected.** Our view heap is bound for a list that binds none. `root_view` and the write-mark table already use that heap when the title binds no view heap. Found by reading the code and checked with a unit test; I have no in-game observation of this case. No game data. Analysis assisted by Claude Code.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:16:54 +00:00
Author
Owner

@⁠Marvisak on GitHub · 2026-11-26 00:42 UTC · original

Automated triage for the maintainers.

Confirmed on main (63bcca4). Every root signature built in crates/victory-gpu/src/pipeline/host.rs sets both ..._HEAP_DIRECTLY_INDEXED flags, but State::wanted in crates/victory-gpu/src/draw.rs substitutes a heap of ours only for the sampler kind; with no title view heap and memory_heap false, the view slot stays title[0] (0), so bind_heaps binds only our sampler heap before the root signature is set.

Open pull request #2896 addresses this.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-26 00:42 UTC · [original](https://github.com/Marvisak/VIctory/issues/2894#issuecomment-7179038348) <!-- victory-issue-triage v1 verdict=confirmed seen=2026-11-25T23:18:37Z at=2026-11-26T00:52:30Z --> Automated triage for the maintainers. Confirmed on `main` (63bcca4). Every root signature built in `crates/victory-gpu/src/pipeline/host.rs` sets both `..._HEAP_DIRECTLY_INDEXED` flags, but `State::wanted` in `crates/victory-gpu/src/draw.rs` substitutes a heap of ours only for the sampler kind; with no title view heap and `memory_heap` false, the view slot stays `title[0]` (0), so `bind_heaps` binds only our sampler heap before the root signature is set. Open pull request #2896 addresses this. --- _Generated by [Claude Code](https://claude.ai/code)_
This discussion has been locked. Commenting is limited to contributors.
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/Marvisak--VIctory#2894
No description provided.