DXC fallback: helpers compile as HLSL 2018 (ambient raise never built under Proton, #2769) #3417

Open
ErRusso wants to merge 1 commit from upstream-pr/3417 into main
ErRusso commented 2026-11-29 23:01:16 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by ErRusso on 2026-11-29T23:01:16Z.


Fixes the raise part of #2769.

What it changes

The DXC fallback in hlsl.rs now compiles the layer's helper shaders as HLSL 2018 (-HV 2018).

What was wrong:

  • The helpers are written for the system compiler, where || and ?: work per component on vectors.
  • Under Proton, Wine's compiler refuses some of them (no isnan, [RootSignature] dropped), so they go to DXC.
  • DXC defaults to HLSL 2021, which refuses vector ||. The ambient estimate's raise then never builds:
WARN victory_gpu::hlsl: a shader of ours: DXC: hlsl.hlsl:288:27: error: operands for short-circuiting logical binary operator must be scalar, for non-scalar types use 'or'
    found = (isnan(found) || isinf(found)) ? 0.0 : max(found, 0.0);
WARN victory_gpu::hlsl: a shader of ours (raise): DXC failed too (VICTORY_DXC names dxcompiler.dll or its folder) error=Call failed. (0x80004005)
WARN victory_gpu::ambient: no stand-in for the indirect light error=Call failed. (0x80004005)

The last line means the whole stand-in for indirect light is off, so scenes come out darker and flatter.

Effect on other platforms:

  • The other helpers that go to DXC under Proton (compose, card compare, gather, keep, mean, place, plane, the indirect clamp) already compiled under 2021. HLSL 2018 is the older, more permissive mode, and they still compile.
  • Windows changes only where its own compiler refuses a helper, which is the only time DXC is used.

Open PR #1702 has the same -HV 2018 in its own dxc.rs. This is just that one line, for main's hlsl.rs.

How it was tested

  • Linux, Proton Experimental 11.0-20261123b, RTX 4060 8 GB, Series S, DLSS balanced, DLSS frame generation 2x:
    • Before: the log above, in every start.
    • After: the same one-line change on v2026.11.29.03, which is what that PC runs, is built and installed. It has not been started in the game yet.
  • Unit tests under Wine (cargo xwin test -p victory-gpu --lib, with VICTORY_DXC pointing at dxcompiler.dll 1.8):
    • New test dxc_takes_the_system_compilers_vector_logic compiles raise's vector logic with DXC. It fails without -HV 2018 and passes with it. It returns early when no dxcompiler.dll can be found.
    • hlsl::: 4 passed.
    • ambient::the_passes_compile fails on main under Wine with DXC and passes with this change.
    • Two other ambient tests (neutral_probe_replaces_colour_without_depth_and_preserves_bounds, raise_opt_in_chroma_scrub_filters_spikes_and_preserves_scene_tones_on_hardware_and_warp) fail under Wine with and without this change.
    • Not run on Windows.
  • Clippy: no warnings in hlsl.rs.
  • Shader changes: none in the title's translation (victory-shader untouched; the shader cache key is unchanged).
  • cargo xtask policy --staged: ok.

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches. Related: #1702 (the same flag inside a larger, conflicting change), #2160 (removes isnan for Wine's own compiler), #3044 (raise writes inside its image).

🤖 Generated with Claude Code

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5556089522 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3417). Originally posted by [ErRusso](https://github.com/ErRusso) on 2026-11-29T23:01:16Z. --- <!-- Labels: pr-fix --> Fixes the `raise` part of #2769. ## What it changes The DXC fallback in `hlsl.rs` now compiles the layer's helper shaders as HLSL 2018 (`-HV 2018`). **What was wrong:** - The helpers are written for the system compiler, where `||` and `?:` work per component on vectors. - Under Proton, Wine's compiler refuses some of them (no `isnan`, `[RootSignature]` dropped), so they go to DXC. - DXC defaults to HLSL 2021, which refuses vector `||`. The ambient estimate's `raise` then never builds: ```text WARN victory_gpu::hlsl: a shader of ours: DXC: hlsl.hlsl:288:27: error: operands for short-circuiting logical binary operator must be scalar, for non-scalar types use 'or' found = (isnan(found) || isinf(found)) ? 0.0 : max(found, 0.0); WARN victory_gpu::hlsl: a shader of ours (raise): DXC failed too (VICTORY_DXC names dxcompiler.dll or its folder) error=Call failed. (0x80004005) WARN victory_gpu::ambient: no stand-in for the indirect light error=Call failed. (0x80004005) ``` The last line means the whole stand-in for indirect light is off, so scenes come out darker and flatter. **Effect on other platforms:** - The other helpers that go to DXC under Proton (compose, card compare, gather, keep, mean, place, plane, the indirect clamp) already compiled under 2021. HLSL 2018 is the older, more permissive mode, and they still compile. - Windows changes only where its own compiler refuses a helper, which is the only time DXC is used. Open PR #1702 has the same `-HV 2018` in its own `dxc.rs`. This is just that one line, for `main`'s `hlsl.rs`. ## How it was tested - **Linux, Proton Experimental 11.0-20261123b, RTX 4060 8 GB, Series S, DLSS balanced, DLSS frame generation 2x:** - **Before:** the log above, in every start. - **After:** the same one-line change on v2026.11.29.03, which is what that PC runs, is built and installed. It has not been started in the game yet. - **Unit tests** under Wine (`cargo xwin test -p victory-gpu --lib`, with `VICTORY_DXC` pointing at `dxcompiler.dll` 1.8): - New test `dxc_takes_the_system_compilers_vector_logic` compiles `raise`'s vector logic with DXC. It **fails without `-HV 2018` and passes with it**. It returns early when no `dxcompiler.dll` can be found. - `hlsl::`: 4 passed. - `ambient::the_passes_compile` fails on `main` under Wine with DXC and passes with this change. - Two other `ambient` tests (`neutral_probe_replaces_colour_without_depth_and_preserves_bounds`, `raise_opt_in_chroma_scrub_filters_spikes_and_preserves_scene_tones_on_hardware_and_warp`) fail under Wine with and without this change. - Not run on Windows. - **Clippy:** no warnings in `hlsl.rs`. - **Shader changes:** none in the title's translation (`victory-shader` untouched; the shader cache key is unchanged). - `cargo xtask policy --staged`: ok. ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. Related: #1702 (the same flag inside a larger, conflicting change), #2160 (removes `isnan` for Wine's own compiler), #3044 (`raise` writes inside its image). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
lewisenator commented 2026-11-30 23:33:42 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by lewisenator on 2026-11-30T23:33:42Z.


Tested in the game under Proton: this is needed, and it works.

Setup: Linux (CachyOS, kernel 7.3.6), GE-Proton11-15, RTX 3080 Ti 12 GB (driver 620.73.04), Ryzen 7 5800X, Series X profile, DLSS Quality at 2560x1440, with and without FSR 3 frame generation 2x. dxcompiler.dll is DXC 1.9 (the one beside the exe).

Before (main at 4d98ca87, 2026-11-29): the log in every start had operands for short-circuiting logical binary operator must be scalar for raise, then no stand-in for the indirect light, and the picture was dark and flat, as described here.

After: the same one-line change (-HV 2018 in hlsl.rs) has been in every build we have run since, on main at 4d98ca87, cec481f4, 41adb551, c71899d9 and e1251c31: about 330 starts, the prologue and the prison cell. In each log:

INFO victory_gpu::hlsl: a shader of ours (raise, cs_5_1): the system's HLSL compiler refused it (its code holds no root signature: the compiler left out [RootSignature]); trying DXC
INFO victory_gpu::hlsl: a shader of ours (raise): compiled by DXC as cs_6_0
INFO victory_gpu::ambient: a stand-in for the indirect light role=Radiance size=[853, 480] level=0.8 constant=0.0

The other helpers that go to DXC here (compose, plane, card compare, card compare batch, clamp, reflect_light) still compile with it. No WARN from victory_gpu::hlsl or victory_gpu::ambient in any of those logs.

I did not run the PR's new unit test; the above is the game only.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7295265785 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3417#issuecomment-7295265785). Originally posted by [lewisenator](https://github.com/lewisenator) on 2026-11-30T23:33:42Z. --- Tested in the game under Proton: this is needed, and it works. **Setup:** Linux (CachyOS, kernel 7.3.6), GE-Proton11-15, RTX 3080 Ti 12 GB (driver 620.73.04), Ryzen 7 5800X, Series X profile, DLSS Quality at 2560x1440, with and without FSR 3 frame generation 2x. `dxcompiler.dll` is DXC 1.9 (the one beside the exe). **Before** (main at 4d98ca87, 2026-11-29): the log in every start had `operands for short-circuiting logical binary operator must be scalar` for `raise`, then `no stand-in for the indirect light`, and the picture was dark and flat, as described here. **After:** the same one-line change (`-HV 2018` in `hlsl.rs`) has been in every build we have run since, on main at 4d98ca87, cec481f4, 41adb551, c71899d9 and e1251c31: about 330 starts, the prologue and the prison cell. In each log: ```text INFO victory_gpu::hlsl: a shader of ours (raise, cs_5_1): the system's HLSL compiler refused it (its code holds no root signature: the compiler left out [RootSignature]); trying DXC INFO victory_gpu::hlsl: a shader of ours (raise): compiled by DXC as cs_6_0 INFO victory_gpu::ambient: a stand-in for the indirect light role=Radiance size=[853, 480] level=0.8 constant=0.0 ``` The other helpers that go to DXC here (`compose`, `plane`, `card compare`, `card compare batch`, `clamp`, `reflect_light`) still compile with it. No `WARN` from `victory_gpu::hlsl` or `victory_gpu::ambient` in any of those logs. I did not run the PR's new unit test; the above is the game only.
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/3417:upstream-pr/3417'
git switch 'upstream-pr/3417'

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