Port water texture readback and guard against stale writes #999
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/fxceless--victory-fork!999
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/999/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@cxy0072019-sketch on GitHub · 2026-11-25 15:33 UTC · original
cxy0072019-sketch:fix/water-texture-readback→main· +383 −6 · 6 files · 2 commits · merged 2026-11-25 21:09 UTCSummary
Port Geckomacabre/vx-layer@eee5667d to victory-fork. In Gone Fishing, the game's CPU physics reads water height and displacement from textures written by the GPU. Copying those textures back after the submission completes gives the boat its buoyancy after the cutscene. Enable with
VICTORY_TEXTURE_BACK=1.Track the texture allocation through submission and skip the copy if that memory was replaced or remapped, or if the texture was released. Include these destinations in the late submission's pending write ranges. The regression test covers invalidation without discarding unrelated allocations.
Refs #863. The original patch is preserved as a separate commit with its authorship.
Validation
cargo test --locked -p victory-gpu --lib -- --test-threads=1returned 171 passed, 5 ignored.cargo build --locked --profile diag -p victory --features diagnosticsand thevictory --versionsmoke test passed.@iGoldenNinja on GitHub · 2026-11-25 16:18 UTC · original
I tested a related allocation-lifetime guard on an RTX 5080. One case that may be worth adding to this PR's regression tests is a later command list naming an old texture after a new buffer takes the same guest base. The old texture can still be alive. Tracking which resource owns the address at creation lets the renderer reject a new readback for that retired owner. The test passed in our port of the allocation checks from this PR. Guard and regression tests
On native Windows 11 Pro 25H2 build 26200.9974, RTX 5080 16 GB / 617.14, Ryzen 9 5900X and Series X settings, the guarded revision kept the boat and both occupants afloat with only the 64×64 RG32F and 128×128 RG16_UINT outputs copied back. The package objective appeared while the controller was idle. Throttle then produced twin wakes, and steering changed the boat's heading against the bridge. At least 1,024 and 256 full-plane writes completed, respectively. No stale rejection was logged during gameplay. The unit test is the evidence for that case. Pinned native report
@SkillIssueXO on GitHub · 2026-11-25 17:12 UTC · original · edited 2026-11-25 17:31 UTC
Independent Series X test on an RTX 5070 Ti with
465b94f, paired waves from #854, and #999 at04df435. Both runs used copies of the same local checkpoint with the structure builder off.VICTORY_LATE_WAIT=3logged 896 landed copies before aDXGI_ERROR_DEVICE_HUNGafter three deferred submissions.VICTORY_LATE_WAIT=0, the boat cutscene ran farther and logged 6,528 landed copies. The game then exited with0xc0000005, reading null inVCRUNTIME140.dll+0x1c45afrom title code. Available system commit was above 20 GiB. These were single runs and the logs establish two failure signatures.256x256f41,256x256f16reached the handoff. Black water patches remained. In the synchronous run, frame 1871 already shows the patches in the 2560×1440 RGBA16F scene target before final upscale.Follow-up on the smaller formats. I tested
ca8829fwith the allocation ownership guard fromb97bb825, paired waves, andVICTORY_LATE_WAIT=0. Both Series X replays logged the parsed list[(64, 64, 16), (128, 128, 36)]and completed water readbacks. They reached the boat cutscene, then hit the same null 16-byte read atVCRUNTIME140.dll+0x1c45a, with the first two title return offsets+0x3de6491and+0x3de2054. The last reported cumulative copy counts were 1,024 and 1,280. Around 21 GiB of system commit remained free in both runs.The second replay enabled the indirect lighting dispatch split. The lighting shader bound and black patches remained visible during the cutscene. This run did not record the requested or submitted group counts. The explicit kind list and completed copies distinguish these runs from the launcher parse issue in #1037.
AI-assisted analysis. Aggregate measurements only.
@DuarttBR on GitHub · 2026-11-25 21:35 UTC · original
Independent test on an RTX 3080 10 GB (Ampere, GA102). The other reports here are on Blackwell cards (RTX 5070 Ti, 5080), so this adds a different architecture.
Machine: driver 617.42, Ryzen 9 5900X, 32 GB RAM, Windows 11 Pro (build 26300), Series X profile at 1080p (
VICTORY_RESOLUTION=1920x1080).Tree:
soldsawn/victory-nvidia-8gbat7b7b952(forkca8829fplus community PRs), with this PR (895c0b8,04df435) cherry-picked on top, clean.VICTORY_TEXTURE_BACK=1; the log showskinds=[(256, 256, 41), (256, 256, 16), (64, 64, 16), (128, 128, 36)].Before (same build,
TEXTURE_BACKunset): the water did not load and the player could run along the bottom, underwater.After: the water behaves, and I played most of the boat mission ("Gone Fishing") before the game stopped in the binoculars cutscene. That stop is a separate problem, an
int3that looks like a read of memory nobody wrote; details in #1049 (it is a different address from the access violation reported there).One build, one long session (about 14 minutes). I did not compare frame times with and without the readback.
AI-assisted (Claude Code). Measured on my own machine. No game files or captures attached.
@B0rm0t0s on GitHub · 2026-11-25 22:23 UTC · original
✅ Tested on RTX 5080: water works
VICTORY_TEXTURE_BACK=1fixes the sinking boats on my machine too.c36971bWhat works now
Performance
🔧 Switches used
VICTORY_ASYNC_SUBMITVICTORY_QUEUE2VICTORY_INDIRECT_WINDOWVICTORY_TEXTURE_NO_WAITVICTORY_COPY_PLAINVICTORY_JOIN_PARTSVICTORY_BACK_OWN_VIEWVICTORY_INDIRECT_GATHERVICTORY_CARD_REHASH_RUNSVICTORY_CARD_WINDOWS_MBVICTORY_WINDOW_UPLOADVICTORY_CARD_BUFFERS_MIN_KBVICTORY_CARD_BUFFERS_MBVICTORY_TEXTURE_BACKThanks for the fix! 🙏