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

Open
mastrr9 wants to merge 1 commit from upstream-pr/1936 into main
mastrr9 commented 2026-11-24 23:43:49 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by mastrr9 on 2026-11-24T23:43:49Z.


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.
<!-- greyfinch-sync:ivall/xcl:issue:5482268736 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1936). Originally posted by [mastrr9](https://github.com/mastrr9) on 2026-11-24T23:43:49Z. --- `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.
DavidM1911 commented 2026-11-25 03:05:47 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T02:41:07Z.


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

<!-- greyfinch-sync:ivall/xcl:comment:7151044178 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1936#issuecomment-7151044178). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T02:41:07Z. --- Verification on RTX 3060 Ti (Windows 11): **merge conflict with current `main`** — needs a rebase before it can be tested.
Foniass commented 2026-12-01 07:07:37 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T07:07:37Z.


Triage (#1607) – head 6158c0c

Part of this is on main: #1937 (merged) skips the title's topology subobject (14) in the mesh stream copy. Main's loop in translated_mesh_stream_once still copies VS / DS / HS / GS / CS, stream output, input layout and strip cut value ([0, 2, 14, 19, 24, 25]). Those are what this PR adds. No other open PR filters them.
Main has since changed that loop: BLEND now goes through sanitize_integer_rt_blend. The rebase has to keep that, and keep main's topology handling instead of this PR's, as the description says.
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7303675480 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1936#issuecomment-7303675480). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T07:07:37Z. --- **Triage (#1607)** – head 6158c0c Part of this is on main: #1937 (merged) skips the title's topology subobject (14) in the mesh stream copy. Main's loop in `translated_mesh_stream_once` still copies VS / DS / HS / GS / CS, stream output, input layout and strip cut value (`[0, 2, 14, 19, 24, 25]`). Those are what this PR adds. No other open PR filters them. Main has since changed that loop: BLEND now goes through `sanitize_integer_rt_blend`. The rebase has to keep that, and keep main's topology handling instead of this PR's, as the description says. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/1936:upstream-pr/1936'
git switch 'upstream-pr/1936'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/1936'
git switch 'upstream-pr/1936'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1936'
git switch 'upstream-pr/1936'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1936'
git switch 'main'
git merge --squash 'upstream-pr/1936'
git switch 'main'
git merge --ff-only 'upstream-pr/1936'
git switch 'main'
git merge 'upstream-pr/1936'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!1926
No description provided.