GPU: indirect execution starts from the read states the list promoted #1526
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1527"
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 Bladureau on 2026-11-24T18:48:00Z.
This PR builds on #1507. Until #1507 is merged, its commit (
f77bd04)shows up here too. The only new commit in this PR is
2ae2e72.What
The second half of the indirect path's state handling: the id=527 errors
that #1507 left.
indirect::boundassumed its argument buffer was inUNORDERED_ACCESS. Thatbuffer is a title buffer's host copy. It is in
COMMONor in the read statesthe list's own bindings promoted it to. When a draw had already read it as
vertex data, the debug layer reported the wrong before-state:
How
promotion.rs(new): eachHostListnotes the read states its ownbindings promote title buffers to. Read states add up, as the host's do.
The module is pure bookkeeping, unit-tested without a GPU.
draw.rs):VERTEX_AND_CONSTANT_BUFFERINDEX_BUFFERVERTEX_AND_CONSTANT_BUFFERNON_PIXEL_SHADER_RESOURCE, orPIXEL_SHADER_RESOURCEfor the pixel stageINDIRECT_ARGUMENTindirect::boundholds the buffer and starts from what the listpromoted. From
COMMON, the clamp's root UAV promotes it by itself, asbefore. From read states, an explicit transition to
UNORDERED_ACCESScomes first.
GENERIC_READinstead ofINDIRECT_ARGUMENT. The execution's own bindings (made afterbound) canread the same title buffer as vertices, indices or root SRVs.
donereturns it to
COMMONand releases it.HostList::closereturns every buffer the list promoted toCOMMON.Decay only happens at the end of
ExecuteCommandLists, and a submissionholds many lists, so without this the next list of the submission could
receive a buffer still in read states. Its clamp would then write a
buffer it cannot promote to
UNORDERED_ACCESS.Limit: accesses through descriptor tables are not noted. The debug
layer does not track them either, without GPU-based validation.
Results
These are diagnostics builds on an RTX 4060 Laptop, with
VICTORY_D3D12_DEBUG=1andVICTORY_D3D12_DRED=1, through the firstmission's intro:
None of the other errors are state errors, and each was there before:
The new "a host list ends with a title buffer in an explicit state"
warning never fired.
This does not fix the world's GPU hang on this machine. It still comes
during the intro. #1508 has the measurements, which point at video memory
(8 GB).
Testing
cargo test -p victory-gpu: 53 passed, 1 ignored (3 new tests inpromotion)cargo clippy -p victory-gpu --all-targets, with and without--features diagnostics: clean🤖 Generated with Claude Code
Imported from Marvisak/VIctory. Originally posted by copilot-pull-request-reviewer[bot] on 2026-11-24T18:48:10Z.
Review: COMMENTED
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
Imported from Marvisak/VIctory. Originally posted by Bladureau on 2026-11-24T19:58:22Z.
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: https://github.com/Marvisak/VIctory/pull/334#issuecomment-7142860514
Pull request closed