GPU: indirect argument buffers back to the common state after execution #1507
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!1507
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1507/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?
@Bladureau on GitHub · 2026-11-24 18:36 UTC · original
Bladureau:fix/indirect-args-common-state→main· +6 −3 · 1 files · 1 commits · closed without mergingWhat
indirect::donenow moves the argument buffer fromINDIRECT_ARGUMENTtoCOMMON, not toUNORDERED_ACCESS.Why
Title buffers' host copies are created in
COMMON(host.rs) and rely onimplicit promotion and decay: nothing else in the crate transitions them.
The indirect path is the exception. After
ExecuteIndirect,done()leftthe buffer explicitly in
UNORDERED_ACCESSfor the rest of the list, so itcould no longer be promoted. The same title buffer also holds vertex data, so
a later
IASetVertexBuffersin that list found it in a state that does notallow vertex reads. With the debug layer on:
Back in
COMMON, the list's later uses promote the buffer again, as they doeverywhere else.
Results
These are diagnostics builds on an RTX 4060 Laptop, with
VICTORY_D3D12_DEBUG=1and
VICTORY_D3D12_DRED=1, through the first mission's intro:IASetVertexBuffers)All of these errors are on the same buffer, so the counts follow how long
each run lasted.
What this does not fix
indirect::boundstill assumes the buffer isin
UNORDERED_ACCESSbefore itsUNORDERED_ACCESS → INDIRECT_ARGUMENTtransition. If the list has already promoted the buffer to a read state
(vertex data), that before-state is wrong. Fixing it needs per-list state
tracking for buffers, like
HostList::transitiondoes for textures. I leftthat out of this PR.
shows this change is not what triggers it: the hang comes at a different
point each run, with or without the change. See the NVIDIA test report, #1508.
Testing
cargo test -p victory-gpu: 50 passed, 1 ignoredcargo clippy -p victory-gpu --all-targets: clean🤖 Generated with Claude Code
@Bladureau on GitHub · 2026-11-24 18:48 UTC · original
Follow-up: #1527 fixes the id=527 errors that this PR leaves (
indirect::bound's before-state). It is stacked on this branch.@Bladureau on GitHub · 2026-11-24 19:58 UTC · original
Closing in favour of #334, which fixes the same debug-layer errors (ids 527 and 538) more completely: it also tracks shader writes and table views, and has a debug-layer test. On this RTX 4060 Laptop, #334 with #578 gives 0 of each in the title: #334
Pull request closed