xshader, d3d12: link mesh programs to their pixel consumer #150

Manually merged
github merged 2 commits from gh-pr/150/head into gh-pr/150/base 2026-11-26 06:34:41 +00:00
Owner

@⁠NathansDomainSolutions on GitHub · 2026-11-25 08:02 UTC · original
NathansDomainSolutions:fix/mesh-pixel-link → main · +107 −11 · 6 files · 2 commits · merged 2026-11-25 08:34 UTC

Summary

Mesh shaders are ProjectScarlett's main geometry path (3,240 recorded mesh requests against 2,114 vertex shaders). Desktop drivers reject a mesh/pixel pipeline when the two signatures disagree on register, mask or component type. vkd3d reports Input signature element ... not compatible with ..., Device11 slot 86 then returns E_INVALIDARG, and the draw is lost.

#117 and #119 reconcile vertex→pixel links. This PR covers mesh→pixel links, which upstream doesn't handle yet:

  1. Link mesh programs to their pixel consumer. On a signature failure the runtime submits a .link request with the mesh as producer, as it already does for vertex and geometry programs. xshader gives the mesh vertex and primitive outputs the consumer's component types and declares them in the consumer's register order. ms_6_5/ms_6_6 are allowed for linked requests.
  2. Translate the mesh pipeline's pixel stage against the guest root. After linking, the remaining failures were pixel shaders declaring root-less space1 CBVs (b21/b5/b6) that the reflected mesh table didn't cover: dxil-spirv Failed to remap CBV 1:22-style errors. The pixel stage is now translated with the pipeline's guest root signature.

Checks

  • cargo test for tools/shader-compiler (x86_64-unknown-linux-gnu): 197 passed.
  • python -m unittest discover -s tests: 264 tests OK.
  • build.py d3d12 builds.
  • In game (RTX 4070, Proton Experimental, offline, on an earlier base): mesh pipeline signature failures dropped from about 20 per run to 1. These changes are not yet re-run in game on current main.

This may also cover the Failed to remap SRV/CBV 1:N class JeffreyBytes reported on RADV in #1.

AI-assisted: written with Claude Code and reviewed by me.

🤖 Generated with Claude Code

**@⁠NathansDomainSolutions** on GitHub · 2026-11-25 08:02 UTC · [original](https://github.com/brcly/TuxBox/pull/150) `NathansDomainSolutions:fix/mesh-pixel-link` → `main` · +107 −11 · 6 files · 2 commits · merged 2026-11-25 08:34 UTC ## Summary Mesh shaders are ProjectScarlett's main geometry path (3,240 recorded mesh requests against 2,114 vertex shaders). Desktop drivers reject a mesh/pixel pipeline when the two signatures disagree on register, mask or component type. vkd3d reports `Input signature element ... not compatible with ...`, Device11 slot 86 then returns `E_INVALIDARG`, and the draw is lost. #117 and #119 reconcile vertex→pixel links. This PR covers mesh→pixel links, which upstream doesn't handle yet: 1. **Link mesh programs to their pixel consumer.** On a signature failure the runtime submits a `.link` request with the mesh as producer, as it already does for vertex and geometry programs. xshader gives the mesh vertex and primitive outputs the consumer's component types and declares them in the consumer's register order. `ms_6_5`/`ms_6_6` are allowed for linked requests. 2. **Translate the mesh pipeline's pixel stage against the guest root.** After linking, the remaining failures were pixel shaders declaring root-less space1 CBVs (b21/b5/b6) that the reflected mesh table didn't cover: dxil-spirv `Failed to remap CBV 1:22`-style errors. The pixel stage is now translated with the pipeline's guest root signature. ## Checks - `cargo test` for tools/shader-compiler (x86_64-unknown-linux-gnu): 197 passed. - `python -m unittest discover -s tests`: 264 tests OK. - `build.py d3d12` builds. - In game (RTX 4070, Proton Experimental, offline, on an earlier base): mesh pipeline signature failures dropped from about 20 per run to 1. These changes are not yet re-run in game on current main. This may also cover the `Failed to remap SRV/CBV 1:N` class JeffreyBytes reported on RADV in #1. AI-assisted: written with Claude Code and reviewed by me. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Desktop drivers reject a mesh/pixel pipeline whose signatures disagree on
register, mask or component type (vkd3d: "Input signature element ... not
compatible with ..."); slot 86 then returns E_INVALIDARG and the draw is lost.
Mesh shaders are the title's main geometry path (3,240 of the recorded
requests, against 2,114 vertex shaders).

On that failure the runtime now submits a .link request with the mesh as
producer, as it already does for vertex and geometry programs. xshader gives
mesh vertex and primitive outputs the consumer's component types and declares
them in the consumer's register order.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 06:34:39 +00:00
github manually merged commit 8a2c01ec5f into gh-pr/150/base 2026-11-26 06:34:41 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.