GPU: write a null CBV when CreateConstantBufferView gets a null desc #2449
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!2449
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/2449/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?
@makmatvey on GitHub · 2026-11-25 13:44 UTC · original
makmatvey:cursor/gpu-create-cbv-null-debc→main· +29 −4 · 1 files · 1 commits · merged 2026-11-25 21:57 UTCWhat'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.
@kotekompotek on GitHub · 2026-11-25 14:02 UTC · original
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).@Marvisak on GitHub · 2026-11-25 15:58 UTC · original
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