Skip to content

GPU: invalidate prefetched indirect arguments on recorded writes - #663

Open
Pin0d1 wants to merge 2 commits into
fxceless:mainfrom
Pin0d1:fix/indirect-window
Open

Pin0d1 wants to merge 2 commits into
fxceless:mainfrom
Pin0d1:fix/indirect-window

Conversation

@Pin0d1

@Pin0d1 Pin0d1 commented Nov 25, 2026 •

Copy link
Copy Markdown

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.

Prepared with the help of Codex 6.2 Astra Max.
Prepared with the help of Codex 6.2 Astra Max.
PiloteCode added a commit to PiloteCode/victory-fork that referenced this pull request Nov 25, 2026
…celess#24/fxceless#104), null CBVs (fxceless#304), tables at list cuts (fxceless#742), heap entries (fxceless#589), barriers (fxceless#787), depth-stencil UAV barriers (fxceless#214), windows ending at recorded writes (fxceless#663), sRGB views (fxceless#644), wide accesses across pages (fxceless#846), view-guard costs (fxceless#812/fxceless#853), the fill latch (fxceless#860), pipeline waits (fxceless#709), robustness; opt-in fxceless#868/fxceless#845
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant