Fall back to DXC for runtime shaders under linux wine #174

Open
gmankab wants to merge 1 commit from upstream-pr/174 into main
gmankab commented 2026-11-24 22:09:44 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by gmankab on 2026-11-24T22:09:44Z.


Reuse the compiler loader and signing path for the indirect clamp, depth twins, card comparison, and in-place probe

Based-on: https://github.com/Marvisak/VIctory/pull/178

<!-- greyfinch-sync:fxceless/victory-fork:issue:5481164014 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/174). Originally posted by [gmankab](https://github.com/gmankab) on 2026-11-24T22:09:44Z. --- Reuse the compiler loader and signing path for the indirect clamp, depth twins, card comparison, and in-place probe Based-on: https://github.com/Marvisak/VIctory/pull/178
rostaddotcc commented 2026-11-24 23:09:33 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by rostaddotcc on 2026-11-24T22:18:01Z.


The premise is right and I have it measured, but there is a version of this that needs no code: the failure is not Wine refusing cs_5_1, it is which d3dcompiler_47 is loaded.

d3dcompiler_47 indirect::tests::argument_clamp_builds clamp source compiled directly
Wine builtin (=b) FAILED E5005: Method 'InterlockedMax' is not defined on type 'RWByteAddressBuffer'
native Microsoft fxc (=n) ok, 0.40 s ok, 3 984 B, root signature kept

On this box (CachyOS, RX 7900 XT, Proton Experimental experimental-11.0-20261112, vkd3d-proton 3.2.0 serving d3d12) the whole victory-gpu suite is 109 passed / 1 failed with d3dcompiler_47=n, and the builtin fails the clamp exactly as you describe. So winetricks d3dcompiler_47 (pinned in the launcher, not inherited from whatever prefix exists) closes it for the tests and for a run today.

Where DXC is the right answer anyway: [RootSignature] is not implemented in vkd3d at all — RTS0 exists there only as a standalone serializer — so the builtin will never accept the fork's sources, and the Interlocked*/Load* methods on RWByteAddressBuffer landed upstream only on 2026-11-04 and are in no release (Load* since 1.14, the Interlocked* intrinsics since 1.15). A DXC fallback therefore buys something the native DLL does not: it removes a dependency on a redistributable Microsoft binary that most prefixes will not have, and it is the only path that keeps working if fxc's cs_5_1 support is ever dropped.

Two things worth deciding explicitly in the PR, since they are what a distro packager will ask about: whether the DXC DLL is expected from the system (VICTORY_DXC already accepts a directory or the DLL) or shipped, and whether the fallback is only for the runtime-only shaders listed or also for the shader tests — the test would then need the same loader, or a skip that says why.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7146058782 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/174#issuecomment-7146058782). Originally posted by [rostaddotcc](https://github.com/rostaddotcc) on 2026-11-24T22:18:01Z. --- The premise is right and I have it measured, but there is a version of this that needs no code: the failure is not Wine refusing `cs_5_1`, it is which `d3dcompiler_47` is loaded. | `d3dcompiler_47` | `indirect::tests::argument_clamp_builds` | clamp source compiled directly | |---|---|---| | Wine builtin (`=b`) | FAILED | `E5005: Method 'InterlockedMax' is not defined on type 'RWByteAddressBuffer'` | | native Microsoft `fxc` (`=n`) | ok, 0.40 s | ok, 3 984 B, root signature kept | On this box (CachyOS, RX 7900 XT, Proton Experimental `experimental-11.0-20261112`, vkd3d-proton 3.2.0 serving `d3d12`) the whole `victory-gpu` suite is 109 passed / 1 failed with `d3dcompiler_47=n`, and the builtin fails the clamp exactly as you describe. So `winetricks d3dcompiler_47` (pinned in the launcher, not inherited from whatever prefix exists) closes it for the tests and for a run today. Where DXC is the right answer anyway: `[RootSignature]` is not implemented in vkd3d at all — `RTS0` exists there only as a standalone serializer — so the builtin will never accept the fork's sources, and the `Interlocked*`/`Load*` methods on `RWByteAddressBuffer` landed upstream only on 2026-11-04 and are in no release (`Load*` since 1.14, the `Interlocked*` intrinsics since 1.15). A DXC fallback therefore buys something the native DLL does not: it removes a dependency on a redistributable Microsoft binary that most prefixes will not have, and it is the only path that keeps working if `fxc`'s `cs_5_1` support is ever dropped. Two things worth deciding explicitly in the PR, since they are what a distro packager will ask about: whether the DXC DLL is expected from the system (`VICTORY_DXC` already accepts a directory or the DLL) or shipped, and whether the fallback is only for the runtime-only shaders listed or also for the shader tests — the test would then need the same loader, or a skip that says why.
ErRusso commented 2026-11-24 23:46:37 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by ErRusso on 2026-11-24T23:46:37Z.

Review: CHANGES_REQUESTED


Reviewed at 9c92ad9 against 2119b0e.

This overlaps #20 but misses its second Wine failure mode. host::compile falls back to DXC only when D3DCompile returns Err. Under Wine the depth-plane twins' source compiles successfully but loses its [RootSignature]/RTS0 chunk, so CreateRootSignature fails and the twins still log no pipeline to draw a depth plane from its twin. There is no carries_root_signature check, and no test covers the missing-RTS0 path.

#20 already routes the same four call sites and adds that check (plus the per-entry root-signature test). Please close this in favour of #20, or add the missing-RTS0 fallback and a test.

<!-- greyfinch-sync:fxceless/victory-fork:review:6049270215 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/174#pullrequestreview-6049270215). Originally posted by [ErRusso](https://github.com/ErRusso) on 2026-11-24T23:46:37Z. **Review:** CHANGES_REQUESTED --- Reviewed at `9c92ad9` against `2119b0e`. This overlaps #20 but misses its second Wine failure mode. `host::compile` falls back to DXC only when `D3DCompile` returns `Err`. Under Wine the depth-plane twins' source compiles successfully but loses its `[RootSignature]`/`RTS0` chunk, so `CreateRootSignature` fails and the twins still log `no pipeline to draw a depth plane from its twin`. There is no `carries_root_signature` check, and no test covers the missing-`RTS0` path. #20 already routes the same four call sites and adds that check (plus the per-entry root-signature test). Please close this in favour of #20, or add the missing-`RTS0` fallback and a test.
gmankab commented 2026-11-29 09:52:50 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by gmankab on 2026-11-29T09:52:50Z.


Agreed about the missing RTS0 case. This PR's DXC fallback runs when D3DCompile returns an error. Wine can return successful bytecode without the embedded root signature, so that case also needs to trigger DXC. #20 includes the root-signature check and per-entry fixture.

Assisted-by: gpt-6.2 sol xhigh

<!-- greyfinch-sync:fxceless/victory-fork:comment:7254059688 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/174#issuecomment-7254059688). Originally posted by [gmankab](https://github.com/gmankab) on 2026-11-29T09:52:50Z. --- Agreed about the missing `RTS0` case. This PR's DXC fallback runs when `D3DCompile` returns an error. Wine can return successful bytecode without the embedded root signature, so that case also needs to trigger DXC. #20 includes the root-signature check and per-entry fixture. Assisted-by: gpt-6.2 sol xhigh
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/174:upstream-pr/174'
git switch 'upstream-pr/174'

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/174'
git switch 'upstream-pr/174'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/174'
git switch 'upstream-pr/174'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/174'
git switch 'main'
git merge --squash 'upstream-pr/174'
git switch 'main'
git merge --ff-only 'upstream-pr/174'
git switch 'main'
git merge 'upstream-pr/174'
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
fxceless/victory-fork!174
No description provided.