GPU: clear descriptors for null constant buffers #1522
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!1522
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1522/head"
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?
@Calvix2k on GitHub · 2026-11-24 18:44 UTC · original
Calvix2k:codex/gpu-null-cbv-descriptor-016→main· +34 −3 · 2 files · 1 commits · closed without mergingSummary
Fixes
VIC-BT-016from audit issue #1242.When
CreateConstantBufferViewreceives a null description, VIctory previously left its descriptor metadata untouched. Reusing a slot could therefore preserve the old CBV. The view model now records an explicit null CBV and mirrors it as an unbound descriptor in the host heap.The regression coverage verifies that a previously valid CBV is replaced by the null view, and exercises the null CBV creation call on the host D3D12 device.
Verification
cargo test -p victory-gpu --lib --locked— 51 passed, 1 ignoredcargo clippy -p victory-gpu --all-targets --all-features --locked -- -D warnings— cleancargo xtask policy --staged— passedgit diff --check— passedThe DirectX specification states that passing a null view description for a descriptor heap CBV results in unbound behavior: https://microsoft.github.io/DirectX-Specs/d3d/ResourceBinding.html
@Calvix2k on GitHub · 2026-11-25 00:52 UTC · original
Still needed on main (
4118f33): descriptor::create_cbv only records a view when the description is non-null, so reusing a descriptor slot after a null CreateConstantBufferView keeps the previous CBV instead of the unbound one the D3D spec asks for. This PR adds View::NullConstant and mirrors it as an unbound host descriptor.Rebased on current main; the only conflict was an old impl View { is_buffer } that main has since moved into descriptor/host.rs (dropped here, the host logic is unchanged).
Verified on Windows 10, Ryzen 7 5800X / RX 7800 XT:
ull_constant_buffer_view_is_accepted_by_the_device passes on the host device (the slot is cleared, device not removed);
@Calvix2k on GitHub · 2026-11-25 00:52 UTC · original
Re-landed as #1916 (this PR cannot be reopened after the rebase force-pushed the branch). Same commit, rebased on
4118f33.Pull request closed