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

Open
github-bot wants to merge 1 commit from github-bot/gh-239 into main AGit
Owner

@⁠fffluffy-dev on GitHub · 2026-11-24 22:58 UTC · original
fffluffy-dev:gpu/indirect-max-zero → main · +22 −0 · 2 files · 1 commits · open

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.

**@⁠fffluffy-dev** on GitHub · 2026-11-24 22:58 UTC · [original](https://github.com/fxceless/victory-fork/pull/239) `fffluffy-dev:gpu/indirect-max-zero` → `main` · +22 −0 · 2 files · 1 commits · open 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.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:39:08 +00:00
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/indirect.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/239/head:github-bot/gh-239'
git switch 'github-bot/gh-239'

Merge

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