GPU: release buffer-pass copies with their descriptor heap #1276

Open
github-bot wants to merge 1 commit from github-bot/gh-1276 into main AGit
Owner

@⁠UwUCammie on GitHub · 2026-11-26 09:09 UTC · original
UwUCammie:fix/retire-heap-view-caches → main · +52 −0 · 2 files · 1 commits · open

Dropping a shader-visible view heap left its buffer copies in both heap-pass caches. Both tables use the address of the host heap as the key. That kept the copies alive and allowed a later heap allocated at that address to inherit the old ranges.

Remove both entries when the view heap drops. Release the copies after unlocking the tables so GPU resource destruction stays outside the critical sections. Command lists that still use a copy keep their own reference.

The new test puts a real GPU buffer copy in both caches and releases the descriptor heap. It failed before the fix. The lifetime test, descriptor tests and heap-pass tests all passed on an RX 7900 XT with RADV 26.3.1 under Wine (13 tests).

**@⁠UwUCammie** on GitHub · 2026-11-26 09:09 UTC · [original](https://github.com/fxceless/victory-fork/pull/1276) `UwUCammie:fix/retire-heap-view-caches` → `main` · +52 −0 · 2 files · 1 commits · open Dropping a shader-visible view heap left its buffer copies in both heap-pass caches. Both tables use the address of the host heap as the key. That kept the copies alive and allowed a later heap allocated at that address to inherit the old ranges. Remove both entries when the view heap drops. Release the copies after unlocking the tables so GPU resource destruction stays outside the critical sections. Command lists that still use a copy keep their own reference. The new test puts a real GPU buffer copy in both caches and releases the descriptor heap. It failed before the fix. The lifetime test, descriptor tests and heap-pass tests all passed on an RX 7900 XT with RADV 26.3.1 under Wine (13 tests).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 11:19:40 +00:00
Author
Owner

@⁠Proudnoob4 on GitHub · 2026-11-26 15:13 UTC · original

RTX 4080 / Win10 verification (989e5c6)

Ported #1276 (impl Drop for HostHeap -> crate::draw::forget_heap_ranges(self)) onto our VIctory-NVIDIA tree (RANGES hoisted out of heap_buffer_pass):

  • Unit test: draw::tests::dropping_a_descriptor_heap_releases_buffer_pass_cache passed (weak.upgrade().is_none() immediately on drop(heap)).
  • 10-minute live GTA 6 run (RTX 4080 / i5-13600K / Win10, Series S 0.6667): 0/230 black frames, 4,582 draws/frame, zero crashes or descriptor/shadow lifetime issues.
**@⁠Proudnoob4** on GitHub · 2026-11-26 15:13 UTC · [original](https://github.com/fxceless/victory-fork/pull/1276#issuecomment-7195970813) ### RTX 4080 / Win10 verification (`989e5c6`) Ported `#1276` (`impl Drop for HostHeap` -> `crate::draw::forget_heap_ranges(self)`) onto our `VIctory-NVIDIA` tree (`RANGES` hoisted out of `heap_buffer_pass`): - **Unit test:** `draw::tests::dropping_a_descriptor_heap_releases_buffer_pass_cache` passed (`weak.upgrade().is_none()` immediately on `drop(heap)`). - **10-minute live GTA 6 run (RTX 4080 / i5-13600K / Win10, Series S `0.6667`):** `0/230` black frames, `4,582` draws/frame, zero crashes or descriptor/shadow lifetime issues.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1276/head:github-bot/gh-1276'
git switch 'github-bot/gh-1276'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1276'
git switch 'github-bot/gh-1276'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1276'
git switch 'github-bot/gh-1276'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1276'
git switch 'main'
git merge --squash 'github-bot/gh-1276'
git switch 'main'
git merge --ff-only 'github-bot/gh-1276'
git switch 'main'
git merge 'github-bot/gh-1276'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.