GPU: a texture read back again after its memory is reused is re-registered (port of fxceless#1376) #686
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/686"
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?
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by kibagami-nc on 2026-11-28T03:33:05Z.
The problem
The title sometimes reuses or remaps the memory a back-copied texture tiles into. The texture's read-back ticket then goes stale (
texback::replaced).A later write of the same texture in the same list found the old entry in
back_wanted(HostList,crates/victory-gpu/src/host.rs) and registered nothing. The read-back was dropped, and the title read back nothing for that texture. In the game, this was the ocean's height map.The change
A stale entry is replaced in place by a fresh target. A fresh entry is kept, and a texture still gets one entry per list.
This is a port of spk-c's fix (fxceless/victory-fork#1376). The only conflict was two tests next to each other in
list.rs; both are kept.Tests
list::tests::a_rewritten_back_texture_after_reuse_is_read_back: a synthetic R32_FLOAT texture is written, its memory reused, then written again. It is read back exactly once at the list's close.cargo test -p victory-gpu --locked --lib: 453 passed, 0 failed.cargo clippy -p victory-gpu --all-targets -- -D warnings, with and without--all-features: nothing in the changed files.main's own findings are fixed by #665.Checked by others
main(63b902f) with the same settings: no guard stop, no out-of-memory, no GPU fault. Both stop at the same first-story loading failure, which this change is not about.No game files, dumps or extracted data are included.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Yoshi-233 on 2026-11-28T03:52:50Z.
I ran the added texture-reuse regression on a Windows RTX 4070 Ti SUPER (driver 617.42). It reached the GPU assertions and passed with re-registration enabled. Disabling only the replacement made it fail at the second-write assertion, as expected.
I also instrumented the stale-entry branch in this PR on top of v2026.11.27.10. In a daytime open-water motorboat checkpoint I recorded 429 completed texture readbacks across loading, idle, acceleration and turns, including 250 while the boat was stationary. The stale-entry branch fired zero times with either switch state. Three complete stationary 24-second intervals with re-registration on/off/on had median frame times of 46.1 / 45.9 / 45.5 ms. DLSS Quality was rendering 2560×1440 for 3840×2160 output, with frame generation off.
The regression is reproducible on Ada. This particular ocean route did not trigger it in gameplay, so it doesn't establish a change to visible wave detail here. A checkpoint or action known to invalidate an ocean texture's backing would make a good next comparison.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by ArturoWolff on 2026-11-28T04:38:32Z.
Independent Linux/Proton qualification of the named registration fixture in #686, on a physical RTX 4060 desktop (8 GB, NVIDIA 620.73.4, 16 GB system RAM). I applied the exact four-file change at
c8f08560e05fa2cd0d594981c76f1fcffb697cd3to.01(63b902fe1720a5188ee79d94a88c8de0470f6349), with the same backing/DXC adaptations as my #628 baseline. Thanks to kibagami-nc and spk-c (original #1376).The locked MSVC release test binary ran in a fresh isolated GE-Proton11-14 prefix, with actual vkd3d-proton 3.2.0 (
cae8353ed7959c4+). No game files mounted. Invokedlist::tests::a_rewritten_back_texture_after_reuse_is_read_back --exact --nocapture --test-threads=1.Actual child exit 0. The host assertion marker confirms the test did not return early for lack of a GPU. This checks registration and the single recorded read-back, not completed pixel values. I ran only this named test, not the full suite or a local switch-off negative; the earlier Windows negative result is separate evidence.
I also launched the game with the corresponding release build, compared with the retained
.01control under identical effective graphics settings, separate cold external caches and the same cloned prefix seed (Series X 1080to1440, 30 cap, DLSS/FG off, full requested effects/write-back/ordinary waits). Both progressed without recorded input..01.01+ #686Both show the loading artwork then a black overlay at the existing first-story loading failure. No guard stop, OOM increment, recorded kernel GPU fault or reported host fence error. I have no witness that the replacement path was exercised by that actual launch, and no visible ocean/height-map output to compare. The targeted fixture is positive on Ada under Proton in addition to Yoshi-233's Windows result, but this change alone does not restore local world entry. No gameplay performance or visual correctness claim.
AI assistance: Hermes Agent, working on behalf of ArturoWolff. (GPT 6.2 Sol High).
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Dukestar69 on 2026-11-28T05:17:12Z.
Review: APPROVED
LGTM — verified on Windows (RTX 5090):
cargo test -p victory-gpu --lib resource::(20/20),texback::, andlist::all passed on RTX 5090cargo xtask policypassed (294 files ok)Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).