Repository navigation
GPU: build our own HLSL with DXC when Wine's compiler refuses it - #21
Closed
oeirughrepuiohg wants to merge 1 commit into
Closed
oeirughrepuiohg wants to merge 1 commit into
oeirughrepuiohg wants to merge 1 commit into
Conversation
Under Wine/Proton, D3DCompile is Wine's d3dcompiler_47 (vkd3d-shader), which has no RWByteAddressBuffer methods. The indirect-argument clamp fails with "E5005: Method 'InterlockedMax' is not defined on type 'RWByteAddressBuffer'", so every indirect draw and dispatch is dropped and the 3D scene stays black on Linux. When D3DCompile refuses a shader of ours, compile the same source with DXC (dxcompiler.dll from VICTORY_DXC, beside dxil.dll, or the exe's folder / System32) as SM 6.0, sign it with dxil.dll, and use that. Applied at every runtime compile site: the clamp (indirect::make_for), host::compile, and the card-compare pass. Windows is unchanged: D3DCompile succeeds there and the fallback never runs. Adapted from Marvisak/VIctory PR fxceless#178 by Ortomanic, generalized to any entry point and SM 5.x target. Assisted-by: Claude Code (Claude Opus 5.5)
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Under Wine/Proton,
D3DCompileis Wine'sd3dcompiler_47(vkd3d-shader), which has noRWByteAddressBuffermethods. The indirect-argument clamp then fails to build:and every indirect draw and dispatch is dropped, so the world stays black on Linux. Two testers on VIctory #844 (an RTX 5070 Ti and my RTX 4070 Ti) needed a DXC fallback to get this fork's lit first scene under Proton.
What is in it (one commit, on
7b0f736, +195/−22)crates/victory-gpu/src/dxc.rs(new): loaddxcompiler.dll(VICTORY_DXC, besidedxil.dll, else the exe's folder / System32), compile the same HLSL as SM 6.0, sign withdxil.dllwhen the digest is zero. Adapted from Marvisak/VIctory PR #178 by Ortomanic, generalized to any entry point and SM 5.x target.indirect.rs(make_for),host.rs(compile, and the card-compare pass inmake_card_work): whenD3DCompilefails, use the DXC result instead of returning the error. The clamp logs the refusal at info level and warns only if DXC fails too.Cargo.toml: theWin32_Graphics_Direct3D_Dxcfeature ofwindows.On Windows
D3DCompilesucceeds and none of this runs.Tested
cae8353e, DXC 1.9.2609 (dxcompiler.dll+dxil.dllgiven viaVICTORY_DXC). Diag build, cross-compiled forx86_64-pc-windows-msvc.d279e69+ VIctory #454 + this change: the log shows the clamp refused by Wine's compiler and then built by DXC, no further error; indirect work runs (~4000–5000 draws per frame in the world); the first gameplay scene renders lit and is controllable with a pad, ~2 fps (8-minute steady window: avg 1.96 fps, p50 507 ms, p99 624 ms). Two runs, ~25 min each, no device loss.7b0f736): builds forx86_64-pc-windows-msvcin release and in the diag profile, andcargo clippy --release -p victory-gpureports no warnings. (My cross build needs blake3'spurefeature, applied locally only; it is not in this PR.) The runs above used the same change ond279e69; I have not yet run this rebased commit in the game.Not tested
AI use
Claude Code (Claude Opus 5.5) wrote the change, ran the builds and tests on my machine and drafted this description.
🤖 Generated with Claude Code