GPU: an argument clamp Wine's compiler builds too (carries #1279) #2911
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2913"
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 arogan178 on 2026-11-25T23:51:55Z.
Under Wine and Proton, every indirect draw and dispatch is dropped, so most of the world is never drawn (#170). The indirect-argument clamp is HLSL compiled at run time, and Wine's built-in
d3dcompiler_47(vkd3d-shader) refuses it: it has noLoad/Storeon byte address buffers and ignores theRootSignatureattribute.This carries #1279, which needs a rebase, onto
main's current clamp (the one that charges records in order). The buffers become structured buffers ofuint, indexed in words;boundalready refuses addresses and strides that are not multiples of 4. The root signature is serialized in code, in the orderboundsets it. The bounds, the budget and its order are unchanged.The clamp tests read back only each record's first word. They now read whole records, and
records_arrive_wholechecks every word of two records of each kind.Fixes #170. Supersedes #1279.
Proof
victory-gputests cross-built forx86_64-pc-windows-msvc, run under Proton-CachyOS 11.0 with vkd3d-proton 3.2.0 on an RX 9070 XT (RADV):indirect::testsmaind3dcompiler_47d3dcompiler_4710.0.26100victory-gpusuite has the same 3 failures asmain. They are vkd3d-proton issues fixed by #1722 and #2101.records_arrive_wholefails.cargo clippy -p victory-gpu --all-targets --target x86_64-pc-windows-msvc -- -D warnings, with and without--all-features: clean. CI runs the Windows tests.Reviewed with sol-loop: 1 round with GPT-6.2 Sol. Sol verdict: approved.
Imported from Marvisak/VIctory. Originally posted by kotekompotek on 2026-11-25T23:53:20Z.
Review: COMMENTED
Verified the byte-to-word conversion:
at = record * (stride/4)and everyLoad(at+N*4)maps toargs[at+N]consistently, including the tail-copies for both draw kinds; the budget/past-budget zeroing keeps the draw layout (zeroed first word, not the whole record). Root descriptors onStructuredBuffer<uint>work — stride comes from the shader decl — so dropping the embedded RootSignature attribute only costs the explicitroot_signature()beside it, which matchesbound's set order. Wine gets the same clamp through its own compiler. LGTM.Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-25T23:59:20Z.
Review: COMMENTED
Verified head
a9f2eb8ccleanly onorigin/main(63bcca43) on Windows 11 x64 (NVIDIA GeForce RTX 5090 + D3D12 WARP +VICTORY_D3D12_DEBUG=1).Code & Equivalence Review
#define RS/ByteAddressBufferwith explicitD3D12SerializeVersionedRootSignature(D3D_ROOT_SIGNATURE_VERSION_1_1) andStructuredBuffer<uint>/RWStructuredBuffer<uint>is mathematically equivalent across all four indirect kinds (Draw,DrawIndexed,Dispatch,Mesh), theGROUPS = 1<<20overflow check, the 64-lane tile loop, and theBUDGET = 1<<27clamp.bound()(crates/victory-gpu/src/indirect.rs:276) already enforces 4-byte alignment on bothgpuandstride, matching Root SRV/UAV requirements forStructuredBuffer<uint>and word-indexedrecord * (stride / 4).Local Verification (
--features diagnostics,VICTORY_D3D12_DEBUG=1)indirect::tests7/7 passed on both adapters (including newrecords_arrive_whole), zero debug-layer errors.cargo clippy --locked -p victory-gpu --all-targets -- -D warnings(default and--features diagnostics) &cargo xtask policy(191 files ok): clean.Looks clean and ready to merge.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-26T02:21:42Z.
Automated triage for the maintainers.
Merge candidate (a recommendation to look, not an approval). In
indirect.rs, the argument-clamp shader moves from byte address buffers toStructuredBuffer<uint>indexed in words, and its root signature is serialised in code (root_signature, in the orderboundsets it). That lets Wine's compiler build it (#170). The clamp bounds and the budget logic are unchanged by my reading. Word indexing is safe becauseboundalready refuses addresses and strides that are not multiples of 4. The new test checks whole records. CIcheckpasses on Windows. This supersedes the older #1279, so only one of the two should land.Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by Dukestar69 on 2026-11-26T05:46:35Z.
Review: APPROVED
Tested locally merged onto
origin/main(63bcca4) on Windows 11 x64 (NVIDIA GeForce RTX 5090 + WARP):ByteAddressBuffer/RWByteAddressBufferwithStructuredBuffer<uint>/RWStructuredBuffer<uint>(using 4-byte-aligned word strides) and serializing the root signature explicitly viaD3D12SerializeRootSignaturecleanly avoids Wine FXC limitations while keeping all draw/dispatch clamping and budget checks intact.cargo test -p victory-gpu indirect::tests -- --test-threads=1(RTX 5090 & WARP): 7 passed, 0 failed on both (includingargument_clamp_builds).cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.