GPU: clear descriptors for null constant buffers #1521
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1522"
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 Marvisak/VIctory. Originally posted by Calvix2k on 2026-11-24T18:44:52Z.
Summary
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
Imported from Marvisak/VIctory. Originally posted by Calvix2k on 2026-11-25T00:52:17Z.
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);
Imported from Marvisak/VIctory. Originally posted by Calvix2k on 2026-11-25T00:52:38Z.
Re-landed as #1916 (this PR cannot be reopened after the rebase force-pushed the branch). Same commit, rebased on
4118f33.Pull request closed