Textures the title reads back are copied into title memory: the Gone Fishing boat stays afloat (VICTORY_TEXTURE_BACK, port of fxceless #999) #205

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

@⁠TobiasFornell on GitHub · 2026-11-25 21:56 UTC · original
TobiasFornell:texture-readback-water → main · +463 −4 · 6 files · 1 commits · open

In the Gone Fishing mission the boat sinks right after the cutscene ("Cal fell off the boat"). The title's shaders write the water's height and flow into textures that its CPU reads back for the boat physics, and those writes never reach title memory. Geckomacabre's fxceless/victory-fork#999 copies such textures back after the submission; this is that change ported to this fork.

VICTORY_TEXTURE_BACK lists the sizes and formats to read back (256x256f41,256x256f16,64x64f16,128x128f36 are the water's; VICTORY_TEXTURE_BACK=1 takes those four). Unset, nothing changes.

Run on Linux only (CachyOS, RX 9070 XT, RADV, Proton Experimental), from the shared Gone Fishing save (fxceless/victory-fork#863), on a Belobug-based tree with our Linux changes: without it the boat sinks; with it the boat stays afloat and the mission goes on ("Follow the plane"), 0 GPU page faults, 47 matched water textures in a 600 s run. This branch is the same logic ported to current main: it builds and clippy finds nothing new, but I have not run it on current main itself (it needs the Wine fixes from #53/#100 to reach the world here). Not run on Windows.

**@⁠TobiasFornell** on GitHub · 2026-11-25 21:56 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/205) `TobiasFornell:texture-readback-water` → `main` · +463 −4 · 6 files · 1 commits · open In the Gone Fishing mission the boat sinks right after the cutscene ("Cal fell off the boat"). The title's shaders write the water's height and flow into textures that its CPU reads back for the boat physics, and those writes never reach title memory. Geckomacabre's fxceless/victory-fork#999 copies such textures back after the submission; this is that change ported to this fork. `VICTORY_TEXTURE_BACK` lists the sizes and formats to read back (`256x256f41,256x256f16,64x64f16,128x128f36` are the water's; `VICTORY_TEXTURE_BACK=1` takes those four). Unset, nothing changes. Run on Linux only (CachyOS, RX 9070 XT, RADV, Proton Experimental), from the shared Gone Fishing save (fxceless/victory-fork#863), on a Belobug-based tree with our Linux changes: without it the boat sinks; with it the boat stays afloat and the mission goes on ("Follow the plane"), 0 GPU page faults, 47 matched water textures in a 600 s run. This branch is the same logic ported to current `main`: it builds and clippy finds nothing new, but I have not run it on current `main` itself (it needs the Wine fixes from #53/#100 to reach the world here). Not run on Windows.
Some textures the title's shaders write are read by its CPU afterwards:
in the Gone Fishing mission the water's height and flow, which the boat
physics read. Without them in title memory the boat sinks right after the
cutscene ("Cal fell off the boat"). With VICTORY_TEXTURE_BACK set, textures
of the listed sizes and formats that a list writes through an unordered
access view are copied back after the submission, in the console's tiling.
VICTORY_TEXTURE_BACK=1 takes the four water kinds
(256x256f41,256x256f16,64x64f16,128x128f36); unset, nothing changes.

Port of fxceless/victory-fork pull request #999 (Geckomacabre).

Source: fxceless/victory-fork#999
Co-authored-by: Geckomacabre <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:37:56 +00:00
Author
Owner

@⁠adrianmjim on GitHub · 2026-11-26 19:49 UTC · original

Native Windows check of 81560c5 (base 4f62c2a), on an RX 7900 XT (driver 32.0.32029.2010) and on WARP. The game is not installed here, so I have nothing on the boat itself.

Builds and tests

  • Debug and release builds of victory succeed. Clippy on victory-gpu (default and diagnostics) gives the same warnings as 4f62c2a. None are in the new code.
  • victory-gpu lib tests: 13 interleaved runs per side for each adapter (7900 XT and WARP) and each setting (VICTORY_TEXTURE_BACK unset and 1).
    • texback::tests passed in every run that reached it (49 of 52). The other 3 were WARP runs that crashed earlier.
    • All other failures and crashes were in the timing and guard-page tests (watch::, frame::, query::, queue::, pipeline::library). The same families failed and crashed on 4f62c2a too.
    • Other jobs were loading the machine at the time.

Copy-back layout (local test, not in this PR)
How the test works:

  • Place a title texture of each default kind in a heap filled with a sentinel byte.
  • Write a known pattern into its host copy with our own list.
  • Call texture_written, then close and run the list.
  • Compare title memory element by element with Layout::offset.

Results:

  • Kinds tested: 256x256 R32_FLOAT (f41), 256x256 R32G32_FLOAT (f16), 64x64 R32G32_FLOAT, 128x128 R16G16_UINT (f36), and a 3-mip 256x256 R32_FLOAT. All are UAV-only with layout 0, which gives SW_4KB_S.
  • Every element is where the layout puts it, and detile gives the pattern back.
  • No byte outside the texture changed.
  • Same on the 7900 XT and on WARP, 5 of 5 runs each.
  • With VICTORY_TEXTURE_BACK unset, title memory is not touched.
  • This checks the copy against the crate's own console layout model, the one texture uploads use. It does not check it against real console memory.

One gap

  • A texture of a listed kind with an XOR swizzle (_X, values 16 and up) is never copied back.
    • Example: a texture created as render target + UAV with layout 0 gets SW_64KB_R_X (resource.rs:153).
    • victory-formats has no address pattern for these swizzles (addressable, victory-formats texture.rs:486), so tile returns Unsupported.
    • In the local test, 64x64 f16 and 128x128 f36 created with RT|UAV flags left title memory unchanged.
  • The warning is logged through a process-wide Once (texback.rs:311). Only the first such failure in a run is logged.
  • @⁠lorddie, about the Unsupported, mip 0 line in #196: if your port logs the same way as this one, that line fits this case.
    • A matched kind only gets Unsupported from such a swizzle, because MSAA and non-2D textures are filtered out.
    • The failure depends only on the texture's layout, so that texture would fail on every later copy with no further log line. Other textures still land.
  • A per-texture failure log or a failure count in the texture readbacks meter line would show whether one of the water textures is affected. The log could be once per address, like "texback matched texture".

Smaller

  • replaced (texback.rs:129) only invalidates a pending copy when a new texture starts at exactly the same address.
    • A buffer, or a texture placed at a different start over the same range, does not invalidate it.
    • This only matters if the title reuses that memory between the list closing and the copy landing.

I have a local branch with the test on top of 81560c5 if it is useful.

**@⁠adrianmjim** on GitHub · 2026-11-26 19:49 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/205#issuecomment-7201997314) Native Windows check of 81560c5 (base 4f62c2a), on an RX 7900 XT (driver 32.0.32029.2010) and on WARP. The game is not installed here, so I have nothing on the boat itself. Builds and tests - Debug and release builds of `victory` succeed. Clippy on victory-gpu (default and `diagnostics`) gives the same warnings as 4f62c2a. None are in the new code. - victory-gpu lib tests: 13 interleaved runs per side for each adapter (7900 XT and WARP) and each setting (`VICTORY_TEXTURE_BACK` unset and `1`). - `texback::tests` passed in every run that reached it (49 of 52). The other 3 were WARP runs that crashed earlier. - All other failures and crashes were in the timing and guard-page tests (`watch::`, `frame::`, `query::`, `queue::`, `pipeline::library`). The same families failed and crashed on 4f62c2a too. - Other jobs were loading the machine at the time. Copy-back layout (local test, not in this PR) How the test works: - Place a title texture of each default kind in a heap filled with a sentinel byte. - Write a known pattern into its host copy with our own list. - Call `texture_written`, then close and run the list. - Compare title memory element by element with `Layout::offset`. Results: - Kinds tested: 256x256 R32_FLOAT (f41), 256x256 R32G32_FLOAT (f16), 64x64 R32G32_FLOAT, 128x128 R16G16_UINT (f36), and a 3-mip 256x256 R32_FLOAT. All are UAV-only with layout 0, which gives `SW_4KB_S`. - Every element is where the layout puts it, and `detile` gives the pattern back. - No byte outside the texture changed. - Same on the 7900 XT and on WARP, 5 of 5 runs each. - With `VICTORY_TEXTURE_BACK` unset, title memory is not touched. - This checks the copy against the crate's own console layout model, the one texture uploads use. It does not check it against real console memory. One gap - A texture of a listed kind with an XOR swizzle (`_X`, values 16 and up) is never copied back. - Example: a texture created as render target + UAV with layout 0 gets `SW_64KB_R_X` (resource.rs:153). - victory-formats has no address pattern for these swizzles (`addressable`, victory-formats texture.rs:486), so `tile` returns `Unsupported`. - In the local test, 64x64 f16 and 128x128 f36 created with RT|UAV flags left title memory unchanged. - The warning is logged through a process-wide `Once` (texback.rs:311). Only the first such failure in a run is logged. - @⁠lorddie, about the `Unsupported, mip 0` line in #196: if your port logs the same way as this one, that line fits this case. - A matched kind only gets `Unsupported` from such a swizzle, because MSAA and non-2D textures are filtered out. - The failure depends only on the texture's layout, so that texture would fail on every later copy with no further log line. Other textures still land. - A per-texture failure log or a failure count in the `texture readbacks` meter line would show whether one of the water textures is affected. The log could be once per address, like "texback matched texture". Smaller - `replaced` (texback.rs:129) only invalidates a pending copy when a new texture starts at exactly the same address. - A buffer, or a texture placed at a different start over the same range, does not invalidate it. - This only matters if the title reuses that memory between the list closing and the copy landing. I have a local branch with the test on top of 81560c5 if it is useful.
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/205/head:github-bot/gh-205'
git switch 'github-bot/gh-205'

Merge

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