Skip to content

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

Open
ErRusso wants to merge 1 commit into
trustno1-coder:mainfrom
ErRusso:fix/dxc-hlsl-2018
Open

ErRusso wants to merge 1 commit into
trustno1-coder:mainfrom
ErRusso:fix/dxc-hlsl-2018

Conversation

@ErRusso

@ErRusso ErRusso commented Nov 29, 2026

Copy link
Copy Markdown

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

🤖 Generated with Claude Code

…ads them (trustno1-coder#2769)

The helpers we compile at run time are written for the system compiler,
where || and ?: work per component on vectors. When it refuses one (Wine's
d3dcompiler under Proton: no isnan, no [RootSignature] kept) the fallback
gave it to DXC at its default, HLSL 2021, which refuses vector || and the
ambient estimate's raise never built:

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

and with it the whole stand-in for the indirect light was off ("no
stand-in for the indirect light"). DXC is now asked for -HV 2018.

A test compiles raise's vector logic with DXC when a dxcompiler.dll can be
found; it fails without -HV 2018. Under Wine with DXC, ambient's
the_passes_compile now passes as well.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
T1bolus added a commit to T1bolus/VIctory-NVIDIA that referenced this pull request Nov 30, 2026
…d under

Proton (its passes never built) and trustno1-coder#3417 just fixed that, so builder=0 may
finally render lit; AMBIENT_AIR=1.5 like the play defaults (it is active only
while the builder rests)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant