Skip to content

D3D12.X: a console MS in the AS slot is translated as the mesh shader it is - #541

Open
ryosen0 wants to merge 3 commits into
ivall:mainfrom
ryosen0:as-slot-ms
Open

ryosen0 wants to merge 3 commits into
ivall:mainfrom
ryosen0:as-slot-ms

Conversation

@ryosen0

@ryosen0 ryosen0 commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

A retail title's minimap pipelines carry their console MS container in the AS subobject with no MS subobject. translated_mesh_stream refuses them today: translated, the title had rendered nothing from then on (a black screen every run), so the refusal was kept as a workaround.

That black screen was the translated mesh shaders failing their ms_6_6 output budget - fixed by the DXC vertex-chunk budget in #304. The slot itself was never the problem. With the budget in place the same shaders translate, the driver accepts the pipelines, and the title keeps rendering.

Stacked on #304 (Stacked on #304); the branch carries its head merge under the change.

What is in it

  • crates/xcl/src/hle/d3d12x/real.rs: mesh_shader_slots(ms_slot, as_slot) - a console MS container alone in the AS slot becomes the MS to translate and is not an AS any more; a real AS (console or PC), an MS already present, or a PC shader in the AS slot are left as they are. The refusal block is removed; one xlog_info line names the moved shader.
  • Unit test a_console_ms_in_the_as_slot_is_the_mesh_shader covers all five cases (fails without the change: the MS-in-AS case returned None).

Tested

  • RTX 3060 Ti 8 GB (wave32), Ryzen 7 9800X3D, driver 32.0.16.1742, Windows 11, release build.
  • cargo build --workspace, then cargo test --workspace --no-fail-fast -- --test-threads=1: 682 passed, 0 failed, 41 ignored; GPU SKIPPED lines: 2 (gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware - no wave64 on this adapter).
  • With --test-threads=4 the lib suite showed 8 GPU-test failures (gpu_sparse_vram_descriptors_buffers_and_xmem, three gpu_wave64_*, four title_textures/vram tests panicking on a poisoned lock). All 13 pass serially; the same failure chain is documented on unmodified main in D3D12.X: show live FPS in the game window title #516's report (GPU-lock contention under parallel test threads, not this change). Serial counts above are the real coverage.
  • Retail run (GTA VI 1.0.2.1, XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_RUN_SECONDS=240, this head over Recompiler: the mesh pass-through budget accounts DXC’s vertex chunks #304): clean exit, 240 s at a steady 60 presents / 2 s from t≈40 s to the end (30 fps), no dip, no device removal. The log shows the minimap shaders (d7c434f73b4b811c, 8659e9d5df3e2a9e, …) translated as MS from t≈36 s and the title rendering on: 780 draws / 2 s steady after t≈80 s. Before this change these pipelines were refused on every run.

Not tested

Regression run
Main 508a0c7:

xcl-smoke v1
commit: 508a0c74d7c0625d6d2de8d24494e69dc2e1926f
gpu: NVIDIA GeForce RTX 3060 Ti
title: ScarlettGame
seconds: 90
exit: 0x0
frames shown: 1294 (PresentX 1294)
presents per 2 s (last 3): 12 12 12
device removals: 0
crashes: 0
peak commit: 14602 MB

Head ce41f94:

xcl-smoke v1
commit: ce41f941f388dab929c46afcd02f36ac1dffe8f7
gpu: NVIDIA GeForce RTX 3060 Ti
title: ScarlettGame
seconds: 90
exit: 0x0
frames shown: 1271 (PresentX 1272)
presents per 2 s (last 3): 14 13 14
device removals: 0
crashes: 0
peak commit: 14928 MB

AI use
GPT-6.2 Astra (API model selector) in DSH wrote the change and the test, ran the builds, tests and runs above, and drafted this description; the human contributor reviewed the diff and the numbers before posting.

A retail title's NGG transform programs (128 vertices / 128 primitives,
21 params + SV_ClipDistance0 = 352 B per vertex) all failed ms_6_6 with
"vertex plus primitive output size is greater than 32768": the split
budget divided 32768 by the stride, but DXC accounts whole chunks of 32
vertices even when fewer are declared - verts[78] at 352 B is accounted
as 96 (33792 B) and refused. Measured with dxc 1.8.2502 on this machine:
every boundary from 9 to 26 float4 rows agrees with the chunk model.

passthrough_split now floors the vertex budget to a multiple of 32
(capped at 256); the wide records go out in 7 groups of 19 triangles
instead of 5 groups of 26 that DXC refuses. Test: the wide record splits
and compiles, a 96-vertex group at 320 B compiles, a narrow record stays
whole; fails without the change (5 != 7).

Assisted-by: DSH (GPT-6.2 Astra)
… it is

A retail title's minimap pipelines carry their console MS container in the AS
subobject with no MS subobject. They were refused: translated, the title had
rendered nothing from then on. That black screen was the translated mesh
shaders failing their ms_6_6 output budget, fixed by the DXC vertex-chunk
budget (ivall#304); the slot itself was never the problem. With the budget in
place the same shaders translate and the title keeps rendering.

mesh_shader_slots moves the container to the MS slot (and it is not an AS any
more); a real AS, an MS already present, or a PC shader are left as they are.
Unit test covers all five cases.

Assisted-by: DSH (GPT-6.2 Astra)

@shdann shdann left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This stack still has the mesh-output failure from #304. At emit.rs:4734, an 80-vertex, one-triangle record with 22 float4 output rows computes one group in compact mode. At line 4670, the emitter uses that count to choose the original layout and declares 80 vertices. DXC charges for 96 vertices and rejects the shader because the output exceeds 32,768 bytes. I previously verified this with SDK 10.0.26100 DXC. Please carry the layout choice separately from the dispatch group count before enabling these pipelines. See #304 (review) . Reviewed ce41f94 with OpenAI Codex (GPT-6.2 Sol).

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.

2 participants