gpu: reclaim idle superseded and slot-pinned dead render targets #2361
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!2361
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2361"
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?
@nidea1 on GitHub · 2026-11-29 12:21 UTC · original
nidea1:fix/reclaim-superseded-render-targets→main· +473 −70 · 3 files · 2 commits · merged 2026-11-30 14:12 UTCWhat it changes
Extends the periodic dead render-target sweep in
crates/victory-gpu/src/resource.rs,crates/victory-gpu/src/descriptor.rs, andcrates/victory-gpu/src/descriptor/host.rsto reclaim superseded and slot-pinned dead render targets (addressing the render-target VRAM growth tracked in #791):NEXT_DEAD_RT_SWEEPonly reclaimed placed render targets whose title memory was unmapped (!committed), so old render targets superseded by a newer target at the same title virtual address (TARGETS_AT/superseded) stayed in VRAM indefinitely because the new target keeps that VA committed.reclaim_dead_render_targetsnow also reclaims superseded non-null targets after 10 s / 60 frames idle (keeping 30 s / 60 frames for unmapped targets).twin'sArc::strong_countand COM reference count before reclaiming and includestwin.colour.bytesin reclaimed totals.TEXTURESlock soTARGETS_ATandSHADER_HEAPSnever nest underTEXTURES. For dead RTs withArc::strong_count == 1whose host resource is still pinned only by stale title descriptor slots (references > 1), queriesdescriptor::evictable_dead_rt_slots(skipping any slot shown by a draw table or marked by sampled-marks since the 10 s cutoff, or held by non-title/sampler slots), resets only slots still holding that exactexpected_rawresource pointer viaHostHeap::texture_slot_evicted(index, Some(expected_raw))without re-queuing them into the sampled texture pass, and restores slots viadescriptor::texture_madeif concurrent reuse occurred.How it was tested
let_go_idle(), causing steady render-target VRAM growth on 8 GB GPUsdead_rt_reclaimable_policy_matrix,reclaim_dead_render_targets_frees_idle_superseded_and_keeps_newest_and_recent, fullresource::tests::&descriptor::tests::, and live 8 GB RTX 3060 Ti sessionscargo testpassed for the crates it touches: yes (cargo test -p victory-gpu --lib --locked -- resource::tests:: descriptor::tests::— 62 passed, 0 failed, 1 ignored)Checked for overlap
slot_evict's filled-texture eviction oridle_sweep_policy, which are already onmain)github-bot referenced this pull request2026-11-30 09:34:54 +00:00