feat(d3d12_x): look up console shaders in a store of translated SPIR-V #31
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!31
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/31/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 03:26 UTC · original
Dark3581:feat/shader-store→main· +710 −1 · 11 files · 1 commits · merged 2026-11-22 03:29 UTCWhat
Second of the three pull requests planned in #4. Console shaders carry precompiled GPU code and no DXIL, so
d3d12_xwill take each one from a shader store: SPIR-V modules translated ahead of time by a separate tool. AnyBox contains no translator.BytecodeLengthstill matches). The container's ownHASHpart is not used: in one title's package 789HASHvalues are shared, 496 of them by containers with different bytes.tools/shader_store.py build <carved> <translated> <store>imports a translated shader set (carved.dxbc+ carveindex.json;<name>.spv+ translationindex.jsonwithstage) and writesmodules.txt(<sha256>\t<stage>\t<path>, paths relative to the store) andmodules.json(the translator's per-module details). Byte-identical containers share a module; a hash whose copies translate to different bytes or stages is dropped and counted, as are missing and invalid entries.lookup <store> <container>prints the module for one container.d3d12_xstore library (store/ShaderStore.cpp, linked intoab_d3d12_x.dll): parsesmodules.txtstrictly, validates a container, hashes it with BCrypt and traces each hit or miss (ANYBOX_TRACE=d3d12_x).TitleShaderStore()loads once fromANYBOX_SHADER_STOREorshadersbeside the executable. Nothing calls it yet; pipeline creation will (debt entry added).Tested
shader_storeandlib_rootsigpassed 5 repeats.shader_store(CTest): builds a synthetic store with the Python tool (a duplicate, a file name with a space, an untranslated shader), then checks the C++ side: SHA-256 test vectors, container size validation, strict index parsing (bad line, bad stage, missing file), lookups including a miss, agreement withshader_store.py lookup, andTitleShaderStorewith and withoutANYBOX_SHADER_STORE.test_shader_store(Python): declared-size hashing, duplicate and conflict handling (different bytes, different stage), missing and invalid entries, index round trip and rejection of malformed lines. Full tools suite 56/56.modules.txton each; loading the 25,889-line index takes about 70 ms. No game data in the PR.check_conventions.py,debt_fold.py --check,progress.py --jsonpass.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/shader_scan.py; SHA-256 through Windows CNG (BCrypt)