d3d12: a pipeline stream the PC numbering cannot read is read with the console's, its 24 the mesh shader (D3D-CONSOLE-STREAM-ENUM) #496

Open
github-bot wants to merge 1 commit from github-bot/gh-496 into main AGit
Owner

@⁠Kokonotcu on GitHub · 2026-11-24 06:27 UTC · original
Kokonotcu:pr/console-stream-enum → main · +69 −2 · 2 files · 1 commits · open

Claim: D3D-CONSOLE-STREAM-ENUM (#14).

What was wrong: the console's pipeline-state subobject enum has no gap at 23, where the PC's has one. The PC numbering is VIEW_INSTANCING 22, AS 24, MS 25, DEPTH_STENCIL2 26, and so on. As a result, the title's mesh-shader subobject is 24, which the PC reading takes for an amplification shader. The layer refuses an AS, so those PSOs fail as unsupported.

docs/retail_boot_intel_host.md section 3 measured this in a retail boot: 430 such PSOs were refused, and each one's 24 carried a payload the size of one of the title's mesh-shader containers (430 of 430; 280 of those sizes match no vertex shader, against the VS reading proposed on the old repository's issue 8815). The translator makes 9,282 of the title's 26,503 shaders mesh shaders.

What changed: CreatePipelineState reads a stream again with the console numbering (a type from 23 on is the PC type one above it) when either:

  • the PC reading refuses it, or
  • the PC reading leaves it with an AS and no MS, which is no valid PC stream.

It takes the console reading only when that reading holds an MS and no AS. A stream the PC reading accepts is never read differently, so no PSO that builds today changes. LEONIDA_XS_STREAM_ENUM=pc turns it off. The first renumbered stream is logged once.

What this assumes beyond the measurement: that the console shifts every type from 23 on, not only the mesh shader. Only 24 is measured. The shift of 25 and up is the reading under which a 24 = MS is consistent; it is used only for streams that fail today anyway.

Tests (d3d12_mesh_test, new checks):

  • A console stream with the MS as 24 makes a mesh PSO.
  • So does the MS as 24 with RASTERIZER1 as 26 (the PC reading refuses that one as a truncated DEPTH_STENCIL2).
  • An MS (25) with a 24 in PC numbering is still refused as an AS.
  • The existing 9 invalid and 2 not-implemented refusals are unchanged, and the draws still match all 4096 pixels.

Tested on Windows 10, i7-11800H, RTX 3080 Laptop (NVIDIA driver), on main 8f481cf16: d3d12_mesh passes. Not yet tested on a retail boot.

🤖 Generated with Claude Code

**@⁠Kokonotcu** on GitHub · 2026-11-24 06:27 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/496) `Kokonotcu:pr/console-stream-enum` → `main` · +69 −2 · 2 files · 1 commits · open Claim: D3D-CONSOLE-STREAM-ENUM (#14). **What was wrong:** the console's pipeline-state subobject enum has no gap at 23, where the PC's has one. The PC numbering is VIEW_INSTANCING 22, AS 24, MS 25, DEPTH_STENCIL2 26, and so on. As a result, the title's mesh-shader subobject is 24, which the PC reading takes for an amplification shader. The layer refuses an AS, so those PSOs fail as unsupported. `docs/retail_boot_intel_host.md` section 3 measured this in a retail boot: 430 such PSOs were refused, and each one's 24 carried a payload the size of one of the title's mesh-shader containers (430 of 430; 280 of those sizes match no vertex shader, against the VS reading proposed on the old repository's issue 8815). The translator makes 9,282 of the title's 26,503 shaders mesh shaders. **What changed:** `CreatePipelineState` reads a stream again with the console numbering (a type from 23 on is the PC type one above it) when either: - the PC reading refuses it, or - the PC reading leaves it with an AS and no MS, which is no valid PC stream. It takes the console reading only when that reading holds an MS and no AS. A stream the PC reading accepts is never read differently, so no PSO that builds today changes. `LEONIDA_XS_STREAM_ENUM=pc` turns it off. The first renumbered stream is logged once. What this assumes beyond the measurement: that the console shifts every type from 23 on, not only the mesh shader. Only 24 is measured. The shift of 25 and up is the reading under which a 24 = MS is consistent; it is used only for streams that fail today anyway. **Tests (`d3d12_mesh_test`, new checks):** - A console stream with the MS as 24 makes a mesh PSO. - So does the MS as 24 with RASTERIZER1 as 26 (the PC reading refuses that one as a truncated DEPTH_STENCIL2). - An MS (25) with a 24 in PC numbering is still refused as an AS. - The existing 9 invalid and 2 not-implemented refusals are unchanged, and the draws still match all 4096 pixels. Tested on Windows 10, i7-11800H, RTX 3080 Laptop (NVIDIA driver), on `main` `8f481cf16`: `d3d12_mesh` passes. Not yet tested on a retail boot. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The console's pipeline-state subobject enum has no gap at 23 where the PC's has one (PC: VIEW_INSTANCING 22, AS 24, MS 25, DEPTH_STENCIL2 26, ...), so the title's mesh-shader subobject is 24, which the PC reading takes for an amplification shader. A retail boot (docs/retail_boot_intel_host.md, section 3) refused 430 such PSOs as unsupported; each one's 24 carried a payload the size of one of the title's mesh-shader containers (430 of 430, 280 of those sizes match no vertex shader). The translator makes 9,282 of the title's 26,503 shaders mesh shaders.

CreatePipelineState now reads a stream again with the console numbering (a type from 23 on is the PC type one above it) when the PC reading refuses it or leaves it with an AS and no MS, and takes that reading when it holds an MS and no AS. A stream the PC reading accepts is never read differently, so no PSO that builds today changes. LEONIDA_XS_STREAM_ENUM=pc turns it off.

d3d12_mesh_test: console streams (MS as 24; MS as 24 with RASTERIZER1 as 26, which the PC reading refuses as a truncated DEPTH_STENCIL2) make mesh PSOs; an MS with a 24 in PC numbering is still refused as an AS; the 9 invalid and 2 not-implemented refusals are unchanged; the draws still match all 4096 pixels (RTX 3080 Laptop).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:04:06 +00:00
Author
Owner

@⁠towade on GitHub · 2026-11-24 13:33 UTC · original

The retail-boot test the description lists as not done, on Windows 11 26300, MSVC 19.44, own 1.0.2.1 copy, AMD Radeon RX 9070 XT (RDNA4, 32.0.32029.2010): pass.

Base: #321 at e0d4fd2b8 + #511 (LEONIDA_LAZY_PSO=1, LEONIDA_ARENA_MB=2048, so the boot gets past the up-front PSOs on AMD) + #588 (format 118), all cherry-picked, --trace --trace-d3d12, the executable's network blocked. Then this PR's 30dd1a450 on top (no conflict). Counts only.

without this PR with it
amplification shaders are not supported (the game has none) lines 98 (distinct sizes) 0
CreatePipelineState unsupported 1,443 615
D3D12 calls up to the run's end (the title's int3, unchanged) 84,737 84,657

The runtime logs a pipeline stream the PC numbering cannot read ... is read with the console's subobject numbering (its 24 is the mesh shader) once, and no PSO the run made before fails now (failed stays at 2). The remaining 615 refusals are not this PR's: most are pipeline-library compute programs my work folder doesn't have translated (1,538 of 2,684), the rest the rectangle-list/#511 interaction I described on #511.

d3d12_mesh_test: passes on the RX 9070 XT; on an Intel UHD 770 it exits 77 (no VK_EXT_mesh_shader), as expected.

Not checked: whether the renumbered streams draw correctly (the run doesn't get far enough into frames to tell).

AI-assisted (Claude Code).

**@⁠towade** on GitHub · 2026-11-24 13:33 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/496#issuecomment-7133002704) The retail-boot test the description lists as not done, on Windows 11 26300, MSVC 19.44, own 1.0.2.1 copy, AMD Radeon RX 9070 XT (RDNA4, 32.0.32029.2010): **pass**. **Base:** #321 at `e0d4fd2b8` + #511 (`LEONIDA_LAZY_PSO=1`, `LEONIDA_ARENA_MB=2048`, so the boot gets past the up-front PSOs on AMD) + #588 (format 118), all cherry-picked, `--trace --trace-d3d12`, the executable's network blocked. Then this PR's `30dd1a450` on top (no conflict). Counts only. | | without this PR | with it | |---|---:|---:| | `amplification shaders are not supported (the game has none)` lines | 98 (distinct sizes) | **0** | | `CreatePipelineState` `unsupported` | 1,443 | **615** | | D3D12 calls up to the run's end (the title's `int3`, unchanged) | 84,737 | 84,657 | The runtime logs `a pipeline stream the PC numbering cannot read ... is read with the console's subobject numbering (its 24 is the mesh shader)` once, and no PSO the run made before fails now (`failed` stays at 2). The remaining 615 refusals are not this PR's: most are pipeline-library compute programs my work folder doesn't have translated (1,538 of 2,684), the rest the rectangle-list/#511 interaction I described on #511. **`d3d12_mesh_test`:** passes on the RX 9070 XT; on an Intel UHD 770 it exits 77 (no `VK_EXT_mesh_shader`), as expected. Not checked: whether the renumbered streams draw correctly (the run doesn't get far enough into frames to tell). AI-assisted (Claude Code).
Author
Owner

@⁠otaviosza on GitHub · 2026-11-24 15:39 UTC · original

Tested on native Windows: Windows 10 22H2 (19045), NVIDIA GeForce RTX 3060, driver 610.88 (32.0.16.1088), MSVC 19.44, own 1.0.2.1 copy, LEONIDA_D3D12=vulkan, LEONIDA_LAZY_PSO=1. Runtime = #321 + #470 + #588 + #461 + #511 + this PR (cherry-picked cleanly); shaders built with main + #387 + #583 + #674 + #647 + #593.

  • Without this PR the log has four amplification shaders are not supported (the game has none) refusals (stream payloads 2580–2796 bytes) shortly before the run ends.
  • With it, those refusals are gone and the log shows the fallback once: a pipeline stream the PC numbering cannot read (an AS and no MS, or refused) is read with the console's subobject numbering (its 24 is the mesh shader). No other new failure.
  • The run still ends at about 15 s with the same title-side access violation as without the PR, so that stop is not caused by these refused mesh PSOs (details in #14).
**@⁠otaviosza** on GitHub · 2026-11-24 15:39 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/496#issuecomment-7136385651) Tested on native Windows: Windows 10 22H2 (19045), NVIDIA GeForce RTX 3060, driver 610.88 (32.0.16.1088), MSVC 19.44, own 1.0.2.1 copy, `LEONIDA_D3D12=vulkan`, `LEONIDA_LAZY_PSO=1`. Runtime = #321 + #470 + #588 + #461 + #511 + this PR (cherry-picked cleanly); shaders built with `main` + #387 + #583 + #674 + #647 + #593. - Without this PR the log has four `amplification shaders are not supported (the game has none)` refusals (stream payloads 2580–2796 bytes) shortly before the run ends. - With it, those refusals are gone and the log shows the fallback once: `a pipeline stream the PC numbering cannot read (an AS and no MS, or refused) is read with the console's subobject numbering (its 24 is the mesh shader)`. No other new failure. - The run still ends at about 15 s with the same title-side access violation as without the PR, so that stop is not caused by these refused mesh PSOs (details in #14).
Author
Owner

@⁠Snooozs on GitHub · 2026-11-24 17:01 UTC · original

Independent check. Windows 10 Pro 22H2 (19045), VS 2022 RelWithDebInfo, Vulkan SDK 1.4.363.0, LEONIDA_VK_VALIDATION=1, merged onto main 82a2aabcc without conflicts, test targets rebuilt; RTX 5060 Ti (621.01) and a Ryzen 7 7700 iGPU (1002:164E, AMD 31.0.22044.1). On the iGPU the pipeline tests fail on plain main too (128 push-constant bytes), so they say nothing there.

  • RTX 5060 Ti: d3d12_mesh_test passes on main and with this PR, with the new line console-numbered streams: 2 mesh PSOs (MS as 24, RASTERIZER1 as 26); 0 VUID lines.

Reading note: the comment above parse_pipeline_stream says the console numbering is used "only for a stream the PC reading leaves with an AS and no MS", but CreatePipelineState also retries any stream the PC reading refuses (FAILED(parsed)), as its own comment says. The second reading must still hold an MS and no AS, so I see no valid PC stream changing, but the first comment should say it.

Synthetic tests only, no game files. AI-assisted (Claude Code): I read the diff and ran the tests on that machine.

**@⁠Snooozs** on GitHub · 2026-11-24 17:01 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/496#issuecomment-7138578377) Independent check. Windows 10 Pro 22H2 (19045), VS 2022 RelWithDebInfo, Vulkan SDK 1.4.363.0, `LEONIDA_VK_VALIDATION=1`, merged onto `main` 82a2aabcc without conflicts, test targets rebuilt; RTX 5060 Ti (621.01) and a Ryzen 7 7700 iGPU (1002:164E, AMD 31.0.22044.1). On the iGPU the pipeline tests fail on plain `main` too (128 push-constant bytes), so they say nothing there. - RTX 5060 Ti: `d3d12_mesh_test` passes on `main` and with this PR, with the new line `console-numbered streams: 2 mesh PSOs (MS as 24, RASTERIZER1 as 26)`; 0 VUID lines. Reading note: the comment above `parse_pipeline_stream` says the console numbering is used "only for a stream the PC reading leaves with an AS and no MS", but `CreatePipelineState` also retries any stream the PC reading refuses (`FAILED(parsed)`), as its own comment says. The second reading must still hold an MS and no AS, so I see no valid PC stream changing, but the first comment should say it. Synthetic tests only, no game files. AI-assisted (Claude Code): I read the diff and ran the tests on that machine.
This pull request has changes conflicting with the target branch.
  • runtime/shims/d3d12_vulkan_device.cpp
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/496/head:github-bot/gh-496'
git switch 'github-bot/gh-496'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-496'
git switch 'github-bot/gh-496'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-496'
git switch 'github-bot/gh-496'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-496'
git switch 'main'
git merge --squash 'github-bot/gh-496'
git switch 'main'
git merge --ff-only 'github-bot/gh-496'
git switch 'main'
git merge 'github-bot/gh-496'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.