GPU descriptor: write null CBV when create_cbv description is null #1573
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1574"
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 geiyiliyabumo on 2026-11-24T19:22:39Z.
Summary
Fixes
create_cbvsilently ignoring a nullD3D12_CONSTANT_BUFFER_VIEW_DESCpointer instead of overwriting the destination descriptor slot with a null CBV (tracking issue #1242,VIC-BT-016).Per the D3D12 specification,
ID3D12Device::CreateConstantBufferView(NULL, DestDescriptor)creates a null CBV descriptor, replacing any prior view atDestDescriptor. Previouslycreate_cbvskippedrecord(...)whendescwas null, leaving stale CBV/SRV/UAV entries active in CPU view tracking and host descriptor heaps.Changes
crates/victory-gpu/src/descriptor.rs: AddView::NullConstant(non-buffer) and record it increate_cbvwhendescis null, overwriting any prior view athandle. Add synthetic unit testnull_cbv_overwrites_an_existing_view.crates/victory-gpu/src/descriptor/host.rs: HandleView::NullConstantinmakeandnull_forvianull_cbv(CreateConstantBufferView(None, at)), clearing any previously retained host resource in that slot. Add live D3D12/WARP regression testnull_cbv_is_mirrored_without_a_buffer.Verification
cargo test -p victory-gpu --lib descriptor: 9/9 passed on AMD Radeon RX 9060 XT (RDNA4) and WARP (--features diagnostics).cargo clippy -p victory-gpu --all-targets -- -D warnings(default &--all-features): clean.cargo xtask policy: 154 files OK.AI-assisted; synthetic tests only, no game files.
Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-24T19:30:31Z.
Review: APPROVED
Verified locally merged onto
origin/main(Windows 11 x64, NVIDIA GeForce RTX 5090 + WARP, Rust 1.98.1 MSVC):cargo test -p victory-gpu— 52 passed, 0 failed (1 ignored) on both RTX 5090 hardware andVICTORY_D3D12_WARP=1(includingnull_cbv_overwrites_an_existing_viewandnull_cbv_is_mirrored_without_a_buffer)cargo clippy -p victory-gpu --all-targets— 0 warningscargo xtask policy— okClean null CBV descriptor handling when
create_cbvreceives a null description, including proper mirroring. Looks good.AI-assisted (Gemini 4 Neon).
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T00:42:46Z.
Automated triage for the maintainers. Closing because another open pull request covers the same change.
See #1298. Same null-CBV-description fix as the smaller #1298, built on a host null CBV (CreateConstantBufferView) that no longer matches main, where constant buffers are raw views.
If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.
Pull request closed