Repository navigation
Conversation
The clamp of indirect arguments is HLSL compiled at run time by the
system's compiler. Under Wine that is vkd3d-shader's, which has no
methods on byte address buffers and ignores the RootSignature attribute:
argument clamp: clamp:19:27: E5005: Method 'Load' is not defined on
type 'RWByteAddressBuffer'.
Without the clamp every indirect execution is dropped ("not bounded"),
which is most of the world's draws and dispatches.
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 instead of
read from it. The bounds and the budget are unchanged.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Added MichaelSmithAI's readback test from #909 to this branch ( Run here on One thing for anyone repeating it under Wine: run the test binary with its own wineserver. Started against a wineserver that lives in another user namespace, (AI-assisted, Claude Code.) Edit: the Wine version was 11.22 Staging, not 11.21 (the system had updated before these runs). |
|
I independently tested 4dd4cfc against main ffe310e on Windows. The GPU diagnostics suite passed 54 tests with one ignored. In a local batch with #1283, #1307, #1309, and #1311, the all-features workspace suite passed 360 tests with six ignored and zero failures. WARP was selected, and Clippy and asset policy passed at local batch commit 1409f9c. These runs used synthetic fixtures. AI-assisted. |
…ied together Merges Marvisak#72 Marvisak#347 Marvisak#1000 Marvisak#358 Marvisak#352 Marvisak#626 Marvisak#1152 Marvisak#1129 Marvisak#1203 Marvisak#24 Marvisak#642 Marvisak#427 Marvisak#485 Marvisak#550 Marvisak#174 Marvisak#1279 onto main (ffe310e), each head unchanged, no conflicts. One change of mine: three of the PRs each add a `mod tests` at the end of pipeline/host.rs, so the merge defines `tests` three times (E0428). The second and third are named `library_tests` and `blend_tests`; nothing else changes. cargo clippy --workspace --all-targets --locked -- -D warnings, with and without --all-features, is clean and cargo test --workspace --locked passes (367 passed, 6 ignored; main has 342 passed, 6 ignored). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
draw.rs keeps both the breadcrumb user-data arm (Marvisak#1081) and the past-host-heap drop (Marvisak#550). indirect.rs takes the bundle's Wine-compiler clamp (Marvisak#1279), the same fix Marvisak#994 carried. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
indirect.rs is the bundle's file: Marvisak#994 and Marvisak#1279 carry the same Wine-compiler clamp, and both root_signature functions had landed. The bundle's frame-wait test uses budget(), the function main made of BUDGET for VICTORY_PIPELINE_WAIT_MS. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ame wait bundle Taken from the bundle: 64 MB stacks for pipeline workers (#1129), no blending on integer render targets (#1152), root signature flag fallback (#626), read-only depth read states (#485, on our stored rtvs/dsv and bind_targets), enhanced texture barrier translation (#642, on our recording_list so continuation segments get it), indirect mesh dispatch (#24), the frame wait taking its tick before it sleeps (#174), and the make.rs unit tests (#1203). Kept from our side: - pipeline/make.rs: early() starts every compute pipeline at creation (b4e8419); the per-pipeline wake pair, per-frame budget, wait_compute and copystat counters. The bundle's the_wait_budget_is_spent_once_per_frame test is dropped (written for its fixed BUDGET; our FrameBudget tests cover it); a_pipeline_is_made_once now holds the tests' serial lock. - indirect.rs: our whole file (#40's overflow-safe clamp, DXC fallback for Wine, rectangle pass). #1279's structured-buffer clamp and its readback test (written for the old bound/done API) are left out. - draw.rs: NOT_MADE counter, user_dword, typed table nulls (table_view_props, mirror_for_draw); the depth test calls readable() directly since our tables() needs a host pipeline. - frame.rs: our `_tick` (the diagnostics log already names it). - list.rs: execute_indirect's DISPATCH_SINGLE mapping in one place; our tests beside the bundle's. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Native Windows run on AMD: RX 6750 XT (RDNA2, gfx1031), AMD driver 32.0.21045.29003, i5-13400F, Windows 11, Rust 1.98.1 MSVC. Head 4dd4cfc on main ffe310e (clean merge).
Synthetic tests only, no game files. AI-assisted (Claude picked the PRs and wrote the batch script; I ran it on my machine). |
…shader writes and reads) onto integ/next Conflicts: 1. crates/victory-gpu/src/draw.rs, `State::bind`: the stack (Marvisak#1439's depth sampling) resets `self.depth_sampled`, Marvisak#334 starts a buffer-state command (`list.begin_command()`). Independent; both kept, reset first. 2. crates/victory-gpu/src/host.rs tests: the stack adds `warp_device_creation_and_caps_probe`, Marvisak#334 adds `buffer_states_transition_between_writes_and_reads`, `buffer_states_keep_a_command_writing` and `debug_layer_accepts_buffers_written_then_read_as_vertices` (with its helpers) at the same place. The shared text holds the `#[test]` before and the closing brace after, so neither side's body closes inside the hunk: the stack's test is closed and Marvisak#334's follow as separate items (not nested). Non-textual fixes: - draw.rs `root_srv_table` (Marvisak#493, bounded root SRVs as one-view tables) reads a host copy without going through `root_view`, so it never asked Marvisak#334's tracker for the read state. It now calls `list.buffer_state(&s.buffer, BUFFER_READ)` after its refresh, on cache hits too, as Marvisak#334's author and Hiiva noted on Marvisak#334 (Marvisak#334 (comment), Marvisak#334 (comment)). - indirect.rs test `clamp_preserves_record_offsets_and_shared_budget` (Marvisak#1279, via Marvisak#1439) called `indirect::done`, which Marvisak#334 removes (the clamp now asks the tracker for the write state and `close` returns the copy to COMMON). The call is dropped; the next `bound` asks for the write state again, so no transition is missing.
|
Automated triage for the maintainers. Needs rebase. This pull request conflicts with Generated by Claude Code |
|
Rebased onto The branch needed a rebase across The conflict resolution:
Tested on Arch Linux, RX 9070 XT (RADV), system Wine 11.22, with vkd3d-proton
No other test changes against If you'd rather rebase it yourself, ignore this. To take it: AI-assisted (Claude Code); numbers from my own runs. |
Under Wine and Proton, D3DCompile is Wine's d3dcompiler_47, whose HLSL
compiler is vkd3d-shader's. It refuses the clamp (E5005: no Load or
Interlocked* methods on RWByteAddressBuffer; [allow_uav_condition] is
"not yet implemented") and ignores [RootSignature], so the clamp is never
made and every indirect execution is dropped ("no argument clamp:
indirect execution dropped"). The window check's compare shader and the
tests' WORKER_CS fail the same way.
The three shaders are rewritten with what both compilers take; the rules
are unchanged (MOST_DRAW, one budget charge per group of 64 in lane order,
the 2^27 budget, the window rules, the gathered records):
- The buffers a shader writes are RWStructuredBuffer<uint> indexed in
words: the destination record at id.x * (stride / 4), copied words at
+ off / 4; the budget's words 0, 1, 2 (bytes 0, 4, 8 as before); the
window check's results at words 0, 1, 2.., 10... A root UAV can be
either kind, and stride, offsets and addresses are already refused
unless multiples of 4 (validate_layout, record_clamp_as, gatherable,
record_gather_as), so the same bytes are written. The read-only source
and count stay ByteAddressBuffer: Load on those builds. Gathered
records (bit 2) read their offsets from the table behind count_buf as
before and land in slot id.x, in words like the rest.
- Interlocked* are called as functions on the buffer's word.
- [allow_uav_condition] is dropped: Microsoft's d3dcompiler_47 builds the
loop without it.
- The root signatures are serialized in code (host::root_signature,
root_constants, root_view; version 1.1, the same parameters as the RS
strings, root SRVs static while set and root UAVs volatile, the
defaults of the strings) and passed to the pipeline. The gather pass
binds the same five parameters; its table is upload memory written
before the list is submitted, which a root SRV static while set allows.
A test checks the clamp's output on the host GPU word by word (offsets
into the source, a count at an offset, strides past the smallest, every
kind): the WARP value tests skip where there is no WARP adapter, as under
Wine.
The form descends from Marvisak/VIctory PR Marvisak#1279 (Mumogg), written for
upstream's simpler clamp; fork PR Marvisak#127 (BitWuehler) did the same for this
fork's clamp before the group charge and the window check came in.
Tested: cargo xwin build --release -p victory; cargo xtask policy (180
files ok). Windows tests under Wine 11.22 (Arch wine 11.22-1; its
d3dcompiler_47 is vkd3d-shader 2.1, Wine bundled) with the vkd3d-proton
of Proton Experimental (experimental-11.0-20261112) on an RX 7900 XTX
(RADV, Mesa 26.3.1): victory-gpu 176 passed, 3 failed (was 170 passed,
8 failed on this commit's parent); fixed:
indirect::tests::argument_clamp_builds,
host_list_budget_starts_empty_at_each_submission,
host_list_reuses_and_grows_scratch_across_submissions,
host_list_window_check_finds_a_record_written_under_its_window,
host_list_window_executions_need_no_barrier_of_their_own; no new
failure. indirect:: passes (16 of 16) also with Proton Experimental's own
d3dcompiler_47 (vkd3d-shader 2.1) and with Microsoft's d3dcompiler_47
10.0.26100.3916 loaded natively (the parent: 10 of 15 with Proton's,
15 of 15 with Microsoft's). With the WARP harness pointed at the RX 7900
XTX for the run only, the WARP value tests, the gathered records' one
included, pass under Wine's compiler (the parent's clamp does not build
there); warp_budget_saturates_without_wraparound_and_preserves_draw_fields
then fails now and then on this commit and on its parent alike, under
Microsoft's compiler too (on a real card the second group can charge
first). Not run on Windows.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The rebased branch makes the world draw under stock Wine (RX 9070 XT, RADV) A world run of the rebased branch (
At least 5 minutes in the world with no crash, no exception and no amdgpu message in the kernel log. The run then stopped about 7½ minutes into the world, on the title's own So under Wine's own compiler, this PR is what turns the black world into a drawn one here. AI-assisted (Claude Code); numbers from my own runs. |
|
Note 🤖 Claude Opus 5.5 responding on behalf of @arogan178 Carried onto current |
|
AI-assisted (Claude). |
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. Filed first as #909 (PRs from outside contributors were closed at the time); 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+ Loader: opt-in VICTORY_NO_WATCHDOG hook for the title's watchdog (build 1.0.2.1) #454 Shaders: key heap handles by element type (atomic on a float-read UAV) #177 Shaders: query a descriptor's level count only when word 3 is read #259 Shaders: wave64 compute on 32-lane hosts, in halves and in the console flow #233 Shaders: fix whole-wave EXEC inline constant sign-extension and prefix lane validation #646 GPU: refuse wave64 mesh and compute programs on hosts without 64-lane waves #578 + the GPU: a copy that meets an unmapped page retries in 64 KiB kernel calls (2 300-2 500 a world frame); one query per region is 2.3x cheaper #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.Verified by others in #909 (on this same commit,
f2a71ac):Not tested: native Windows on a hardware GPU, AMD, and
cargo teston my side (the existingargument_clamp_buildstest covers this path on a machine with a GPU).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.
Closes #909.
🤖 Generated with Claude Code