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

Merged
NathansDomainSolutions merged 2 commits from upstream-pr/150 into main 2026-11-25 08:34:39 +00:00
NathansDomainSolutions commented 2026-11-25 08:02:03 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by NathansDomainSolutions on 2026-11-25T08:02:03Z.


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

<!-- greyfinch-sync:brcly/TuxBox:issue:6599958361 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/150). Originally posted by [NathansDomainSolutions](https://github.com/NathansDomainSolutions) on 2026-11-25T08:02:03Z. --- ## 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)
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
brcly/TuxBox!150
No description provided.