feat(d3d12_x): record draws and dispatches, with D3D12 viewports and winding #52
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!52
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/52/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 22:13 UTC · original
Dark3581:feat/draw-dispatch→main· +618 −6 · 14 files · 1 commits · merged 2026-11-22 22:15 UTCWhat
The drawing half of command lists:
CommandRecordergainsBeginRendering/EndRenderingover color and depth-stencil views,SetViewports(D3D12 viewports become Vulkan viewports with a negative height, so NDC +y is the top and D3D12's clockwise-front winding applies without changing the pipeline),SetScissors,SetPrimitiveTopology(every list, strip and adjacency topology; primitive restart on strips when the pipeline has a strip cut),SetBlendFactor,SetStencilReference,SetVertexBufferswith strides,SetIndexBuffer(R16 and R32),BindPipeline,SetPushConstants(up to the 144 bytes of the title layout),Draw,DrawIndexedandDispatch.VulkanTopologyandVulkanViewportare pure and tested on their own; inverted depth ranges are accepted as in D3D12, empty, non-finite and out-of-range viewports are refused.GraphicsPipeline(#44): a pipeline without vertex buffers no longer declares the vertex stride dynamic. With it declared, every draw of such a pipeline needed avkCmdBindVertexBuffers2call first; the validation layer flagged it here, and 1,404 of the title's vertex shaders take no vertex buffers.What goes in the push constant block (the title's root arguments as user registers, the heap base and the code base) is up to the caller; that mapping is not known yet and the debt entry says so.
Tested
Windows 10, RTX 3070 Ti (driver 621.14), Khronos validation layer.
pso_probe draw-selftest: topology mapping, the viewport flip field by field, an inverted depth range, and three refused viewports.pso_probe draw-gpu --validatedraws into a blue 64x64 target and reads the pixels back: a triangle given clockwise in D3D12 coordinates covers the upper-left half with the default rasterizer state; the same triangle is culled when counter-clockwise faces are front; a right-half viewport moves it into the right half; an indexed triangle from a vertex buffer (20-byte stride, two slots, one per instance) and an R16 index buffer covers the lower-right half; the pixel shader's alpha of 0.5 is stored as 127 or 128; a dispatch writes 256 values through a buffer address passed in push constants; a 148-byte push block is refused. 7 checks, 0 validation errors. Both run in thepipeline_statetest.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