vkback: replace below-base placed images in hold_lower regardless of fill state #193
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!193
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-193"
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 07:03 UTC · original
Mhyster:fix/tex-hold-lower-non-gpu-filled→main· +91 −43 · 1 files · 1 commits · openWhat
Fixes streamed placed textures getting stranded permanently black (null descriptor, infinite
NoRange::BelowBaseretries) whenhold_lowerlowersheld_fromon an image created atImg::base > 0whose prior fill was notGPU_FILLED:hold_lower(greenfield/vkback/src/placed.rs) lowered or removedself.held_from, then returned early ifself.tex_keys.get(&id)did not matchSome(&(k, GPU_FILLED))(which is true forGPU_UNFILLEDtextures whose first fill was deferred while title memory was unmapped, CPU-detiled textures, or textures absent fromtex_keys).self.held_fromwas already lowered/removed while theImg::base > 0image remained inself.images, every subsequent view starting atfirst < img.basefailedview_rangewithErr(NoRange::BelowBase)and wrote a null slot, while subsequenthold_lowerretries sawheld_from == Noneand became no-ops.hold_lowerchecks whetherwant < img.baseregardless of fill state (hold_action) and always retires/removes theImg::base > wantimage (plus removes it fromself.unnamed), so the caller (write_view) immediately creates a replacement image starting atwant. In-place refill (want >= img.base) continues to run only forGPU_FILLEDtextures, and the common fast path (first >= img.baseandfirst >= held) avoids calling the texture provider.Reproduces console texture mip streaming: when a title starts sampling higher-resolution mip levels, the host image is always replaced with one that includes those levels.
The reference
crates/victory-gpu/src/resource.rs(REPLACED,base_level) andcrates/victory-gpu/src/texture.rs(read_from): the D3D12 path replaces a host texture copy whenever a view starts below the copy'sbase_level, regardless of whether its prior upload had completed.Evidence
greenfield/vkback/src/placed.rs(hold_action_replaces_below_base_images_even_when_not_gpu_filled): verifieshold_actionreturnsHoldAction::Replacewheneverwant < img_baseeven whengpu_filled == falseorlower_held == false, and returnsHoldAction::Refillonly whenwant >= img_base && lower_held && gpu_filled.cargo 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)(169 passed, 3 ignored; 6/6 policy tests)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 clippyruns 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)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.