feat(d3d12_x): create vertex input from the input layout and the shader's inputs #46
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!46
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/46/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 21:06 UTC · original
Dark3581:feat/vertex-input→main· +693 −15 · 17 files · 1 commits · merged 2026-11-22 21:10 UTCWhat
Vertex input for graphics pipelines. A translated vertex shader reads each vertex input at the location of its D3D input register (the translator's rule, documented in its design notes), so the runtime has to bind a title's input layout by semantic to those locations.
shader_store.py buildalso writesinputs.txt, one<sha256> <location> <semantic> <index> <type> <mask>line per vertex input, from the translation'svertex_inputsand input signature. A module whose inputs and signature disagree counts as invalid. The C++ store loads it intoShaderModule::inputsand validates every field; a store withoutinputs.txtasks to be rebuilt.pso/VertexInput.cpp: matches eachD3D12_INPUT_ELEMENT_DESCto the vertex shader input with the same semantic name (compared without case, as D3D12 does) and index, at that input's location.D3D12_APPEND_ALIGNED_ELEMENTplaces an element after the previous one in its slot, aligned to the smaller of 4 bytes and its size. Bindings are per slot, per vertex or per instance, with strides left to draw time (the pipeline already keeps them dynamic). Elements the shader does not read are left out. Refused with an error naming the element: a shader input with no element, a format whose class (float, unsigned, signed) differs from the input's type, instance step rates other than 1, a slot mixing rates, a semantic named twice, unmapped formats, slots past 31 and offsets past 2047.pso_probe:input-selftest, a vertex-input case ingraphics-gpu(a test shader with float and unsigned inputs on two slots), andgraphics-title, which turns a title's vertex shader into a pipeline through the store, an input layout built from its own signature and the render state path.shaders_psoruns it on eight vertex shaders.The append alignment is an assumption, recorded in the debt fragment with the other gaps.
Tested
Windows 10, MinGW build, RTX 3070 Ti (driver 621.14).
pso_probe input-selftest: offsets with appended elements of 1, 2 and 4 bytes, two slots with per-instance data, an empty layout, format sizes and classes, 13 refusals with their messages.pso_probe graphics-gpu --validate: 8 pipelines (the 7 from #44 plus vertex input), 0 validation errors.shaders_storefinds all 26,503 containers with stage, subgroup size and input count matching the translation;shaders_psoturns 8 sampled title vertex shaders with 1 to 3 inputs into graphics pipelines, and its compute and offline-cache parts still pass.ctest: 66 of 66.tools/tests: 82.python tools/check_conventions.py: ok. No barestd::min/std::max(#38, #45).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