GPU: write a null CBV when CreateConstantBufferView gets a null desc #2447
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2449"
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 makmatvey on 2026-11-25T13:44:57Z.
What's wrong
create_cbvignored a null description and left the previousView(and mirrored host slot) in place. D3D12'sCreateConstantBufferViewwith a nullpDescis valid and writes a null CBV (BufferLocation = 0,SizeInBytes = 0). VIC-BT-016 in #1242.What the change does
When
descis null, recordView::Constant(0, 0)so the title slot is overwritten. Host mirroring already treatsConstantviews that cannot be made as null buffer views (null_for→null_buffer_view).Tests
descriptor::tests::null_cbv_clears_a_stale_view(clears a prior CBV and a prior SRV).cargo xtask policy— ok.victory-gpu(pre-existingview_format/host_resourcecfg); Windows CI is the gate.Asset policy
No game data used.
Fixes VIC-BT-016 in #1242.
Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-25T13:55:27Z.
Review: APPROVED
Verified against
origin/main(940d32f) on Windows 11 + NVIDIA GeForce RTX 5090 and WARP:CreateConstantBufferViewreceives a null desc cleanly clears stale descriptor slots.cargo test -p victory-gpu descriptor::tests: 6/6 passed on RTX 5090, 6/6 passed on WARP (includingnull_cbv_clears_a_stale_view).cargo clippy -p victory-gpu --all-targets -- -D warnings: 0 warnings.cargo xtask policy: 183 files ok.AI-assisted (Gemini 4 Neon).
Imported from Marvisak/VIctory. Originally posted by kotekompotek on 2026-11-25T14:02:19Z.
Correct: D3D12
CreateConstantBufferViewwith a null description writes a null view, it does not leave the slot alone — an untouched slot would keep the previous CBV live.View::Constant(0, 0)is the existing null form and the test verifies the overwrite (and that a following null SRV behaves the same).Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T14:11:23Z.
Review: COMMENTED
Write a null CBV when CreateConstantBufferView gets null. Static review only: victory-gpu/victory-hle are Windows-only (D3D12/windows-sys); not compiled or tested on this macOS arm64 host. rustc 1.98.1.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T15:58:21Z.
Automated triage for the maintainers.
Merge candidate.
create_cbvincrates/victory-gpu/src/descriptor.rsnow recordsView::Constant(0, 0)for a null description instead of leaving the slot's previous view in place, which matches the optional description in D3D12'sCreateConstantBufferViewand howcreate_srv/create_uavin the same file already record null descriptions. I checked the consumers: host mirroring (descriptor/host.rsmake/null_for) andbindless.rsfind no shadow at address 0 with size 0 and fall back to a null buffer view. CI: passing.Generated by Claude Code
upstream-sync referenced this pull request2026-11-26 06:03:33 +00:00