GPU: an indirect execution of at most zero records ends before its argument clamp #239

Open
fffluffy-dev wants to merge 1 commit from upstream-pr/239 into main
fffluffy-dev commented 2026-11-24 22:58:28 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by fffluffy-dev on 2026-11-24T22:58:28Z.


An ExecuteIndirect with MaxCommandCount 0 runs nothing, but State::execute_indirect still refreshed the arguments, went through indirect::bound (a UAV barrier and two state changes on the scratch buffer, even with no clamp dispatch), prepare and an empty host execution. It now returns at once, counted as run, not dropped.

A count of 0 in a count buffer is left alone: that buffer is mostly written by the title's passes on the card after the list is recorded, so the CPU cannot know it (that needs GPU-side work, e.g. upstream #242/#740).

Validation (cargo-xwin, tests under Wine): cargo test -p victory-gpu 111 passed, 1 ignored, new test only_an_execution_of_no_records_ends_early; clippy clean both ways; policy ok. How often max == 0 happens in the title's frames is not measured; if it never does, this saves nothing.

AI use: written with Claude Code (Claude Opus 5.5); reviewed and posted with my approval. No game files were used.

<!-- greyfinch-sync:fxceless/victory-fork:issue:6593104213 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/239). Originally posted by [fffluffy-dev](https://github.com/fffluffy-dev) on 2026-11-24T22:58:28Z. --- An `ExecuteIndirect` with `MaxCommandCount` 0 runs nothing, but `State::execute_indirect` still refreshed the arguments, went through `indirect::bound` (a UAV barrier and two state changes on the scratch buffer, even with no clamp dispatch), `prepare` and an empty host execution. It now returns at once, counted as run, not dropped. A count of 0 in a count buffer is left alone: that buffer is mostly written by the title's passes on the card after the list is recorded, so the CPU cannot know it (that needs GPU-side work, e.g. upstream #242/#740). Validation (cargo-xwin, tests under Wine): `cargo test -p victory-gpu` 111 passed, 1 ignored, new test `only_an_execution_of_no_records_ends_early`; clippy clean both ways; policy ok. How often `max == 0` happens in the title's frames is not measured; if it never does, this saves nothing. **AI use:** written with Claude Code (Claude Opus 5.5); reviewed and posted with my approval. No game files were used.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/239:upstream-pr/239'
git switch 'upstream-pr/239'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/239'
git switch 'upstream-pr/239'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/239'
git switch 'upstream-pr/239'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/239'
git switch 'main'
git merge --squash 'upstream-pr/239'
git switch 'main'
git merge --ff-only 'upstream-pr/239'
git switch 'main'
git merge 'upstream-pr/239'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
fxceless/victory-fork!239
No description provided.