Textures: a refresh lets title memory move again once its bytes are copied (VICTORY_TEXTURE_SHORT_HOLD=1) #1078
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!1078
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1078"
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?
@alexis27yt on GitHub · 2026-11-25 18:40 UTC · original
alexis27yt:texture-short-hold→main· +264 −3 · 2 files · 1 commits · openA texture refresh holds title memory still (
watch::title_memory_reading) so no page goes under its read, and today it keeps holding it through the hash of the whole texture and the detile. Every page remap of the title (map_alias, ~850 in a frame that streams per the README, each takingMAPPINGalone) waits for every refresh under way, and the title's render thread waits for those remaps: the README's streaming frames where "the render thread waits for its own jobs", one of which is the page-mapping copies.VICTORY_TEXTURE_NO_WAITstops textures from waiting for remaps; nothing stopped remaps from waiting for textures.With
VICTORY_TEXTURE_SHORT_HOLD=1(off by default) all three paths (partly mapped,VICTORY_TEXTURE_COPY, in place) copy the bytes out under the lock, let it go, then hash and detile the copy. The in-place path pays one extra pass over the bytes, which the read buffer already held for the others.Measured with the new
tests/texture_hold.rs(ignored by default) on an i5-12400F, SW_64KB_S, all mips:At the ~110 MB of textures a streaming frame reads (runs 91/93), that is ~42 ms → ~6.6 ms of lock held a frame on this CPU, summed over refreshes. Not measured in game: whether this is what the remaps wait on is exactly what the frame log's
RemapWaitUs(andRefreshStillUs) from a streaming scene would show, with and without the switch.Tests: new
a_refresh_detiles_what_title_memory_holdsbuilds a realStagingon a host upload buffer over guarded memory of its own, refreshes, has the "title" write the texture through the guard, refreshes again, and compares the staging bytes withLayout::detileeach time; it and the 13 other texture tests pass with and without the switch (RTX 4070 SUPER). Clippy: no new warnings, with and withoutdiagnostics.@BitWuehler on GitHub · 2026-11-26 23:08 UTC · original
In-world Linux/Proton data point (CachyOS, GE-Proton11-14 +
vkd3d-proton, RTX 5080 16 GB, Series X profile,4f83d40merged ontoe4245f3/52ac4ec):VICTORY_TEXTURE_SHORT_HOLD=1alongsideVICTORY_HEAP_WORKER=1andVICTORY_LEVELS_ON_DEMAND=1: clean throughout (0 page faults, no crashes or texture-corruption regressions attributable to the shorter hold).framelog'sremapping: ... waiting for readersacross two full world runs on the same52ac4ec-based binary (caveat: multi-switch comparison between our full turbo preset withVICTORY_TEXTURE_SHORT_HOLD=1and a minimalQU17preset withVICTORY_TEXTURE_SHORT_HOLDunset, not a single-variable A/B):VICTORY_TEXTURE_SHORT_HOLD=1(373 logged intervals): mean 1.10 ms (sum 411.0 ms,max 61.1 ms).VICTORY_TEXTURE_SHORT_HOLDunset (274 logged intervals): mean 2.98 ms (sum 817.1 ms,max 96.7 ms).(AI-assisted testing, log extraction, and summary.)
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.