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

Closed
github-bot wants to merge 1 commit from github-bot/gh-3235 into main AGit
Owner

@⁠RanoGames on GitHub · 2026-11-29 20:55 UTC · original
RanoGames:fix/panel-retire-buffers → main · +3 −1 · 1 files · 1 commits · closed without merging

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/closed PRs for panel.rs / mem::forget / Buffers. Related: #3049 (menu only), #915 (broader mixed PR that also mentions panel).
**@⁠RanoGames** on GitHub · 2026-11-29 20:55 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3235) `RanoGames:fix/panel-retire-buffers` → `main` · +3 −1 · 1 files · 1 commits · closed without merging ## 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/closed PRs for `panel.rs` / `mem::forget` / `Buffers`. Related: #3049 (menu only), #915 (broader mixed PR that also mentions panel).
Panel, Notice, and F2 advisor paths used mem::forget on format/scale change
(and notice expiry), permanently leaking upload and card ID3D12Resources.
Route them through host::retire instead, same pattern as the menu fix.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 20:57:28 +00:00
github-bot force-pushed github-bot/gh-3235 from 6e804d49b8 to d6c631e45e 2026-11-29 21:27:46 +00:00 Compare
github-bot closed this pull request 2026-12-01 16:29:19 +00:00
Author
Owner

@⁠RanoGames on GitHub · 2026-12-01 16:24 UTC · original

Closing in favor of #915, which already retires the startup notice buffers when the notice expires.

**@⁠RanoGames** on GitHub · 2026-12-01 16:24 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3235#issuecomment-7317565004) Closing in favor of #915, which already retires the startup notice buffers when the notice expires.

Pull request closed

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!3235
No description provided.