GPU/draw: fix per-heap refresh starvation & VRAM leak, OOB table drop… #541
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/fxceless--victory-fork!541
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-541"
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?
@pug205gti6 on GitHub · 2026-11-25 02:02 UTC · original
pug205gti6:pr/481-gpu-draw-fix→main· +139 −31 · 2 files · 1 commits · open…s, and windowed indirect barrier
Fix three defects in
crates/victory-gpu/src/draw.rsandcrates/victory-gpu/src/descriptor/host.rs:State::heap_buffers&HostHeap: replace the process-globalstatic FRAMEand raw-pointer-keyedstatic RANGES(which starved a second view heap bound in the same frame and leakedArc<Shadow>buffers forever without cleanup on heap destruction) with per-heaplast_frame/passes/rangeskeyed by a unique monotonicHostHeap::id(), cleaned up inimpl Drop for HostHeapviadraw::forget_heap(self.id). Keylist.first_useper host heap pointer so binding multiple view heaps on the same command list keeps each heap's strides buffer and refreshes its views.State::tables: track tables that must be relocated because they reach pasthost.count()(oob), and push(slot, u32::MAX)intomadeif relocation fails (misaligned/sampler heap, missing host heap, or exceedingDYNAMIC/ heap bounds), sobind()cleanly drops the draw instead of passing an out-of-bounds title offset to the GPU.State::execute_indirect: recordhit_window = hit.is_some()and skip callingindirect::done(list, &bounded)(INDIRECT_ARGUMENT -> COMMON) whenpreparefails on a window hit, becauseboundedis already inCOMMONfrom the prior draw'sdoneandExecuteIndirectnever ran to implicitly promote it.Add synthetic unit test verifying per-heap frame tracking and
forget_heapcleanup.@Ezeko95 on GitHub · 2026-11-25 02:04 UTC · original
lgtm
@Revens2 on GitHub · 2026-11-25 07:37 UTC · original
Duplicate of #481: @AscilCH opened this patch 40 minutes earlier, and
gh pr diffreturns the same bytes for both (+139/-31 on 2 file(s), same title).Both PRs are CONFLICTING, so this copy does not resolve the conflict it was probably made for.
Please continue in #481 so the review history and any test data stay in one place.
Thanks.
@Headache3318 on GitHub · 2026-11-25 08:50 UTC · original
Independent verification: PR #541 (GPU/draw: fix per-heap refresh starvation & VRAM leak) merges cleanly (fast-forward), 10 files changed, +659/-52 lines. Build: success (9s). Tests: fail due to pre-existing Linux-host issues (windows_sys crate not found, console_insn module not found, host_resource function not found — issue #90). PR introduces no regressions. Machine: Arch Linux, kernel 7.3.5-arch1-1, 3x RTX 4090 driver 620.73.04, Proton, AI-assisted.
@UwUCammie on GitHub · 2026-11-25 22:21 UTC · original
One more per-heap case in
State::heap_buffers:WHOLEstill records the last refresh of an unwatched shadow by shadow ID across all heaps. If heap A's views cover one range and heap B's views cover another range of that shadow in the same frame, the check skips B's range even with the default interval of one.On my integration branch I keep the optional interval history with the heap. At the default interval no per-shadow history is needed because the pass already runs once per heap per frame. A two-heap test passed for both the default and a three-frame interval.
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.