Store indirect signature argument types and replay VERTEX_BUFFER_VIEW/INDEX_BUFFER_VIEW state #1620

Closed
BubsMcgee wants to merge 1 commit from upstream-pr/1620 into main
BubsMcgee commented 2026-11-25 06:11:27 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by BubsMcgee on 2026-11-25T06:11:27Z.


Claimed in the coordination issue as: INDIRECT-STATE-ARGS

Depends on:

Fixes:

What and why

CommandSignature stored only indirect kind and byte stride, dropping every argument descriptor (VERTEX_BUFFER_VIEW, INDEX_BUFFER_VIEW, root constants, descriptor views). ExecuteIndirect recorded minimal state and the Vulkan replay applied no argument bindings, so a signature like [VERTEX_BUFFER_VIEW, DRAW] drew with whatever vertex buffer was already bound. This stores argument types from CreateCommandSignature through ExecuteIndirect into the replay, which reads VERTEX_BUFFER_VIEW and INDEX_BUFFER_VIEW values from the argument buffer and binds the matching VkBuffer before the indirect draw.

Tested

Build check only — no GPU available for vkCmdDrawIndirect validation; host-parity validation cases in d3d12_execute_indirect_validation_test.cpp can be added for signatures with vertex/index buffer arguments.

GPUs tested: n/a

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly
  • One topic; follow-up work goes in a new pull request
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here
  • A new translator rule is in the contract table of docs/design.md — n/a (D3D12 layer, not shader translator)
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5486179898 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1620). Originally posted by [BubsMcgee](https://github.com/BubsMcgee) on 2026-11-25T06:11:27Z. --- Claimed in the coordination issue as: INDIRECT-STATE-ARGS Depends on: Fixes: ### What and why CommandSignature stored only indirect kind and byte stride, dropping every argument descriptor (VERTEX_BUFFER_VIEW, INDEX_BUFFER_VIEW, root constants, descriptor views). ExecuteIndirect recorded minimal state and the Vulkan replay applied no argument bindings, so a signature like [VERTEX_BUFFER_VIEW, DRAW] drew with whatever vertex buffer was already bound. This stores argument types from CreateCommandSignature through ExecuteIndirect into the replay, which reads VERTEX_BUFFER_VIEW and INDEX_BUFFER_VIEW values from the argument buffer and binds the matching VkBuffer before the indirect draw. ### Tested Build check only — no GPU available for vkCmdDrawIndirect validation; host-parity validation cases in d3d12_execute_indirect_validation_test.cpp can be added for signatures with vertex/index buffer arguments. GPUs tested: n/a AI-assisted: yes ### Checklist - [x] Based on current main and merges cleanly - [x] One topic; follow-up work goes in a new pull request - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here - [ ] A new translator rule is in the contract table of docs/design.md — n/a (D3D12 layer, not shader translator)
adrianmjim commented 2026-11-25 09:04:45 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by adrianmjim on 2026-11-25T09:04:45Z.


Heads-up before anyone tests this: the diff at 13774f4df doesn't contain what the title and description say.

  • None of the 5 changed files has anything about command signatures or indirect arguments. There is no VERTEX_BUFFER_VIEW, INDEX_BUFFER_VIEW, INDIRECT_ARGUMENT or CommandSignature in it.
  • What is there is stream-output code from #1630: SOSetTargets, StreamOutput PSO acceptance, the VK_EXT_transform_feedback paths and SO_STATISTICS queries. Its +/- lines are a subset of #1630's. The 5 files are the same as #1630's, but it lacks #1630's README, docs and test hunks, and its runtime/src/vulkan_backend.h hunks that load the transform-feedback entry points.

It looks like part of the stream-output work was pushed to indirect-state-args by mistake. The review of that code is on #1630.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7157845628 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1620#issuecomment-7157845628). Originally posted by [adrianmjim](https://github.com/adrianmjim) on 2026-11-25T09:04:45Z. --- Heads-up before anyone tests this: the diff at `13774f4df` doesn't contain what the title and description say. - None of the 5 changed files has anything about command signatures or indirect arguments. There is no `VERTEX_BUFFER_VIEW`, `INDEX_BUFFER_VIEW`, `INDIRECT_ARGUMENT` or `CommandSignature` in it. - What is there is stream-output code from #1630: `SOSetTargets`, `StreamOutput` PSO acceptance, the `VK_EXT_transform_feedback` paths and `SO_STATISTICS` queries. Its +/- lines are a subset of #1630's. The 5 files are the same as #1630's, but it lacks #1630's README, docs and test hunks, and its `runtime/src/vulkan_backend.h` hunks that load the transform-feedback entry points. It looks like part of the stream-output work was pushed to `indirect-state-args` by mistake. The review of that code is on #1630.
BubsMcgee commented 2026-11-25 10:32:55 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by BubsMcgee on 2026-11-25T10:32:55Z.


Thanks @adrianmjim — confirmed and fixed. The branch had accidentally picked up stream-output code, and the actual indirect-state-args work was sitting in a local stash. I force-updated indirect-state-args to the real change (fe916f5ed): CommandSignature now stores the argument types + root signature, ExecuteIndirect carries them into the command struct, and vulkan_replay.h binds VERTEX_BUFFER_VIEW/INDEX_BUFFER_VIEW from the argument buffer before the indirect draw. The diff now matches the title/description (5 files, +101/−8) and gta6rt_d3d12_com builds cleanly on current main. No GPU validation — build check only.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7159846916 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1620#issuecomment-7159846916). Originally posted by [BubsMcgee](https://github.com/BubsMcgee) on 2026-11-25T10:32:55Z. --- Thanks @adrianmjim — confirmed and fixed. The branch had accidentally picked up stream-output code, and the actual indirect-state-args work was sitting in a local stash. I force-updated `indirect-state-args` to the real change (`fe916f5ed`): `CommandSignature` now stores the argument types + root signature, `ExecuteIndirect` carries them into the command struct, and `vulkan_replay.h` binds `VERTEX_BUFFER_VIEW`/`INDEX_BUFFER_VIEW` from the argument buffer before the indirect draw. The diff now matches the title/description (5 files, +101/−8) and `gta6rt_d3d12_com` builds cleanly on current `main`. No GPU validation — build check only.
BubsMcgee commented 2026-11-25 12:04:42 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by BubsMcgee on 2026-11-25T12:04:42Z.


Closing as superseded. Main's ba626820e ("Integrate post-story-load memory, queue and Vulkan runtime changes") reworked the same files: CommandSignature now carries packed_size / terminal_only / graphics_writes, and ExecuteIndirect has the newer compute-replay path and defers compound draws via reset_indirect_graphics_bindings. This PR was written against the older argument_types / root_signature shape, so rebasing is a re-implementation rather than a conflict resolution, and a "keep ours" merge would regress main's indirect/compute paths.

The remaining work — replaying VERTEX_BUFFER_VIEW / INDEX_BUFFER_VIEW arguments from the argument buffer for compound indirect draws — is still unlanded and should be re-claimed against the current design. The branch is preserved at fe916f5ed for reference.

AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7161889013 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1620#issuecomment-7161889013). Originally posted by [BubsMcgee](https://github.com/BubsMcgee) on 2026-11-25T12:04:42Z. --- Closing as superseded. Main's `ba626820e` ("Integrate post-story-load memory, queue and Vulkan runtime changes") reworked the same files: `CommandSignature` now carries `packed_size` / `terminal_only` / `graphics_writes`, and `ExecuteIndirect` has the newer compute-replay path and defers compound draws via `reset_indirect_graphics_bindings`. This PR was written against the older `argument_types` / `root_signature` shape, so rebasing is a re-implementation rather than a conflict resolution, and a "keep ours" merge would regress main's indirect/compute paths. The remaining work — replaying `VERTEX_BUFFER_VIEW` / `INDEX_BUFFER_VIEW` arguments from the argument buffer for compound indirect draws — is still unlanded and should be re-claimed against the current design. The branch is preserved at `fe916f5ed` for reference. AI-assisted.

Pull request closed

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
ProjectLeonida/mandy!1620
No description provided.