Repository navigation
d3d12: ExecuteIndirect with DISPATCH_MESH records as DispatchMesh does (RT-INDIRECT-DISPATCH-MESH-PARITY) - #2492
Conversation
…s (RT-INDIRECT-DISPATCH-MESH-PARITY) GraphicsCommandList::record_indirect for IndirectKind::dispatch_mesh differed from DispatchMesh and the indirect DRAW/DRAW_INDEXED path in three ways: - it tested viewport 0 only, so a call with viewport 0 empty and another viewport set recorded nothing; it now uses any_nonempty_viewport(); - it did not set draw.viewports, so the replay drew with viewport 0 and scissor 0 alone; it now sets draw_viewports(); - it had no mesh_ok check, so a root signature larger than a mesh shader's 16-dword window recorded; it is now a recording error, as for DispatchMesh. The root-window check and its direct-heap notes move into one helper that both paths call. d3d12_mesh_test records each case; each check fails with its part of the fix reverted. Found by kevincommits on ProjectLeonida#1608. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
lixonik
left a comment
There was a problem hiding this comment.
Reviewed 455e574b7 (runtime/shims/d3d12_com.cpp, runtime/test/d3d12_mesh_test.cpp) and tested on RTX 5070:
- Extracting
mesh_root_window_okand bringingrecord_indirect(IndirectKind::dispatch_mesh) to parity withDispatchMesh(any_nonempty_viewport(),draw.viewports = draw_viewports(), and rejecting oversized mesh root signatures withE_INVALIDARGatClose()) is clean and well-tested. - Tested on NVIDIA GeForce RTX 5070 (Windows 11, driver 610.88, Vulkan 1.4.341, MSVC 19.44;
VK_LAYER_KHRONOS_validationnot installed locally):d3d12_mesh: passed (0.32 s; includingExecuteIndirect DISPATCH_MESH {2, 1, 1}4096/4096 pixels matched, root window check, viewport 1 of 2 drawn, viewport and scissor arrays kept).
Looks good to merge.
AI-assisted (Antigravity, Gemini).
|
Reviewed at head Verification
Notes
Approve. AI-assisted review + local MSVC/dual-GPU verification. |
|
#2492 | head 455e574 (merged cleanly with main 33db04a) | |
Claimed in the coordination issue as: RT-INDIRECT-DISPATCH-MESH-PARITY (#1608 (comment))
Found by @kevincommits, item 1 of #1608 (comment). Thank you for the precise line references.
What and why
GraphicsCommandList::record_indirectforIndirectKind::dispatch_mesh(runtime/shims/d3d12_com.cpp) recorded differently fromDispatchMeshand from the indirect DRAW/DRAW_INDEXED path:DispatchMesh)any_nonempty_viewport()draw.viewportsnot set, so the replay drew with viewport 0 / scissor 0 alone (vulkan_replay.h)draw.viewports = draw_viewports()mesh_okcheck: a root signature larger than the mesh shader's 16-dword window (s16..s31) recordedClosereturnsE_INVALIDARG), logged onceThe
mesh_okcheck and the direct-heap window notes that followed it inDispatchMeshmove into one helper,mesh_root_window_ok, which both paths call.DispatchMeshbehaves the same as before.Nearby open PRs: #1549 and #841 change
DispatchMeshitself, not this path. If one lands first, the conflict is inDispatchMesh's first lines only.Tested
Windows 11 Pro 26300, MSVC 14.52 (VS 2026), RelWithDebInfo, on
main43a9d562d. Profile M: RTX 4070 SUPER 12 GB, NVIDIA 621.01, 64 GB. Built at--parallel 4, below-normal priority, while a game boot was running on the same machine. No game files.New checks in
d3d12_mesh_test, in the existing DISPATCH_MESH command-signature block. They only record commands and execute nothing;rt::d3d12::recorded_commandsreads them back:ExecuteIndirect:Close() == E_INVALIDARG;viewportsnon-null, 2 viewports, 2 scissors, and viewport 1's width kept;Each check fails without its part of the fix:
main'sd3d12_com.cpp: line 717 (Close() == E_INVALIDARG);draw.viewportsremoved: line 733 (no arrays).With the fix,
d3d12_meshpasses. The existing indirect mesh pixel check still matches all 4096 pixels.ctest -R "mesh|indirect|bundle|command_list|d3d12_com": 38/38 pass.git diff --checkandscripts/check_no_game_data.pyon both files: clean.Not run: the full suite, because a boot was running.
GPUs tested: NVIDIA GeForce RTX 4070 SUPER, driver 621.01, Windows 11 (the test needs a device with
VK_EXT_mesh_shaderto create the mesh PSO; the new checks only record)AI-assisted: yes. AI-assisted (Claude Code).
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed: n/a (runtime shim).🤖 Generated with Claude Code