d3d12_fspx_compute, d3d12_msaa_draw, d3d12_set0_compute and
d3d12_pipeline_library build PSOs from 144-byte shaders. On a device
whose maxPushConstantsSize is 128 (AMD's Windows driver on RDNA2 iGPUs,
some Intel Arc drivers) the layer refuses those PSOs with E_NOTIMPL, as
D3D-14 intends, so the tests failed at the first CreatePipelineState and
ctest reported 4 failures on a correct runtime. They now exit 77 there
(SKIP_RETURN_CODE in CMake) with the reason; pipeline_library still runs
its library-blob checks first. Devices with 144 bytes or more are
unchanged. d3d12_compute and d3d12_draw are left to #2402, which runs
their --pc-tail-ubo path on such devices.
AI-assisted.
Review on #1911: two containers with the same kind-6 program and different kind-0 entries (32x1x1 and 64x1x1)
translate to different modules but got the same fspx_code_sha256, so both resolved to the same pipeline.
- tools/fspx_unpack.py writes the kind-0 entry as fspx/<name>.state; tools/shader_meta.py records its SHA-256 as
fspx_state_sha256 next to fspx_code_sha256.
- make_game.py: entries with the same code and state keys must have identical modules, otherwise the FSPX step fails
naming both programs and drops the index. The same code key with other state keys is allowed.
- runtime: a container or bare payload (kinds 0 and 6 present) matches the code key and then the state key; no match
is E_INVALIDARG. A bare kind-6 program (slot 67, no kind 0) takes the code key's entries when their modules are
identical, and is refused with E_INVALIDARG and an "ambiguous" log line when they differ.
- Tests: the review case in tests/test_fspx_shaders_stage.py, shader_library_test and d3d12_fspx_compute_test.
- docs/fspx.md: the two keys and the ambiguous case.
On 1.0.2.1 the 29 kind-6 programs are distinct, so nothing resolved wrongly before: 17 translated entries, 17
distinct code keys, 17 distinct (code, state) pairs, all 17 found from the container and from the bare program.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The FidelityFX DLL creates its compute pipelines from FSPX programs (docs/fspx.md): through slot 67 with the bare
kind-6 program, then through slot 62 with the DXBC container whose ACCC part holds the payload. Both ended in
E_INVALIDARG: the layer took only FSSM bytecode, the build never translated the DLL and the index had no key for it.
- make_game.py: the shaders stage unpacks the package's DLL with tools/fspx_unpack.py --disasm into
<work>/shaders/fspx and translates it into <work>/shaders/spirv/fspx, with the same wave64 mode and fallback
flags. The step is redone as a whole when the DLL, its tools, llvm-mc or the flags change (fspx_build.json,
written last) and never makes the game's shaders run again.
- tools/shader_meta.py: an entry of a program without an FSSM blob gets fspx_code_sha256, the SHA-256 of
fspx/<name>.code.
- runtime/src/shader_library.h: the library also loads <dir>/fspx/index.json and finds entries by
fspx_code_sha256. compute_program() takes an FSSM program as before, the kind-6 bytes of an ACCC container or of a
bare FSPX payload, and a bare kind-6 program recognized by its prologue; the directory is parsed with the DLL
reader's rules and bounds-checked, so a malformed one is refused.
- create_compute: looks the program up by the key of its kind and uses those bytes as the code base.
- Tests: shader_library_test (parsing, malformed directories, lookup, the fspx folder), d3d12_fspx_compute_test
(PSOs from both forms, a dispatch each, refused inputs) and tests/test_fspx_shaders_stage.py.
- Docs: the lookup in docs/fspx.md; slots 62 and 67 in d3d12_command_objects.md and d3d12_vulkan.md. The size the
slot-67 description carries at +0x30 is kind 6's own size, read from the DLL's code.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>