GPU: clear cached bindings after an inline indirect clamp #251
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Belobug--VIctory-Belobug-AMD!251
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-251"
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?
@loyodea on GitHub · 2026-11-26 12:40 UTC · original
loyodea:victory-serial-indirect→main· +76 −5 · 3 files · 2 commits · openRelated to #106. The inline indirect clamp binds its own pipeline and compute root signature. Invalidate the cached host bindings immediately after the clamp records, so returning early from rejected indexed-rectangle expansion cannot leave stale state for the next draw.
Tested
4f62c2afailed the same write-watch assertion.Indexed rectangles use the inline path in both modes. The reported mode-0-only retail crash remains unverified. Codex helped implement and test this patch.
@gut0to on GitHub · 2026-11-26 16:25 UTC · original · reviewed
AI-assisted review. I inspected the inline-clamp invalidation path and its focused test statically; I did not run tests or a GPU/game build. This review suggests checking the following draw state.
@ -2188,0 +2220,4 @@assert!(!ran);assert_eq!(state.host_pipeline, 0,@gut0to on GitHub · 2026-11-26 16:25 UTC · original
AI-assisted review; I did not run tests. Could the test call
prepareagain after the rejected indexed rectangle and assert the graphics PSO cache is populated again before closing the list? The current assertion proves the cache was invalidated, but not that the next ordinary draw rebinds the pipeline that the clamp replaced.@ -2188,0 +2220,4 @@assert!(!ran);assert_eq!(state.host_pipeline, 0,@loyodea on GitHub · 2026-11-26 18:53 UTC · original
Agreed. The current test verifies that the rejected indexed rectangle clears the cached PSO. Preparing an ordinary triangle draw on the same list and checking that it restores the original graphics PSO would cover the next draw's rebind.
@adrianmjim on GitHub · 2026-11-26 21:43 UTC · original
Tested natively on Windows 11, RX 7900 XT (RDNA3, driver 32.0.32029.2010). Head
2a6cca9, base4f62c2a. Debug builds. Other heavy jobs were running on the machine.Tests:
cargo test -p victory-gpu --lib: 4 runs each of base and PR, alternating. Clean runs: 113 passed on base, 114 on the PR, 4 ignored. The other runs failed only known flaky tests, seen on both sides (frame::tests::waits_end_on_ticks_and_count_frames,watch::tests, plus onequery::testson the PR and onepipeline::libraryon base).rejected_indexed_rectangle_leaves_the_inline_pipeline_cache_invalidatedfails (cached PSO nonzero). It fails on the 7900 XT and on WARP (--features diagnostics,VICTORY_D3D12_WARP=1). With the PR it passes on both.-p victory-gpu --all-targets --no-deps): the same warnings on base and PR.On the follow-up test from the review:
host_pipeline == 0assertion should stay, because that is the one that catches this bug.Scope of the fix (from reading the code; not covered by a test):
indirect_rectangles. So it also covers non-indexed rectangle lists that are rejected after the clamp: a missing vertex view, a shadow not found, orrects::vertices/rects::recordsreturningNone. On main those also returned with the stale cache, andrects::verticesbinds its own compute pipeline too.SetDescriptorHeapsand does not touch the graphics root. So clearinghost_pipelineandhost_roots[1]is enough.With #212 and #227:
VICTORY_HOIST_CLAMPSmode.888d58a,acedbae).Not tested: no game run, no #106 repro, no release build, no debug layer.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.