GPU: run indirect mesh dispatches (DispatchMeshX) through indirect execution #24

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

@⁠artor410 on GitHub · 2026-11-23 23:18 UTC · original
artor410:indirect-mesh-dispatch → main · +74 −13 · 1 files · 1 commits · open

Summary

DispatchMeshX with an indirect address was dropped. It now goes through the indirect execution added in 8c26061, so it gets the same argument clamp, budget and INDIRECT_ARGUMENT transition as the title's ExecuteIndirect:

 dispatch_mesh_x(x, flags, indirect, payload)
-  indirect != 0: warn once, drop
+  indirect != 0:
+    State::execute_indirect(list, (MESH 10, stride 12, max 1), indirect, None)
+    not run        -> counted in INDIRECT (the frame-rate line's dropped indirect work)
   indirect == 0: dispatch_mesh(x)

Argument layout is inferred, not documented, and I can't add evidence for DispatchMeshX itself: I work without game files. Someone with the title would need to confirm it (buffer contents at that call): three 32-bit group counts (D3D12_DISPATCH_MESH_ARGUMENTS), as the title's own mesh dispatch signatures use (stride 12); x is then unused, flags and payload unknown. Noted in the doc comment.

Also on the direct DispatchMesh(x, y, z) path (split out as #2014, which can go in alone):

-  if y * z != 1: warn          // overflows in debug; y or z = 0 still ran x groups
-  dispatch_mesh(x)
+  mesh_groups(x, y, z): none if any dimension is 0, else x (y/z != 1 still warned once)

Evidence

No game files were used, and this is untested against the game. New unit tests in list.rs:

  • indirect_mesh_dispatches_not_run_are_counted: a title list's DispatchMeshX(0, 0, &[7, 1, 1], 0) with indirect execution off. Before: dropped silently, INDIRECT unchanged (fails). After: counted (passes).
  • mesh_dispatches_run_x_groups_unless_empty: (5,1,1) → 5, (5,0,1), (5,1,0), (0,1,1) → none, (5,2,3) → 5, (5,MAX,MAX) → 5 with no overflow.

cargo test -p victory-gpu: 38 passed. cargo clippy -p victory-gpu --all-targets (with and without diagnostics) adds no warnings, and cargo xtask policy passes. The changed lines are rustfmt-clean. On my machine victory-loader's load_probe fails for an unrelated reason: the checkout path is too long for link.exe when building the fixture.

Merge Danger

Door: two-way

Blast Radius: small

Indirect DispatchMeshX calls now run instead of being dropped (or are counted when they can't run); an empty-dimension DispatchMesh no longer draws.

🤖 Generated with Claude Code

**@⁠artor410** on GitHub · 2026-11-23 23:18 UTC · [original](https://github.com/Marvisak/VIctory/pull/24) `artor410:indirect-mesh-dispatch` → `main` · +74 −13 · 1 files · 1 commits · open ## Summary `DispatchMeshX` with an indirect address was dropped. It now goes through the indirect execution added in 8c26061, so it gets the same argument clamp, budget and `INDIRECT_ARGUMENT` transition as the title's `ExecuteIndirect`: ```diff dispatch_mesh_x(x, flags, indirect, payload) - indirect != 0: warn once, drop + indirect != 0: + State::execute_indirect(list, (MESH 10, stride 12, max 1), indirect, None) + not run -> counted in INDIRECT (the frame-rate line's dropped indirect work) indirect == 0: dispatch_mesh(x) ``` Argument layout is **inferred, not documented**, and I can't add evidence for `DispatchMeshX` itself: I work without game files. Someone with the title would need to confirm it (buffer contents at that call): three 32-bit group counts (`D3D12_DISPATCH_MESH_ARGUMENTS`), as the title's own mesh dispatch signatures use (stride 12); `x` is then unused, `flags` and `payload` unknown. Noted in the doc comment. Also on the direct `DispatchMesh(x, y, z)` path (split out as #2014, which can go in alone): ```diff - if y * z != 1: warn // overflows in debug; y or z = 0 still ran x groups - dispatch_mesh(x) + mesh_groups(x, y, z): none if any dimension is 0, else x (y/z != 1 still warned once) ``` ## Evidence No game files were used, and this is **untested against the game**. New unit tests in `list.rs`: - `indirect_mesh_dispatches_not_run_are_counted`: a title list's `DispatchMeshX(0, 0, &[7, 1, 1], 0)` with indirect execution off. **Before:** dropped silently, `INDIRECT` unchanged (fails). **After:** counted (passes). - `mesh_dispatches_run_x_groups_unless_empty`: `(5,1,1) → 5`, `(5,0,1)`, `(5,1,0)`, `(0,1,1) → none`, `(5,2,3) → 5`, `(5,MAX,MAX) → 5` with no overflow. `cargo test -p victory-gpu`: 38 passed. `cargo clippy -p victory-gpu --all-targets` (with and without `diagnostics`) adds no warnings, and `cargo xtask policy` passes. The changed lines are rustfmt-clean. On my machine `victory-loader`'s `load_probe` fails for an unrelated reason: the checkout path is too long for `link.exe` when building the fixture. ## Merge Danger **Door:** two-way **Blast Radius:** small Indirect `DispatchMeshX` calls now run instead of being dropped (or are counted when they can't run); an empty-dimension `DispatchMesh` no longer draws. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
DispatchMeshX with an indirect address used to be dropped. It now runs as
indirect execution of one mesh dispatch (stride 12), through the same
State::execute_indirect, argument clamp and VICTORY_INDIRECT switch as the
title's ExecuteIndirect; when it does not run it is counted with the other
indirect work dropped. The argument layout is inferred: those of a PC
indirect mesh dispatch, three 32-bit group counts.

A direct mesh dispatch with an empty y or z dimension now runs nothing
instead of its x groups, and y * z no longer overflows.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:46:56 +00:00
Author
Owner

@⁠jeremygold02 on GitHub · 2026-11-24 04:14 UTC · original

Thanks @⁠artor410 for this change. I tested the open PR at head 4b76fffb956fdc3c813f3573a26e093ae7969fb4 with:

cargo test -p victory-gpu --lib -- --test-threads=1

Result: 38 passed, 0 failed. This includes indirect_mesh_dispatches_not_run_are_counted, which checks that an indirect mesh dispatch is counted when indirect execution is disabled, and mesh_dispatches_run_x_groups_unless_empty, which covers zero dimensions, non-unit y/z dimensions, and u32::MAX values without overflow.

These are library unit tests; no title or game runtime was launched. The added regression cases are in list.rs.

**@⁠jeremygold02** on GitHub · 2026-11-24 04:14 UTC · [original](https://github.com/Marvisak/VIctory/pull/24#issuecomment-7121839685) Thanks @⁠artor410 for this change. I tested the open PR at head `4b76fffb956fdc3c813f3573a26e093ae7969fb4` with: ``` cargo test -p victory-gpu --lib -- --test-threads=1 ``` Result: 38 passed, 0 failed. This includes `indirect_mesh_dispatches_not_run_are_counted`, which checks that an indirect mesh dispatch is counted when indirect execution is disabled, and `mesh_dispatches_run_x_groups_unless_empty`, which covers zero dimensions, non-unit y/z dimensions, and `u32::MAX` values without overflow. These are library unit tests; no title or game runtime was launched. The added regression cases are in [list.rs](https://github.com/Marvisak/VIctory/blob/4b76fffb956fdc3c813f3573a26e093ae7969fb4/crates/victory-gpu/src/list.rs).
Author
Owner

@⁠Raxstreams on GitHub · 2026-11-24 05:08 UTC · original

Ported the indirect DispatchMeshX path onto a Windows integration branch where normal ExecuteIndirect is already enabled. Both mesh_dispatches_run_x_groups_unless_empty and indirect_mesh_dispatches_not_run_are_counted passed on the RTX 3080 Ti host. Our sampled scene already uses ordinary indirect mesh draws. I have not observed a DispatchMeshX call with an indirect address in this scene.

**@⁠Raxstreams** on GitHub · 2026-11-24 05:08 UTC · [original](https://github.com/Marvisak/VIctory/pull/24#issuecomment-7122664492) Ported the indirect DispatchMeshX path onto a Windows integration branch where normal ExecuteIndirect is already enabled. Both mesh_dispatches_run_x_groups_unless_empty and indirect_mesh_dispatches_not_run_are_counted passed on the RTX 3080 Ti host. Our sampled scene already uses ordinary indirect mesh draws. I have not observed a DispatchMeshX call with an indirect address in this scene.
Author
Owner

@⁠artor410 on GitHub · 2026-11-24 07:06 UTC · original

Rebased onto main (d5f41f5): indirect execution is now always on there, so the indirect DispatchMeshX path runs without the removed VICTORY_INDIRECT switch; cargo test -p victory-gpu --lib: 45 passed. Thanks @⁠jeremygold02 and @⁠Raxstreams for testing.

**@⁠artor410** on GitHub · 2026-11-24 07:06 UTC · [original](https://github.com/Marvisak/VIctory/pull/24#issuecomment-7124623449) Rebased onto main (d5f41f5): indirect execution is now always on there, so the indirect DispatchMeshX path runs without the removed VICTORY_INDIRECT switch; `cargo test -p victory-gpu --lib`: 45 passed. Thanks @⁠jeremygold02 and @⁠Raxstreams for testing.
Author
Owner

@⁠dcastell1 on GitHub · 2026-11-24 11:34 UTC · original

Verified as part of the world-stack several testers are using, on NVIDIA GeForce RTX 5090, driver 621.24, Windows 11 10.0.26300, Rust 1.98.1, MSVC 14.44.35207, debug build:

main@ffe310e (342 passed, 0 failed, 6 ignored)
+ this PR
+ #24 (indirect mesh dispatches)
+ MIN_DYNAMIC = 1 << 18 (issue #747)
cargo test --workspace  ->  346 passed; 0 failed; 6 ignored   (exit 0)

So on Blackwell the stack builds and the workspace is green with it applied; #413 is the one that does not apply to current main (it is marked conflicting). What I cannot answer from here is the G-buffer effect — this box has no retail package, so the frame counts have to come from a machine that runs the title.

AI-assisted (opencode): applied the stack to a built tree, ran the suite, reverted it.

**@⁠dcastell1** on GitHub · 2026-11-24 11:34 UTC · [original](https://github.com/Marvisak/VIctory/pull/24#issuecomment-7130277299) Verified as part of the world-stack several testers are using, on **NVIDIA GeForce RTX 5090, driver 621.24, Windows 11 10.0.26300, Rust 1.98.1, MSVC 14.44.35207, debug build**: ``` main@ffe310e (342 passed, 0 failed, 6 ignored) + this PR + #24 (indirect mesh dispatches) + MIN_DYNAMIC = 1 << 18 (issue #747) cargo test --workspace -> 346 passed; 0 failed; 6 ignored (exit 0) ``` So on Blackwell the stack builds and the workspace is green with it applied; #413 is the one that does not apply to current main (it is marked conflicting). What I cannot answer from here is the G-buffer effect — this box has no retail package, so the frame counts have to come from a machine that runs the title. AI-assisted (opencode): applied the stack to a built tree, ran the suite, reverted it.
Author
Owner

@⁠EduBertozzi on GitHub · 2026-11-24 12:50 UTC · original

Windows 10 + Pascal data point (tests only, no game run).

Setup: Windows 10 Education 22H2 (19045), GTX 1060 6 GB (582.66), Rust 1.98.1, debug. I tested d5f41f5 merged (cleanly) onto my mesh fallback branch from #3, which is today's main plus a compute form of mesh programs. That branch runs indirect mesh dispatches through State::execute_indirect too, so it is the case where both meet.

  • cargo test -p victory-gpu: 59 passed, 0 failed, including mesh_dispatches_run_x_groups_unless_empty and indirect_mesh_dispatches_not_run_are_counted.
  • cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.

Because this sends DispatchMeshX to execute_indirect as kind 10 (stride 12, one record), a host without mesh shaders that takes the fallback also gets these dispatches, with no change on either side.

AI-assisted (Claude Code); runs on my machine.

**@⁠EduBertozzi** on GitHub · 2026-11-24 12:50 UTC · [original](https://github.com/Marvisak/VIctory/pull/24#issuecomment-7131985787) Windows 10 + Pascal data point (tests only, no game run). **Setup:** Windows 10 Education 22H2 (19045), GTX 1060 6 GB (582.66), Rust 1.98.1, debug. I tested `d5f41f5` merged (cleanly) onto my mesh fallback branch from #3, which is today's `main` plus a compute form of mesh programs. That branch runs indirect mesh dispatches through `State::execute_indirect` too, so it is the case where both meet. - `cargo test -p victory-gpu`: **59 passed, 0 failed**, including `mesh_dispatches_run_x_groups_unless_empty` and `indirect_mesh_dispatches_not_run_are_counted`. - `cargo clippy -p victory-gpu --all-targets -- -D warnings`: clean. Because this sends `DispatchMeshX` to `execute_indirect` as kind 10 (stride 12, one record), a host without mesh shaders that takes the fallback also gets these dispatches, with no change on either side. AI-assisted (Claude Code); runs on my machine.
Author
Owner

@⁠artor410 on GitHub · 2026-11-24 23:06 UTC · original

Rebased onto main (70564ae), conflict in list.rs tests resolved (kept both). Mesh tests pass; dynamic_slots_are_held_until_released and lists_share_a_table_and_copies_keep_their_views fail on main too, unrelated.

**@⁠artor410** on GitHub · 2026-11-24 23:06 UTC · [original](https://github.com/Marvisak/VIctory/pull/24#issuecomment-7147026200) Rebased onto main (70564ae), conflict in list.rs tests resolved (kept both). Mesh tests pass; `dynamic_slots_are_held_until_released` and `lists_share_a_table_and_copies_keep_their_views` fail on main too, unrelated.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 00:23 UTC · original · edited 2026-11-25 03:25 UTC

Automated triage for the maintainers.

Needs work. The head is unchanged since the last note. crates/victory-gpu/src/list.rs still has two changes:

  1. The mesh_groups fix to direct DispatchMesh. It is now also in #2014, which carries it alone.
  2. Indirect DispatchMeshX goes through State::execute_indirect as kind 10, stride 12, one record.

Part 2 still rests on an inferred argument layout, and no one has shown it running; the Windows tester above reports that the sampled scene never calls DispatchMeshX with an indirect address. To change the verdict, this needs evidence of the buffer layout at that call (the title's code that fills it, or buffer contents seen at that call). Once #2014 lands, please also rebase so mesh_groups is not carried twice.

CI: check failed on the old base (70564ae), in victory-shader tests this PR does not touch. A rebase will re-run it.

On your reply: thanks for the split and the cleaned-up description. Without the evidence this can stay open, but it can't be merged yet.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 00:23 UTC · [original](https://github.com/Marvisak/VIctory/pull/24#issuecomment-7148461970) · edited 2026-11-25 03:25 UTC <!-- victory-triage v1 head=857897aa580b8a4a4f699f8e328c96fd007f3e5f verdict=needs-work at=2026-11-25T03:26:00Z --> Automated triage for the maintainers. **Needs work.** The head is unchanged since the last note. `crates/victory-gpu/src/list.rs` still has two changes: 1. The `mesh_groups` fix to direct `DispatchMesh`. It is now also in #2014, which carries it alone. 2. Indirect `DispatchMeshX` goes through `State::execute_indirect` as kind 10, stride 12, one record. Part 2 still rests on an inferred argument layout, and no one has shown it running; the Windows tester above reports that the sampled scene never calls `DispatchMeshX` with an indirect address. To change the verdict, this needs evidence of the buffer layout at that call (the title's code that fills it, or buffer contents seen at that call). Once #2014 lands, please also rebase so `mesh_groups` is not carried twice. CI: `check` failed on the old base (70564ae), in `victory-shader` tests this PR does not touch. A rebase will re-run it. On your reply: thanks for the split and the cleaned-up description. Without the evidence this can stay open, but it can't be merged yet. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠artor410 on GitHub · 2026-11-25 03:07 UTC · original

Split the mesh_groups fix into #2014. I can't supply DispatchMeshX buffer evidence (no game files here), so this stays open for someone with the title to confirm the layout; stale VICTORY_INDIRECT mentions removed from the description.

**@⁠artor410** on GitHub · 2026-11-25 03:07 UTC · [original](https://github.com/Marvisak/VIctory/pull/24#issuecomment-7151612925) Split the `mesh_groups` fix into #2014. I can't supply `DispatchMeshX` buffer evidence (no game files here), so this stays open for someone with the title to confirm the layout; stale `VICTORY_INDIRECT` mentions removed from the description.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

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

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-24'
git switch 'github-bot/gh-24'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-24'
git switch 'github-bot/gh-24'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-24'
git switch 'main'
git merge --squash 'github-bot/gh-24'
git switch 'main'
git merge --ff-only 'github-bot/gh-24'
git switch 'main'
git merge 'github-bot/gh-24'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!24
No description provided.