Wine/Proton: root signatures made in code, clamps Wine's compiler builds, loop latches and a large pipeline stack #10
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/DoubleGhosty--cool_fox!10
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/10/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@simon0302010 on GitHub · 2026-11-26 13:06 UTC · original
simon0302010:wine-fixes→main· +453 −50 · 12 files · 5 commits · merged 2026-11-26 15:21 UTCFive fixes for running under Wine/Proton. Without them, the Series S profile shows a black screen on Linux. With them, the world renders and every one of our helper passes is made.
Most of these come down to one difference: under Wine,
D3DCompileis vkd3d-shader's compiler. It ignores[RootSignature]and embeds none in the blob, soCreateRootSignature(0, <shader bytes>)fails withE_FAIL(0x80004005). It also lacks some methods and intrinsics that Microsoft's compiler has.What changes
Two-plane composer (
compose.rs). Its root signature is now serialized in code, andD3DCompile's errors are logged instead of dropped. Before, the composer was never made, so in the Series S profile only the base plane was shown: a black screen (two-plane composer not made; showing base plane only, 2,915 times in one run).Ambient, depth-plane and keep-awake passes, via a new
rootsig.rs.rootsig::makeserializes what each shader's RS string describes, with the defaults a version 1.1 RS string gets. It's used by:no stand-in for the indirect light): without it, everything out of direct light is much too dark. Its shader also testedisnan/isinf, which Wine's compiler lacks (E5005: Function "isnan" is not defined). It now tests the exponent bits instead, with the same result.no pipeline to draw a depth plane from its twin)the card is not kept awake)The HLSL keeps its
[RootSignature], so on Windows the shaders are unchanged; only where the root signature comes from differs.Indirect argument clamps (
indirect.rs,indirect/batch.rs). Wine's compiler refuses both (E5005: Method 'InterlockedOr' is not defined on type 'RWByteAddressBuffer'), so every indirect draw was dropped. The written buffers becomeRWStructuredBuffer<uint>indexed in words, so they hold the same bytes.Interlocked*are called as functions,[allow_uav_condition]is dropped, and the root signatures are made in code. Ported from fxceless/victory-fork#1011, as described in Belobug/VIctory-Belobug-AMD#183.One back edge per loop header (
emit/bitcode.rs,emit/shader.rs), ported from Marvisak/VIctory#1885 (d48ec767). vkd3d-proton's dxil-spirv recurses without end on loop headers with several back edges. Under Wine the stack overflow hangs the thread instead of failing; in one run here it held the process heap lock and froze the whole process. The upstream unit test is included.256 MiB stack for the pipeline workers (
pipeline/make.rs,emit/mod.rs), ported from Marvisak/VIctory#1885 (5aa10e54). Only reserved. The largest ray-tracing passes overflow 2 MiB even without the endless recursion. The upstream change to the offlinetranslatecommand is left out.Items 3–5 are the same changes as Belobug/VIctory-Belobug-AMD#245.
Testing
Linux (Arch, kernel 7.2), Radeon 8050S (Strix Halo, RDNA 3.5, 512 MB carve-out, 32 GB RAM), RADV / Mesa 26.2.6, GE-Proton11-14 (vkd3d-proton 3.2), Series S profile, the launcher's
pareto-residencysettings, no ray tracing:f4b48ad(main)isnanrefusedmainnever got past the black screen here, so it didn't reach the clamps or the loop latches. The "before" for items 3–5 is from builds of other forks on the same machine, with the same code in those places: the clamps were refused (no argument clamp: indirect execution dropped), and there were 2–5 stack overflows in pipeline creation, once followed by the heap-lock freeze. With these changes, neither showed up in any run.Not covered:
0x218), and a few hundred indirect executions a frame are dropped. I didn't look into either.x86_64-pc-windows-gnufrom Linux. On Windows the root signatures made in code describe what the RS strings did, but I haven't run them there.cargo check --testspasses; I couldn't run the GPU or shader tests here.No game files, captures or screenshots are included.
AI use: Claude Code (Claude Opus 5.5) wrote and ported the changes, ran the tests on my machine and wrote this description; I reviewed it.
🤖 Generated with Claude Code
Under Wine, D3DCompile is vkd3d-shader's compiler, which ignores [RootSignature] and embeds none, so CreateRootSignature on the shader's bytes failed (E_FAIL) and three of our passes were never made: - the stand-in for the indirect light ("no stand-in for the indirect light"): everything out of direct light much too dark - the depth plane drawn from its twin ("no pipeline to draw a depth plane from its twin"): those depth planes stayed as they were - the keep-awake pass ("the card is not kept awake") `rootsig::make` serializes what each shader's RS string describes, with that string's default flags. The ambient pass also tests NaN and infinity by their exponent bits, since Wine's compiler has no isnan/isinf. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Ck4nRpEBizbYrjNarbDQc4