GPU: the depth converter Wine's compiler builds too #2919

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

@⁠arogan178 on GitHub · 2026-11-25 23:58 UTC · original
arogan178:wine-depth-twin → main · +127 −13 · 1 files · 1 commits · open

Under Wine and Proton, 16-bit depth that the title writes through unordered views never reaches the host's depth texture (#1860). It is moved by a compute converter compiled at run time. Wine's built-in d3dcompiler_47 (vkd3d-shader) refuses it, because it has no Load/Store on byte address buffers, and it ignores the RootSignature attribute. The converter is never made.

#1872 serializes the root signature when the compiler drops it. That is half of it: with Proton-CachyOS 11.0's compiler the shader still fails on buf.Load, and #1872's own test fails there too. This PR does both halves, the way #2913 does for the indirect clamp:

  • The buffer becomes a structured buffer of uint, indexed in words. Every offset and pitch comes from a placed footprint: offsets are 512-byte aligned, row pitches 256.
  • The root signature is serialized beside the shader, in the order the caller sets it.

The conversion itself is unchanged. A new test runs it both ways on a 3-wide surface, with a distinct value per texel and a sentinel in each row's padding. It is adapted from #1872's test.

Fixes #1860. Supersedes #1872.

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):

  • Wine's built-in compiler: the new test passes. With main's shader swapped back in, it fails because the converter is never built. With the odd-width tail guard removed, it fails on the padding sentinel.
  • Microsoft's d3dcompiler_47 10.0.26100: the new test passes. The whole suite has the same 3 failures as main. They are vkd3d-proton issues fixed by #1722 and #2101.
  • Clippy: cargo clippy -p victory-gpu --all-targets --target x86_64-pc-windows-msvc -- -D warnings, with and without --all-features, is clean. CI runs the Windows tests.

Reviewed with sol-loop: 1 round with GPT-6.2 Sol. Sol verdict: approved (its one nit, a stronger test fixture, is in).

**@⁠arogan178** on GitHub · 2026-11-25 23:58 UTC · [original](https://github.com/Marvisak/VIctory/pull/2919) `arogan178:wine-depth-twin` → `main` · +127 −13 · 1 files · 1 commits · open Under Wine and Proton, 16-bit depth that the title writes through unordered views never reaches the host's depth texture (#1860). It is moved by a compute converter compiled at run time. Wine's built-in `d3dcompiler_47` (vkd3d-shader) refuses it, because it has no `Load`/`Store` on byte address buffers, and it ignores the `RootSignature` attribute. The converter is never made. #1872 serializes the root signature when the compiler drops it. That is half of it: with Proton-CachyOS 11.0's compiler the shader still fails on `buf.Load`, and #1872's own test fails there too. This PR does both halves, the way #2913 does for the indirect clamp: - The buffer becomes a structured buffer of `uint`, indexed in words. Every offset and pitch comes from a placed footprint: offsets are 512-byte aligned, row pitches 256. - The root signature is serialized beside the shader, in the order the caller sets it. The conversion itself is unchanged. A new test runs it both ways on a 3-wide surface, with a distinct value per texel and a sentinel in each row's padding. It is adapted from #1872's test. Fixes #1860. Supersedes #1872. ## 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): - **Wine's built-in compiler:** the new test passes. With `main`'s shader swapped back in, it fails because the converter is never built. With the odd-width tail guard removed, it fails on the padding sentinel. - **Microsoft's `d3dcompiler_47` 10.0.26100:** the new test passes. The whole suite has the same 3 failures as `main`. They are vkd3d-proton issues fixed by #1722 and #2101. - **Clippy:** `cargo clippy -p victory-gpu --all-targets --target x86_64-pc-windows-msvc -- -D warnings`, with and without `--all-features`, is clean. CI runs the Windows tests. Reviewed with sol-loop: 1 round with GPT-6.2 Sol. Sol verdict: approved (its one nit, a stronger test fixture, is in).
16-bit depth written through unordered views reaches the host's depth
texture through a compute converter compiled at run time. Wine's and
Proton's built-in d3dcompiler_47 refuse it (no methods on byte address
buffers) and ignore its RootSignature attribute, so the converter is
never made and that depth stays clear (#1860).

The buffer becomes a structured buffer of uint indexed in words (every
offset and pitch is a placed footprint's, a multiple of 4), and the
root signature is serialized beside the shader. A test runs the
conversion both ways, after #1872's.

Co-authored-by: BastienRdz <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:17:30 +00:00
Author
Owner

@⁠Kajanos on GitHub · 2026-11-26 00:07 UTC · original

Windows 11 / NVIDIA test run, head 13f215d5a4 merged onto main 63bcca43c6.

Setup: Windows 11 Home build 26300, RTX 5080, NVIDIA 621.40, rustc 1.98.1 MSVC, VS 2022 Build Tools, Windows SDK 10.0.26100 (dxil.dll from the SDK).

  • cargo test --locked -p victory-gpu: 232 passed, 0 failed, 1 ignored (main: 231). On Windows this uses the native d3dcompiler_47, so the Wine-compiler path this PR targets is not exercised here.

Not run: the retail title, clippy, and other crates.

AI-assisted (Claude Code)

**@⁠Kajanos** on GitHub · 2026-11-26 00:07 UTC · [original](https://github.com/Marvisak/VIctory/pull/2919#issuecomment-7178414579) **Windows 11 / NVIDIA test run**, head `13f215d5a4` merged onto `main` `63bcca43c6`. Setup: Windows 11 Home build 26300, RTX 5080, NVIDIA 621.40, rustc 1.98.1 MSVC, VS 2022 Build Tools, Windows SDK 10.0.26100 (`dxil.dll` from the SDK). - `cargo test --locked -p victory-gpu`: 232 passed, 0 failed, 1 ignored (`main`: 231). On Windows this uses the native `d3dcompiler_47`, so the Wine-compiler path this PR targets is not exercised here. Not run: the retail title, clippy, and other crates. AI-assisted (Claude Code)
Author
Owner

@⁠Marvisak on GitHub · 2026-11-26 04:29 UTC · original

Automated triage for the maintainers.

Merge candidate. The 16-bit depth converter in twin.rs now builds with Wine's compiler too: the buffer is a word-indexed RWStructuredBuffer<uint> and the root signature is serialized in code (root_signature). The parameter order (b0 constants at 0, root UAV at 1) matches the caller's SetComputeRoot32BitConstants(0, ...) / SetComputeRootUnorderedAccessView(1, ...), and every offset and pitch is a multiple of 4 so the division is exact. The test runs both directions on an odd width with padding sentinels against independently computed values. If merged, #1872 looks superseded.

CI: passing.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-26 04:29 UTC · [original](https://github.com/Marvisak/VIctory/pull/2919#issuecomment-7182645550) <!-- victory-triage v1 head=13f215d5a491e18717c25f6ce6c9de16872fd2ad verdict=merge-candidate at=2026-11-26T04:29:44Z --> Automated triage for the maintainers. **Merge candidate.** The 16-bit depth converter in `twin.rs` now builds with Wine's compiler too: the buffer is a word-indexed `RWStructuredBuffer<uint>` and the root signature is serialized in code (`root_signature`). The parameter order (b0 constants at 0, root UAV at 1) matches the caller's `SetComputeRoot32BitConstants(0, ...)` / `SetComputeRootUnorderedAccessView(1, ...)`, and every offset and pitch is a multiple of 4 so the division is exact. The test runs both directions on an odd width with padding sentinels against independently computed values. If merged, #1872 looks superseded. CI: passing. --- _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/2919/head:github-bot/gh-2919'
git switch 'github-bot/gh-2919'

Merge

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