Skip to content

d3d12: CreateCommandSignature creates a DISPATCH_MESH signature on a device with mesh shaders (ExecuteIndirect with it not replayed yet) - #7330

Open
NiiRoZz wants to merge 1 commit into
ItsNotRexed:mainfrom
NiiRoZz:d3d12/dispatch-mesh-signature
Open

NiiRoZz wants to merge 1 commit into
ItsNotRexed:mainfrom
NiiRoZz:d3d12/dispatch-mesh-signature

Conversation

@NiiRoZz

@NiiRoZz NiiRoZz commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Claimed in #7231 (comment)

Depends on: none (based on main). It overlaps #3777 on purpose: the new IndirectKind::dispatch_mesh = 3 has the name and value #3777 uses, and its creation case is the one #3777 adds. If #3777 lands first, this PR is unnecessary; if this lands first, #3777 drops the stand-in in ExecuteIndirect.

What

  • CreateCommandSignature on the Vulkan layer creates a one-argument DISPATCH_MESH signature when the device has VK_EXT_mesh_shader (it reports MeshShaderTier 1). Without the extension it is still E_NOTIMPL, the same answer a mesh PSO gets there. The stride and argument-order checks before it are unchanged, so a stride below the 12 bytes of D3D12_DISPATCH_MESH_ARGUMENTS is E_INVALIDARG.
  • ExecuteIndirect with such a signature validates its buffers as before, then records nothing and logs once: the replay is Runtime: ExecuteIndirect with DISPATCH_MESH signatures and the M5 mesh gate (translated mesh shader) #3777's (vkCmdDrawMeshTasksIndirectEXT). The list stays valid and closes.

Why

The retail boot under LEONIDA_D3D12=vulkan, with #7163 (type 105) and #7115 (slot 61) merged locally. The title's renderer init creates five one-argument command signatures at startup and asserts if any of them fails. The fifth is a 12-byte DISPATCH_MESH, which the layer refused with E_NOTIMPL. The PC runtime creates it on any mesh-tier-1 device, and the layer already has mesh PSOs and DispatchMesh on that tier.

This is a stand-in: the title's indirect mesh dispatches draw nothing until the replay lands. I'll post that remaining work on the coordination issue.

Tested

Windows 11, MSVC 2022 (14.44, RelWithDebInfo, Ninja), RTX 5090, Vulkan SDK 1.4.363.0:

  • d3d12_mesh_test: exit 0. New checks: without the extension, the signature is E_NOTIMPL. With it, the signature is created, a stride of 8 is E_INVALIDARG, and a list with ExecuteIndirect through the signature closes S_OK.
  • Negative control: without the creation case, the test fails at its CreateCommandSignature expectation.
  • d3d12_execute_indirect_validation_test: 49 parity cases, 0 failures.
  • d3d12_vulkan_device_test exits 1 here both with and without this change (no case reports a mismatch; it fails the same way on plain main on this machine).
  • Retail boot (locally merged with the boot-path PRs): before, the renderer-init assert after the five signatures (1,656 D3D12 calls). After, the init passes and the boot goes on to device slot 74.

AI-assisted: yes (Claude Code)

Checklist

  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. Only public API names, argument shapes and counts; no addresses, offsets, disassembly, strings or bytes from the executable.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a: no translator change)

🤖 Generated with Claude Code

…device with mesh shaders

The Vulkan layer created signatures for draw, draw-indexed and dispatch only and answered E_NOTIMPL
for DISPATCH_MESH, which the PC runtime creates on any mesh-shader tier 1 device. A title that
creates such a signature at startup and asserts on the result stopped there.

The signature is created when the device has VK_EXT_mesh_shader (MeshShaderTier 1), as a new
IndirectKind::dispatch_mesh (the name and value ItsNotRexed#3777 uses, so the two merge). ExecuteIndirect with
it records nothing yet and says so once; ItsNotRexed#3777 replays it as vkCmdDrawMeshTasksIndirectEXT.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MartinIndra02

Copy link
Copy Markdown

Independent Windows + GPU test of efc347830: pass.

Setup: Windows 11 x64, MSVC 19.44.35220 (RelWithDebInfo, Windows SDK 10.0.26100.0), NVIDIA GeForce RTX 3080 (driver 32.0.16.2124 / 621.24), Vulkan SDK 1.4.363.1, no game files.

  • d3d12_mesh_test.exe: PASS (exit 0) — confirms DISPATCH_MESH command signature returns E_NOTIMPL without VK_EXT_mesh_shader, succeeds with 12-byte stride on RTX 3080, returns E_INVALIDARG on 8-byte stride, and ExecuteIndirect logs once and lets the list close cleanly.
  • Under LEONIDA_VK_VALIDATION=1: 0 validation errors from this PR's code (only the pre-existing 3 VUID-vkCmdDrawMeshTasksEXT-pipelineStatistics-07076 errors in the statistics query test, tracked separately in Runtime: mesh-draw statistics segments count no clipping (VUID-07076); clipping from mesh-primitives queries #7112).

AI-assisted review/test.

@Pipodi

Pipodi commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Tested efc347830 on the retail boot: pass, and it unblocks the boot. Own 1.0.2.1 copy, Windows 11, RTX 4090 / 617.42, LEONIDA_D3D12=vulkan, on boot-integration plus #7115, #6891, #7201, #7163 and a local DirectStorage zlib stage (the #7180 idea).

AI-assisted (Claude Code).

@umnitus

umnitus commented Nov 23, 2026

Copy link
Copy Markdown

Independent native Windows check at efc3478, RTX 3060 12 GB / NVIDIA 621.14, clang-cl/xwin, Khronos validation 1.4.363.

d3d12_execute_indirect_validation passed all 49 parity cases against native NVIDIA D3D12 and WARP, including the positive GPU dispatch, with zero validation errors. d3d12_mesh passed with validation off. With validation on, it failed twice with three vkCmdDrawMeshTasksEXT-pipelineStatistics-07076 reports, for the clipping counters already reported in #2359. I saw no other validation errors in those runs. AI-assisted testing.

@memorypressure

Copy link
Copy Markdown

Verified at efc3478, merge-tree clean against current main 9177299. DISPATCH_MESH gated on the same MeshShaderTier as DispatchMesh, ExecuteIndirect-with-mesh records nothing and logs once — consistent with the stated "not replayed yet" scope (#3777) — and d3d12_mesh_test.cpp covers both the no-extension refusal and the create/execute/close path with stride<12 refused. C++/ctest not runnable on this box; CI pending is the execution gate. AI-assisted: yes. Tested on Linux (RTX 5080 host, CPU-only run, C++ review-only).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants