feat(d3d12_x): create compute pipelines from pipeline state descriptions, cache first #43
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!43
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/43/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 20:18 UTC · original
Dark3581:feat/compute-pipeline-state→main· +867 −54 · 23 files · 3 commits · merged 2026-11-22 20:21 UTCWhat
The pipeline state path for compute, ready for the device's
CreateComputePipelineStateonce a title's calls show the device's shape:modules.txtis<sha256> <stage> <subgroup> <path>, the subgroup size a pipeline must require (32, 64, or 0 for any) taken from the translation. Copies of one container that disagree on it count as a conflict. The C++ store keeps each module's key and subgroup size. Rebuild an existing store with theshader_storetarget.pso/PipelineState.cpp: resolves aD3D12_COMPUTE_PIPELINE_STATE_DESCto its stored module through the SHA-256 of the shader container. It refuses a missing shader, a non-DXBC blob, a module whose stage is notcs, any pipeline state flag, and a node other than the first, each with its own error. A cached pipeline blob is ignored (it holds console GPU code) and the root signature is not needed, because every pipeline uses the title layout.vulkan/PipelineLibrary.cpp: creates each pipeline once and is thread-safe (concurrent requests for one key wait for the single creation). It first asks the driver for the pipeline without compiling (VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT, the device now enablespipelineCreationCacheControlwhen offered), compiles only when that fails, and refuses a module over the run-time compile limit instead of compiling it. Some modules need far more memory to compile than a PC can commit; the offlineshader_pipelinesrun fills the cache the title then only loads.PipelineCacheread and wrote its file in one stream call, which fails with the MinGW runtime for a file this size (a title's cache passes 4 GB), so it started empty. It now reads and writes in 64 MiB pieces.Tested
Windows 10, MinGW build, RTX 3070 Ti (driver 621.14).
pipeline_statetest (fake store with real compute SPIR-V): every resolution error; 6 requests on 4 threads for 2 shaders create 2 pipelines; a saved cache givesreadyon the next run (driver reports a cache hit, 0.000 s); with an empty cache, a module over the limit isrefusedwith nothing compiled, and the same module under a higher limit iscompiled.anybox-pipeline-probe selftest: file pieces of 4096 and 1000 bytes, whole-file and default sizes, errors and an empty file.shaders_storefinds all 26,503 with the right stage and subgroup size. Newshaders_pso: 12 compute shaders up to 1 MiB go from their carved containers to pipelines; the largest (43 MiB, which needs about 75 GB to compile) is refused in 0.3 s with an empty cache instead of compiled. With the 4.74 GB offline cache (loaded in about 7 s), 9 of the 13 come backready; the other 3 small ones lie in the part of the offline run that is still going.ctest: 61 of 61.tools/tests: 81.python tools/check_conventions.py: 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>.mdD3D12_COMPUTE_PIPELINE_STATE_DESCand Vulkan 1.3 pipeline creation cache control, both public; the translator's index for subgroup sizes