Skip to content

d3d12_xs: slot 57 DeserializeGraphicsPipelineStateX, fspx_gfx index, and pipeline blob input layout - #8890

Closed
RipcuBAN wants to merge 1 commit into
ProjectLeonida:mainfrom
RipcuBAN:feat/slot57-fspx-gfx-and-boot-findings
Closed

RipcuBAN wants to merge 1 commit into
ProjectLeonida:mainfrom
RipcuBAN:feat/slot57-fspx-gfx-and-boot-findings

Conversation

@RipcuBAN

Copy link
Copy Markdown
Contributor

Summary

Adds measured support for Xbox ID3D12Device slot 57 (DeserializeGraphicsPipelineStateX, +0x1c8, measured at RVA 0x2477578) and <shaders>/fspx_gfx/index.json loading for native RDNA2 graphics stages (vs / ps / ms / gs), along with full documentation of the measured slot-57 blobs in docs/fspx.md.

Unlike slot 67 (DeserializeComputePipelineStateX at RVA 0x24800d5), which falls back to slot 62 (CreateComputePipelineState at RVA 0x247fe66) when slot 67 fails, slot 57 at RVA 0x2477578 has no fallback: on a negative HRESULT (test r14d, r14d; js 0x2477a07) it leaves the PSO entry in the title's table null, causing a null graphics PSO dereference (mov r14, [rax+0x68] at RVA 0xb5a5f8) once boot shader creation finishes and offline xgamesave initialization begins.

Measured Facts Included

  1. ShaderLibrary <shaders>/fspx_gfx/index.json loading (runtime/src/shader_library.h):

    • Extends the optional folder loop from {fspx, bvh} to {fspx, fspx_gfx, bvh}.
    • Adds fspx_gfx_size() so fspx_size() (compute fspx/), fspx_gfx_size() (graphics fspx_gfx/), and bvh_size() (bvh/) remain separate.
    • Supports optional spv filename overrides in ShaderEntry (where fspx_gfx/index.json uses the 64-character fspx_code_sha256 as the JSON key and stores <sha256[:16]>_lib(ps|vs)_<id>.spv in spv).
    • Adds PipelineState::create_graphics fallback for bare RDNA2 program blobs via library->fspx_candidates(stage.name, hash) (runtime/shims/d3d12_vulkan_device.cpp).
  2. Xbox slot 57 (DeserializeGraphicsPipelineStateX) layout (0x68 bytes, 13 qwords) (runtime/shims/d3d12_xs_device.cpp, docs/fspx.md):

    • +0x00: ID3D12RootSignature*
    • +0x08 / +0x10: state_blob (388 B in boot PSOs 1–2, 380 B in boot PSO 3; magic 0x4005d800 / 0x4005d808 / 0x4005d810)
    • +0x18 / +0x20: pipeline_blob (188 B / 0xbc in boot PSOs 1–3; contains vertex input layout)
    • +0x28 / +0x30: prog_a (native RDNA2 program Add pytest regression tests for the RDNA2 -> SPIR-V translator, plus a Linux CI job #1, or nullptr/0 in VS-only PSOs such as boot PSO 3)
    • +0x38 / +0x40: stage_a (kind-2 stage blob Add pytest regression tests for the RDNA2 -> SPIR-V translator, plus a Linux CI job #1, e.g. 208 B, or nullptr/0)
    • +0x48 / +0x50: prog_b (native RDNA2 program Vulkan tools: fix builds on Linux #2, e.g. 320..384 B)
    • +0x58 / +0x60: stage_b (kind-2 stage blob Vulkan tools: fix builds on Linux #2, e.g. 752 B)
    • Important measured correction: in the first 3 boot graphics PSOs (records 8916, 8917, 12511), pair 2 (+0x28/+0x30, 448 B / 768 B) is the pixel shader (ps) and pair 4 (+0x48/+0x50, 384 B / 320 B) is the vertex shader (vs). Stage assignment is therefore taken from entry->stage in fspx_gfx/index.json by sha256(program_bytes), never assumed from blob position.
    • Preserves PC ID3D12Device4::CreateProtectedResourceSession forwarding on slot 57 when riid != IID_ID3D12PipelineState.
  3. Measured 188 B (0xbc) pipeline blob input-layout parser & tail-truncation guard:

    • +0x10: per-element field block size (0x1c = 28 B in PSOs 1–2, 0 in PSO 3)
    • +0x38: 4 + n*28 + sum(len(name)+1) (0x70 = 112 in PSOs 1–3)
    • +0x4c: num_elements (3)
    • +0x54..: array of NUL-terminated ASCII semantic name + 7 u32s (+0x00 InputSlot, +0x04 DXGI_FORMAT, +0x08 SemanticIndex, +0x0c AlignedByteOffset).
    • Decodes POSITION (DXGI_FORMAT_R32G32B32_FLOAT @ 0), COLOR (DXGI_FORMAT_R8G8B8A8_UNORM @ 12), TEXCOORD (DXGI_FORMAT_R32G32_FLOAT @ 16).
    • Because stored pipeline blobs truncate the last 1..4 bytes of the final 28-byte block (in PSO 1, TEXCOORD at 0x9b + 9 B name + 28 B fields ends at 0xc0, truncated at 0xbc), parse_xbox_pipeline_blob_input_layout checks bounds with memchr and never reads past blob_size.
  4. Measured 380..388 B state blob offset logging:

    • Logs each measured offset once ([rt] d3d12_xs: state blob: campo sin identificar en 0x%03x = 0x%08x) without guessing unconfirmed fixed-function D3D12 state fields.

Verification

  • python -I scripts/check_no_game_data.py passed on all modified files.
  • Tested on Windows 11 with an NVIDIA GeForce RTX 3060 (device_proxy, xs_proxy_mock, d3d12_compute, d3d12_fspx_compute, root_signature, pipeline_cache_file all 100% PASS, including a PAGE_NOACCESS guard-page test on the truncated 188-byte pipeline blob and synthetic fspx / fspx_gfx / bvh index count isolation test).
  • Note: AI-assisted contribution, reviewed and tested against live boot traces and unit tests.

@abnalstlll-byte abnalstlll-byte left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified on Windows 11.

  • Critical boot progress fix for retail graphics PSO deserialization in
    untime/shims/d3d12_xs_device.cpp:
    • Accurately decodes 13-qword \XboxNativeGraphicsPipelineStateDesc\ for \ID3D12Device\ slot 57 (\DeserializeGraphicsPipelineStateX).
    • Correctly pairs Stage 2 (pixel shader) and Stage 4 (vertex shader) against measured boot PSOs (8916, 8917, 12511), looking up binaries via \sha256\ in <shaders>/fspx_gfx/index.json.
    • Parses 188-byte pipeline input layout safely with bounds validation, guarding against truncated final descriptors.
    • Non-intrusive logging for unconfirmed state blob offsets without inventing state assumptions.
  • \compileall, \git diff --check, and clean-room checks pass.

LGTM!

@smowlyy

smowlyy commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Reproduced a real test failure on head f1ab75aca merged onto main (867d922f0) on native Windows 11 (10.0.26300.9974, MSVC 19.44, RelWithDebInfo):

Defect

device_proxy_test fails 2 checks in the new fspx_gfx test:

  • FAIL fspx_gfx PS entry preserves stage and custom spv filename
  • FAIL fspx_gfx VS entry preserves stage and custom spv filename

Root cause

ShaderLibrary::load_index() in runtime/src/shader_library.h prepends prefix ("fspx_gfx/") to e.spv_file:

e.spv_file = prefix + spv->string;

(which load_spirv() expects when opening dir_ + "/" + entry.spv_file), whereas runtime/test/device_proxy_test.cpp asserts spv_file without the "fspx_gfx/" prefix:

ps_entry->spv_file == "9e5ffd2c6c521c03_libps_00842.spv"
vs_entry->spv_file == "160fbe4368fb1a63_libvs_00843.spv"

Steps to reproduce

  1. Merge f1ab75aca onto main (867d922f0).
  2. cmake --build runtime/build --target device_proxy_test --parallel
  3. ctest --test-dir runtime/build -R '^device_proxy$' --output-on-failure -V
  4. Observe device_proxy_test: FAILED (2 failures) on the two fspx_gfx assertions above.

AI-assisted.

@kacper-serewis

Copy link
Copy Markdown
Contributor

Offline cache coverage check on f1ab75a, before a runtime comparison. Our existing translated work folder has 26,566 root entries, a compute-only library, and no fspx_gfx/index.json. For the first three boot graphics records, none of the five distinct stage/program pairs matched a same-stage root fssm_sha256 using either the whole native program or its extracted instruction range. Across all 18,838 distinct graphics stage/program pairs, both exact-match counts were zero. These hashes cover different representations, so this only rules out direct rekeying by those two byte ranges. Does your local fspx_gfx producer also resolve the source graphics interface, and is there a reproducible command for producing the index from the player's work folder? No runtime or frame result from this comparison. AI-assisted.

@Marukooh

Copy link
Copy Markdown
Contributor

checked: Wine 11.22 / RTX 5070 Ti / NVIDIA 620.73.04, offline.

base: dd44a4b53 boot integration with #7685, #7448, #8591, #7880, #8458 and #8763, plus adapted runtime hunks from f1ab75a. shader_library CTest passes. The full private graphics catalog contains 16,684 SPIR-V-validated modules from 18,837 graphics programs attempted.

With original #8890 parsing and the five modules for the initial checks, one PSO that had translated stages reached the device but returned E_INVALIDARG for an invalid vertex attribute format. With the parser from #8754 wired to the same runtime path and the full catalog, all 10,241 slot-57 calls in that retail run reached CreateGraphicsPipelineState and returned S_OK. No missing-stage or invalid-layout message was emitted. The title still presented black at both the 45 s and 95 s screen samples. This measures PSO creation and does not validate the guessed fixed-function state or explain the remaining black frames.

AI-assisted. No game files, blobs, identifiers, images or trace lines attached.

@kacper-serewis

Copy link
Copy Markdown
Contributor

Follow-up on the first three boot graphics records: each of their five stage records resolves to exactly one source container using the library stage digest and the carved container HASH. With those source interfaces beside the local disassembly, the translator at 867d922 produced 3 VS and 2 PS modules, all five passing spirv-val. Each generated fspx_code_sha256 matches the full native program bytes independently. This gives a five-entry private fspx_gfx index for a bounded runtime comparison. Pipeline creation and presented pixels remain unmeasured with that index. AI-assisted.

@gkissel

gkissel commented Nov 23, 2026

Copy link
Copy Markdown

I'd like to test this on Linux + Wine 11.21 with a GTX 1650 Mobile (4 GB, NVIDIA, 32-wide subgroups only), on ASTROWwwW:ladder-frame + #7584 (needed under Wine to get past the startup watchdog). On that stack today the title records frames for minutes (ClearRenderTargetView every frame, 0 draws) with about 10,241 slot-57 calls unserved, so this PR is the next thing to measure there.

One question before I build: how do you generate <shaders>/fspx_gfx/ and its index.json? This PR has no tool or make_game.py step for it. The keys are fspx_code_sha256, with the spv names given as <sha256[:16]>_lib(ps|vs)_<id>.spv. Is it tools/shader_library.py --stages vs,ps,ms plus rdna2spirv.py with particular flags, or a script of your own? If it is a script, could it go into this PR (or a linked one), so that anyone with a work folder can rebuild the folder the same way?

Once I can build it, I'll post: slot-57 calls served and refused, whether the first draws appear, and how far the boot gets, 2 runs each with and without this PR.

AI-assisted. No game data.

tibzejoker added a commit to tibzejoker/Leonida that referenced this pull request Nov 23, 2026
Only the PR's own commit is applied (its branch also carries 49 newer main commits, left out). Slot 57 handler and its dispatch added beside slots 17-24 and the lease/initial-state code; in the Vulkan layer the new FSSM/FSPX lookup keeps ItsNotRexed#7417's stub_or on both 'no translated shader' paths. device_proxy_test: the fspx_gfx spv filename check expects the folder prefix the loader adds.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@kacper-serewis

Copy link
Copy Markdown
Contributor

@gkissel For the five-module Windows check, I used the program bytes and code_range from tools/shader_library.py, matched each stage digest via carve_digests on the dxbc work folder, and put the matching source .dxbc beside disasm/ under the same stem. These are the operations of python -I tools/shader_library.py <shaders.rpf> --out <private-library> --stages vs,ps,ms,gs --carve <work/shaders/dxbc> --disasm (I restricted my local extraction to the three records). Then python -I tools/rdna2spirv.py <private-library>/disasm --out <private-translation> --wave64-emulate --no-asm. For each validated module, retain its translator metadata, key the fspx_gfx index by its full fspx_code_sha256, and place its module at fspx_gfx/.spv. I verified that all five keys equal the full native program digest, including the prologue. This recipe is verified on those five; the full catalog and Wine result above are the other contributor's measurement. AI-assisted.

@gkissel

gkissel commented Nov 23, 2026

Copy link
Copy Markdown

Thanks @kacper-serewis, that is what I needed. I will build fspx_gfx/ that way from the whole library (vs, ps, ms and gs) once my current pipelines stage frees the machine, and then post the with/without numbers here.

AI-assisted.

@kacper-serewis

Copy link
Copy Markdown
Contributor

Windows offline retail comparison, RTX 5070 616.56, MSVC 14.50. Private boot stack at 4ecae894d plus its recorded local changes and #8890 f1ab75a. Each measured run issued 25,450 slot-57 calls. On the same instrumented executable the empty graphics index served 0 calls; adding only the five verified modules served 4. With the same five modules and #8754 at 4a04398 wired into the runtime handler, 5 calls returned S_OK. The remainder returned E_INVALIDARG in each run. Full swapchain RGB readbacks were black in all 539, 375 and 337 images respectively. One additional launch stopped before slot 57 and was excluded from this comparison. All reached runs ended at a breakpoint within the 75 s bound. These are five-module results; the full-catalog Wine run above measures a different configuration. One synthetic discrepancy on my integration: device_proxy_test fails its two custom-filename comparisons because spv_file contains the fspx_gfx/ prefix while the test expects a bare filename. Both forms can be checked independently via a real module read. AI-assisted.

@venetanji

Copy link
Copy Markdown
Contributor

Checked the bare-program code-base path on f1ab75ac with a synthetic pixel shader on Linux.

A bare graphics stage with uses_code_base=true can reach E_OUTOFMEMORY with ample memory. In d3d12_vulkan_device.cpp, the bare-program fallback at line 3322 resolves the catalog entry while leaving Stage::fssm empty. Line 3370 selects the stage for code-base upload. With one such stage, if pipeline creation succeeds, line 3766 then asks arena_allocate for zero bytes, which lines 701-702 reject.

A hand-written pixel shader using s_getpc_b64 and s_load_dwordx4 to read its embedded constants produces uses_code_base=true with the normal translator. The full-program hash matches and the generated module passes spirv-val --target-env vulkan1.2. I verified the metadata and followed the return in source. Windows execution of this particular PSO remains unmeasured.

The bare graphics path needs to retain the matching native program bytes for that upload, as the compute path does. The same synthetic shader would make a regression fixture for creating a PSO and reading back its embedded constant.

AI-assisted. Synthetic input only.

@FIocker

FIocker commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

For the state blob (pair 0), which this PR records but doesn't turn into PSO state: #8507 decodes it.

  • Layouts: it is a block of GPU context register values in two layouts. VS pipelines are 380–420 B, with the layout word = 4; your 0x4005d800/08/10 are its first word. MS pipelines are 464–520 B, with the same registers 0x54 later.
  • Registers decoded: CB_BLEND0..7_CONTROL, CB_TARGET_MASK, SPI_SHADER_COL_FORMAT, CB_SHADER_MASK, SX_PS_DOWNCONVERT (format class), DB_DEPTH_CONTROL, DB_STENCIL_CONTROL, DB_STENCILREFMASK(_BF). tools/pso_state_decode.py writes the D3D12-level reading per library record.
  • Checks: over all 5,680 distinct blobs, blend-on ⇔ SX_MRTn_BLEND_OPT ≠ disabled holds in 45,440 of 45,440 (blob, target) pairs, and no blob writes depth with the test off.
  • Not decoded yet: rasterizer and topology.

One measurement that supports keying by bytes (Windows 11, RTX 5080, LEONIDA_D3D12=vulkan, #7180 for the zlib reads, own 1.0.2.1 copy; counts and indices only). On our stack the first slot-57 call is the library's graphics record 0, verbatim. Its six pairs are byte-identical to the library's:

pair contents library
state 388 B blob 93, which only record 0 uses
input layout 188 B blob 94
pair 2 PS program program 42
pair 3 its stage blob blob 95
pair 4 VS program program 43
pair 5 its stage blob blob 96

That's the same PS-first order you measured on records 8916/8917/12511. So besides the program hashes, a handler can also find the exact record, and with it the decoded blend/depth state, from the state blob's bytes. There are 5,680 distinct state blobs.

AI-assisted (Claude Code).

@MarcPique

Copy link
Copy Markdown

Windows retail integration result for f1ab75ac on an RTX 4090 (32.0.16.1656), MSVC 19.44.35228, Windows 11.

  • Integrated this route with the Decode the vertex input layout used by slot 57 #8754 input-layout parser and the existing boot stack. A local probe recorded 20,478 native program references across the slot-57 startup calls. All 1,266 distinct programs mapped to the local pipeline library. All 1,266 translated and passed spirv-val.
  • With the same runtime and only a 17-module fspx_gfx pilot index, startup created 17 slot-57 PSOs. With the complete reached index, it created 10,241 of 10,241 slot-57 PSOs, with zero slot-57 failures or lookup misses.
  • The complete index run continued into presentation and drawing. Windows Graphics Capture still showed a uniformly black client area during the frame loop. Device slot 55 was reached and still fell through to the PC CreateReservedResource1 route on this stack.

The local index used the normal translator output filenames, keyed by fspx_code_sha256. The build-tool selector used for the initial pilot is in #9054. Counts and API names only. AI-assisted.

@kacper-serewis

Copy link
Copy Markdown
Contributor

Coverage detail while building the full catalog on Windows: 12,062 of the 25,471 graphics library records reference a mesh program (10,726 MS+PS and 1,336 MS only). At f1ab75a the stage lookup can return ms, but the slot-57 handler assigns VS, PS or GS only; a resolved ms takes the same E_INVALIDARG path as a missing stage. This is a static library count, not the number of mesh records reached on boot. Separating known-but-unsupported MS from lookup misses in the counters would make full-cache results easier to interpret. AI-assisted.

@kacper-serewis

Copy link
Copy Markdown
Contributor

Measured on Windows/RTX 5070 with the corrected #8754 input parser and five-module graphics cache: two independent runs each returned 5 successes, 24,109 stage-lookup misses and 1,336 failures from PC CreateGraphicsPipelineState. In the second run every one of those 1,336 failures had zero VS, PS and GS bytecode lengths in the outgoing PC descriptor. The number equals the archive's mesh-only record count, but the counters did not establish record identity. In particular an empty outgoing descriptor can fail at PC creation without the proxy's unknown-stage branch ever firing. AI-assisted; aggregates only.

hexxone pushed a commit to hexxone/Leonida that referenced this pull request Nov 23, 2026
…ception context

Adapted slot 57 from upstream PR ItsNotRexed#8890 by RipcuBAN. Measure and decode the length-prefixed input layout, build the graphics library, and diagnose allocation failures locally.
@kacper-serewis

Copy link
Copy Markdown
Contributor

The 1,336 empty PC descriptors are now attributed to mesh-only records on this Windows run. I joined the runtime state blob and input-layout blob to the corresponding archive fields by the pair of content hashes, keeping the keys local. Across all 25,471 graphics records, records sharing such a key always had the same stage set. All 1,336 empty-PC-descriptor failures matched MS-only, zero unmatched or ambiguous. The proxy reads two program pairs, and neither supplied a VS, PS or GS on these failures. This identifies a missing mesh path independently of graphics cache size; it does not establish the location of mesh bytecode in the runtime descriptor. AI-assisted.

@XIIYAZ

XIIYAZ commented Nov 23, 2026

Copy link
Copy Markdown

Test bug at f1ab75aca: device_proxy_test fails its own two new checks, fspx_gfx PS entry preserves stage and custom spv filename and the VS one. ShaderLibrary::load_index stores e.spv_file = prefix + spv->string, so the entry holds fspx_gfx/9e5ffd2c6c521c03_libps_00842.spv, and spirv() needs that prefix to open the file under dir_. The test compares against the bare 9e5ffd2c6c521c03_libps_00842.spv. Expecting the prefixed path makes device_proxy and device_proxy_trace pass (Windows 11, MSVC 2022, RTX 3070); the loader looks right as written.

Also, when this lands with #7529, the second folder loop (the one that returns (fspx_count_ + fspx_gfx_count_) > 0) should include #7529's library folder, and the counter line should count library/ with fspx/.

AI-assisted test run.

@Hiiva

Hiiva commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

CPU-only parser review of #8890 at f1ab75acaa0014c62c1acfcf1f2a92bcf1baa784 and #8754 at 4a043987b295ee0203885b92db36d3cff6f51af1, both on GitHub main 867d922f. Both production sources were unchanged. Windows x64, MSVC 19.44, SDK 10.0.26100.0.

The synthetic comparison exposes three integration issues:

Wiring #8754 needs to honor parsing failure and copy all six numeric fields, including the per-instance class and step rate. Both parsers own their semantic strings after input storage is released; the descriptor and string vectors stay alive through the synchronous backend call.

Reproduction input, entirely synthetic:

using Bytes = std::vector<std::uint8_t>;
void append_u32(Bytes& bytes, std::uint32_t value) {
    for (unsigned shift = 0; shift < 32; shift += 8)
        bytes.push_back(static_cast<std::uint8_t>(value >> shift));
}
void append_element(Bytes& bytes, std::string_view name,
                    std::initializer_list<std::uint32_t> fields) {
    append_u32(bytes, static_cast<std::uint32_t>(name.size() + 1));
    bytes.insert(bytes.end(), name.begin(), name.end());
    bytes.push_back(0);
    for (auto value : fields) append_u32(bytes, value);
}
Bytes bytes(80, 0);
bytes[76] = 2;
append_element(bytes, "ATTR", {3, 16, 2, 28, 0, 0});
append_element(bytes, "CUSTOM_0", {7, 41, 5, 0xffffffffu, 1, 3});
bytes.resize((bytes.size() + 3) & ~std::size_t{3});

unsigned old_accepted = 0, strict_accepted = 0;
for (std::size_t cut = 0; cut < bytes.size(); ++cut) {
    std::vector<rt::d3d12_xs::XboxPipelineInputElement> partial;
    if (rt::d3d12_xs::parse_xbox_pipeline_blob_input_layout(
            bytes.data(), cut, partial))
        ++old_accepted;
    if (leonida::parse_slot57_input_layout(std::span(bytes).first(cut)))
        ++strict_accepted;
}
// Observed: bytes.size() == 152, old_accepted == 68, strict_accepted == 0.

Eight stock CPU gates also passed: shader-library, slot57-input-layout, and the six proxy-mock modes present at these heads. No GPU, WARP, title execution, or full device-proxy fixture was run for this review. No game data is included.

@thedarkcr0w

Copy link
Copy Markdown

Thanks for measuring the call site: that the call passes IID_ID3D12PipelineState, and that pair 2 is the PS and pair 4 the VS, matches what we see. Below are counts only, from my own 1.0.2.1 copy's pipeline library (25,471 graphics records). Three readings in the pipeline-blob table don't hold over the whole library, and one consequence matters for the handler:

  1. +0x10 is not a per-element field-block size. Bytes +0x10..+0x17 are one DXGI_FORMAT per render target. They are non-zero from target 0 upwards in all 25,471 records, and their count equals the byte at +0x25 in all of them. 0x1c is 28 = R8G8B8A8_UNORM; your PSO 3 has 0 there because it has no render target (it is the VS-only one), while its elements are still 28 bytes. In every (record, target) pair that exports, the formats agree with the state blob's export format and down-convert class (R16G16B16A16_FLOAT with FP16_ABGR, R10G10B10A2 with 2_10_10_10, R11G11B10_FLOAT with 10_11_11, R9G9B9E5 with 9_9_9_E5, ...).
  2. +0x24 is three bytes, not one word: the depth-stencil DXGI_FORMAT (0, 20, 40, 55, or the console's 118), the render-target count, and the primitive topology type. So 0x00130100 is "no depth, 1 target, topology 19", and 0x00130037 is "D16_UNORM, 0 targets, topology 19". Topology is 3 in 25,062 records, 2 in one and 19 in 408 vertex records. 19 is not a D3D12_PRIMITIVE_TOPOLOGY_TYPE, and your three boot pipelines all have it, so creating them as TRIANGLE is a guess.
  3. The element framing is Decode the vertex input layout used by slot 57 #8754's: a u32 name length (NUL included), the name, then six u32 (semantic index, format, input slot, byte offset, classification, step rate), no padding, with the count at +0x4c. That frames all 25,229 distinct blobs exactly, with at most 3 zero bytes of padding at the end. Read as "name + 7 u32", the seventh word is the next element's name length, which is why the last element looks truncated and why InputSlot and SemanticIndex look swapped (both are 0 in your three). +0x50 is the first element's name length, not a maximum.
  4. Because of 1 and 2, the description does carry the formats. The state blob carries blend, depth and stencil (pso_state_decode: read the pipeline library's graphics state blobs as GPU registers (slot 57) #8507), and culling, clip and depth bias: PA_SU_SC_MODE_CNTL at +0x0a0 (no culling in 13,534 records, back in 11,875), PA_CL_CLIP_CNTL at +0x09c, poly offset at +0x0ac..0x0b4. The fixed description here (one R8G8B8A8_UNORM target, D32_FLOAT, depth LESS with writes, no blending, no culling) is wrong for most records: 7,079 records have no depth target, 2,731 use D16_UNORM, a large share blend, and render targets range from 0 to 8 in 30-odd formats. A Vulkan pipeline created with attachment formats other than those of the pass it is drawn in is invalid usage, so I would refuse what isn't read rather than substitute defaults.

Smaller points:

An implementation that reads all of the above is on a public branch, free to take. @ruvenesh, since the handler is yours on the coordination issue: thedarkcr0w/Leonida:slot57-gfx-pso, the commits on top of #8754's input-layout parser:

  • 35935852b "device slot 57 creates a graphics pipeline from the library's state and pipeline blobs": reads the RTV/DSV formats, target count, topology, sample words, blend/write masks, depth/stencil, cull/front face, clip and poly offset. It refuses unread state with a named reason. VS and PS are found by fspx_code_sha256 under their stage, as slot 67 does.
  • 85dc0ff1a "make_game: translate the pipeline library's vertex and pixel programs for device slot 57" (make_game, shader_library: unpack, translate, and load pipeline-library compute programs (D3D-703) #7527's step, now cs,vs,ps).

Tests (RTX 4090, MSVC RelWithDebInfo):

  • slot57_pipeline_state (portable).
  • d3d12_slot57_draw: three pipelines from hand-built blobs and hand-written SPIR-V, drawn and read back for write mask, cull, the front-face bit and blend.
  • device_proxy additions: host D3D12/WARP accepts the description the proxy builds, using host DXBC shaders.
  • Full ctest passes, apart from two failures that are baseline on this machine.
  • With the real decoder over my library, 12,966 of 13,409 vertex records read; the rest are 408 with topology 19, 17 with another sample form, 12 with a word at +0x120 and 6 with head word 3.

The branch sits on my local integration of boot-chain PRs, so only those three commits are the change. I'm not opening a competing PR; please take whatever helps.

AI-assisted (Claude Code).

@kacper-serewis

Copy link
Copy Markdown
Contributor

Windows offline retail full-library comparison, RTX 5070 616.56. Translated and spirv-val validated 14,159 of 18,837 native graphics programs at 867d922. The catalog completely covers 19,328 of 25,471 graphics records. With #8890 f1ab75a + #8754 4a04398 on the same private stack and executable as my five-module comparison, slot 57 succeeded 12,566/25,450 times (five-module result: 5). All 276 full swapchain readbacks were black. This run later ended with a host access violation.

Separate diagnostic with the same catalog: the archive state/layout digest pair uniquely identified the mesh program for every mesh-containing record. Submitting that archived program through the existing PC mesh PSO stream produced 6,647 additional S_OK returns, for 19,213/25,450 slot-57 successes. The diagnostic also returned 498 E_INVALIDARG and 95 E_OUTOFMEMORY on mesh submissions. Remaining first failures overall: 5,624 proxy stage lookup misses and 613 PC creation failures. All 465 swapchain readbacks were black. This tests archive-based reconstruction using existing fixed-function defaults; it does not establish the runtime mesh descriptor layout or correct per-draw state. AI-assisted. No game data attached.

@SweatierKey

Copy link
Copy Markdown
Contributor

Clean-room static ABI finding answering @kacper-serewis's question about where mesh bytecode sits in the slot-57 runtime descriptor (plus one no-game-data policy heads-up):

1. Full slot-57 descriptor size is 0x108 bytes (264 B) with all 7 stage slots (MS is at +0x68)

Static inspection of the single slot-57 call site and its descriptor populator confirms that the descriptor passed to device slot 57 is 0x108 bytes (not 0x68 bytes). It maps the 2 header blobs and all 7 (program, stage_blob) stage pairs from each 0x70-byte archive graphics record (docs/shader_library.md §2) 1:1 in the exact same order, with 0xFFFFFFFF indices zero-filled to (nullptr, 0):

Desc offset Size Contents Archive slot (docs/shader_library.md §2)
+0x00 8 ID3D12RootSignature* populated per call
+0x08, +0x10 16 (state_blob, state_blob_size) state blob index
+0x18, +0x20 16 (pipeline_blob, pipeline_blob_size) pipeline / input-layout blob index
+0x28..+0x47 32 Stage 0: (prog, prog_size, stage_blob, stage_blob_size) slot 0 (PS)
+0x48..+0x67 32 Stage 1: (prog, prog_size, stage_blob, stage_blob_size) slot 1 (VS)
+0x68..+0x87 32 Stage 2: (prog, prog_size, stage_blob, stage_blob_size) slot 2 (MS — mesh shader)
+0x88..+0xA7 32 Stage 3: (prog, prog_size, stage_blob, stage_blob_size) slot 3 (unused in archive)
+0xA8..+0xC7 32 Stage 4: (prog, prog_size, stage_blob, stage_blob_size) slot 4 (unused in archive)
+0xC8..+0xE7 32 Stage 5: (prog, prog_size, stage_blob, stage_blob_size) slot 5 (unused in archive)
+0xE8..+0x107 32 Stage 6: (prog, prog_size, stage_blob, stage_blob_size) slot 6 (2 records)

That directly explains @kacper-serewis's 1,336 empty outgoing descriptors on MS-only records (and missing MS on the 10,726 MS+PS records): XboxNativeGraphicsPipelineStateDesc currently stops at +0x60 (stages 0 and 1 = PS and VS), so stage 2 (+0x68 / +0x70 code, +0x78 / +0x80 stage blob) is never read. Extending the struct to 0x108 bytes with StageSlot stages[7] at +0x28 gives direct access to the mesh program at stages[2] (and stages[6] for the 2 slot-6 records).

2. Clean-room / no-game-data heads-up in docs/fspx.md

The added docs/fspx.md section currently includes an exact executable RVA and per-record checksums/SHA-256 prefixes from the retail archive. Dropping those before merge (keeping only struct offsets, counts, and sizes, as in docs/shader_library.md and #8273) will keep the PR compliant with the repository's no-game-data policy.

(Clean-room static ABI inspection only — counts, sizes, and struct offsets; no game bytes/addresses/hashes. No build executed here.)

@kacper-serewis

Copy link
Copy Markdown
Contributor

Draw attribution on the full-cache RTX 5070 run: joined the render target at each recorded draw to the actual PresentX source resource and the pipeline's selected modules. All 325 draws targeting a presented resource used the same VS/PS pair from fspx_gfx. The other 651 recorded draws used two VS/PS pairs from the root shader index. All 327 complete GPU readbacks were black. The final PS metadata has three bindings. This shows a translated graphics-library pair is actually used on the presentation target on this stack. It does not yet identify what produced black at the fragment stage. AI-assisted; aggregate counts only.

@FIocker

FIocker commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Follow-up with a full boot's worth of calls (Windows 11, RTX 5080, LEONIDA_D3D12=vulkan, own 1.0.2.1 copy; counts only).

A probe logged the SHA-256 of each of the six pairs for 10,138 slot-57 calls. That is everything this run reached before its stop, a 2D A8 render target at allocation-info slot 25, which is not related to slot 57. Correlated with the pipeline library:

  • Coverage: 10,138 / 10,138 calls are exact library graphics records. Every part is a library blob or program, every combination is an existing record, and no call has an unknown part or another layout.
  • One call per record: 10,138 distinct records, each created once.
  • Vertex-shader pipelines only: all are VS pipelines (VS+PS, or VS-only with pair 2/3 empty). None is a mesh-shader record. The library has 13,409 VS records and 12,062 MS records, so MS pipelines come through another path.

So a handler keyed by the program hashes (this PR) or by the state blob's hash (5,680 distinct, #8507 decodes them) covers every slot-57 call seen so far. What it serves still depends on the library's VS/PS programs being translated: 1,340 of 1,343 VS and 7,871 of 9,996 PS pass spirv-val with llvm-mc 23.1.5 and #6446/#6808/#6809 (docs/shader_library.md §5 in #6813).

AI-assisted (Claude Code).

seblessa added a commit to seblessa/Leonida that referenced this pull request Nov 23, 2026
…px_gfx for slot 57

Completes the WIP commit before it. The executable creates its graphics pipelines with Xbox device slot 57
(DeserializeGraphicsPipelineStateX, ItsNotRexed#8890) and passes each record's programs as bare kind-6 bytes; the runtime looks
them up by sha256(program bytes) in <shaders>/fspx_gfx/index.json, which nothing generated.

- make_game.py's shaders stage gets library_graphics_shaders() after ItsNotRexed#7529's compute step: shader_library.py
  --stages ps,vs,ms --disasm --carve into <work>/shaders/library_gfx, then rdna2spirv.py with one --shard per job
  (translate()) into <work>/shaders/spirv/fspx_gfx, with the stage's --wave64-emulate and fallback flags.
- Each index entry keeps stage and fspx_code_sha256 (the program's table bytes, what slot 57 passes) and gets
  "spv", which ShaderLibrary reads under the folder prefix as fspx_gfx/<name>.spv. No fspx_state_sha256: slot 57
  passes no kind 0, so two programs with the same bytes and different modules fail the step.
- The carve is required (pixel and mesh programs need their source container's signatures). The step reruns whole
  when shaders.rpf, the tools, llvm-mc, the wave64 mode, the flags or the stages change (fspx_gfx_build.json,
  written last), and prints the translated count per stage on every run.

Tests: tests/test_library_gfx_shaders_stage.py (tool calls, index format, reuse, invalidation, stale outputs and
shard plan, empty result, key clash, and the code key on a hand-built library through the real shader_library.py).
Measured on the 1.0.2.1 package: 14,159 of 18,837 programs translate (docs/shader_library.md).

AI-assisted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gkissel

gkissel commented Nov 23, 2026 •

Copy link
Copy Markdown

Result on Linux + Wine 11.21, GTX 1650 Mobile 4 GB (NVIDIA, 32-wide subgroups), clang-cl + xwin build. Base: ASTROWwwW:ladder-frame a1751a9 + #7584 + this PR f1ab75a. The merge conflicted in d3d12_xs_device.{h,cpp}, shader_library.h, device_proxy_test.cpp and docs/d3d12_vulkan.md; I resolved it by keeping both sides, and shader_library.h loads {"fspx", "fspx_gfx", "bvh", "library", "exe"}. Runs used LEONIDA_SKIP_INT3=1 and an 18 GB memory cap.

Building fspx_gfx/ from what the boot asks for:

  • tools/shader_library.py --stages vs,ps,ms,gs --carve <work>/shaders/dxbc --disasm over the whole library: 18,839 programs.
  • A temporary local log of every slot-57 kind-6 miss (hashes only, not part of anything pushed). Round 1: 950 distinct programs. Round 2, after adding those: 316 more, the second stage of the same PSOs. That is 1,266 in total, the same count MarcPique measured.
  • All 1,266 were found in the library by fspx_code_sha256 of their .code. rdna2spirv.py --wave64-emulate --no-asm: 1,266 translated, 1,266 pass spirv-val. It took 37 s for the first 950, so the full graphics catalog is minutes, not hours.
  • The translator's own index.json and output names went into fspx_gfx/ unchanged, and the runtime loaded it: 950 fspx_gfx, then 1,266.

Boot, 180 s:

before this PR's modules with the 1,266
slot-57 kind-6 misses 10,240 calls (950 programs) 0
DrawInstanced 0 3,121
SetPipelineState 0 3,122
ClearRenderTargetView every frame 3,849

Some slot-57 calls still fail after the lookup succeeds (slot 57 call N failed, state 388 B, pipeline blob 152 or 188 B, two programs), and 1,535 CreatePipelineState calls fail overall. I haven't split those by cause yet. I didn't capture the window's contents.

Wave64 note from the translator for the first 950 of them on 32-wide subgroups: tier A 364, tier B 4, tier C 533 (not exact on NVIDIA).

AI-assisted. No game data: counts, sizes and API names only.

@gkissel

gkissel commented Nov 23, 2026

Copy link
Copy Markdown

A data point for that split, from my Wine run above: my temporary miss log sits in the same else branch, so it also caught any program whose stage resolved to ms. With the 1,266 modules in place it recorded 0 slot-57 calls in 180 s. So on this boot route no slot-57 PSO reached the mesh path, and the slot 57 call N failed lines I still see (two programs, 152- or 188-byte pipeline blobs) come after a VS/PS was assigned, not from a resolved ms. I agree a separate counter for "resolved but unsupported stage" would make full-catalog runs easier to read.

AI-assisted. Counts only.

@kacper-serewis

Copy link
Copy Markdown
Contributor

Narrowed the Windows full-catalog black-frame measurement to raster coverage. A validated private diagnostic fragment module wrote distinct opaque colors on its normal-return and discard paths. Verified the exact module digest at runtime on the PSO bound to the PresentX source. GPU occlusion queries: 0/7 sampled draws to the presentation resource covered samples, versus 17/17 sampled offscreen draws. The six sampled presentation draw-state records used rectangle topology, 3 vertices, a full-target viewport/scissor, and no depth attachment. Disabling depth/stencil on that PSO alone still gave 0/7; enabling the existing descriptor table copy for its FSPX vertex program alone also gave 0/7. Readbacks remained black. This explains why fragment texture-value probes cannot diagnose the color yet on this build. AI-assisted, no game data.

@seblessa

Copy link
Copy Markdown
Contributor

Two findings from running this with the rest of the boot chain (#7240, #7066, #7516, #7201, #8517, #8869) on a retail boot, RTX 4080 SUPER, driver 617.42. Outcomes only.

  1. Nothing in main or the open PRs generates <shaders>/fspx_gfx/index.json. Without it, slot 57 returns E_INVALIDARG with "no translated graphics stage in fspx_gfx", and the title then uses a null PSO. It needs the graphics counterpart of shaders: translate the pipeline library's compute pipelines, which the executable creates with slot 67 (RT-5) #7529: the shaders.rpf pipeline-library programs (kind 6 vs/ps), translated with rdna2spirv and indexed by SHA-256 in this PR's format. I'm handing over an unfinished start (a make_game stage on top of shaders: translate the pipeline library's compute pipelines, which the executable creates with slot 67 (RT-5) #7529, not yet run to completion on the retail package): https://github.com/seblessa/Leonida/commits/fspx-gfx
  2. This PR's own test expects spv_file without its folder prefix, but the lookup keeps the prefix, so the test fails. Fix: seblessa@61612b4e6

AI-assisted (Claude Code).

@RAINighty

Copy link
Copy Markdown

Tested f1ab75aca merged with main 867d922f0 (clean merge) on Windows 11 (10.0.26300), Intel Core i7-14650HX, MSVC 19.44.35228, RelWithDebInfo (Ninja): fails.

  • With this PR device_proxy and device_proxy_trace both fail (0 of 2); on main both pass. The failing checks are fspx_gfx PS entry preserves stage and custom spv filename and fspx_gfx VS entry preserves stage and custom spv filename (the ShaderLibrary::load call itself and the fspx_gfx_size()/fspx_size()/bvh_size() counts pass; only the two find_fspx_by_code entry checks fail).
  • Re-run after rebuilding all objects, same result. I did not find out whether this is a Windows-only difference in the new fspx_gfx loading or in the test's fixture.
  • Control with main's implementation files does not compile with this PR's test (XboxPipelineInputElement is not a member of rt::d3d12_xs).
  • Code not reviewed beyond running it. No GPU or game files.

AI-assisted (Claude Code).

@seblessa

Copy link
Copy Markdown
Contributor

Update to my comment above: the fspx_gfx generator is now complete on the branch (https://github.com/seblessa/Leonida/commits/fspx-gfx), on top of #7529.

  • make_game.py gets a stage, library_graphics_shaders() (seblessa@531a23a06). It extracts the pipeline library's ps/vs/ms programs from shaders.rpf with tools/shader_library.py, translates them with rdna2spirv into <shaders>/fspx_gfx/, and writes an index with stage, fspx_code_sha256 and spv in the form this PR's slot 57 reads. It needs the shaders.rpf carve that the shaders stage already makes.
  • A local run on the retail package found 18,837 programs (PS 9,996, MS 7,498, VS 1,343) with no key collisions. 14,159 translate (PS 6,119, MS 6,744, VS 1,296). The 4,678 that fail are mostly "fall-through into undecodable words" (3,998), and at least 319 hit the encoding check (v_fma_mix*, v_interp_p2_f16). All five SHA-256 of the three boot PSOs in the docs are present, translated, with the right stage.
  • tests/test_library_gfx_shaders_stage.py passes 13/13 on synthetic fixtures, and check_no_game_data is clean.

One more finding in this PR: in slot 57's FSPX branch in d3d12_vulkan_device.cpp, the code base was left at 0 bytes. That affects the 121 graphics programs that read constants embedded in their code; none of them is a boot PSO. Fix: seblessa@dace5ce4e

Take whatever helps; we've stopped active work. AI-assisted (Claude Code).

@kacper-serewis

Copy link
Copy Markdown
Contributor

Restored raster coverage with the original FSPX vertex and pixel modules on Windows/RTX 5070. The presentation VS performs its own vertex fetch through a buffer descriptor loaded via s[0:1]; the transform/resource table is separate at s8. For this bounded three-vertex draw I copied the three records from the title's bound, CPU-mapped IA view (24-byte stride) into the shader arena, built a strided buffer descriptor, supplied its arena offset at s[0:1], and kept the transform-table copy at s8. The descriptor was bound on 473 draws. GPU queries on the presentation PSO went from 0/7 covered with the transform table alone to 7/7 with both. All 474 swapchain readbacks remained black. Independent known-position/diagnostic-fragment controls produced a solid diagnostic color, and known positions with the original fragment shader still produced black in 442 readbacks. These isolate a vertex-input issue and leave the fragment inputs/output open. The local fetch test is specific to this measured draw, not a general ABI implementation. AI-assisted, aggregate counts only.

@kacper-serewis

Copy link
Copy Markdown
Contributor

Followed the final PS sample after restoring vertex fetch on the RTX 5070. In a run with the original vertex and pixel modules, all 403 observed presentation texture descriptors decoded, resolved to a registered bindless image, and identified one live resource. It was a slot-133 offscreen render target: two other PSOs recorded 807 draws into that resource, which was separate from the presented surface. All 403 swapchain readbacks were black. In isolated PS probes keeping the title VS, forwarding either interpolated input produced nonuniform diagnostic pixels (307 and 332 readbacks); forwarding the floating-point texture sample produced 0 nonblack in 331, with 7/7 presentation draws covered. Next measured question is what the two offscreen producers write. AI-assisted; aggregate counts only.

@Yoshi-OOF

Copy link
Copy Markdown

Independent Windows 11 / RTX 5070 Ti / 621.24 run, current rt5-integration 2bd3841 with the measured input-layout decoder from #8754 and existing format/presentation fixes: native census found 1,266 distinct program hashes across 10,241 slot-57 calls. The initial five-module cache served 5 calls; 10,236 failed. All 46 PresentX calls succeeded and all eleven swapchain samples were black. I have now translated and spirv-val validated all 1,266 demanded programs, packed by exact full program hash using #9153 (its ten synthetic tests also pass); the all-demanded-cache runtime comparison is next, not yet evidence of rendered output.

@kacper-serewis

Copy link
Copy Markdown
Contributor

checked: Windows execution follow-up to the bare graphics code-base finding, on the private #8890 f1ab75a stack, RTX 5070 / 616.56.

A synthetic bare vertex program flagged uses_code_base returned E_OUTOFMEMORY and a null PSO. Retaining the matched bare bytes for the existing code-base upload returned S_OK and a PSO. For the GPU check I used a synthetic bare pixel program with an embedded constant and a hand-written SPIR-V-compatible GLSL shader that reads it through the runtime's heap and code-base push constants. The mesh and ordinary vertex draws matched all 4,096 expected pixels. Changing only the embedded constant made the pixel check fail.

On the offline retail stack with 14,185 validated graphics programs, doubling the shader arena from 256 to 512 MiB left all 123 slot-57 E_OUTOFMEMORY results in place. Retaining the bare program bytes at the default arena size converted all 123 into successes (19,313 to 19,436 of 25,450). The E_INVALIDARG count stayed at 6,014. All 408 GPU readbacks with the change were black. The retail comparison uses the same parser, mesh attribution and deferred pipeline creation as the previous boot report. AI-assisted. Aggregate results only.

@thedarkcr0w

Copy link
Copy Markdown

Follow-up on topology 19 (point 2 above), same library (my own 1.0.2.1 copy, counts only):

19 is the console's rectangle list. 385 of the 408 topology-19 records have no input elements. They are blits, down-samples, and tiled lighting and weathering passes. Their vertex programs build the position from the vertex index: indices 0..2 give (-1,1), (-1,-3) and (3,1), and index 3 would give (3,-3) = v1 + v2 - v0. That is the implied fourth corner of a 3-vertex rectangle primitive; read in perimeter order as a quad, it would be a bow-tie. The other 23 records have POSITION (plus COLOR and TEXCOORD) vertex buffers.

The same branch now serves it: thedarkcr0w/Leonida:slot57-gfx-pso, commit 1babf1e02.

  • runtime/src/rect_list_geometry.h generates a geometry module from the vertex module's own outputs. It takes triangles in and emits a strip v0, v1, v2, v1+v2-v0, extending gl_Position and every located output the same way; integer outputs take v0's value. It refuses a module it cannot extend, and names the reason.
  • The Vulkan device builds the pipeline as a triangle list plus that stage.
  • Test: d3d12_slot57_draw pipeline E draws 3 vertices with topology 19 and reads back the rectangle they span (RTX 4090).
  • Over the first 400 translated library vertex programs, the generated stage passes spirv-val --target-env vulkan1.3.

Assumptions to check on a live draw: the title draws 3 vertices per rectangle (vertex counts that are multiples of 4 would contradict it), and the fourth corner is exact in clip space when w is equal on the three vertices.

AI-assisted (Claude Code).

@Impre-visible

Copy link
Copy Markdown

Measured correction to the pipeline blob's input layout (this PR's parser, with #8754), from a retail boot on Linux: with the layout below, slot 57 goes from thousands of refused PSOs to 0 failures on my run.

Setup: Arch Linux, Wine 11.22, GTX 1660 (NVIDIA 620.73.04, 32-wide), my own 1.0.2.1 copy; stack Impre-visible:boot/linux-nvidia-stack@b8b6c374c, which has this PR (f1ab75a.. cherry-picked) and #8754, plus a full fspx_gfx catalog built locally (tools/shader_library.py --stages ps,vs,ms --disasm --carve, then rdna2spirv.py: 16,709 of 18,837 library graphics programs translated and valid).

What I saw with the parser as it is: 141+ slot 57 calls, then the layer refuses most graphics PSOs with "the input layout does not feed COLOR1 (register 1)" (3,416 times in 300 s, about 3,860 with the other semantics) and a few with "vertex attribute format not supported yet" for format values that are ASCII (the bytes of a semantic name).

What the blobs hold, read from 40 boot blobs of 120, 152 and 188 B (1, 2 and 3 elements, 6 distinct layouts): the element array is a serialized D3D12_INPUT_ELEMENT_DESC list.

  • +0x4c: element count (as you have it).
  • +0x50: the first element starts here, not at +0x54. Each element is:
    • u32 name length, counting the NUL (9 for POSITION, 6 for COLOR, 9 for TEXCOORD),
    • the name bytes with their NUL,
    • six u32s in the PC structure's order: SemanticIndex, Format, InputSlot, AlignedByteOffset, InputSlotClass, InstanceDataStepRate (24 bytes).
  • So what looked like a seventh u32 of the 28-byte block is the next element's name length, and the "truncated tail" of the last block is simply the absence of a next length: 0x50 + (4+9+24) + (4+6+24) + (4+9+24) = 188, and 152 and 120 for two and one elements, exactly.
  • Reading the name by its NUL and stepping 28 bytes lands on that length word for every element after the first, which is where the ASCII "formats" came from. It also means field +0x00 is SemanticIndex and +0x08 is InputSlot (the PR has them the other way round; both are 0 in the first boot PSOs, so it does not show there, and it matters for COLOR1).
  • The formats I saw in the first elements: 6, 16 and 2 for POSITION, 28 for COLOR, 16 for TEXCOORD.

Result with that parser (one local commit in the branch above, "slot 57 pipeline blob input layout is a serialized D3D12_INPUT_ELEMENT_DESC list"): in a 240 s run, 0 slot 57 failures, 0 "does not feed", 0 unsupported formats; the title goes from 1 DrawInstanced per frame to 3 (with #7759 for slot 55 also in the stack: 14,841 failed derived-PSO calls become 0). The window is still uniform black.

Not run: this PR's unit tests with the changed parser (device_proxy_test will need its synthetic blob in the same shape).

AI-assisted (Claude). Counts, sizes, offsets in the blob and SDK names only; no game data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.