D3D12.X: console mesh pipeline streams (MS as subobject 24), null stand-in shaders #170
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!170
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/170/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?
@Sr-0w on GitHub · 2026-11-23 18:39 UTC · original
Sr-0w:xbox-mesh-streams→main· +336 −5 · 2 files · 7 commits · closed without mergingStacked on #163 (uses its
pc_format); the first commit here is #163's. Review only the last commit, or merge #163 first.Problem
The retail title's pipeline streams carry their mesh shader as subobject type 24, which is the PC's amplification shader. A diagnostic logging the DXIL program kind of each shader subobject showed:
(kind 13 = mesh).
translated_mesh_streamlooks for type 25, found no MS, and did not translate these pipelines. The stream then reached the driver as it was, and the D3D12 debug layer reportedCreateAmplificationShader: … Shader version provided: ms_6_6and thenCannot deduce Pipeline State type: neither VS, CS nor MS.Second bug, found by the debug layer:
fallback_streamwritesb.as_ptr()for the shaders it drops (&[]), which is Rust's dangling pointer0x1, not null. The driver refused the mesh stand-ins (0x80070057, so the title compiled them in its own call until its watchdog fired), and the debug layer crashed reading0x19.Change
pc_stream_types, applied first indev_create_pipeline_state: renumbers AS/MS subobjects by the program kind in their bytecode (13 → 25, 14 → 24), maps console formats in DSV/RTV subobjects (pc_format, D16S8 → D24S8) and rect-list topology type 19 → TRIANGLE. It returns a copy only when something changed; PC streams are untouched.fallback_stream: a dropped shader gets a null pointer.log_stream_shapes: a stream refused even with stand-ins logs its subobject types and shader kinds (first 6).console_mesh_streams_become_pc_ones.Result
PSO stream rejected … the fallback version too; mesh stand-ins are created.956a476(with #163), the retail title runs at 30 fps likemain, its mesh streams now renumbered (made the PC'sin the log). The device removal I reported earlier came from deferring compute pipelines in #162, not from this PR (bisected).Test plan
cargo test --release -p xcl --lib: 536 passed; onlygpu_wave64_ps_whole_wave_reductionsfails, as onmainXCL_D3D12_DEBUG=1: no stream errors, no debug-layer crash🤖 Generated with Claude Code
GTA VI's pipeline streams carry their mesh shader (DXIL program kind 13) as subobject type 24, the PC's amplification shader. translated_mesh_stream found no MS, did not translate them and the driver refused the stream ("CreateAmplificationShader: ms_6_6", then "neither VS, CS nor MS"). pc_stream_types renumbers AS / MS subobjects by the program kind in their bytecode and makes the stream's console formats (D16S8 DSV / RTV) and rect-list topology type the PC's, before any other path reads the stream. fallback_stream wrote an empty slice's dangling pointer (0x1) for the shaders it drops: the driver refused the mesh stand-ins (0x80070057) and the debug layer crashed reading 0x19. It now writes a null pointer. A stream refused even with stand-ins logs its subobject types and shader kinds. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01XTYmP6vKUQKatSiA2PC95B@TheHoracio on GitHub · 2026-11-23 19:28 UTC · original
Ran the test suite on AMD RDNA3: Radeon RX 7800 XT (16 GB), driver 32.0.32015.7029, Windows 11 Pro 10.0.26300, Rust 1.100.0
x86_64-pc-windows-msvc, DXC 1.9.2602.17. The PR head8f2104bwas tested, with #163's commit included as stacked. No retail data was used, so this only covers regressions.cargo test --workspace --no-fail-fast: 569 passed, 1 failed, 39 ignored, 0SKIPPED.console_mesh_streams_become_pc_onesandconsole_depth_buffers_become_pc_onespass.gpu_wave64_ps_whole_wave_reductions. It fails the same way onmain956a476on this GPU and is fixed by #155. It is unrelated to this PR.@mastrr9 on GitHub · 2026-11-23 20:28 UTC · original
Independent Windows + RTX 5080 GPU verification of
aeadb23f0(merge-basedb5dc26cb) on NVIDIA GeForce RTX 5080 (Blackwell desktop, driver617.42, D3D12 SM 6.6 + mesh shaders, 32-wide waves, Windows 11, Ryzen 7 9800X3D, Rust1.100.0, DXC1.9.2602.17, noXCL_SAMPLE_*, no game files):Build & Tests
cargo build --workspace && cargo test --workspace -- --test-threads=4: 571 passed, 0 failed, 39 ignored (git diff --checkclean; 2 expectedno wave64skips).console_depth_buffers_become_pc_ones,console_mesh_streams_become_pc_ones, andconsole_depth_views_become_pc_ones.Code notes (non-blocking)
pc_stream_typesrenumbering of subobjects24/25by DXBC/DXIL program kind,D16S8 -> D24S8mapping,RECT_LIST -> TRIANGLE, andfallback_streamavoiding dangling0x1for empty shader slices all look clean.db5dc26and bundles thexbox-depth-uavmerge commits alongside the mesh-stream changes; (2) inreal.rs::depth_srv_format(),(r != (view, if stencil { 1 } else { 0 }) || r.0 != view)has a redundant second clause (both evaluate tor.0 != viewsincer.1always matchesstencil), and returningNonewhen a caller passes stencil format22/47leavesPlaneSliceunchanged if it was0.(AI-assisted)
@Kalmarv on GitHub · 2026-11-23 20:28 UTC · original
Tested the stacked PR head
aeadb23f0a4c29c0297392266e3de1cd9453251bdirectly againstmainat956a476bf738a098f39df4f4c8acef682e43030f. Windows x64 MSVC, Rust 1.99.0, RTX 5070 Ti, driver 610.74. Synthetic debug-profile lib tests.hle::d3d12x::tests, including each revision's own testsfallback_streamdrops a GS, serialized (pointer, length)One diagnostics issue remains. In
crates/xcl/src/hle/d3d12x/real.rs:3888, capture runs on the original stream before the rewrite. For the PR's own slot-24/kind-13 fixture,null.rs:370passesasto shader capture, so the by-stage count and optional dump filename identify that mesh program as an amplification shader. Capturing afterpc_stream_typeswould make the report match the stream passed onward. This observation follows the call path in source.The verbatim PR test cannot compile on main because
pc_stream_typesandprogram_kindare absent. The dropped-stage check exercises the same existing function on both revisions. These checks cover stream encoding. I did not submit these synthetic mesh shaders to the driver, merge onto main or run retail content. AI-assisted review.@ivall on GitHub · 2026-11-23 20:57 UTC · original
Closing - main has the pieces in another form. On main (
38b05b7,eaa36b6) the retail game now reaches its first menu at 30 fps with ~19 GB of commit, checked on an RX 9070;cargo test --workspaceis green (548 unit tests). One finding to note: pipelines whose console MS container sits in subobject 24 (no MS subobject) are refused on main on purpose. Translated as the mesh shader they are, which is what this PR does by renumbering them to 25, the title rendered nothing from then on - a black screen on every run on the RX 9070. Refused, it goes on to its menu. What it expects of those pipelines is still open (see HANDOFF). The null stand-in shader pointers (no dangling 0x1) are on main from #195.Pull request closed