GPU: an argument clamp Wine's compiler builds too (carries #1279) #2913

Open
github-bot wants to merge 2 commits from github-bot/gh-2913 into main AGit
Owner

@⁠arogan178 on GitHub · 2026-11-25 23:51 UTC · original
arogan178:wine-clamp-carry → main · +115 −36 · 1 files · 2 commits · open

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 no Load/Store on byte address buffers and ignores the RootSignature attribute.

This carries #1279, which needs a rebase, onto main's current clamp (the one that charges records in order). The buffers become structured buffers of uint, indexed in words; bound already refuses addresses and strides that are not multiples of 4. The root signature is serialized in code, in the order bound sets 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_whole checks every word of two records of each kind.

Fixes #170. Supersedes #1279.

Proof

victory-gpu tests cross-built for x86_64-pc-windows-msvc, run under Proton-CachyOS 11.0 with vkd3d-proton 3.2.0 on an RX 9070 XT (RADV):

indirect:: tests main this PR
Wine's built-in d3dcompiler_47 0 of 6 pass 7 of 7 pass
Microsoft's d3dcompiler_47 10.0.26100 6 of 6 pass 7 of 7 pass
  • With Microsoft's compiler the whole victory-gpu suite has the same 3 failures as main. They are vkd3d-proton issues fixed by #1722 and #2101.
  • With one word copy removed from the shader, records_arrive_whole fails.
  • 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.

**@⁠arogan178** on GitHub · 2026-11-25 23:51 UTC · [original](https://github.com/Marvisak/VIctory/pull/2913) `arogan178:wine-clamp-carry` → `main` · +115 −36 · 1 files · 2 commits · open 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 no `Load`/`Store` on byte address buffers and ignores the `RootSignature` attribute. This carries #1279, which needs a rebase, onto `main`'s current clamp (the one that charges records in order). The buffers become structured buffers of `uint`, indexed in words; `bound` already refuses addresses and strides that are not multiples of 4. The root signature is serialized in code, in the order `bound` sets 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_whole` checks every word of two records of each kind. Fixes #170. Supersedes #1279. ## Proof `victory-gpu` tests cross-built for `x86_64-pc-windows-msvc`, run under Proton-CachyOS 11.0 with vkd3d-proton 3.2.0 on an RX 9070 XT (RADV): | `indirect::` tests | `main` | this PR | |---|---|---| | Wine's built-in `d3dcompiler_47` | 0 of 6 pass | 7 of 7 pass | | Microsoft's `d3dcompiler_47` 10.0.26100 | 6 of 6 pass | 7 of 7 pass | - With Microsoft's compiler the whole `victory-gpu` suite has the same 3 failures as `main`. They are vkd3d-proton issues fixed by #1722 and #2101. - With one word copy removed from the shader, `records_arrive_whole` fails. - `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.
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 (#170, #909, #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 #1279, rebased onto the clamp that charges records in order.

Co-authored-by: Mumogg <[email protected]>
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.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:17:21 +00:00
Author
Owner

@⁠Marvisak on GitHub · 2026-11-26 02:21 UTC · original

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 to StructuredBuffer<uint> indexed in words, and its root signature is serialised in code (root_signature, in the order bound sets 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 because bound already refuses addresses and strides that are not multiples of 4. The new test checks whole records. CI check passes on Windows. This supersedes the older #1279, so only one of the two should land.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-26 02:21 UTC · [original](https://github.com/Marvisak/VIctory/pull/2913#issuecomment-7180730822) <!-- victory-triage v1 head=a9f2eb8c23227e4610295449ae12ba3b3990a0ef verdict=merge-candidate at=2026-11-26T02:21:36Z --> 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 to `StructuredBuffer<uint>` indexed in words, and its root signature is serialised in code (`root_signature`, in the order `bound` sets 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 because `bound` already refuses addresses and strides that are not multiples of 4. The new test checks whole records. CI `check` passes on Windows. This supersedes the older #1279, so only one of the two should land. --- _Generated by [Claude Code](https://claude.ai/code)_
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/2913/head:github-bot/gh-2913'
git switch 'github-bot/gh-2913'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2913'
git switch 'github-bot/gh-2913'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2913'
git switch 'github-bot/gh-2913'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2913'
git switch 'main'
git merge --squash 'github-bot/gh-2913'
git switch 'main'
git merge --ff-only 'github-bot/gh-2913'
git switch 'main'
git merge 'github-bot/gh-2913'
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!2913
No description provided.