feat(victory-gpu): add opt-in tile reclamation and zero-alloc single-run mappings #429
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/429"
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 LooperSalty/AnyXboxX. Originally posted by Lewandox on 2026-11-26T18:19:26Z.
Summary
Adds opt-in VRAM tile reclamation for mip levels the title no longer holds (
VICTORY_LEVELS_RECLAIM=1, off by default) and avoids unnecessary per-call heap allocations inTiled::give_lockedandDrop for Tiled(third_party/victory/crates/victory-gpu/src/tiles.rs):VICTORY_LEVELS_RECLAIM=1, off by default):Given(level_runs: Vec<Vec<(usize, u32, u32)>>for standard mips +packed_runs).VICTORY_LEVELS_RECLAIM=1is set and a standard mip level is no longer held by the title or written by the card (!named),give_lockedunmaps that subresource (D3D12_TILE_RANGE_FLAG_NULLviaUpdateTileMappings) and returns its tiles to the heap pool (updatingSTATS[2]), allowing freed VRAM to be reused by other textures (and allowing empty 64 MiB heaps to return to the GPU).give_locked, uses stack arrays for single-run tile mappings (runs.len() == 1, the common case) instead of allocating threeVecs (flags,starts,counts) on everyUpdateTileMappingscall.reclaim_onparsing andreclaim_unheldunmapping/returning tiles for unheld standard mips while preserving held/card-written levels and updatinggiven_bytesaccurately.Verification
cargo test -p victory-gpu --lib tiles::tests(default and--features diagnostics)cargo xtask policyinsidethird_party/victory