fix(gpu): verify moved-texture bytes before keeping old slot view (VICTORY_KEEP_SHOWN=checked) #280

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

@⁠Mikey970 on GitHub · 2026-11-27 20:40 UTC · original
Mikey970:pr/keep-shown-checked → main · +109 −12 · 1 files · 1 commits · open

Problem

With VICTORY_KEEP_SHOWN=1, a descriptor slot rewritten with a texture of the same format and size at a different address (Kin::Moved) keeps showing the old texture until the new upload runs. That is right when the title moves a texture, but wrong when the streamer reuses a slot for a different texture of the same dimensions/format (e.g. an albedo where a mask or another character's map lived): the surface displays garbage/rainbow-noise texels in the G-buffer albedo until the upload finishes (reproducible on faces during the opening cutscene).

Fix

  • Adds VICTORY_KEEP_SHOWN=checked (opt-in; existing numeric 0/1/2 defaults unchanged).
  • On Kin::Moved, kept_meanwhile compares the first and last 4 KiB (or the whole buffer under 8 KiB) via crate::host::read_into. If both ends match, the old texture stays; if they differ or either address is unreadable, the slot falls back to the neutral texture until the new upload completes.
  • Extends the existing 5,000-rewrite log line with checked-kept vs checked-neutral counts.

Testing

  • Added unit test descriptor::host::bake_flip_tests::a_moved_texture_is_kept_only_with_the_same_ends (passed via cargo test -p victory-gpu).
  • Validated in-game on opening-cutscene captures: eliminated rainbow-noise face corruption with no measurable frame-time regression.
**@⁠Mikey970** on GitHub · 2026-11-27 20:40 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/280) `Mikey970:pr/keep-shown-checked` → `main` · +109 −12 · 1 files · 1 commits · open ## Problem With `VICTORY_KEEP_SHOWN=1`, a descriptor slot rewritten with a texture of the same format and size at a different address (`Kin::Moved`) keeps showing the old texture until the new upload runs. That is right when the title moves a texture, but wrong when the streamer reuses a slot for a *different* texture of the same dimensions/format (e.g. an albedo where a mask or another character's map lived): the surface displays garbage/rainbow-noise texels in the G-buffer albedo until the upload finishes (reproducible on faces during the opening cutscene). ## Fix - Adds `VICTORY_KEEP_SHOWN=checked` (opt-in; existing numeric `0`/`1`/`2` defaults unchanged). - On `Kin::Moved`, `kept_meanwhile` compares the first and last 4 KiB (or the whole buffer under 8 KiB) via `crate::host::read_into`. If both ends match, the old texture stays; if they differ or either address is unreadable, the slot falls back to the neutral texture until the new upload completes. - Extends the existing 5,000-rewrite log line with checked-kept vs checked-neutral counts. ## Testing - Added unit test `descriptor::host::bake_flip_tests::a_moved_texture_is_kept_only_with_the_same_ends` (passed via `cargo test -p victory-gpu`). - Validated in-game on opening-cutscene captures: eliminated rainbow-noise face corruption with no measurable frame-time regression.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 20:42:52 +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/280/head:github-bot/gh-280'
git switch 'github-bot/gh-280'

Merge

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