GPU: shaders of our own that Wine's compiler builds too #2969

Open
github-bot wants to merge 1 commit from github-bot/gh-2969 into main AGit
Owner

@⁠neonbyte1 on GitHub · 2026-11-26 01:48 UTC · original
neonbyte1:pr/wine-compile → main · +541 −333 · 9 files · 1 commits · open

Under Wine, D3DCompile is Wine's d3dcompiler_47 (vkd3d-shader's HLSL). It has no methods on writable byte address buffers (E5005: Method 'Load' is not defined on type 'RWByteAddressBuffer'), and it ignores [RootSignature], so the blob carries no root signature to create. Every shader VIctory compiles at run time failed there:

  • the indirect-argument clamp: no argument clamp: indirect execution dropped, after which every indirect draw and dispatch is dropped as not bounded;
  • the depth twin's 16-bit conversion: no depth conversion;
  • the tests' own shaders.

On Linux this alone keeps the world from drawing. In a run on main with the NVIDIA fixes below, indirect drops summed to about 5,000 a frame, including the mesh dispatches that carry the world's geometry.

What changes

  • A new module, compute, compiles a shader and builds its root signature in Rust from the parameters the host binds.
  • The clamp keeps main's design: one group, tiles of 64, groupshared costs charged in order, the list's budget, the rest of each record copied. The title's records are now a StructuredBuffer<uint> (t0), and the clamped records and the budget are RWStructuredBuffer<uint> (u0, u1), indexed in words. bound() already refuses addresses and strides that aren't multiples of 4. The root signature is b0 (4 constants), SRV t0, UAV u1, UAV u0, in the order bound() binds them.
  • The depth conversion indexes its scratch buffer in words, with b0 (8 constants) and UAV u0.
  • The tests' shaders drop their [RootSignature] attributes the same way. The marked-write test ORs its page bit through a RWStructuredBuffer<uint>.
  • A new test checks every word the clamp writes for draws, indexed draws, dispatches, mesh dispatches, records past the budget and the budget spent.

The approach is @⁠Mumogg's from #1279 (structured buffers indexed in words, the root signature built beside the shader). #1279 no longer applies to main's rewritten clamp, so this ports it and extends it to the depth conversion. #2093 takes the other route, compiling these shaders on Windows at build time. Either fixes the run-time failure; this one needs no change to the build.

Tested on an RTX 5090 (driver 620.73.04), Linux, Wine 11.22, vkd3d-proton 3.1-83 (GE-Proton11-14), with cargo xtask wine-test (#1218):

  • victory-gpu under Wine: 225 passed, 6 failed, against 200/30 on main (63bcca4). The remaining 6 are other Wine gaps, fixed elsewhere (#1722, #2101, #2973).
  • pipeline::library::tests::pipelines_load_on_many_threads_at_once is one of the 6, and it only fails with this PR. On main its RWByteAddressBuffer/[RootSignature] shader doesn't compile under Wine, so it returned early and counted as passed. Now it compiles and runs into vkd3d-proton refusing a non-null empty pipeline library blob, which #1722 fixes. With #1722 on top, all 11 pipeline::library tests pass (3 of 3 runs).
  • In game, on our NVIDIA/Wine test build: no argument clamp and the not bounded drops are gone. Indirect drops fell from thousands to about 90 a frame, and draws run from about 800 to 4,900 a frame.
  • cargo clippy --workspace --all-targets (with and without diagnostics) and cargo xtask policy are clean.
  • Once, in three full victory-gpu runs, watch::tests::a_retake_marks_buffer_copies_alone hung with the rest of the suite running beside it. It passed 10 of 10 runs on its own, both with and without this change. Mentioning it in case others see it.

Not tested on Windows. Microsoft's compiler accepts the same HLSL, but I haven't run it.

AI-assisted (Claude); measured on my machine, no game data shared.

**@⁠neonbyte1** on GitHub · 2026-11-26 01:48 UTC · [original](https://github.com/Marvisak/VIctory/pull/2969) `neonbyte1:pr/wine-compile` → `main` · +541 −333 · 9 files · 1 commits · open Under Wine, `D3DCompile` is Wine's `d3dcompiler_47` (vkd3d-shader's HLSL). It has no methods on writable byte address buffers (`E5005: Method 'Load' is not defined on type 'RWByteAddressBuffer'`), and it ignores `[RootSignature]`, so the blob carries no root signature to create. Every shader VIctory compiles at run time failed there: - the indirect-argument clamp: `no argument clamp: indirect execution dropped`, after which every indirect draw and dispatch is dropped as `not bounded`; - the depth twin's 16-bit conversion: `no depth conversion`; - the tests' own shaders. On Linux this alone keeps the world from drawing. In a run on `main` with the NVIDIA fixes below, indirect drops summed to about 5,000 a frame, including the mesh dispatches that carry the world's geometry. **What changes** - A new module, `compute`, compiles a shader and builds its root signature in Rust from the parameters the host binds. - The clamp keeps `main`'s design: one group, tiles of 64, groupshared costs charged in order, the list's budget, the rest of each record copied. The title's records are now a `StructuredBuffer<uint>` (t0), and the clamped records and the budget are `RWStructuredBuffer<uint>` (u0, u1), indexed in words. `bound()` already refuses addresses and strides that aren't multiples of 4. The root signature is b0 (4 constants), SRV t0, UAV u1, UAV u0, in the order `bound()` binds them. - The depth conversion indexes its scratch buffer in words, with b0 (8 constants) and UAV u0. - The tests' shaders drop their `[RootSignature]` attributes the same way. The marked-write test ORs its page bit through a `RWStructuredBuffer<uint>`. - A new test checks every word the clamp writes for draws, indexed draws, dispatches, mesh dispatches, records past the budget and the budget spent. The approach is @⁠Mumogg's from #1279 (structured buffers indexed in words, the root signature built beside the shader). #1279 no longer applies to `main`'s rewritten clamp, so this ports it and extends it to the depth conversion. #2093 takes the other route, compiling these shaders on Windows at build time. Either fixes the run-time failure; this one needs no change to the build. **Tested** on an RTX 5090 (driver 620.73.04), Linux, Wine 11.22, vkd3d-proton 3.1-83 (GE-Proton11-14), with `cargo xtask wine-test` (#1218): - `victory-gpu` under Wine: 225 passed, 6 failed, against 200/30 on `main` (63bcca4). The remaining 6 are other Wine gaps, fixed elsewhere (#1722, #2101, #2973). - `pipeline::library::tests::pipelines_load_on_many_threads_at_once` is one of the 6, and it only fails with this PR. On `main` its `RWByteAddressBuffer`/`[RootSignature]` shader doesn't compile under Wine, so it returned early and counted as passed. Now it compiles and runs into vkd3d-proton refusing a non-null empty pipeline library blob, which #1722 fixes. With #1722 on top, all 11 `pipeline::library` tests pass (3 of 3 runs). - In game, on our NVIDIA/Wine test build: `no argument clamp` and the `not bounded` drops are gone. Indirect drops fell from thousands to about 90 a frame, and draws run from about 800 to 4,900 a frame. - `cargo clippy --workspace --all-targets` (with and without `diagnostics`) and `cargo xtask policy` are clean. - Once, in three full `victory-gpu` runs, `watch::tests::a_retake_marks_buffer_copies_alone` hung with the rest of the suite running beside it. It passed 10 of 10 runs on its own, both with and without this change. Mentioning it in case others see it. Not tested on Windows. Microsoft's compiler accepts the same HLSL, but I haven't run it. _AI-assisted (Claude); measured on my machine, no game data shared._
Under Wine, D3DCompile is Wine's d3dcompiler_47 (vkd3d-shader HLSL): it
has no methods on writable byte address buffers (E5005 'Load' is not
defined on RWByteAddressBuffer) and ignores a [RootSignature] attribute,
so the code holds no root signature to make. Every run-time shader of
ours failed there: the argument clamp ("no argument clamp: indirect
execution dropped", every indirect draw and dispatch then dropped as
not bounded), the depth twin's 16-bit conversion ("no depth
conversion"), and the tests' own shaders.

A new module, compute, compiles a shader and serializes its root
signature in Rust from the parameters the host binds. The clamp keeps
main's design (one group, tiles of 64, groupshared costs charged in
order, the list's budget, the record's rest copied) with the title's
records a StructuredBuffer<uint> (t0) and the clamped records and the
budget RWStructuredBuffer<uint> (u0, u1), indexed in words: bound()
already refuses addresses and strides not multiples of 4. Its root
signature is b0 (4 constants), SRV t0, UAV u1, UAV u0, as bound()
binds them. The depth conversion indexes its scratch buffer in words
(footprint offsets and pitches are multiples of 4) with b0 (8
constants) and UAV u0. Test shaders lose their RootSignature
attributes the same way.

A new test checks every word the clamp writes for draws, indexed
draws, dispatches, mesh dispatches, records past the budget and the
budget spent.

The approach is Mumogg's (#1279: structured buffers indexed in words,
the root signature serialized beside the shader), ported to main's
rewritten clamp and extended to the depth conversion.

The tests that bound their own root signatures:
The marked-UAV, placed-view and depth-twin rebind tests compile their
shaders with a [RootSignature] attribute Wine's compiler ignores, and
the marked write ORs its page bit through a byte address buffer method
it lacks. Their root signatures are made with crate::compute from what
the tests bind, and the bitmap is a RWStructuredBuffer<uint> indexed in
words.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:18:55 +00:00
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-26 02:00 UTC · original · reviewed

Reviewed and verified against main (63bcca43) on Windows 11 (RTX 5090 + WARP, VICTORY_D3D12_DEBUG=1) — clean refactor and ready to merge:

  • crates/victory-gpu/src/compute.rs cleanly replaces inline [RootSignature] annotations across all 8 call sites with explicit D3D12SerializeRootSignature 1.0 builders matching the previous register spaces and slot ordering 1-for-1, and converting writable RWByteAddressBuffer usages (indirect.rs, twin.rs, draw.rs, pipeline/library.rs) to StructuredBuffer<uint> / RWStructuredBuffer<uint> preserves 4-byte alignment and atomic bit indexing.
  • Native Windows FXC compilation and D3D12 Debug Layer run with zero warnings on both hardware and WARP.

Local verification:

  • victory-gpu (compute::, draw::tests::, bindless::, indirect::, twin::, host::tests::, pipeline:: with VICTORY_D3D12_DEBUG=1): 81/81 passed on both RTX 5090 and WARP (excluding pre-existing NVIDIA 1M view-heap baseline test)
  • cargo clippy --locked -p victory-gpu --tests -- -D warnings: 0 warnings
  • cargo xtask policy: 192 files ok
**@⁠fuzeofficlal** on GitHub · 2026-11-26 02:00 UTC · [original](https://github.com/Marvisak/VIctory/pull/2969#pullrequestreview-6067554229) · **reviewed** Reviewed and verified against `main` (`63bcca43`) on Windows 11 (RTX 5090 + WARP, `VICTORY_D3D12_DEBUG=1`) — clean refactor and ready to merge: - `crates/victory-gpu/src/compute.rs` cleanly replaces inline `[RootSignature]` annotations across all 8 call sites with explicit `D3D12SerializeRootSignature` 1.0 builders matching the previous register spaces and slot ordering 1-for-1, and converting writable `RWByteAddressBuffer` usages (`indirect.rs`, `twin.rs`, `draw.rs`, `pipeline/library.rs`) to `StructuredBuffer<uint>` / `RWStructuredBuffer<uint>` preserves 4-byte alignment and atomic bit indexing. - Native Windows FXC compilation and D3D12 Debug Layer run with zero warnings on both hardware and WARP. **Local verification**: - `victory-gpu` (`compute::`, `draw::tests::`, `bindless::`, `indirect::`, `twin::`, `host::tests::`, `pipeline::` with `VICTORY_D3D12_DEBUG=1`): **81/81 passed** on both **RTX 5090** and **WARP** (excluding pre-existing NVIDIA 1M view-heap baseline test) - `cargo clippy --locked -p victory-gpu --tests -- -D warnings`: 0 warnings - `cargo xtask policy`: 192 files ok
Author
Owner

@⁠steven-seagull27 on GitHub · 2026-11-26 03:05 UTC · original

I exercised the format-118 depth/stencil conversion through the production Twin::copy path on Windows. The RTX 5080 and built-in WARP both returned exact results on 16080c4 and its parent 63bcca4. On each adapter and build, all 174,342 depth texels and 174,342 stencil bytes matched in each direction.

The fixture uses a 259×257 texture, three mips and two array slices. It covers all 65,536 D16 values, both pixels packed into a word, odd row widths, differing row pitches and an independent stencil pattern. It compares the intermediate D32 bit patterns against the material-depth formula, overwrites the twin, then checks the copy back to D16/S8. As a sensitivity check, deliberately reading the low 16 bits for both pixels failed at (1, 0) on both adapters with 0x00000000 instead of 0x3f1e379e.

The test-only commit 3708bd0 can be cherry-picked onto this branch. Run cargo test --locked -p victory-gpu --features diagnostics --lib depth_twin_preserves_every_u16 -- --nocapture. Set VICTORY_D3D12_WARP=1 for the software pass. The three twin tests, strict Clippy and asset policy passed here. This measures the Windows conversion path; the in-game Wine observation is the author's.

**@⁠steven-seagull27** on GitHub · 2026-11-26 03:05 UTC · [original](https://github.com/Marvisak/VIctory/pull/2969#issuecomment-7181383707) I exercised the format-118 depth/stencil conversion through the production `Twin::copy` path on Windows. The RTX 5080 and built-in WARP both returned exact results on `16080c4` and its parent `63bcca4`. On each adapter and build, all **174,342 depth texels and 174,342 stencil bytes matched in each direction**. The fixture uses a 259×257 texture, three mips and two array slices. It covers all 65,536 D16 values, both pixels packed into a word, odd row widths, differing row pitches and an independent stencil pattern. It compares the intermediate D32 bit patterns against the material-depth formula, overwrites the twin, then checks the copy back to D16/S8. As a sensitivity check, deliberately reading the low 16 bits for both pixels failed at (1, 0) on both adapters with `0x00000000` instead of `0x3f1e379e`. The [test-only commit `3708bd0`](https://github.com/steven-seagull27/VIctory/commit/3708bd00ec556275cb67c55d752a7c471fb09627) can be cherry-picked onto this branch. Run `cargo test --locked -p victory-gpu --features diagnostics --lib depth_twin_preserves_every_u16 -- --nocapture`. Set `VICTORY_D3D12_WARP=1` for the software pass. The three twin tests, strict Clippy and asset policy passed here. This measures the Windows conversion path; the in-game Wine observation is the author's.
Author
Owner

@⁠postblink on GitHub · 2026-11-26 04:22 UTC · original

Tested on Linux with an NVIDIA card: it works there too.

Setup: CachyOS (Linux 7.3.6), RTX 5080 (driver 620.73.04), Ryzen 7 9800X3D. GE-Proton11-14's wine run directly, with vkd3d-proton master 71cae091 (dxil-spirv b540c8a) in the prefix and DXVK's dxgi. main 63bcca4 with #2723 and #189 on top, diag build, retail 1.0.2.1, Series X mode.

before (main + #2723) with #2969 (and #189)
no argument clamp: indirect execution dropped logged absent
indirect executions dropped, median per frame in the world about 4,770 about 730
draws reaching the host, median per frame about 800 about 4,000, up to 6,300
picture nearly black, scattered lights lit opening cutscene, then the first playable section (camera input works)

#189 removes refused wave64 pipelines and doesn't touch the clamp. The indirect numbers moved with the clamp alone: a run with my own port of #1279 instead of #2969, and no #189, already showed about 760 indirect drops and up to 8,600 draws per frame. The remaining indirect drops are not the clamp. Most are no dynamic slots for root views on NVIDIA's capped view heap (#747), which I'm comparing separately.

Before trying this PR I carried #1279 onto main myself as a check. Its indirect tests went from 0 of 6 to 6 of 6 under GE-Proton's Wine compiler on the RTX 5080. Yours takes the same approach and covers the depth twin too (I ran its in-game path above, not its tests), so I dropped mine.

AI-assisted (Claude), runs and numbers from my own hardware.

**@⁠postblink** on GitHub · 2026-11-26 04:22 UTC · [original](https://github.com/Marvisak/VIctory/pull/2969#issuecomment-7182538064) Tested on Linux with an NVIDIA card: it works there too. **Setup:** CachyOS (Linux 7.3.6), RTX 5080 (driver 620.73.04), Ryzen 7 9800X3D. GE-Proton11-14's `wine` run directly, with vkd3d-proton master `71cae091` (dxil-spirv `b540c8a`) in the prefix and DXVK's `dxgi`. `main` `63bcca4` with #2723 and #189 on top, `diag` build, retail 1.0.2.1, Series X mode. | | before (`main` + #2723) | with #2969 (and #189) | |---|---|---| | `no argument clamp: indirect execution dropped` | logged | absent | | indirect executions dropped, median per frame in the world | about 4,770 | about 730 | | draws reaching the host, median per frame | about 800 | about 4,000, up to 6,300 | | picture | nearly black, scattered lights | lit opening cutscene, then the first playable section (camera input works) | #189 removes refused wave64 pipelines and doesn't touch the clamp. The indirect numbers moved with the clamp alone: a run with my own port of #1279 instead of #2969, and no #189, already showed about 760 indirect drops and up to 8,600 draws per frame. The remaining indirect drops are not the clamp. Most are `no dynamic slots for root views` on NVIDIA's capped view heap (#747), which I'm comparing separately. Before trying this PR I carried #1279 onto `main` myself as a check. Its `indirect` tests went from 0 of 6 to 6 of 6 under GE-Proton's Wine compiler on the RTX 5080. Yours takes the same approach and covers the depth twin too (I ran its in-game path above, not its tests), so I dropped mine. _AI-assisted (Claude), runs and numbers from my own hardware._
Author
Owner

@⁠Marvisak on GitHub · 2026-11-26 05:36 UTC · original

Automated triage for the maintainers.

Merge candidate. The PR moves VIctory's run-time compute shaders (the indirect-argument clamp in indirect.rs, the depth twin's 16-bit conversion in twin.rs, and the test shaders) off RWByteAddressBuffer methods and [RootSignature] attributes, which Wine's D3DCompile does not support, onto uint structured buffers indexed in words, with the root signatures built in Rust (new compute.rs). main already makes allowances for Wine (host.rs, pipeline/library.rs, xmem::on_wine), so this is in scope, and it needs no build change, unlike the build-time route in #2093. I checked the clamp's word arithmetic against the old byte offsets (records stride / 4 words apart; bound() already refuses unaligned addresses and strides), the root parameter order against what bound() and Twin::copy bind, and the twin's (at16 + y * pitch16) / 4 + id.x against the old x * 2 byte offset with even x. The new clamped_records_hold_every_word expectations work out by hand. A commenter reports bit-exact twin conversion on Windows (RTX 5080 and WARP) and another reports the in-game effect under Wine.

The author has not run it on Windows; a maintainer run of victory-gpu tests on a Windows GPU would close that gap.

CI: passing. Recommending a look, not approving.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-26 05:36 UTC · [original](https://github.com/Marvisak/VIctory/pull/2969#issuecomment-7183637938) <!-- victory-triage v1 head=16080c4b2dd63dfc2246c9f7e5e48a49c01e5d8e verdict=merge-candidate at=2026-11-26T05:36:12Z --> Automated triage for the maintainers. **Merge candidate.** The PR moves VIctory's run-time compute shaders (the indirect-argument clamp in `indirect.rs`, the depth twin's 16-bit conversion in `twin.rs`, and the test shaders) off `RWByteAddressBuffer` methods and `[RootSignature]` attributes, which Wine's `D3DCompile` does not support, onto `uint` structured buffers indexed in words, with the root signatures built in Rust (new `compute.rs`). `main` already makes allowances for Wine (`host.rs`, `pipeline/library.rs`, `xmem::on_wine`), so this is in scope, and it needs no build change, unlike the build-time route in #2093. I checked the clamp's word arithmetic against the old byte offsets (records `stride / 4` words apart; `bound()` already refuses unaligned addresses and strides), the root parameter order against what `bound()` and `Twin::copy` bind, and the twin's `(at16 + y * pitch16) / 4 + id.x` against the old `x * 2` byte offset with even `x`. The new `clamped_records_hold_every_word` expectations work out by hand. A commenter reports bit-exact twin conversion on Windows (RTX 5080 and WARP) and another reports the in-game effect under Wine. The author has not run it on Windows; a maintainer run of `victory-gpu` tests on a Windows GPU would close that gap. CI: passing. Recommending a look, not approving. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠postblink on GitHub · 2026-11-26 05:43 UTC · original

Follow-up on my earlier comment, which said I hadn't run this PR's tests. I've now run them: the whole victory-gpu suite under Wine, on main 63bcca4 and on this head 16080c4. Same machine and prefix (RTX 5080, GE-Proton11-14's wine, vkd3d-proton master 71cae091), one top-level module per process.

main #2969
passed 184 206
failed 25 4
  • Fixed (22): every indirect test, 16 draw tests that run its compute shaders (the placed-view, marked sub-page UAV and upload tests, plus compute_view_marks_rebind_after_depth_twin_conversion) and bindless::tests::heap_views_follow_writes_through_another_mapping. The new clamped_records_hold_every_word passes.
  • Fails only with this PR (1): pipeline::library::tests::pipelines_load_on_many_threads_at_once (5 of 5; an empty library at library.rs:668). It isn't a regression. On main, that test's RWByteAddressBuffer / [RootSignature] shader doesn't compile under Wine, so it returns at "no shader compiler here" and counts as passed. With this PR the shader builds and the test really runs into vkd3d-proton refusing an empty library blob, which #1722 fixes. With #1722 on top, all 11 pipeline::library tests pass, 3 of 3 runs, including a_rejected_blob_gives_an_empty_library.
  • Fail on both (3): descriptor::host::tests::dynamic_slots_are_held_until_released (the NVIDIA heap cap, #747), draw::tests::a_texture_written_in_one_format_reads_in_another_through_a_placed_view, and pipeline::library::tests::a_rejected_blob_gives_an_empty_library (#1722).

Not run: resource::tests::a_list_waiting_for_another_queues_write_reads_what_it_wrote, which hangs under Wine on both builds. Run all together, the suite also took the headless X server down after about two minutes, so I ran it one module at a time. This is still Wine, not Windows, so the Windows run the triage asks for is still open.

AI-assisted (Claude), runs and numbers from my own hardware.

**@⁠postblink** on GitHub · 2026-11-26 05:43 UTC · [original](https://github.com/Marvisak/VIctory/pull/2969#issuecomment-7183749412) Follow-up on my earlier comment, which said I hadn't run this PR's tests. I've now run them: the whole `victory-gpu` suite under Wine, on `main` `63bcca4` and on this head `16080c4`. Same machine and prefix (RTX 5080, GE-Proton11-14's `wine`, vkd3d-proton master `71cae091`), one top-level module per process. | | `main` | #2969 | |---|---|---| | passed | 184 | 206 | | failed | 25 | 4 | - **Fixed (22):** every `indirect` test, 16 `draw` tests that run its compute shaders (the placed-view, marked sub-page UAV and upload tests, plus `compute_view_marks_rebind_after_depth_twin_conversion`) and `bindless::tests::heap_views_follow_writes_through_another_mapping`. The new `clamped_records_hold_every_word` passes. - **Fails only with this PR (1): `pipeline::library::tests::pipelines_load_on_many_threads_at_once`** (5 of 5; `an empty library` at `library.rs:668`). It isn't a regression. On `main`, that test's `RWByteAddressBuffer` / `[RootSignature]` shader doesn't compile under Wine, so it returns at "no shader compiler here" and counts as passed. With this PR the shader builds and the test really runs into vkd3d-proton refusing an empty library blob, which #1722 fixes. With #1722 on top, all 11 `pipeline::library` tests pass, 3 of 3 runs, including `a_rejected_blob_gives_an_empty_library`. - **Fail on both (3):** `descriptor::host::tests::dynamic_slots_are_held_until_released` (the NVIDIA heap cap, #747), `draw::tests::a_texture_written_in_one_format_reads_in_another_through_a_placed_view`, and `pipeline::library::tests::a_rejected_blob_gives_an_empty_library` (#1722). Not run: `resource::tests::a_list_waiting_for_another_queues_write_reads_what_it_wrote`, which hangs under Wine on both builds. Run all together, the suite also took the headless X server down after about two minutes, so I ran it one module at a time. This is still Wine, not Windows, so the Windows run the triage asks for is still open. _AI-assisted (Claude), runs and numbers from my own hardware._
Author
Owner

@⁠kotekompotek on GitHub · 2026-11-26 02:49 UTC · original · approved these changes

LGTM — verified the port preserves semantics on Windows while staying inside Wine's compiler subset.

What I checked:

  • compute.rs: root parameters built in Rust and serialized via D3D12SerializeRootSignature — this removes the RootSignature attribute dependency entirely (Wine's d3dcompiler ignores it, so the blob carried no signature to create). Error blobs are still logged on failure.
  • indirect.rs: byte→word conversions are consistent throughout (Load(at+4)→args[at+1], Store3(at+8)→dest[at+2..at+4] conditional on kind==1 as before); the draw copy-out writes words +2/+3 unconditionally and +4 only for indexed draws, matching Store2/Store3 exactly. The (stride/4) indexing is safe because bound() refuses non-4-multiple addresses and strides. Root params preserve the RS order: b0, t0, u1 (budget), u0 (dest). clamped_records_hold_every_word is a strong test — every output word asserted per kind, budget charged per the cost model, past-budget records run empty while keeping their non-count words.
  • twin.rs: (at16 + y·pitch16)/4 + id.x is exact because each thread owns a 2-pixel pair in one word; x*4 bytes = x words on the 32-bit side. Round-trip constants unchanged (0x37800080 / saturate*65535+0.5), so the tiled-lighting EQUAL-float behavior is preserved.
  • memory.rs test pipelines: table/root-view/constants params match the old RS strings register-for-register, including space=2 placements and unbounded ranges.

Note (non-blocking): several test-only shaders still use RWByteAddressBuffer.Store (e.g. dst in bindless/memory tests) — under Wine those tests would still not compile, which is presumably #2973's scope. Runtime paths are all Wine-safe now.

**@⁠kotekompotek** on GitHub · 2026-11-26 02:49 UTC · [original](https://github.com/Marvisak/VIctory/pull/2969#pullrequestreview-6067893009) · **approved these changes** LGTM — verified the port preserves semantics on Windows while staying inside Wine's compiler subset. What I checked: - **compute.rs**: root parameters built in Rust and serialized via `D3D12SerializeRootSignature` — this removes the `RootSignature` attribute dependency entirely (Wine's d3dcompiler ignores it, so the blob carried no signature to create). Error blobs are still logged on failure. - **indirect.rs**: byte→word conversions are consistent throughout (`Load(at+4)`→`args[at+1]`, `Store3(at+8)`→`dest[at+2..at+4]` conditional on kind==1 as before); the draw copy-out writes words +2/+3 unconditionally and +4 only for indexed draws, matching Store2/Store3 exactly. The `(stride/4)` indexing is safe because `bound()` refuses non-4-multiple addresses and strides. Root params preserve the RS order: b0, t0, u1 (budget), u0 (dest). `clamped_records_hold_every_word` is a strong test — every output word asserted per kind, budget charged per the cost model, past-budget records run empty while keeping their non-count words. - **twin.rs**: `(at16 + y·pitch16)/4 + id.x` is exact because each thread owns a 2-pixel pair in one word; `x*4` bytes = `x` words on the 32-bit side. Round-trip constants unchanged (0x37800080 / saturate*65535+0.5), so the tiled-lighting EQUAL-float behavior is preserved. - **memory.rs test pipelines**: table/root-view/constants params match the old RS strings register-for-register, including space=2 placements and unbounded ranges. Note (non-blocking): several test-only shaders still use `RWByteAddressBuffer.Store` (e.g. `dst` in bindless/memory tests) — under Wine those tests would still not compile, which is presumably #2973's scope. Runtime paths are all Wine-safe now.
Author
Owner

@⁠Dukestar69 on GitHub · 2026-11-26 07:30 UTC · original · approved these changes

Tested locally merged onto origin/main (63bcca4) on Windows 11 x64 (NVIDIA GeForce RTX 5090 + WARP):

  • cargo test -p victory-gpu indirect::tests -- --test-threads=1 (RTX 5090 & WARP): 7 passed, 0 failed on both.
  • cargo test -p victory-gpu twin::tests -- --test-threads=1: 2 passed, 0 failed.
  • cargo test -p victory-gpu present_compositor_builds_both_pipeline_states -- --test-threads=1: 1 passed, 0 failed.
  • cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.
  • cargo xtask policy: 192 files ok.

Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).

**@⁠Dukestar69** on GitHub · 2026-11-26 07:30 UTC · [original](https://github.com/Marvisak/VIctory/pull/2969#pullrequestreview-6070062129) · **approved these changes** Tested locally merged onto `origin/main` (`63bcca4`) on Windows 11 x64 (NVIDIA GeForce RTX 5090 + WARP): - `cargo test -p victory-gpu indirect::tests -- --test-threads=1` (RTX 5090 & WARP): 7 passed, 0 failed on both. - `cargo test -p victory-gpu twin::tests -- --test-threads=1`: 2 passed, 0 failed. - `cargo test -p victory-gpu present_compositor_builds_both_pipeline_states -- --test-threads=1`: 1 passed, 0 failed. - `cargo clippy -p victory-gpu --all-targets -- -D warnings`: clean. - `cargo xtask policy`: 192 files ok. Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
Author
Owner

@⁠neonbyte1 on GitHub · 2026-11-26 10:38 UTC · original

@⁠postblink Thanks for running the whole suite. I reproduced it on an RTX 5090 under GE-Proton11-14's Wine and vkd3d-proton, 3 runs per build, with a print at each place the library tests return early:

  • On main, Wine's compiler fails on pipelines_load_on_many_threads_at_once's shader (E5005: Method 'Load' is not defined on type 'RWByteAddressBuffer'). The test returns at "no shader compiler here" and counts as passed.
  • With this PR, the shader compiles and the test fails at an empty library (library.rs:668), 3 of 3.
  • With #1722 on top, all 11 pipeline::library tests pass, 3 of 3. That includes a_rejected_blob_gives_an_empty_library and a_pipeline_loads_while_a_save_holds_the_library. The latter also skips under Wine on both main and this PR until #1722.

I'm leaving the test as it is, because it now catches a real problem. When there's no saved library yet, the host asks for an empty one the same way, and under Wine without #1722 it ends up with no pipeline library at all. Making the test skip there would hide that, and the fix belongs to #1722. I've added a sentence about it to the description.

In a full victory-gpu run (one module per process, the hanging resource test skipped), this is the only test that fails with this PR and not on main: 30 failures on main, 6 with this PR. It's also the only test whose skip at the compile step this PR turns into a real run; the other tests whose shaders fail to compile on main already failed rather than skipping.

AI-assisted (Claude); measured on my machine, no game data shared.

**@⁠neonbyte1** on GitHub · 2026-11-26 10:38 UTC · [original](https://github.com/Marvisak/VIctory/pull/2969#issuecomment-7189637759) @⁠postblink Thanks for running the whole suite. I reproduced it on an RTX 5090 under GE-Proton11-14's Wine and vkd3d-proton, 3 runs per build, with a print at each place the library tests return early: - **On `main`,** Wine's compiler fails on `pipelines_load_on_many_threads_at_once`'s shader (`E5005: Method 'Load' is not defined on type 'RWByteAddressBuffer'`). The test returns at "no shader compiler here" and counts as passed. - **With this PR,** the shader compiles and the test fails at `an empty library` (`library.rs:668`), 3 of 3. - **With #1722 on top,** all 11 `pipeline::library` tests pass, 3 of 3. That includes `a_rejected_blob_gives_an_empty_library` and `a_pipeline_loads_while_a_save_holds_the_library`. The latter also skips under Wine on both `main` and this PR until #1722. I'm leaving the test as it is, because it now catches a real problem. When there's no saved library yet, the host asks for an empty one the same way, and under Wine without #1722 it ends up with no pipeline library at all. Making the test skip there would hide that, and the fix belongs to #1722. I've added a sentence about it to the description. In a full `victory-gpu` run (one module per process, the hanging `resource` test skipped), this is the only test that fails with this PR and not on `main`: 30 failures on `main`, 6 with this PR. It's also the only test whose skip at the compile step this PR turns into a real run; the other tests whose shaders fail to compile on `main` already failed rather than skipping. _AI-assisted (Claude); measured on my machine, no game data shared._
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2969/head:github-bot/gh-2969'
git switch 'github-bot/gh-2969'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2969'
git switch 'github-bot/gh-2969'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2969'
git switch 'github-bot/gh-2969'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2969'
git switch 'main'
git merge --squash 'github-bot/gh-2969'
git switch 'main'
git merge --ff-only 'github-bot/gh-2969'
git switch 'main'
git merge 'github-bot/gh-2969'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!2969
No description provided.