GPU: evict cold unpinned textures under DXGI local VRAM budget pressure #2878
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2880"
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 Marvisak/VIctory. Originally posted by mitaka1959 on 2026-11-25T22:59:32Z.
What
When the card goes over budget, the eviction pass used to give up (destroy) the least recently used host textures fed from title memory. At their next use they were made again from title memory: detiled and uploaded again.
Now a committed texture past the budget is evicted with
ID3D12Device::Evictand kept. Its contents and GPU address stay. Its next use only callsMakeResident: a copy back if the system paged it out, nothing otherwise. Large textures, the most expensive to rebuild, are the committed ones.Unchanged:
placement.rs) are given up as before. D3D12 changes residency only for heaps and committed resources, not for single placed resources.How no GPU work reaches an evicted texture
HostListstates) are made resident in one call (residency::before_running).Resource::host) makes the texture resident before a view of it is made.HostHeap::check_resident, inmirrorandmake_at). That covers descriptor-array entries a list never names.MakeResident, other textures are evicted first, least recently used and none the submission uses, then it asks once more. Refused again, the run ends with a crash report instead of a GPU fault.MakeResidentdocs).Code
crates/victory-gpu/src/residency.rs:planreplacesresource::choose. Also the budget marks, the budget override and the address-space check.resource.rs:HostTexturegains aresidencyfield.evict_amongruns one walk of the heaps for textures given up and evicted together.give_upis split; its giving-up part is nowlet_go.make_roomfor the refusal path.host.rs:before_runningis called inexecutebeforeExecuteCommandLists.VICTORY_VRAM_BUDGET_MB=<n>: a smaller budget, to simulate a smaller card on a larger one.VICTORY_GIVE_UP_TEXTURES=1: the old behaviour, for A/B runs.Not included, possible follow-ups:
Testing
cargo clippy --workspace --all-targetswith and without--all-features,-D warnings, forx86_64-pc-windows-msvc: clean.cargo xtask policy: ok.residency::tests, 10): pass. Among them:choosetest, ported toplan.residency::device_tests: an eviction and a use, a list recorded before the eviction, a heap slot) and a run in the world: TODO before merge (cargo test -p victory-gpu --lib residency).VICTORY_VRAM_BUDGET_MB=8192, checking thefirst host textures evicted past the budgetline and the evicted / made-resident-again counts, compared withVICTORY_GIVE_UP_TEXTURES=1.Pull request closed