feat(d3d12_x): execute indirect draws and dispatches #53
No reviewers
Labels
No labels
accessibility
bug
ci
docs
documentation
duplicate
enhancement
fixes issue
good first issue
help wanted
invalid
library request
libs
needs rebase
question
relinker
stale
tools
unblocks title
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Dark3581--AnyBox!53
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/53/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Dark3581 on GitHub · 2026-11-22 23:07 UTC · original
Dark3581:feat/execute-indirect→main· +479 −6 · 15 files · 1 commits · merged 2026-11-22 23:09 UTCWhat
ExecuteIndirectfor the signatures that map straight to Vulkan:commands/IndirectCommands.cpp:TranslateCommandSignatureaccepts a signature whose only argument is a draw, indexed draw or dispatch, with a stride of at least the argument size and a multiple of 4. Refused with the argument named: signatures that also change constants, views or vertex and index buffers per command, a draw or dispatch that is not the last argument, mesh and ray dispatches, other nodes.CommandRecorder::ExecuteIndirect:D3D12_DRAW_ARGUMENTS,D3D12_DRAW_INDEXED_ARGUMENTSandD3D12_DISPATCH_ARGUMENTShave the layouts ofVkDrawIndirectCommand,VkDrawIndexedIndirectCommandandVkDispatchIndirectCommand(checked withstatic_assert), so the argument buffer is used as it is. A count buffer usesvkCmdDrawIndirectCount/vkCmdDrawIndexedIndirectCount(drawIndirectCount); withoutmultiDrawIndirectthe draws are recorded one by one; dispatches are recorded one per command, and a dispatch count buffer is refused. Offsets, alignment and bounds are checked.multiDrawIndirectanddrawIndirectCountwhen offered, and the title buffer window's buffer can also be bound as vertex, index, indirect and uniform buffer, so a title's buffers in it can be used for all of these.Tested
Windows 10, RTX 3070 Ti (driver 621.14), Khronos validation layer.
pso_probe indirect-selftest: argument sizes and layouts, three accepted signatures and 7 refusals with their messages.pso_probe indirect-gpu --validatedraws into a blue target throughExecuteIndirectand reads the pixels back: two draw commands with a 32-byte stride cover both halves; the same with a count buffer holding 1 draws only the first, and with 0 draws nothing; an indexed indirect draw covers the lower-right half; an indirect dispatch of 2 groups writes 128 values and not the 129th; a dispatch with a count buffer, arguments past the buffer and misaligned arguments are refused. 5 checks, 0 validation errors. Thewindowprobe still passes with the wider buffer usage.ctest: 66 of 66. Thed3d12_xtargets also build with MSVC 2022.python tools/check_conventions.pyanddebt_fold.py --check: ok.Checklist
main; no other open PR implements the same functionspython tools/check_conventions.pypasses (no comments in code, one declaration per export, Conventional Commit subjects)AbxNotImplemented/AbxUnsupported); silent stubs are listed under Silent stubs through a debt fragmentdocs/dev/debt/changes/<branch>.md