Skip to content

d3d12: take console subobject types 24/23 as VS/HS in streams without MS - #8815

Open
LooperSalty wants to merge 1 commit into
ItsNotRexed:mainfrom
LooperSalty:d3d12-console-vs-hs-subobjects
Open

LooperSalty wants to merge 1 commit into
ItsNotRexed:mainfrom
LooperSalty:d3d12-console-vs-hs-subobjects

Conversation

@LooperSalty

@LooperSalty LooperSalty commented Nov 23, 2026 •

Copy link
Copy Markdown

Claimed in: #8504 (comment)

Depends on: none

What and why

Slot 86 pipeline streams carry the console VS as subobject type 24 and the HS as type 23 (read statically by @TreXito in #8186: when the VS object carries a certain pair of flag bits, the title writes the VS position as 24, and the HS position as 23 if an HS exists). parse_pipeline_stream took 24 as an amplification shader and refused 23 as an unknown type, so create_graphics refused those PSOs.

  • Without an MS subobject, 24 is now taken as the VS and 23 as the HS, when those slots are empty (map_console_stages, after the parse loop).
  • A stream with MS keeps today's path: 24 stays an amplification shader (refused by create_graphics), 23 stays an unknown type (E_INVALIDARG). A slot already holding a real VS or HS keeps the old behaviour too.
  • The remap is logged once.

Thanks @TreXito for the static reading in #8186.

Tested

Windows 11 26300, RTX 4070 SUPER (driver 610.88), MSVC RelWithDebInfo, base main 867d922f.

  • d3d12_mesh_test, new cases placed before the mesh-extension early return so they run without VK_EXT_mesh_shader: 24 alone → PSO created; 24 + 23 → E_NOTIMPL (HS not built, see Limits); 23 with a real VS → refused; 24 with a real VS → not remapped. The new "24 alone" case failed before the change (line 202) and passes now. The existing MS cases (23 → E_INVALIDARG, AS + MS → E_NOTIMPL) are unchanged.
  • Full ctest on this branch: 263/266. Failures: d3d12_vulkan_device, d3d12_depth_resolve, d3d12_indirect_rt, which also fail on main dde82f27 on this machine (main 867d922f not re-run).
  • Retail 1.0.2.1 boot into the frame loop (own copy, the title's shaders translated, main dde82f27 + the open boot-path PRs): at least 2,048 graphics PSOs in 150 s arrive with type 24, no VS and no MS (PS present, triangle topology). With this exact commit on the same local stack: refused CreatePipelineState 3,140 → 219, created 54,282 → 57,203 (2,921 more), out of 57,423 calls in both runs; remap logged once. See the measurement comment below (an earlier "602 → 219" compared two different stacks).

Limits

Slot numbers and counts only, no game data. AI-assisted (Claude Code).

cc @ItsNotRexed

Slot 86 pipeline streams carry the console VS as subobject type 24 and
the HS as 23 (read statically by TreXito, Leonida#8186). parse_pipeline_stream
took 24 as an amplification shader and refused 23 as an unknown type, so
create_graphics refused those PSOs.

A stream with no MS subobject has no mesh stage, so there 24 is taken as
the VS and 23 as the HS, when those slots are empty. A stream with MS keeps
the mesh path unchanged: 24 stays an AS (refused), 23 is an unknown type.
The remap is logged once.

The HS is not built yet, so a stream with 23 is E_NOTIMPL, not created.

Tests: d3d12_mesh covers 24 alone (created), 24+23 and 23 with a VS
(E_NOTIMPL), and 24 with a real VS (not remapped, E_NOTIMPL).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LwHrL5Lxc1rum25b6tnpo8

@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.

  • Excellent resolution for retail console graphics pipeline streams (slot 86):
    • In streams lacking a Mesh Shader (MS) subobject, cleanly remaps console subobject type 24 → VS and 23 → HS into vacant slots.
    • Streams containing MS preserve the mesh pipeline path intact (type 24 remaining AS).
    • Unblocks retail PSO creation across thousands of graphics shaders that previously failed with unrecognised subobject types.
  • Regression tests in \d3d12_mesh_test\ cover standalone type 24, combinations with HS, and negative controls.
  • Clean-room check and \git diff --check\ pass.

LGTM!

@lohant27-netizen

Copy link
Copy Markdown

Tested 8e8c5dfa1 on Windows 11 (10.0.26300), NVIDIA GeForce RTX 5070 (driver 32.0.16.2101, subgroup 32), MSVC with SDK 10.0.26100, Release, merged onto main 867d922f0 together with #8815, #8814, #8809, #8784, #8783 and #8813 (no conflicts): pass.

@smowlyy

smowlyy commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Verified head 8e8c5dfa1 merged onto main (867d922f0) on native Windows 11 (10.0.26300.9974, MSVC 19.44, RelWithDebInfo, NVIDIA GeForce RTX 5060 Ti, driver 610.88, Vulkan 1.4.341):

  • python -I scripts/check_no_game_data.py on both changed files: clean (exit 0)
  • cmake --build runtime/build --target d3d12_mesh_test --parallel: built cleanly
  • .\runtime\build\d3d12_mesh_test.exe: passed (console stream subobjects 24 and 23 remapped to VS and HS (no mesh subobject); D3D-29: mesh tier 1; mesh and VS PSOs from pipeline state streams (9 refused as invalid, 2 as not implemented); DispatchMesh over X, Y and Z and a stream VS draw matched all 4096 pixels)

AI-assisted.

@LooperSalty

Copy link
Copy Markdown
Author

Correction of the measurement in the description. The "602 → 219" figure compared two different local stacks. Re-measured with this exact commit (8e8c5dfa, cherry-picked onto the same local stack, nothing else changed) on the retail 1.0.2.1 boot (native Windows 11, RTX 4070 SUPER 610.88, Vulkan backend, 26.5k translated shaders, LEONIDA_STUB_PIPELINES=1), counting CreatePipelineState results in the d3d12 trace over the whole creation phase (57,423 calls in both runs):

  • without the commit: 54,282 created, 3,140 refused (at least 2,048 of them are "no MS, no VS, PS present" streams, i.e. type 24)
  • with the commit: 57,203 created, 219 refused, so 2,921 more PSOs are created
  • the remap line is logged once; no "amplification shaders are not supported" refusal remains in the run

The remaining 219 have other causes (e.g. depth-bounds, subobject 21), not looked into here. Both runs end in the same unrelated host AV (null write, caller game+0x5ebea38) about 40 s in, after 4 PresentX; the PSO counts above cover the full creation phase, which completes before that. Single run per variant. Sorry for the wrong number. AI-assisted (Claude Code).

@ethandepstein-del

Copy link
Copy Markdown

Independent Windows + RTX 5080 GPU verification of 8e8c5dfa1 (merge-base 867d922f0) on NVIDIA GeForce RTX 5080 (Blackwell, desktop, NVIDIA driver 617.42, Vulkan API 1.4.351, Vulkan SDK 1.4.363.0, MSVC 19.44.35230.0, Windows 11, Ryzen 7 9800X3D, DISABLE_RTSS_LAYER=1, DISABLE_VULKAN_OBS_CAPTURE=1, no game files):

Build & Tests

  • scripts/build_runtime.ps1 (CMake + Ninja, RelWithDebInfo, -DLEONIDA_REQUIRE_VULKAN=ON): OK (git diff --check clean).
  • d3d12_mesh_test.exe: PASS (D3D-29: mesh tier 1; mesh and VS PSOs from pipeline state streams (9 refused as invalid, 2 as not implemented); DispatchMesh over X, Y and Z and a stream VS draw matched all 4096 pixels; ... statistics queries around mesh draws resolve).
  • ctest -R "d3d12_mesh|d3d12_vulkan_device|d3d12_draw|d3d12_translated_draw":
    • d3d12_mesh: PASS (0.40s)
    • d3d12_draw: PASS (0.28s)
    • d3d12_translated_draw: PASS (0.28s)
    • d3d12_vulkan_device: pre-existing baseline failure (line 6574: tiles == 1, identical to main 867d922f0, unrelated to this PR).

Code check

  • map_console_stages() remapping for !out.has_ms (24 → g.VS, 23 → g.HS, duplicate/conflict → E_INVALIDARG) and out.has_ms (24 stays AS, 23 → E_INVALIDARG) looks clean and matches the new test cases.
  • Minor non-blocking note: an empty {nullptr, 0} subobject of type 23 sets out.has_graphics_stage = true unconditionally (whereas stage(g.HS) checks for non-empty bytecode), though it is still rejected downstream.

(AI-assisted)

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.

5 participants