gpu(panel): retire old Buffers on format/scale change instead of mem::forget #3278

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

@⁠RanoGames on GitHub · 2026-11-29 21:15 UTC · original
RanoGames:fix/book-notice-drop-on-attach-fail → main · +3 −3 · 1 files · 1 commits · open

What it changes

Fixes permanent GPU/COM resource leaks in crates/victory-gpu/src/host/panel.rs:

  • Panel::draw, Notice::draw, and the F2 advisor path used std::mem::forget(self.buffers.take()) when (format, scale) changed (or when the start notice expired), permanently leaking the old Buffers (upload resources + card ID3D12Resource).
  • Replaces each mem::forget with if let Some(old) = self.buffers.take() { super::retire(old); } so drops are deferred via host::retire until in-flight GPU work finishes.

Same pattern as the menu fix (#3049).

How it was tested

  • GPU and profile (Series X or S, resolution, DLSS, frame generation, ray tracing): N/A (code-verified resource-retirement fix)
  • Before: every format/scale change (and notice expiry) leaked Buffers via mem::forget.
  • After: old Buffers are queued in host::retire and dropped after GPU submissions finish.
  • For shader changes, the wave sizes tested (32 and/or 64 lanes): N/A
  • cargo test passed for the crates it touches: yes (cargo test --locked -p victory-gpu --lib -- host::panel; cargo xtask policy --staged passed)

Checked for overlap

  • Searched open and closed pull requests for panel.rs / mem::forget / Buffers. Related: #3049 (menu only), #915 (broader mixed PR that also mentions panel).
**@⁠RanoGames** on GitHub · 2026-11-29 21:15 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3278) `RanoGames:fix/book-notice-drop-on-attach-fail` → `main` · +3 −3 · 1 files · 1 commits · open ## What it changes Fixes permanent GPU/COM resource leaks in `crates/victory-gpu/src/host/panel.rs`: - `Panel::draw`, `Notice::draw`, and the F2 advisor path used `std::mem::forget(self.buffers.take())` when `(format, scale)` changed (or when the start notice expired), permanently leaking the old `Buffers` (upload resources + `card` `ID3D12Resource`). - Replaces each `mem::forget` with `if let Some(old) = self.buffers.take() { super::retire(old); }` so drops are deferred via `host::retire` until in-flight GPU work finishes. Same pattern as the menu fix (#3049). ## How it was tested - GPU and profile (Series X or S, resolution, DLSS, frame generation, ray tracing): N/A (code-verified resource-retirement fix) - Before: every format/scale change (and notice expiry) leaked `Buffers` via `mem::forget`. - After: old `Buffers` are queued in `host::retire` and dropped after GPU submissions finish. - For shader changes, the wave sizes tested (32 and/or 64 lanes): N/A - `cargo test` passed for the crates it touches: yes (`cargo test --locked -p victory-gpu --lib -- host::panel`; `cargo xtask policy --staged` passed) ## Checked for overlap - [x] Searched open and closed pull requests for `panel.rs` / `mem::forget` / `Buffers`. Related: #3049 (menu only), #915 (broader mixed PR that also mentions panel).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 21:16:27 +00:00
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/3278/head:github-bot/gh-3278'
git switch 'github-bot/gh-3278'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-3278'
git switch 'github-bot/gh-3278'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-3278'
git switch 'github-bot/gh-3278'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-3278'
git switch 'main'
git merge --squash 'github-bot/gh-3278'
git switch 'main'
git merge --ff-only 'github-bot/gh-3278'
git switch 'main'
git merge 'github-bot/gh-3278'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/trustno1-coder--VIctory-NVIDIA!3278
No description provided.