D3D12.X: no VS, input layout or topology from the title in a mesh pipeline #1936

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

@⁠mastrr9 on GitHub · 2026-11-24 23:43 UTC · original
mastrr9:fix/d3d12x-mesh-stream-strip-forbidden-subobjects → main · +121 −3 · 1 files · 1 commits · draft

translated_mesh_stream builds XCL's PC mesh pipeline and then copied almost every other subobject of the title's stream into it, including VS / DS / HS / GS / CS, input layout, strip cut value, stream output and primitive topology type. D3D12 allows none of these in a mesh pipeline, so CreatePipelineState can fail with E_INVALIDARG (0x80070057), and a console VS or GS among them reached the driver as console bytecode. The copy now leaves them out.

Draft: the head commit has not been built or tested yet.

What is in it

  • hle/d3d12x/real.rs: mesh_stream_state copies only the state a mesh pipeline may set
  • the same file, mesh_stream_state_tests: one test of what is kept, one GPU test that creates the pipeline from a stream naming a VS, input layout, strip cut value and line topology

Tested
These runs are from before the final rebase, on a combined branch (01db80a, based on main e9e94ce; it holds this change plus four other changes), not on this PR's head commit.

  • Windows 11 x64, NVIDIA GeForce RTX 5080 16 GB, cargo test debug build. Driver, CPU and Rust versions were not recorded.
  • XCL_REQUIRE_GPU=mesh, cargo test -p xcl --lib mesh_stream_state_tests -- --nocapture --test-threads=1: 2 passed, 0 failed; the GPU test ran on the adapter (not skipped).
  • real.rs is unchanged between e9e94ce and f5136a6, and the commit's patch is the same after the rebase.

Regression run
Not run: there are no xcl-smoke blocks for this change.

Not tested

  • The head commit (rebased onto main f5136a6) has not been built or tested: it was rebased on macOS, with no Rust toolchain.
  • cargo test --workspace was not run for this change on its own.
  • AMD and Intel GPUs; release build.
  • A run of the new GPU test without the fix.
  • Overlaps #1937 on one point: it also stops copying the title's topology type here, but declares TRIANGLE where this change leaves the type out. The two conflict in real.rs; #1937 does not remove the other subobjects. If it lands first, this needs a rebase that keeps its TRIANGLE declaration, with the unit test adjusted.

AI use

  • Code and tests: written by Claude Opus 5.5 in an agent session (Duet) with no Windows or GPU.
  • RTX 5080 test runs above: a Claude Sonnet 5.5 agent.
  • Overlap check, rebase and this description: Claude Code, Claude Sonnet 5.5.
**@⁠mastrr9** on GitHub · 2026-11-24 23:43 UTC · [original](https://github.com/xcl-dev/xcl/pull/1936) `mastrr9:fix/d3d12x-mesh-stream-strip-forbidden-subobjects` → `main` · +121 −3 · 1 files · 1 commits · draft `translated_mesh_stream` builds XCL's PC mesh pipeline and then copied almost every other subobject of the title's stream into it, including VS / DS / HS / GS / CS, input layout, strip cut value, stream output and primitive topology type. D3D12 allows none of these in a mesh pipeline, so `CreatePipelineState` can fail with `E_INVALIDARG` (`0x80070057`), and a console VS or GS among them reached the driver as console bytecode. The copy now leaves them out. Draft: the head commit has not been built or tested yet. **What is in it** - `hle/d3d12x/real.rs`: `mesh_stream_state` copies only the state a mesh pipeline may set - the same file, `mesh_stream_state_tests`: one test of what is kept, one GPU test that creates the pipeline from a stream naming a VS, input layout, strip cut value and line topology **Tested** These runs are from before the final rebase, on a **combined branch** ([`01db80a`](https://github.com/mastrr9/xcl/commit/01db80a), based on main `e9e94ce`; it holds this change plus four other changes), **not on this PR's head commit**. - Windows 11 x64, NVIDIA GeForce RTX 5080 16 GB, `cargo test` debug build. Driver, CPU and Rust versions were not recorded. - `XCL_REQUIRE_GPU=mesh`, `cargo test -p xcl --lib mesh_stream_state_tests -- --nocapture --test-threads=1`: 2 passed, 0 failed; the GPU test ran on the adapter (not skipped). - `real.rs` is unchanged between `e9e94ce` and `f5136a6`, and the commit's patch is the same after the rebase. **Regression run** Not run: there are no `xcl-smoke` blocks for this change. **Not tested** - The head commit (rebased onto main `f5136a6`) has not been built or tested: it was rebased on macOS, with no Rust toolchain. - `cargo test --workspace` was not run for this change on its own. - AMD and Intel GPUs; release build. - A run of the new GPU test without the fix. - Overlaps #1937 on one point: it also stops copying the title's topology type here, but declares `TRIANGLE` where this change leaves the type out. The two conflict in `real.rs`; #1937 does not remove the other subobjects. If it lands first, this needs a rebase that keeps its `TRIANGLE` declaration, with the unit test adjusted. **AI use** - Code and tests: written by Claude Opus 5.5 in an agent session (Duet) with no Windows or GPU. - RTX 5080 test runs above: a Claude Sonnet 5.5 agent. - Overlap check, rebase and this description: Claude Code, Claude Sonnet 5.5.
translated_mesh_stream builds the PC mesh pipeline from XCL's RS, pass-through
MS and PS and then copied every other subobject of the title's stream as it
was, skipping only RS, PS, cached PSO, AS and MS. So a VS, DS, HS, GS or CS
the title named, an input layout, an index buffer strip cut value, stream
output and its primitive topology type all went into the mesh pipeline.

D3D12's mesh shader rules allow none of these in a mesh pipeline (no other
shader stage, input assembler and stream output disabled, no input layout or
index buffer): a stream that sets one is refused (E_INVALIDARG), which the title then gets
from CreatePipelineState for a pipeline XCL had translated, or names state a
mesh pipeline has no use for.
A console VS or GS among them also reached the driver as console bytecode,
which the module keeps out of the driver everywhere else. The topology type
named the title's primitives; the pass-through always makes triangles, and
the VS+GS mesh pipeline (translated_gs_pso) and the runner's mesh pipelines
already carry none.

The copy is now mesh_stream_state, which leaves these out and keeps the rest
(blend, rasteriser, depth, formats as the PC's, sample desc, node mask,
flags, view instancing).

Tests: a unit test of the subobjects kept and their formats, and a GPU test
that creates the mesh pipeline from a stream that also names a (PC DXIL) VS,
an input layout, a strip cut value and a line topology type.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:10:28 +00:00
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 02:41 UTC · original

Verification on RTX 3060 Ti (Windows 11): merge conflict with current main — needs a rebase before it can be tested.

**@⁠DavidM1911** on GitHub · 2026-11-25 02:41 UTC · [original](https://github.com/xcl-dev/xcl/pull/1936#issuecomment-7151044178) Verification on RTX 3060 Ti (Windows 11): **merge conflict with current `main`** — needs a rebase before it can be tested.
This pull request has changes conflicting with the target branch.
  • crates/xcl/src/hle/d3d12x/real.rs
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/1936/head:github-bot/gh-1936'
git switch 'github-bot/gh-1936'

Merge

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