Repository navigation
Conversation
The clamp of indirect arguments is HLSL compiled at run time by the system's compiler. Under Wine and Proton that is vkd3d-shader's, which has no methods on byte address buffers and ignores the RootSignature attribute, so the clamp is never made and every indirect execution is dropped (Marvisak#170, Marvisak#909, Marvisak#2744). The buffers become structured buffers of uint, indexed in words (the caller already refuses addresses and strides that are not multiples of 4), and the root signature is serialized beside the shader, in the order the caller sets it. The bounds, the budget and its order are unchanged. Carries Marvisak#1279, rebased onto the clamp that charges records in order. Co-authored-by: Mumogg <104529023+Mumogg@users.noreply.github.com>
The clamp tests read back only each record's first word. They now read whole records, and one test checks every word of two records of each kind.
kotekompotek
left a comment
There was a problem hiding this comment.
Verified the byte-to-word conversion: at = record * (stride/4) and every Load(at+N*4) maps to args[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 on StructuredBuffer<uint> work — stride comes from the shader decl — so dropping the embedded RootSignature attribute only costs the explicit root_signature() beside it, which matches bound's set order. Wine gets the same clamp through its own compiler. LGTM.
fuzeofficlal
left a comment
There was a problem hiding this comment.
Verified head a9f2eb8c cleanly on origin/main (63bcca43) on Windows 11 x64 (NVIDIA GeForce RTX 5090 + D3D12 WARP + VICTORY_D3D12_DEBUG=1).
Code & Equivalence Review
- Replacing
#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)
- RTX 5090 & WARP:
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.
|
Automated triage for the maintainers. Merge candidate (a recommendation to look, not an approval). In Generated by Claude Code |
Dukestar69
left a comment
There was a problem hiding this comment.
Tested locally merged onto origin/main (63bcca4) on Windows 11 x64 (NVIDIA GeForce RTX 5090 + WARP):
- Diff review: Replacing
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).
Both were HLSL compiled at first use with D3DCompile. Under Wine that is vkd3d-shader's compiler, which refuses them (no methods on RWByteAddressBuffer, [RootSignature] ignored), so indirect execution was dropped and 16-bit depth written through unordered views never reached the depth texture. The rewrites in Marvisak#2913, Marvisak#2919 and Marvisak#2969 still need a Wine of 11.22 or later. victory-shader now writes both programs itself with its DXIL builder (emit::argument_clamp, emit::depth_conversion), the same algorithm and clamps as the HLSL, and victory-gpu makes their root signatures in code (own.rs). No shader compiler runs, whatever the Wine version. Tests: every_word_of_each_kind checks each word the clamp writes for every record kind; depth_converts_both_ways runs the conversion both ways on a buffer, with no compiler for the test either; our_programs_validate runs both through the DXIL validator where the SDK has one. Under Wine 10 and vkd3d-proton 3.1 the 7 indirect tests and the new depth test pass (6 indirect tests failed before), and the two draw tests that read converted depth pass with a native compiler for their own shaders. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 GPU: the host pipeline library works under Wine (null blob for an empty library) #1722 and GPU: castable formats the host has #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.