feat(d3d12_x): create the Vulkan device, the title layout and compute pipelines #34
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!34
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/34/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 10:21 UTC · original
Dark3581:feat/vulkan-pipelines→main· +1756 −57 · 19 files · 1 commits · merged 2026-11-22 10:23 UTCWhat
The runtime half of the Vulkan backend planned in #4, up to what can be built without a title's executable: the device, the pipeline layout the translated shaders expect, and compute pipeline creation from the shader store.
VulkanDevicepicks a Vulkan 1.3 GPU that supports every shader feature a store names (discrete first), enables exactly those plus the bindless layout's descriptor-indexing features (partially bound, sampled and storage image update-after-bind) and subgroup size control, and opens one graphics and compute queue. An unknown feature name stops device creation rather than being ignored. The layout's descriptor counts are checked against the device's update-after-bind limits. Optional validation loads the Khronos layer and counts its errors through a debug messenger.TitleLayout: set 0 with twenty bindings (2D, 2D-array, 1D and 3D sampled images, samplers, the descriptor hash table as a storage buffer, and 2D, 2D-array, 3D and 1D storage images per component class) and a 144-byte push constant range for all stages. The binding types come from what the translated modules declare; array sizes are AnyBox's choice and recorded as debt.PipelineCompiler: reads and checks SPIR-V, creates compute pipelines (requiring the module's subgroup size when the device can), and keeps a pipeline cache on disk that is reused only when its header matches this GPU and driver and is replaced atomically. Batches run small modules in parallel, then each module over 4 MiB alone: large modules need several GB each inside the driver, and compiling them side by side can run out of memory.anybox-pipeline-probe(layout,selftest,validation,compile) andtools/spirv_layout.py, which reads the descriptor bindings a SPIR-V module declares and compares them with the layout.pipeline_probe(layout contents; device, compile, cache save and reload, a foreign cache rejected, both batch modes; and a 160-byte push constant block that the validation layer must catch),tools_test_spirv_layout, and with the shader options from #33shaders_layout(every stored module against the layout) andshaders_compute(60 evenly spaced compute modules up to 1 MiB, validated).VulkanDevice,TitleLayoutandPipelineCompiler.Graphics pipelines are not here: they need the title's pipeline state, which only its pipeline creation calls give.
Tested
check_conventions.pyanddebt_fold.py --checkpass.shaders_layoutfinds all 25,889 modules fit the layout, largest push constant use 144 bytes;shaders_computecompiles 60 of 60 with 0 validation errors. A wider manual run compiled 120 of 120 compute modules up to 5.9 MB, evenly spaced over the store, with 0 validation errors (82 with subgroup size 32 required, 38 wave64-emulated at any size; 1,098 s, 85 MB cache). The validation self-test shows the layer catches a push constant range outside the layout. No game data in the PR.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>.mdtools/spirv_layout.py); Vulkan behaviour from the Vulkan 1.3 specification and the Khronos validation layer