GPU: invalidate prefetched indirect arguments on recorded writes #663

Open
github-bot wants to merge 2 commits from github-bot/gh-663 into main AGit
Owner

@⁠Pin0d1 on GitHub · 2026-11-25 04:12 UTC · original
Pin0d1:fix/indirect-window → main · +30 −5 · 2 files · 2 commits · open

With VICTORY_INDIRECT_WINDOW=1, a recorded write could leave a prefetched indirect argument valid in the command list. Two three-vertex draws prefetched the next record. A deferred copy then set its vertex count to zero. The third draw still executed three vertices, giving nine IA vertices where the input called for six.

The list now records whether its indirect window is reusable. Recording a copy, a GPU Shadow write or a callback that may write guest memory makes the next eligible draw rebuild the window. A coalesced copy does the same. Resetting the list resets this state. Consecutive eligible draws with no intervening writes can still share a clamp pass. An unrelated write can cause an extra clamp.

I verified the vertex count on an RTX 2060 SUPER and WARP, twice per adapter, against 310c6eb and this commit. The fixture uses the deferred copy path used by CopyBufferRegion. A second test covers an adjacent copy and an unknown writer.

Run cargo test --locked -p victory-gpu --features diagnostics --lib indirect_window_ends_at_a_copy_or_unknown_writer for the recording test. Run the independent main and indirect-window cases for the GPU comparison. Source, commands and transcripts

On the clean PR head, Windows workspace tests passed (511 default, 519 with all features, 9 ignored in each configuration). The release workspace build and repository asset-policy test passed. Both Clippy configurations reported the same lints as on the base commit. Applying this change and #662 to #642 passed both Clippy commands. The workspace formatting check also failed on both. Commands and diagnostics

Prepared with the help of Codex 6.2 Astra Max.

**@⁠Pin0d1** on GitHub · 2026-11-25 04:12 UTC · [original](https://github.com/fxceless/victory-fork/pull/663) `Pin0d1:fix/indirect-window` → `main` · +30 −5 · 2 files · 2 commits · open With `VICTORY_INDIRECT_WINDOW=1`, a recorded write could leave a prefetched indirect argument valid in the command list. Two three-vertex draws prefetched the next record. A deferred copy then set its vertex count to zero. The third draw still executed three vertices, giving nine IA vertices where the input called for six. The list now records whether its indirect window is reusable. Recording a copy, a GPU Shadow write or a callback that may write guest memory makes the next eligible draw rebuild the window. A coalesced copy does the same. Resetting the list resets this state. Consecutive eligible draws with no intervening writes can still share a clamp pass. An unrelated write can cause an extra clamp. I verified the vertex count on an RTX 2060 SUPER and WARP, twice per adapter, against `310c6eb` and this commit. The fixture uses the deferred copy path used by `CopyBufferRegion`. A second test covers an adjacent copy and an unknown writer. Run `cargo test --locked -p victory-gpu --features diagnostics --lib indirect_window_ends_at_a_copy_or_unknown_writer` for the recording test. Run the independent `main` and `indirect-window` cases for the GPU comparison. [Source, commands and transcripts](https://github.com/Pin0d1/victory-fork/tree/73f564e92ca86fe07be7c53492ee0e23a2471fa9/review-evidence) On the clean PR head, Windows workspace tests passed (511 default, 519 with all features, 9 ignored in each configuration). The release workspace build and repository asset-policy test passed. Both Clippy configurations reported the same lints as on the base commit. Applying this change and #662 to #642 passed both Clippy commands. The workspace formatting check also failed on both. [Commands and diagnostics](https://github.com/Pin0d1/victory-fork/blob/27ca3c0058a50ce618613b969d1cc8f180aebd46/review-evidence/results/workspace-checks.json) Prepared with the help of Codex 6.2 Astra Max.
Prepared with the help of Codex 6.2 Astra Max.
Prepared with the help of Codex 6.2 Astra Max.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:48:30 +00:00
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/draw.rs
  • crates/victory-gpu/src/host.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/663/head:github-bot/gh-663'
git switch 'github-bot/gh-663'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-663'
git switch 'github-bot/gh-663'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-663'
git switch 'github-bot/gh-663'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-663'
git switch 'main'
git merge --squash 'github-bot/gh-663'
git switch 'main'
git merge --ff-only 'github-bot/gh-663'
git switch 'main'
git merge 'github-bot/gh-663'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.