GPU/draw: fix per-heap refresh starvation & VRAM leak, OOB table drop… #541
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/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?
Imported from fxceless/victory-fork. Originally posted by pug205gti6 on 2026-11-25T02:02:32Z.
…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.Imported from fxceless/victory-fork. Originally posted by Ezeko95 on 2026-11-25T02:04:42Z.
lgtm
Imported from fxceless/victory-fork. Originally posted by Revens2 on 2026-11-25T07:37:48Z.
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.
Imported from fxceless/victory-fork. Originally posted by Headache3318 on 2026-11-25T08:50:44Z.
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.
Imported from fxceless/victory-fork. Originally posted by UwUCammie on 2026-11-25T22:21:38Z.
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
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.