feat(d3d12_x): add D3D12 command allocators and command lists on Vulkan #62
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!62
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/62/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-23 00:43 UTC · original
Dark3581:feat/command-lists→main· +879 −20 · 15 files · 1 commits · merged 2026-11-23 00:46 UTCWhat
ID3D12CommandAllocatorandID3D12GraphicsCommandList, plusExecuteCommandListson the queue from #60, recording into Vulkan command buffers through the command recorder (#51–#54) on the resources from #61:objects/CommandAllocator.cpp: a Vulkan command pool on the device's queue family. Each listResettakes one primary command buffer from it, and its ownResetresets the pool and reuses those buffers. Direct, compute and copy types; other types are refused.objects/CommandList.cpp:Create/Reset/Close: a secondClose, or aResetwhile recording, returnsE_FAIL. A list on an allocator of another type is refused.Closeends with a barrier that makes GPU writes visible to the CPU, so a readback after a fence wait sees them as in D3D12.ResourceBarrier: transitions of whole resources or single subresources (mip, layer and plane fromSplitSubresource/PlaneAspect), buffer transitions, UAV and aliasing barriers, batched into onevkCmdPipelineBarrier2. The list remembers the states its barriers set, so later copies use the matching image layouts. Split barriers stop the title.CopyBufferRegion,CopyTextureRegion(footprint to texture, texture to footprint and texture to texture, with boxes and destination offsets),CopyResource(buffers, and textures subresource by subresource),ResolveSubresource.IASetVertexBuffers/IASetIndexBuffer(GPU addresses mapped into the buffer window),IASetPrimitiveTopology,RSSetViewports,RSSetScissorRects,OMSetBlendFactor,OMSetStencilRef.ExecuteIndirectstop the title with "not implemented yet" until descriptor heap and pipeline state objects exist. Queries, predication, stream output, tiles and bundles stop the title. Resources AnyBox did not create, and recording into a closed list, stop the title too.objects/CommandQueue.cpp:ExecuteCommandListsqueues the closed lists' command buffers as one submission, ordered with the queue's signals and waits. Work behind a held wait is held with it. Foreign lists, lists still recording and lists of another type stop the title.vkResetCommandPool.Tested
Windows 10, RTX 3070 Ti (driver 621.14), Khronos validation layer.
pso_probe commandlist-gpu --validate, 26 checks in a 64 MiB window:Resetwhile recording, a secondClose;ExecuteCommandListswithSignaland an event;Reset:CopyResourcebetween two buffers, and between two textures followed by an all-subresource barrier and a readback of mip 1;0 validation errors. The test runs in the
pipeline_statetest.MinGW
ctest: 72 of 72. With MSVC 2022,commandlist-gpuandfence-gpupass and every target builds exceptab_gameinput, which needsgameinput.lib, which this machine doesn't have (the same before this change).python tools/check_conventions.pyanddebt_fold.py --check: ok.The queue's
CommandQueuedebt entry is still in the unfolded fragment from #60, so this PR updates it there.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