Restore the title’s final texture state after water readback #1170

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

@⁠BradRoland on GitHub · 2026-11-25 22:37 UTC · original
BradRoland:codex/restore-water-readback-state → main · +51361 −84 · 15 files · 17 commits · open

The water readback in #999 transitions a texture to COPY_SOURCE when the command list closes. It can leave the texture there even if the title had already transitioned it back to shader-resource or unordered-access use. A later shader can inherit this state when its texture index is computed and the next list does not explicitly name that texture.

This saves the final state recorded by the current list, transitions for the copy if needed, and restores that state immediately afterward. A combined read state that already includes COPY_SOURCE needs no extra barrier. For a texture with no earlier state in the list, the submission prelude still establishes the copy-source state.

On 9c184b3, an 8×8 R32_FLOAT regression landed the expected texel but left the texture at 0x800 instead of the requested shader-resource state 0xc0. The corrected test passes for shader-resource, unordered-access, combined shader-resource/copy-source, and copy-source states. Reproduce with cargo test --locked -p victory-gpu --features diagnostics water_readback_preserves_the_final_texture_state.

A separate D3D12 debug-queue check covered 48 combinations on RTX 4080 and WARP, with water readback on/off and synchronous or deferred submission (relay off or stage 2). All 48 passed after the fix. The graphics suite had 201 passes and six ignored on each of two standalone runs. The sole failure was the existing indirect-budget ordering assertion in #1118. In 12 isolated WARP repetitions per binary, the same assertion failed six times with the original renderer and nine times with this patch. The state and subresource tests also passed together with #1152.

The fixtures use synthetic textures. The later device loss in the mission report still has no established cause. Gameplay report

AI-assisted implementation and testing.

**@⁠BradRoland** on GitHub · 2026-11-25 22:37 UTC · [original](https://github.com/fxceless/victory-fork/pull/1170) `BradRoland:codex/restore-water-readback-state` → `main` · +51361 −84 · 15 files · 17 commits · open The water readback in #999 transitions a texture to `COPY_SOURCE` when the command list closes. It can leave the texture there even if the title had already transitioned it back to shader-resource or unordered-access use. A later shader can inherit this state when its texture index is computed and the next list does not explicitly name that texture. This saves the final state recorded by the current list, transitions for the copy if needed, and restores that state immediately afterward. A combined read state that already includes `COPY_SOURCE` needs no extra barrier. For a texture with no earlier state in the list, the submission prelude still establishes the copy-source state. On `9c184b3`, an 8×8 R32_FLOAT regression landed the expected texel but left the texture at `0x800` instead of the requested shader-resource state `0xc0`. The corrected test passes for shader-resource, unordered-access, combined shader-resource/copy-source, and copy-source states. Reproduce with `cargo test --locked -p victory-gpu --features diagnostics water_readback_preserves_the_final_texture_state`. A separate D3D12 debug-queue check covered 48 combinations on RTX 4080 and WARP, with water readback on/off and synchronous or deferred submission (relay off or stage 2). All 48 passed after the fix. The graphics suite had 201 passes and six ignored on each of two standalone runs. The sole failure was the existing indirect-budget ordering assertion in #1118. In 12 isolated WARP repetitions per binary, the same assertion failed six times with the original renderer and nine times with this patch. The state and subresource tests also passed together with #1152. The fixtures use synthetic textures. The later device loss in the mission report still has no established cause. [Gameplay report](https://git.gtahub.st/github/fxceless--victory-fork/pulls/999) AI-assisted implementation and testing.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:58:50 +00:00
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/1170/head:github-bot/gh-1170'
git switch 'github-bot/gh-1170'

Merge

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