vkback: drain refused_slots when GTT room recovers and spill object textures #191
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/vktory6--VKtory!191
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-191"
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?
@Mhyster on GitHub · 2026-12-02 06:52 UTC · original
Mhyster:fix/tex-refused-slots-gtt-drain→main· +82 −13 · 4 files · 1 commits · openWhat
Fixes permanently black textures after transient GTT pressure while VRAM stays over its line:
refused_slotson GTT recovery, not only VRAM recovery (residency.rsroom_for_textures/room_update,srclife.rstexture_place): slots are only parked inrefused_slots(withExit::Own, so they stay cached as null until drained) when both VRAM and GTT are past their lines (Place::None). Previously,room_for_texturesonly drainedrefused_slotswhen VRAM transitionedfalse -> true. Whenever VRAM remained over its line and GTT spiked and recovered, refused slots stayed null forever even thoughtexture_placewas already spilling new textures to GTT.refused_slotsis non-empty (arena.rstake_retry_slots,srclife.rssource_sweep):take_retry_slotscallsroom_for_textures(which still enforces its 100 ms throttle) whenrefused_slotsis non-empty so refused slots recover even if no new texture creation occurs, andsource_sweepinvalidates the 100 ms timestamp when it frees copies (matchinglet_go_idle).create_object(lib.rscreate_object): checkself.texture_place() == Place::Noneinstead of!self.room_for_textures(), matchingensure_image_orandwrite_viewso object textures also spill to GTT instead of being deferred lazy when VRAM is full and GTT has room.Reproduces the console's never-refuse-a-texture rule (
srclife.rsmodule doc): once either heap has room again, every previously refused slot is retried.The reference
crates/victory-gpu/src/resource.rs(room,let_go_idle): the D3D12 path tracks texture residency against a single budget line without a separate GTT spill path; vkback's two-heap spill (Place::Vram/Place::Gtt/Place::None) is specific togreenfield/vkback/src/srclife.rs(texture_place) andresidency.rs(room_for_textures).Evidence
greenfield/vkback/src/residency.rs(room_update):gtt_recovery_drains_refused_slots_even_while_vram_stays_overvram_recovery_drains_refused_slots_while_gtt_stays_overunknown_budget_has_room_in_both_heapscargo test -p victory-shader -p victory-formats -p victory-core -p xtask --locked(cd greenfield && cargo test -p umem -p frame -p vkback --lib --locked && cargo test -p vkback --test policy --locked)(171 passed, 3 ignored; 6/6 policy tests includingfile_size)cargo clippy --all-targets --locked -- -D warningson root native crates,greenfield,greenfield/wine, andgreenfield/vkback/translate.frames.py) could not be run in this session (no live game run performed);cargo xwin clippyforx86_64-pc-windows-msvcruns in GitHub Actions CI.Checklist (docs/AGENTS.md)
docs/TASKS.mdnot edited, the fixed item named above (rule 29)unsafeblock has a// SAFETY:comment; no raw pointer around the borrow checker (rule 36)TRANSLATOR_VERSIONbumped if the translator's output changes (rule 27)@vktory6 on GitHub · 2026-12-02 15:28 UTC · original
Thanks, this fixes the same black textures as #188, more simply. #188 has the better structure (one cached room check), so this waits for it:
create_objectspill to GTT plus the sweep invalidation, as one small PR.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.