Wine: the indirect argument clamp does not compile with Wine's HLSL compiler, so every indirect execution is dropped (fix on a branch) #909
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Imported from Marvisak/VIctory. Originally posted by Mumogg on 2026-11-24T13:55:43Z.
Pull requests are limited to collaborators right now, so this is offered as a branch; a collaborator is welcome to open a PR from it.
f2a71ac, onmainffe310e, one file)Problem
Under Wine, every indirect execution is dropped. The clamp of indirect arguments (
crates/victory-gpu/src/indirect.rs) is HLSL compiled at run time withD3DCompile, and Wine'sd3dcompiler_47(vkd3d-shader's HLSL compiler) refuses it:indirect::boundthen returns false for every record andexecute_indirectreportsnot bounded (no clamp, or arguments not 4-byte aligned). In the world that is most of the frame: in one run here, per world frame on average, 1,449 mesh dispatches (kind 10), 776 dispatches (kind 2), 285 draws (kind 0) and 79 indexed draws (kind 1) were dropped for that reason alone. I found no issue or PR that mentions it; anyone testing under Wine or Proton with the builtin compiler has it.Wine's compiler has a second gap that the first one hides: it ignores the
RootSignatureattribute (W5302: Ignoring unknown attribute "RootSignature"), so the compiled blob has noRTS0part andCreateRootSignaturefrom the shader bytes would fail next.Change
One file, the clamp only:
argsandbudgetareRWStructuredBuffer<uint>instead ofRWByteAddressBuffer, indexed in words.boundalready refuses addresses and strides that are not multiples of 4, so the same words are read and written. A root descriptor can be a structured buffer.D3D12SerializeVersionedRootSignaturebeside the shader, aspipeline/host.rsdoes for its own, instead of being read from the shader blob.InterlockedAddon it are unchanged.Testing
RTX 5070 Ti, driver 615.78.08, Nobara 44, Wine 11.21 Staging, vkd3d-proton and DXVK
dxgi.dllfrom GE-Proton11-14, diag build cross-compiled on Linux, Series X 1.0.2.1, network off.D3DCompile(cs_5_1) from both Wine's builtind3dcompiler_47and Microsoft's (a small test program, run under Wine with and without the native DLL). The old source compiles only with Microsoft's.ffe310e+ #454 #177 #259 #233 #646 #578 + the #783 fallback), one 450 s run each:d3dcompiler_47.dllbeside the exeargument clampwarningnot boundeddropsWith the clamp in place the next reasons for dropped indirect work are pipelines still being made, wave64 mesh programs refused by #578 on this 32-lane host, and shaders that do not translate.
cargo clippy -p victory-gpu --all-targets --all-features --locked -- -D warnings(targetx86_64-pc-windows-msvc) is clean.Not tested: native Windows (the pipeline is created through vkd3d-proton in all three columns, so D3D12's own check of a structured-buffer root UAV against this shader is not exercised), AMD,
cargo test(the existingargument_clamp_buildstest covers this path on a machine with a GPU), and the clamped values themselves beyond the title running with them.A workaround without this change: put Microsoft's
d3dcompiler_47.dllnext tovictory.exeand addd3dcompiler_47=ntoWINEDLLOVERRIDES.AI-assisted (Claude Code): it found the cause from the logs, wrote the change and this text, and ran the tests on the machine above. No game data attached.
Imported from Marvisak/VIctory. Originally posted by MichaelSmithAI on 2026-11-24T13:58:58Z.
The numerical clamp comparison passed. On an RTX 4090 under Wine/GE 3.2,
f2a71acproduced the expected words with Wine’s builtin compiler and Microsoft D3DCompiler. The same fixture on a main-based port of #190, which supplies precompiled DXIL, returned the identical buffer. This covers draw, indexed draw, mesh, accepted and rejected compute records, and padding at a 32-byte stride. The final indexed draw also exercised the budget consumed by earlier records.Only the clamp executed.
On native Windows 10, andrewpozdnakov7-jpg verified pipeline creation on
f2a71acusing D3D12 WARP and the system D3DCompiler. On4dd4cfcboth focused tests passed, including the final comparison of all output and padding words. The full diagnostics suite had 54 passes and one ignored test. Counter saturation remains untested. Native WARP result The test-only follow-up is available against the author branch.Imported from Marvisak/VIctory. Originally posted by Mumogg on 2026-11-24T17:05:03Z.
Now that outside PRs are open again, this is PR #1279 (same commit,
f2a71ac), with the two verifications from this thread quoted in its description. Thanks for both. (AI-assisted, Claude Code.)Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T06:51:04Z.
Automated triage for the maintainers.
This is the same defect as #170, which is confirmed and still open:
make()incrates/victory-gpu/src/indirect.rscompiles the clamp withD3DCompile, Wine's compiler refusesRWByteAddressBuffer.Load, and every indirect execution is dropped. Your fix is now PR #1279, which is already named there. Proposed for closing as a duplicate of #170: it will be closed in 48 hours unless the reporter replies or a maintainer removes the label.Generated by Claude Code