GPU/descriptor: refresh tiled texture slots for tabled views and stale first_shown #764
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/764"
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 fxceless/victory-fork. Originally posted by AscilCH on 2026-11-25T06:44:55Z.
Problem
Under levels-on-demand (
VICTORY_LEVELS_ON_DEMAND=1),make()shifts a tiled texture's host SRV to start atfirst_shown(), andOnDemand::uploaded()/card_wrote()records the texture's start address inRESHOWNforHostHeap::texture_views_remade(). Two gaps left tabled (and non-placed) tiled texture slots permanently stuck at unmappedMostDetailedMip = 0(black) or stale mips:HostHeap::note_buffer()excludestabled_latelyslots fromself.placed(Spans), soHostHeap::texture_views_remade()never found tabled slots when drainingRESHOWN.HostHeap::mirror()only rebuilt a slot whenmade[index] != key. Once a draw mirrored a tabled tiled slot before its first upload (first_shown() == None->MostDetailedMip = 0) or before finer mips arrived, every subsequent draw hitmade[index] == keyand skippedmake().Fix
HostHeap::tiled_shown(TiledSlots), storing theOnDemandhandle, optional placed start address (including tabled slots excluded fromself.placed), and thefirst_shownlevel baked into the slot, gated by a fasthas_tiled: AtomicBoolso non-tiled heaps incur no mutex overhead.tiled_shown.slots_at(start)inHostHeap::texture_views_remade().HostHeap::mirror(), whenmade[index] == keyandtiled_stale(index)is true (first_shown()changed since the slot was built), rebuild the host descriptor and updatetiled_shown.Verification
cargo test -p victory-gpu --locked -- descriptor::host::tests:20 passed; 0 failed(including pure unit testtiled_slots_tracks_tabled_starts_and_detects_first_shown_changes).VICTORY_LEVELS_ON_DEMAND=1 cargo test -p victory-gpu --locked -- descriptor::host::tests::tabled_tiled_slot_remakes_when_first_shown_changes:1 passed; 0 failed(exercising a real tiled placed texture on D3D12 hardware through bothtexture_views_remade()andmirror()).cargo clippy -p victory-gpu --all-targets --all-features --locked: 0 warnings indescriptor/host.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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.