GPU/texture: preserve Tiled::held and update judged when on-demand detile() is skipped #765
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!765
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-765"
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?
@AscilCH on GitHub · 2026-11-25 06:44 UTC · original
AscilCH:fix/gpu-texture-on-demand-skipped-detile-and-judged→main· +129 −4 · 1 files · 1 commits · openProblem
Two levels-on-demand staging bugs in
crates/victory-gpu/src/texture.rs:detile()wipesTiled::held: FreshStaginginitializeddetiled = 0, andupload()unconditionally queuedon_demand.uploaded(staging.detiled.load(Relaxed), ...)afterStep::Texture. WhenStaging::refreshskippeddetile()— becauserefresh_unlocked()failed during a remapping underVICTORY_TEXTURE_NO_WAIT=1, or because a partly-mapped texture read all zeros —on_demand.uploaded(0, ...)wipedTiled::heldand resetfirst_showntoNone, turning a previously valid tiled texture permanently black. In addition, a failedrefresh_unlocked()leftdirty = falseafter the prior deferred host closure cleared it, preventing the next draw from retrying.refresh_timed()skippeddetile()on an all-zero partly-mapped tiled texture,staging.judgedremained[0, 0]. Becausejudgement()always returnslimit >= HEADoru64::MAX,judgement() != judged()evaluated true on every subsequentupload(), callingstaging.forget()(wipinglast.partialandlast.hash) and settingdirty = trueon every submission.Fix
has_detiled: AtomicBool+Staging::detiled_levels() -> Option<u32>soupload()'s deferred host callback only callson_demand.uploaded()afterdetile()has actually produced a held-level mask.self.dirty.store(true, Relaxed)whenrefresh_unlocked()fails so the next draw retries.self.judgedwhenrefresh_timed()completes the all-zero check on anon_demandtexture sojudgement() != judged()fires only whenfirst_viewedornext_startchanges.Verification
cargo test -p victory-gpu --locked -- texture::title_memory_tests:3 passed; 0 failed(including new teston_demand_skipped_detile_preserves_none_and_updates_judged).cargo clippy -p victory-gpu --all-targets --all-features --locked: 0 warnings intexture.rs(only pre-existing8dd30abwarnings indraw.rs:2377andindirect.rs:1322).cargo xtask policy:171 files ok.(AI-assisted; synthetic unit tests only, no game data.)
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.