GPU: helper shaders compiled at run time fall back to DXC (Wine's compiler refuses many and drops [RootSignature]) #925

Merged
kc01-8 merged 3 commits from upstream-pr/925 into main 2026-11-29 00:24:47 +00:00
kc01-8 commented 2026-11-28 09:10:27 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by kc01-8 on 2026-11-28T09:10:27Z.


Summary

  • Every helper shader victory compiles at run time now falls back to DXC when the system's compiler refuses it. That covers the indirect-argument clamp, the card compare, the ambient light's stand-in, the depth planes' pass, the scatter, the upload check, the tiles' look, keeping the card awake, and the composer.
  • Why this matters under Wine/Proton. The system's d3dcompiler_47 refuses many of these helpers. Worse, it accepts [RootSignature(...)] but leaves it out of the code. vkd3d-proton then finds no RTS0 part and fails CreateRootSignature with E_FAIL, and the helper quietly turns itself off. Such code now counts as refused, so DXC compiles it.
  • On Windows nothing changes. The system's compiler takes every helper as before, and DXC is never loaded.

How

  • crates/victory-gpu/src/hlsl.rs (new): compile_for(name, source, entry, target).
    • It tries the system's D3DCompile first, then DXC at the 6.0 model of the same stage (cs_5_1 becomes cs_6_0, and so on).
    • DXC is dxcompiler.dll, looked for in this order: VICTORY_DXC (the DLL or its folder), then the executable's folder, then System32.
    • A system result is refused when its source declares a root signature for that entry and its container has no RTS0 part.
  • The callers. host::compile, the card compare, the composer and the indirect clamp go through it. The depth planes' vertex shader follows its pixel shader to DXC, so a pipeline's two stages are of one kind.
  • Build. The Win32_Graphics_Direct3D_Dxc feature of windows.

Testing

  • Build: victory.exe cross-builds (x86_64-pc-windows-gnullvm, release) on this branch, which is 63b902fe plus these commits.
  • Unit tests: hlsl::tests (3) pass under Proton Experimental's Wine with DXC.
  • In play: under Proton Experimental with vkd3d-proton master, RTX 3080 Ti, NVIDIA 620.73.04, every helper named above is made.
    • Before, the depth planes' pass and keeping the card awake failed with E_FAIL.
    • The scatter, the upload check and the tiles' look were off without a word.
  • Not tested: Windows, with this exact branch.

Where this comes from

This is part of kc01-8/VIctoryNVIDIALINUX (branch kc/foxhound). It is this tree running on an NVIDIA GeForce card under Linux and Proton. So far, on an RTX 3080 Ti:

  • Memory: 12–14 GB that cannot be reclaimed, for a whole run. Title memory is read in place instead of copied, because NVIDIA's Linux driver pins every page of a buffer it is given.
  • Shaders: 2,533 of the 2,534 shaders the title asked for in a run translate (99.96 %), and all 2,185 host pipelines were made.
  • Frame rate: 8–14 fps at 1,400–3,700 draws a frame under Proton.

Its README has the progress by run, what works and what doesn't, and a ranked list of next steps for people and agents taking it further.

Credits

  • The DXC fallback for helper shaders began in JMAN730/victory dffc5924 ("Optionally cross-compile the built-in GPU helper shaders with host DXC", Codex).
  • Extended here to every helper, and to Wine's dropped root signatures.

🤖 Generated with Claude Code

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5538607000 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/925). Originally posted by [kc01-8](https://github.com/kc01-8) on 2026-11-28T09:10:27Z. --- ## Summary - **Every helper shader victory compiles at run time now falls back to DXC when the system's compiler refuses it.** That covers the indirect-argument clamp, the card compare, the ambient light's stand-in, the depth planes' pass, the scatter, the upload check, the tiles' look, keeping the card awake, and the composer. - **Why this matters under Wine/Proton.** The system's `d3dcompiler_47` refuses many of these helpers. Worse, it accepts `[RootSignature(...)]` but leaves it out of the code. vkd3d-proton then finds no `RTS0` part and fails `CreateRootSignature` with `E_FAIL`, and the helper quietly turns itself off. Such code now counts as refused, so DXC compiles it. - **On Windows nothing changes.** The system's compiler takes every helper as before, and DXC is never loaded. ## How - **`crates/victory-gpu/src/hlsl.rs` (new): `compile_for(name, source, entry, target)`.** - It tries the system's `D3DCompile` first, then DXC at the 6.0 model of the same stage (`cs_5_1` becomes `cs_6_0`, and so on). - DXC is `dxcompiler.dll`, looked for in this order: `VICTORY_DXC` (the DLL or its folder), then the executable's folder, then System32. - A system result is refused when its source declares a root signature for that entry and its container has no `RTS0` part. - **The callers.** `host::compile`, the card compare, the composer and the indirect clamp go through it. The depth planes' vertex shader follows its pixel shader to DXC, so a pipeline's two stages are of one kind. - **Build.** The `Win32_Graphics_Direct3D_Dxc` feature of `windows`. ## Testing - **Build:** `victory.exe` cross-builds (x86_64-pc-windows-gnullvm, release) on this branch, which is `63b902fe` plus these commits. - **Unit tests:** `hlsl::tests` (3) pass under Proton Experimental's Wine with DXC. - **In play:** under Proton Experimental with vkd3d-proton master, RTX 3080 Ti, NVIDIA 620.73.04, every helper named above is made. - Before, the depth planes' pass and keeping the card awake failed with `E_FAIL`. - The scatter, the upload check and the tiles' look were off without a word. - **Not tested:** Windows, with this exact branch. ## Where this comes from This is part of **[kc01-8/VIctoryNVIDIALINUX](https://github.com/kc01-8/VIctoryNVIDIALINUX)** (branch `kc/foxhound`). It is this tree running on an NVIDIA GeForce card under **Linux and Proton**. So far, on an RTX 3080 Ti: - **Memory:** 12–14 GB that cannot be reclaimed, for a whole run. Title memory is read in place instead of copied, because NVIDIA's Linux driver pins every page of a buffer it is given. - **Shaders:** 2,533 of the 2,534 shaders the title asked for in a run translate (99.96 %), and all 2,185 host pipelines were made. - **Frame rate:** 8–14 fps at 1,400–3,700 draws a frame under Proton. Its README has the progress by run, what works and what doesn't, and a ranked list of next steps for people and agents taking it further. ## Credits - The DXC fallback for helper shaders began in [JMAN730/victory](https://github.com/JMAN730/victory) `dffc5924` ("Optionally cross-compile the built-in GPU helper shaders with host DXC", Codex). - Extended here to every helper, and to Wine's dropped root signatures. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Dukestar69 commented 2026-11-28 09:18:52 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Dukestar69 on 2026-11-28T09:18:52Z.

Review: APPROVED


Tested locally merged onto main (63b902f).

  • Merge & Policy: Clean merge; cargo xtask policy passed (295 files ok).
  • Tests (RTX 5090):
    • cargo test -p victory-gpu --lib hlsl passed (3 passed; 0 failed: a_root_signature_is_declared_for_its_function, compiled_code_holds_its_root_signature, raw_buffer_shader_compiles_with_a_fallback).
    • cargo test -p victory-gpu --lib ambient:: passed (5 passed; 0 failed).
    • cargo test -p victory-gpu --lib host::card_steps:: passed (9 passed; 0 failed; 1 ignored).
  • Compiled with 0 warnings.

Clean DXC fallback and root-signature preservation for runtime-compiled helper shaders. LGTM.

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

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:review:6096936194 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/925#pullrequestreview-6096936194). Originally posted by [Dukestar69](https://github.com/Dukestar69) on 2026-11-28T09:18:52Z. **Review:** APPROVED --- Tested locally merged onto `main` (`63b902f`). - **Merge & Policy**: Clean merge; `cargo xtask policy` passed (`295 files ok`). - **Tests (RTX 5090)**: - `cargo test -p victory-gpu --lib hlsl` passed (`3 passed; 0 failed`: `a_root_signature_is_declared_for_its_function`, `compiled_code_holds_its_root_signature`, `raw_buffer_shader_compiles_with_a_fallback`). - `cargo test -p victory-gpu --lib ambient::` passed (`5 passed; 0 failed`). - `cargo test -p victory-gpu --lib host::card_steps::` passed (`9 passed; 0 failed; 1 ignored`). - Compiled with 0 warnings. Clean DXC fallback and root-signature preservation for runtime-compiled helper shaders. LGTM. Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
ArturoWolff commented 2026-11-28 09:32:17 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by ArturoWolff on 2026-11-28T09:32:17Z.


This overlaps a compiler defect we independently isolated on RTX 4060/16 GB under GE-Proton11-14: the system-only host::compile returned a scatter shader whose root-signature creation failed with E_FAIL, so the ordinary submission-owned upload path never ran. Routing that one pass to the existing DXC fallback restored actual upload work (#628 measurements). Thank you for addressing the wider class of helper shaders here; credits to kc01-8 and JMAN730/victory dffc5924 as noted in the PR.

Independent numerical validation of your exact head 8fb73e2d50899c8f467ce1c3c966b707b71e979f: I added a test-only fixture invoking the actual host/send.rs::pass() constructor, then dispatched that unchanged scatter shader into an owned 256-byte device-local buffer. The buffer was initialized from 64 distinct CPU words, and the input pairs at byte offset 16 requested three aligned in-bounds updates at word indices 3, 29 and 61. Fenced whole-output readback matched the independent CPU expectation for all 64 words, including every untouched word. No game files mounted, no hardware skip. Windows MSVC release cross-build, verified physical RTX 4060, NVIDIA 620.73.04, GE11-14/vkd3d-proton 3.2.0, DXC 1.9.2609.

scatter readback: 64/64 words correct, 3 changed and 61 untouched
 test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 492 filtered out; finished in 0.89s

Actual game: exact PR with only the already-tested Linux file-backing adaptation (and the above cfg(test) fixture, absent from the release), Series X 1080to1440, DLSS/FG off, cloned profile/fresh external caches, full write-back, ordinary waits and effects intact. No private compiler adapter or compact bucket experiment layered onto this PR. Four DXC successes (two generic host helper root-signature omissions, the card compare's Load4 refusal, and the clamp's InterlockedOr refusal), zero DXC failures. Submission-own send summaries: 26/49 nonzero, maximum reported 21.8 MB/frame; the prior system-only scatter configuration reported zero throughout. This confirms broader fallback compilation and real restored upload activity; the generic log label does not identify every helper, so I cannot claim local coverage of all named passes.

The launch still reaches loading artwork and a black overlay, then actual exit 5 after 127.9 s, minimum available host RAM 1914 MiB. Our previous scatter-only fallback run with standard allocation buckets was 133.7 s / 2312 MiB / exit 5. No guard stop, OOM increment, recorded GPU fault or reported device/fence failure. Not an in-world FPS or visual-quality comparison; no title check or watchdog changes. No game files, dumps or extracted data attached.

AI assistance: Hermes Agent, working on behalf of ArturoWolff. (GPT 6.2 Sol High).

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7237303697 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/925#issuecomment-7237303697). Originally posted by [ArturoWolff](https://github.com/ArturoWolff) on 2026-11-28T09:32:17Z. --- This overlaps a compiler defect we independently isolated on RTX 4060/16 GB under GE-Proton11-14: the system-only `host::compile` returned a scatter shader whose root-signature creation failed with E_FAIL, so the ordinary submission-owned upload path never ran. Routing that one pass to the existing DXC fallback restored actual upload work ([#628 measurements](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/628#issuecomment-7237035754)). Thank you for addressing the wider class of helper shaders here; credits to kc01-8 and JMAN730/victory `dffc5924` as noted in the PR. **Independent numerical validation of your exact head `8fb73e2d50899c8f467ce1c3c966b707b71e979f`:** I added a test-only fixture invoking the actual `host/send.rs::pass()` constructor, then dispatched that unchanged scatter shader into an owned 256-byte device-local buffer. The buffer was initialized from 64 distinct CPU words, and the input pairs at byte offset 16 requested three aligned in-bounds updates at word indices 3, 29 and 61. Fenced whole-output readback matched the independent CPU expectation for all 64 words, including every untouched word. No game files mounted, no hardware skip. Windows MSVC release cross-build, verified physical RTX 4060, NVIDIA 620.73.04, GE11-14/vkd3d-proton 3.2.0, DXC 1.9.2609. ```text scatter readback: 64/64 words correct, 3 changed and 61 untouched test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 492 filtered out; finished in 0.89s ``` **Actual game:** exact PR with only the already-tested Linux file-backing adaptation (and the above `cfg(test)` fixture, absent from the release), Series X 1080to1440, DLSS/FG off, cloned profile/fresh external caches, full write-back, ordinary waits and effects intact. No private compiler adapter or compact bucket experiment layered onto this PR. Four DXC successes (two generic host helper root-signature omissions, the card compare's Load4 refusal, and the clamp's InterlockedOr refusal), zero DXC failures. Submission-own send summaries: 26/49 nonzero, maximum reported 21.8 MB/frame; the prior system-only scatter configuration reported zero throughout. This confirms broader fallback compilation and real restored upload activity; the generic log label does not identify every helper, so I cannot claim local coverage of all named passes. The launch still reaches loading artwork and a black overlay, then actual exit 5 after 127.9 s, minimum available host RAM 1914 MiB. Our previous scatter-only fallback run with standard allocation buckets was 133.7 s / 2312 MiB / exit 5. No guard stop, OOM increment, recorded GPU fault or reported device/fence failure. Not an in-world FPS or visual-quality comparison; no title check or watchdog changes. No game files, dumps or extracted data attached. AI assistance: Hermes Agent, working on behalf of ArturoWolff. (GPT 6.2 Sol High).
Aniseto commented 2026-11-28 09:38:38 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Aniseto on 2026-11-28T09:38:38Z.


Ran the HLSL fallback tests at 8fb73e2 on Windows with an NVIDIA Blackwell desktop part:

Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only, 16 GB) driver 32.0.16.2124, Intel Core i5-12400F, 64 GB RAM, Rust 1.98.1 (pinned by rust-toolchain.toml), MSVC 14.44.35207, DXC 1.9.2609.5 (shared env), debug build.

cargo test -p victory-gpu --lib hlsl::tests -- --test-threads=1
3 passed; 0 failed; 0 ignored; 0 measured; 489 filtered out      (exit 0)

All three tests pass. The PR description says the hlsl::tests were run under Wine/Proton and that Windows with this exact branch was not tested; this run fills that gap. On Windows the system compiler takes every helper, so the DXC fallback path itself is not exercised here. The thread has an RTX 4060/Proton report but no 5070 Ti or Windows run.

Not tested: the Wine/Proton fallback path, a paired smoke run, the full workspace suite, AMD and Intel GPUs, native wave64 hosts, game data.

AI-assisted (OpenCode), model: DeepSeek V4.1 Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7237372642 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/925#issuecomment-7237372642). Originally posted by [Aniseto](https://github.com/Aniseto) on 2026-11-28T09:38:38Z. --- Ran the HLSL fallback tests at `8fb73e2` on Windows with an NVIDIA Blackwell desktop part: Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only, 16 GB) driver 32.0.16.2124, Intel Core i5-12400F, 64 GB RAM, Rust 1.98.1 (pinned by `rust-toolchain.toml`), MSVC 14.44.35207, DXC 1.9.2609.5 (shared env), debug build. ``` cargo test -p victory-gpu --lib hlsl::tests -- --test-threads=1 3 passed; 0 failed; 0 ignored; 0 measured; 489 filtered out (exit 0) ``` All three tests pass. The PR description says the `hlsl::tests` were run under Wine/Proton and that Windows with this exact branch was **not** tested; this run fills that gap. On Windows the system compiler takes every helper, so the DXC fallback path itself is not exercised here. The thread has an RTX 4060/Proton report but no 5070 Ti or Windows run. Not tested: the Wine/Proton fallback path, a paired smoke run, the full workspace suite, AMD and Intel GPUs, native wave64 hosts, game data. AI-assisted (OpenCode), model: **DeepSeek V4.1 Flash Free** - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.
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!925
No description provided.