composer: make the root signature in code, so it works under Wine without DXC #2449

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

@⁠HyperRamzey on GitHub · 2026-11-29 13:10 UTC · original
HyperRamzey:pr/compose-in-code-root-signature → main · +227 −42 · 2 files · 1 commits · open

What

The composer's HLSL declared its root signature with [RootSignature(RS)]. Wine's builtin d3dcompiler accepts the attribute and leaves the RTS0 part out of the code; vkd3d-proton then fails CreateRootSignature with E_FAIL (no RTS0), the layer falls back to DXC, and on a machine without DXC the composer is never made: the title presents frames but only the base plane is shown, black during loading (#860). This ports #1702's idea with main's corrected shape:

  • the three [RootSignature] attributes, the RS string and the #define are gone from the source;
  • with_signature_description builds a version-1.1 description in code: parameter 0 is one SRV descriptor table (t0, 2 descriptors) for the pixel stage, parameter 1 is 18 32-bit constants at b0 for the pixel stage (main's shadow-lift constants; #605's 1-parameter version left them unbound), plus one static linear/clamp sampler at s0 for all stages;
  • D3D12SerializeVersionedRootSignature -> pipeline::samplers::know_own -> CreateRootSignature;
  • SetGraphicsRootDescriptorTable(0) and SetGraphicsRoot32BitConstants(1) match the parameter order;
  • compile() returns the code bytes through hlsl::compile_for; the now-unused hlsl::blob helper is removed.

Verified in game (Proton-CachyOS, vkd3d-proton)

  • With DXC present: picture up at 30.0 fps / 33.3 ms, 0 two-plane composer not made over 16,210 log lines; no compose refusal line, so Wine's compiler compiled the composer directly.
  • With dxcompiler.dll and dxil.dll moved out of reach: picture again at 30.0 fps, 0 over 4,130 log lines, while another helper shader (card compare) still shows DXC absent by refusing and failing its fallback with 0x80004005. The composer's success is the in-code signature's, not a fallback's.

Test

compose::signature_tests::the_root_signature_matches_the_sources_rs pins the parameter count, types, ranges, register/space, counts, visibilities, the static sampler and the flags, and fails when any is perturbed (sabotage: root_constants(0, 1) turns it red). Passes under Wine.

Resolves / relates

  • Fixes the composer half of #860 (black frames under UMU-Proton); the descriptor-heap half stays with #638/#847.
  • Same failure family as #357 and #1380 (helper shaders whose [RootSignature] Wine drops).
  • Credits #1702, whose explicit composer signature this follows.
**@⁠HyperRamzey** on GitHub · 2026-11-29 13:10 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2449) `HyperRamzey:pr/compose-in-code-root-signature` → `main` · +227 −42 · 2 files · 1 commits · open ## What The composer's HLSL declared its root signature with `[RootSignature(RS)]`. Wine's builtin d3dcompiler accepts the attribute and leaves the `RTS0` part out of the code; vkd3d-proton then fails `CreateRootSignature` with `E_FAIL` (no `RTS0`), the layer falls back to DXC, and on a machine without DXC the composer is never made: the title presents frames but only the base plane is shown, black during loading (#860). This ports #1702's idea with main's corrected shape: - the three `[RootSignature]` attributes, the `RS` string and the `#define` are gone from the source; - `with_signature_description` builds a version-1.1 description in code: parameter 0 is one SRV descriptor table (`t0`, 2 descriptors) for the pixel stage, parameter 1 is 18 32-bit constants at `b0` for the pixel stage (main's shadow-lift constants; #605's 1-parameter version left them unbound), plus one static linear/clamp sampler at `s0` for all stages; - `D3D12SerializeVersionedRootSignature` -> `pipeline::samplers::know_own` -> `CreateRootSignature`; - `SetGraphicsRootDescriptorTable(0)` and `SetGraphicsRoot32BitConstants(1)` match the parameter order; - `compile()` returns the code bytes through `hlsl::compile_for`; the now-unused `hlsl::blob` helper is removed. ## Verified in game (Proton-CachyOS, vkd3d-proton) - With DXC present: picture up at 30.0 fps / 33.3 ms, **0** `two-plane composer not made` over 16,210 log lines; no `compose` refusal line, so Wine's compiler compiled the composer directly. - With `dxcompiler.dll` and `dxil.dll` moved out of reach: picture again at 30.0 fps, **0** over 4,130 log lines, while another helper shader (`card compare`) still shows DXC absent by refusing and failing its fallback with `0x80004005`. The composer's success is the in-code signature's, not a fallback's. ## Test `compose::signature_tests::the_root_signature_matches_the_sources_rs` pins the parameter count, types, ranges, register/space, counts, visibilities, the static sampler and the flags, and fails when any is perturbed (sabotage: `root_constants(0, 1)` turns it red). Passes under Wine. ## Resolves / relates - Fixes the composer half of #860 (black frames under UMU-Proton); the descriptor-heap half stays with #638/#847. - Same failure family as #357 and #1380 (helper shaders whose `[RootSignature]` Wine drops). - Credits #1702, whose explicit composer signature this follows.
The composer's HLSL declared its signature with [RootSignature(RS)].
Wine's d3dcompiler accepts the attribute and leaves the RTS0 part out of
the code, so vkd3d-proton refuses CreateRootSignature with E_FAIL; the
layer falls back to DXC, and without DXC the composer is never made and
the window stays black (#860, #357, #1380).

Take the signature out of the source and build it in code, as #1702
proposed: a 1.1 description with both planes as one SRV table at t0 for
the pixel stage, the 18 plane constants at b0, and one static linear
clamping sampler s0; serialize with D3D12SerializeVersionedRootSignature,
let pipeline::samplers::know_own see the blob, and CreateRootSignature.
The Set calls move to root parameter 0 (descriptor table) and 1
(constants). compile() now returns the code bytes through
hlsl::compile_for, and the unused hlsl::blob helper goes.

Verified in game under Proton-CachyOS: with DXC, 0 "two-plane composer
not made" over 16,210 log lines and the picture at 30 fps; with
dxcompiler.dll/dxil.dll moved away (another helper shader still proves
DXC absent by refusing and failing its fallback), 0 over 4,130 lines and
the picture again. The signature test pins the parameter order, counts
and visibilities and fails when they are perturbed.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 13:11:54 +00:00
Author
Owner

@⁠Dukestar69 on GitHub · 2026-11-29 13:25 UTC · original · approved these changes

Tested locally merged onto main (829188e9).

  • Merge: Clean merge in crates/victory-gpu/src/compose.rs.
  • Tests: cargo test -p victory-gpu --lib compose passed (2 passed; 0 failed, including the new compose::signature_tests::the_root_signature_matches_the_sources_rs test) with 0 new warnings.

Clean programmatic root-signature serialization avoiding DXC dependency under Wine. LGTM.

Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).

**@⁠Dukestar69** on GitHub · 2026-11-29 13:25 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2449#pullrequestreview-6103066062) · **approved these changes** Tested locally merged onto `main` (`829188e9`). - **Merge**: Clean merge in `crates/victory-gpu/src/compose.rs`. - **Tests**: `cargo test -p victory-gpu --lib compose` passed (`2 passed; 0 failed`, including the new `compose::signature_tests::the_root_signature_matches_the_sources_rs` test) with 0 new warnings. Clean programmatic root-signature serialization avoiding DXC dependency under Wine. LGTM. Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2449/head:github-bot/gh-2449'
git switch 'github-bot/gh-2449'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2449'
git switch 'github-bot/gh-2449'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2449'
git switch 'github-bot/gh-2449'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2449'
git switch 'main'
git merge --squash 'github-bot/gh-2449'
git switch 'main'
git merge --ff-only 'github-bot/gh-2449'
git switch 'main'
git merge 'github-bot/gh-2449'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/trustno1-coder--VIctory-NVIDIA!2449
No description provided.