Under Wine, title memory is copied, not used in place #53

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

@⁠ntgata1-dotcom on GitHub · 2026-11-25 13:10 UTC · original
ntgata1-dotcom:wine-copies-title-memory → main · +29 −3 · 1 files · 1 commits · open

Under Wine and Proton, every frame has been black from the first one since 440589e ("GPU: title memory used in place by the host GPU"); see #19. sil-kong bisected it there, and I got the same commit in a separate bisect.

Change

One function, direct() in crates/victory-gpu/src/shadow.rs:

  • Under Wine, title memory is copied by default, as with VICTORY_COPY_MEMORY. Wine is detected the way victory-hle's xmem::on_wine does it: ntdll exports wine_get_version.
  • Under Wine, VICTORY_COPY_MEMORY=0 keeps title memory in place, to try a vkd3d-proton where that works.
  • On Windows nothing changes.
  • The log line says which: title memory used in place by the host GPU on=false wine=true.
VICTORY_COPY_MEMORY Windows Wine
not set in place (as before) copied
0 copied (as before) in place
any other value copied (as before) copied

Tested

Linux: RX 9070 XT (RDNA4), RADV / Mesa 26.3.1, system Wine 11.22, vkd3d-proton v3.1-83-gcae8353ed and DXVK dxgi from GE-Proton11-14. Diagnostics build for x86_64-pc-windows-msvc with cargo-xwin. First-boot screens, no input, 75 s per run, judged from VICTORY_CAPTURE frames:

Build Frame GPU time per frame
8e79c80 (upstream base) renders
71652a2 black (every pixel 0)
this branch, not set renders, frame-2048.png byte-identical to 8e79c80's 0.6 ms
this branch, VICTORY_COPY_MEMORY=0 black 12.1 ms
this branch, VICTORY_COPY_MEMORY=1 renders, byte-identical 0.6–0.7 ms
  • cargo xwin clippy -p victory-gpu --all-targets: the same 58 warning lines as on main, none in the changed code.
  • cargo xtask policy --staged: ok. The full check stops at lower.rs's size, as the README says.
  • Not run on Windows. There on_wine() is false, so both branches of the switch behave as before.
  • Not tested past the first-boot screens.

AI-assisted (Claude Code).

🤖 Generated with Claude Code

**@⁠ntgata1-dotcom** on GitHub · 2026-11-25 13:10 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/53) `ntgata1-dotcom:wine-copies-title-memory` → `main` · +29 −3 · 1 files · 1 commits · open Under Wine and Proton, every frame has been black from the first one since `440589e` ("GPU: title memory used in place by the host GPU"); see #19. sil-kong bisected it there, and I got the same commit in a separate bisect. ## Change One function, `direct()` in `crates/victory-gpu/src/shadow.rs`: - Under Wine, title memory is copied by default, as with `VICTORY_COPY_MEMORY`. Wine is detected the way `victory-hle`'s `xmem::on_wine` does it: ntdll exports `wine_get_version`. - Under Wine, `VICTORY_COPY_MEMORY=0` keeps title memory in place, to try a vkd3d-proton where that works. - On Windows nothing changes. - The log line says which: `title memory used in place by the host GPU on=false wine=true`. | `VICTORY_COPY_MEMORY` | Windows | Wine | |---|---|---| | not set | in place (as before) | **copied** | | `0` | copied (as before) | in place | | any other value | copied (as before) | copied | ## Tested Linux: RX 9070 XT (RDNA4), RADV / Mesa 26.3.1, system Wine 11.22, vkd3d-proton `v3.1-83-gcae8353ed` and DXVK `dxgi` from GE-Proton11-14. Diagnostics build for `x86_64-pc-windows-msvc` with cargo-xwin. First-boot screens, no input, 75 s per run, judged from `VICTORY_CAPTURE` frames: | Build | Frame | GPU time per frame | |---|---|---| | `8e79c80` (upstream base) | renders | | | `71652a2` | black (every pixel 0) | | | this branch, not set | renders, `frame-2048.png` byte-identical to `8e79c80`'s | 0.6 ms | | this branch, `VICTORY_COPY_MEMORY=0` | black | 12.1 ms | | this branch, `VICTORY_COPY_MEMORY=1` | renders, byte-identical | 0.6–0.7 ms | - `cargo xwin clippy -p victory-gpu --all-targets`: the same 58 warning lines as on `main`, none in the changed code. - `cargo xtask policy --staged`: ok. The full check stops at `lower.rs`'s size, as the README says. - Not run on Windows. There `on_wine()` is false, so both branches of the switch behave as before. - Not tested past the first-boot screens. AI-assisted (Claude Code). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Since 440589e the host GPU uses title memory in place. Under Wine
(vkd3d-proton) the heaps are made without an error, but every frame
then stays black from the first one, first-boot screens and intro video
included (#19). There title memory is copied again, as with
VICTORY_COPY_MEMORY. Nothing changes on Windows. Under Wine,
VICTORY_COPY_MEMORY=0 keeps memory in place, to try a host where that
works.

Bisected to 440589e by sil-kong in #19, and separately here.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:34:36 +00:00
Author
Owner

@⁠TobiasFornell on GitHub · 2026-11-25 21:32 UTC · original

Confirming this fix in-world on Linux (CachyOS, RX 9070 XT RDNA4, RADV, Proton Experimental, offline, x86_64-pc-windows-msvc diagnostics build, Series S mode, 480 s runs).

Measured in-world A/B (same build, VICTORY_COPY_MEMORY=1 only, with the 4 KiB tile-base fix from #100 applied):

  • In-place heaps (OpenExistingHeapFromAddress1, ~2.5 GiB in L0/GTT over PCIe on RADV): median 9,537 ms/frame, GPU median 8,867 ms/frame (even though D3D12 command timestamps in a separate timing run summed to only 33.9–48.1 ms/frame).
  • Copy mode under Wine (VICTORY_COPY_MEMORY=1, n=47 world frames): median 1,954 ms/frame (-79.5%), GPU median 148 ms/frame (-98.3%), 0 kernel GPU page faults, and visible 3D world rendering (time_to_world dropped from 215.3 s to 144.9 s).

One companion note for Wine/vkd3d-proton once copy mode is on: if sparse copies remain enabled, Shadow::sparse_writing hits 0xc0000005 on world entry because vkd3d-proton's Map() is only 4 KiB-aligned — that is fixed by #100 (or avoided by #69).

**@⁠TobiasFornell** on GitHub · 2026-11-25 21:32 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/53#issuecomment-7175223525) Confirming this fix **in-world** on Linux (CachyOS, RX 9070 XT RDNA4, RADV, Proton Experimental, offline, `x86_64-pc-windows-msvc` diagnostics build, Series S mode, 480 s runs). **Measured in-world A/B (same build, `VICTORY_COPY_MEMORY=1` only, with the 4 KiB tile-base fix from #100 applied):** - **In-place heaps (`OpenExistingHeapFromAddress1`, ~2.5 GiB in `L0`/GTT over PCIe on RADV):** median **9,537 ms/frame**, GPU median **8,867 ms/frame** (even though D3D12 command timestamps in a separate timing run summed to only **33.9–48.1 ms/frame**). - **Copy mode under Wine (`VICTORY_COPY_MEMORY=1`, `n=47` world frames):** median **1,954 ms/frame** (**-79.5%**), GPU median **148 ms/frame** (**-98.3%**), **0 kernel GPU page faults**, and visible 3D world rendering (`time_to_world` dropped from 215.3 s to 144.9 s). One companion note for Wine/vkd3d-proton once copy mode is on: if sparse copies remain enabled, `Shadow::sparse_writing` hits `0xc0000005` on world entry because vkd3d-proton's `Map()` is only 4 KiB-aligned — that is fixed by #100 (or avoided by #69).
Author
Owner

@⁠gut0to on GitHub · 2026-11-25 16:23 UTC · original · reviewed

AI-assisted static review; I did not run tests or launch the game. Wine is detected with wine_get_version; title memory is copied by default under Wine, while VICTORY_COPY_MEMORY=0 preserves the in-place test path. The PR reports capture comparisons for unset, 0, and 1, plus cargo xwin clippy and cargo xtask policy --staged. I did not run those checks or the game here.

**@⁠gut0to** on GitHub · 2026-11-25 16:23 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/53#pullrequestreview-6061089724) · **reviewed** AI-assisted static review; I did not run tests or launch the game. Wine is detected with wine_get_version; title memory is copied by default under Wine, while VICTORY_COPY_MEMORY=0 preserves the in-place test path. The PR reports capture comparisons for unset, 0, and 1, plus cargo xwin clippy and cargo xtask policy --staged. I did not run those checks or the game here.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
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/53/head:github-bot/gh-53'
git switch 'github-bot/gh-53'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-53'
git switch 'github-bot/gh-53'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-53'
git switch 'github-bot/gh-53'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-53'
git switch 'main'
git merge --squash 'github-bot/gh-53'
git switch 'main'
git merge --ff-only 'github-bot/gh-53'
git switch 'main'
git merge 'github-bot/gh-53'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.