gpu(native): run ExecuteIndirect of one dispatch from title memory #112

Closed
github-bot wants to merge 1 commit from github-bot/gh-112 into main AGit
Owner

@⁠Olima34 on GitHub · 2026-11-26 16:50 UTC · original
Olima34:feat/native-execute-indirect-dispatch → main · +161 −2 · 11 files · 1 commits · closed without merging

What this changes

On macOS ExecuteIndirect never ran: only the #[cfg(windows)] path in list.rs executes, and the native host counted each call and dropped it ("indirect execution dropped"). Tester report #99 shows five dropped just before the story load stalls, among them signatures of stride 12 whose single argument is a dispatch (type 2, or the console's single-pass dispatch 105).

The native host now runs the simplest form: one record of one dispatch argument, max == 1, and no count buffer. The GPU reads the group counts from title memory at the argument address, through dispatchThreadgroupsWithIndirectBuffer on the pool buffer, with the pipeline and root arguments a direct dispatch would get. Everything else is still dropped and counted as before: draws (#99's strides 16 and 20), several records, a count buffer, root constants or views before the dispatch. A shortcut: comment says when to take those.

How it was tested

  • an_indirect_dispatch_reads_its_group_counts_from_title_memory (native, on Metal): group counts written to title memory drive the dispatch, and its output is checked. only_single_dispatches_execute_indirectly_on_the_native_host pins which signatures run.
  • cargo test -p victory-gpu -p victory-metal on arm64 with the Metal Shader Converter (185 tests, 2 passes); arm64 cargo test --workspace (694)
  • cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings, also with --all-features
  • cargo xtask policy
  • Ran the game: not done, no copy of it here

Checklist

  • No game files, game code, disassembly listings or SDK files are included
  • No guesses about console behaviour (105 runs as a plain dispatch, as the Windows path already does)
  • No new diagnostics
**@⁠Olima34** on GitHub · 2026-11-26 16:50 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/112) `Olima34:feat/native-execute-indirect-dispatch` → `main` · +161 −2 · 11 files · 1 commits · closed without merging ## What this changes On macOS `ExecuteIndirect` never ran: only the `#[cfg(windows)]` path in `list.rs` executes, and the native host counted each call and dropped it ("indirect execution dropped"). Tester report #99 shows five dropped just before the story load stalls, among them signatures of stride 12 whose single argument is a dispatch (type 2, or the console's single-pass dispatch 105). The native host now runs the simplest form: one record of one dispatch argument, `max == 1`, and no count buffer. The GPU reads the group counts from title memory at the argument address, through `dispatchThreadgroupsWithIndirectBuffer` on the pool buffer, with the pipeline and root arguments a direct dispatch would get. Everything else is still dropped and counted as before: draws (#99's strides 16 and 20), several records, a count buffer, root constants or views before the dispatch. A `shortcut:` comment says when to take those. ## How it was tested - [x] `an_indirect_dispatch_reads_its_group_counts_from_title_memory` (native, on Metal): group counts written to title memory drive the dispatch, and its output is checked. `only_single_dispatches_execute_indirectly_on_the_native_host` pins which signatures run. - [x] `cargo test -p victory-gpu -p victory-metal` on arm64 with the Metal Shader Converter (185 tests, 2 passes); arm64 `cargo test --workspace` (694) - [x] `cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings`, also with `--all-features` - [x] `cargo xtask policy` - [ ] Ran the game: not done, no copy of it here ## Checklist - [x] No game files, game code, disassembly listings or SDK files are included - [x] No guesses about console behaviour (105 runs as a plain dispatch, as the Windows path already does) - [x] No new diagnostics
On macOS every ExecuteIndirect was counted and dropped (tester report
#99: five just before the load stalls). One kind now runs: one record
whose signature holds one dispatch argument (type 2, or the console's
single-pass dispatch, 105, run as a plain dispatch as on Windows) and
no count buffer. The native list records a dispatch whose group counts
the GPU reads from title memory when it runs: the backend's Dispatch
takes an optional indirect buffer and offset, which Metal encodes with
dispatchThreadgroupsWithIndirectBuffer. Several records, a count
buffer, draws and signatures with other arguments are still dropped and
counted.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 16:52:00 +00:00
github-bot closed this pull request 2026-11-26 16:58:24 +00:00
Author
Owner

@⁠Olima34 on GitHub · 2026-11-26 16:57 UTC · original

Closing: 8765326 (native/execute-indirect, now on main) covers this and more (draws as well as dispatches). Thanks!

**@⁠Olima34** on GitHub · 2026-11-26 16:57 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/112#issuecomment-7198316517) Closing: 8765326 (native/execute-indirect, now on main) covers this and more (draws as well as dispatches). Thanks!

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.