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

Open
HyperRamzey wants to merge 1 commit from upstream-pr/2449 into main
HyperRamzey commented 2026-11-29 13:10:02 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by HyperRamzey on 2026-11-29T13:10:02Z.


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.
<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5551024311 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2449). Originally posted by [HyperRamzey](https://github.com/HyperRamzey) on 2026-11-29T13:10:02Z. --- ## 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.
Dukestar69 commented 2026-11-29 13:25:14 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Dukestar69 on 2026-11-29T13:25:14Z.

Review: APPROVED


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).

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:review:6103066062 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2449#pullrequestreview-6103066062). Originally posted by [Dukestar69](https://github.com/Dukestar69) on 2026-11-29T13:25:14Z. **Review:** APPROVED --- 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 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/2449:upstream-pr/2449'
git switch 'upstream-pr/2449'

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/2449'
git switch 'upstream-pr/2449'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2449'
git switch 'upstream-pr/2449'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2449'
git switch 'main'
git merge --squash 'upstream-pr/2449'
git switch 'main'
git merge --ff-only 'upstream-pr/2449'
git switch 'main'
git merge 'upstream-pr/2449'
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
trustno1-coder/VIctory-NVIDIA!2449
No description provided.