gpu: exclude VIctory debug menu and overlays from frame generation #4900

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

@⁠topangag on GitHub · 2026-12-01 13:14 UTC · original
topangag:pr/exclude-debug-menu-from-framegen → main · +167 −26 · 5 files · 1 commits · closed without merging

What it changes

Prevents VIctory's own debug menu (F1) and diagnostic overlays (F3 stats panel, notices, advisor) from being warped or blurred by frame generation when rotating the camera:

  1. Root cause:
    • VIctory's overlays are composited directly onto the full-resolution swap-chain back buffer in Host::present_placed() after DLSS Super Resolution, so DLSS SR never blurs them.
    • However, because they are copied onto the back buffer before Present(), Streamline DLSS-G and AMD FSR 3 Frame Generation treated those static overlay pixels as moving world geometry — smearing/blurring the F1 menu whenever the camera moved.
  2. Pause frame generation cleanly while the F1 debug menu is open (crates/victory-gpu/src/streamline.rs, crates/victory-gpu/src/streamline/fsr.rs):
    • Menu::draw, Panel::draw, Notice::draw, and Advisor::draw now return bool indicating whether VIctory stamped pixels onto that frame.
    • Adds pause_framegen_for_ui(overlay_drawn): pauses DLSS-G (keeping DLSSG_RETAIN_RESOURCES_WHEN_OFF so resume is instant without teardown) and FSR 3 FG (without calling retire()) while SETTINGS_MENU_OPEN is true.
    • Opt-out via VICTORY_FRAMEGEN_IN_MENU=1; opt-in to also pause FG while any diagnostic overlay (F3/F2/notice) is visible via VICTORY_OVERLAY_NO_FRAMEGEN=1.
  3. Separate UI overlay plane & HUD-less fallback (crates/victory-gpu/src/host.rs, crates/victory-gpu/src/streamline.rs, crates/victory-gpu/src/streamline/fsr.rs):
    • In two-plane DLSS-G mode (overlay.is_some()), lazily allocates a 2-slot COPY_DEST ui_overlay ring on Presenter, copies the title's UI plane into it, stamps VIctory's overlays onto that UI plane (all rendered overlay pixels have alpha = 1.0), and tags it as BUFFER_UI_COLOR_AND_ALPHA so DLSS-G separates UI from motion-interpolated world pixels.
    • When hudless.is_none() and a VIctory overlay was drawn onto the back buffer, falls back to tagging planes.base as BUFFER_HUDLESS_COLOR (and passes planes.base as hudless to FSR 3 FG).

How it was tested

  • PC Hardware:
    • CPU: AMD Ryzen 9 9955HX3D
    • RAM: 16 GB physical RAM (15,544.2 MiB usable)
    • GPU: NVIDIA GeForce RTX 5070 Ti Laptop GPU, 12 GB VRAM (Driver 595.97.0, Streamline 2.14.16, Hardware GPU Scheduling)
    • OS: Windows 11 (10.0.26200)
  • Game & Profile:
    • Profile: Xbox Series X, 1080to1440, DLSS Quality, DLSS Frame Generation 2x (--framegen 2), Ray Tracing Off (VICTORY_HW_RT=0), 30 FPS cap, DualSense input profile, fixed input replay pad_xsx.txt
  • Before:
    • With DLSS Frame Generation 2x active, opening the F1 menu left DLSS-G running over the back-buffer overlay, visibly smearing/blurring F1 menu text whenever the camera moved.
  • After (verified live on 3ae31073 combined with 5fabb46e):
    • F1 menu closed (gameplay): DLSS Frame Generation switched frame=1367 on=true times=2 code=0 result="ok" → steady 15–17 presents with it on, 0 off, 15–17 frames shown by it (status 0x0).
    • F1 menu open (VICTORY_MENU_OPEN=1, gameplay): steady 0 presents with it on, 14–17 off, 0 frames shown by it (status 0x0), 0.08 ms before present, 0.00 ms lock wait, zero Streamline errors or resource teardown.
    • Note: FSR 3 FG path and Series S two-plane BUFFER_UI_COLOR_AND_ALPHA path were verified by code inspection, Clippy, and unit tests; live gameplay run tested Series X DLSS-G 2x on RTX 5070 Ti.
  • For shader changes, the wave sizes tested (32 and/or 64 lanes): N/A (no shader changes)
  • cargo test passed for the crates it touches: yes
    • Local on 3ae31073: cargo test --locked -p victory-gpu --lib -- streamline:: → 55 passed, 0 failed (including new unit test debug_menu_pauses_framegen_by_default_without_blocking_hud_overlays).
    • Local Clippy (default & --all-features) on 3ae31073: 0 warnings/errors in the 5 touched files.
    • Full Windows GitHub Actions CI (check = Clippy, Clippy --all-features, full workspace cargo test) verified green (6m28s) in fork PR topangag/VIctory-NVIDIA#3 on top of upstream CI baseline fixes (#4708 Clippy fixes + #4143 victory-hle alias validation fix).

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches. Related: none found.
**@⁠topangag** on GitHub · 2026-12-01 13:14 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4899) `topangag:pr/exclude-debug-menu-from-framegen` → `main` · +167 −26 · 5 files · 1 commits · closed without merging ## What it changes Prevents VIctory's own debug menu (F1) and diagnostic overlays (F3 stats panel, notices, advisor) from being warped or blurred by frame generation when rotating the camera: 1. **Root cause**: - VIctory's overlays are composited directly onto the full-resolution swap-chain back buffer in `Host::present_placed()` **after** DLSS Super Resolution, so DLSS SR never blurs them. - However, because they are copied onto the back buffer **before** `Present()`, Streamline DLSS-G and AMD FSR 3 Frame Generation treated those static overlay pixels as moving world geometry — smearing/blurring the F1 menu whenever the camera moved. 2. **Pause frame generation cleanly while the F1 debug menu is open (`crates/victory-gpu/src/streamline.rs`, `crates/victory-gpu/src/streamline/fsr.rs`)**: - `Menu::draw`, `Panel::draw`, `Notice::draw`, and `Advisor::draw` now return `bool` indicating whether VIctory stamped pixels onto that frame. - Adds `pause_framegen_for_ui(overlay_drawn)`: pauses DLSS-G (keeping `DLSSG_RETAIN_RESOURCES_WHEN_OFF` so resume is instant without teardown) and FSR 3 FG (without calling `retire()`) while `SETTINGS_MENU_OPEN` is true. - Opt-out via `VICTORY_FRAMEGEN_IN_MENU=1`; opt-in to also pause FG while any diagnostic overlay (F3/F2/notice) is visible via `VICTORY_OVERLAY_NO_FRAMEGEN=1`. 3. **Separate UI overlay plane & HUD-less fallback (`crates/victory-gpu/src/host.rs`, `crates/victory-gpu/src/streamline.rs`, `crates/victory-gpu/src/streamline/fsr.rs`)**: - In two-plane DLSS-G mode (`overlay.is_some()`), lazily allocates a 2-slot `COPY_DEST` `ui_overlay` ring on `Presenter`, copies the title's UI plane into it, stamps VIctory's overlays onto that UI plane (all rendered overlay pixels have `alpha = 1.0`), and tags it as `BUFFER_UI_COLOR_AND_ALPHA` so DLSS-G separates UI from motion-interpolated world pixels. - When `hudless.is_none()` and a VIctory overlay was drawn onto the back buffer, falls back to tagging `planes.base` as `BUFFER_HUDLESS_COLOR` (and passes `planes.base` as `hudless` to FSR 3 FG). ## How it was tested - **PC Hardware**: - CPU: AMD Ryzen 9 9955HX3D - RAM: 16 GB physical RAM (`15,544.2 MiB` usable) - GPU: NVIDIA GeForce RTX 5070 Ti Laptop GPU, 12 GB VRAM (Driver `595.97.0`, Streamline `2.14.16`, Hardware GPU Scheduling) - OS: Windows 11 (`10.0.26200`) - **Game & Profile**: - Profile: Xbox Series X, `1080to1440`, DLSS Quality, DLSS Frame Generation 2x (`--framegen 2`), Ray Tracing Off (`VICTORY_HW_RT=0`), 30 FPS cap, DualSense input profile, fixed input replay `pad_xsx.txt` - **Before**: - With DLSS Frame Generation 2x active, opening the F1 menu left DLSS-G running over the back-buffer overlay, visibly smearing/blurring F1 menu text whenever the camera moved. - **After (verified live on `3ae31073` combined with `5fabb46e`)**: - **F1 menu closed (gameplay)**: `DLSS Frame Generation switched frame=1367 on=true times=2 code=0 result="ok"` → steady `15–17 presents with it on, 0 off, 15–17 frames shown by it (status 0x0)`. - **F1 menu open (`VICTORY_MENU_OPEN=1`, gameplay)**: steady `0 presents with it on, 14–17 off, 0 frames shown by it (status 0x0)`, `0.08 ms before present`, `0.00 ms` lock wait, zero Streamline errors or resource teardown. - Note: FSR 3 FG path and Series S two-plane `BUFFER_UI_COLOR_AND_ALPHA` path were verified by code inspection, Clippy, and unit tests; live gameplay run tested Series X DLSS-G 2x on RTX 5070 Ti. - For shader changes, the wave sizes tested (32 and/or 64 lanes): N/A (no shader changes) - `cargo test` passed for the crates it touches: **yes** - Local on `3ae31073`: `cargo test --locked -p victory-gpu --lib -- streamline::` → **55 passed, 0 failed** (including new unit test `debug_menu_pauses_framegen_by_default_without_blocking_hud_overlays`). - Local Clippy (default & `--all-features`) on `3ae31073`: 0 warnings/errors in the 5 touched files. - Full Windows GitHub Actions CI (`check` = Clippy, Clippy `--all-features`, full workspace `cargo test`) verified green (`6m28s`) in fork PR [topangag/VIctory-NVIDIA#3](https://github.com/topangag/VIctory-NVIDIA/pull/3) on top of upstream CI baseline fixes (#4708 Clippy fixes + #4143 `victory-hle` alias validation fix). ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. Related: none found.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 13:15:57 +00:00
Author
Owner

@⁠andrewpozdnakov7-jpg on GitHub · 2026-12-01 13:38 UTC · original · edited 2026-12-01 14:21 UTC

On 3ae31073, the Streamline swap chain stays proxied after you turn DLSS Frame Generation off in F1. With a visible overlay in two-plane mode, that still triggers a full-size UI texture copy and another round of overlay draws every present. The movie path has the same extra work while DLSS Frame Generation is held off.

da7b5d02 gates the combined UI plane on the live DLSS-G request and submission readiness, and skips it on movie presents. The regular back-buffer overlays still draw. The diagnostic cycle can still prepare a UI plane on a present where it switches generation back on.

cargo check --locked -p victory-gpu passed on Windows with the patch. The staged asset policy passed for both files. The remaining check is two-plane presentation on a DLSS-G card, with a visible overlay while switching generation off and back on.

81d9ff31 is a follow-up on the same branch series for two-plane presentation. It uses the typed view already accepted by the compositor, so a compatible typeless or sRGB display plane can be copied into the UI texture. The DLSS and FSR paths use the overlay actually drawn by the compositor. The copy still requires a matching size, one mip, and the same sample description. D3D12 CopyResource format rules

cargo check --locked -p victory-gpu passed on Windows with both commits. The staged asset policy passed on the additional file change.

Please keep the Git author on cherry-pick or rebase, or add Co-authored-by: andrewpozdnakov7-jpg <[email protected]> if folding the change in.

AI-assisted with OpenAI Codex.

**@⁠andrewpozdnakov7-jpg** on GitHub · 2026-12-01 13:38 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4899#issuecomment-7312943443) · edited 2026-12-01 14:21 UTC On `3ae31073`, the Streamline swap chain stays proxied after you turn DLSS Frame Generation off in F1. With a visible overlay in two-plane mode, that still triggers a full-size UI texture copy and another round of overlay draws every present. The movie path has the same extra work while DLSS Frame Generation is held off. [da7b5d02](https://github.com/andrewpozdnakov7-jpg/VIctory-NVIDIA/commit/da7b5d0229f9764a48c36e3ef52f9e91d508cb40) gates the combined UI plane on the live DLSS-G request and submission readiness, and skips it on movie presents. The regular back-buffer overlays still draw. The diagnostic cycle can still prepare a UI plane on a present where it switches generation back on. `cargo check --locked -p victory-gpu` passed on Windows with the patch. The staged asset policy passed for both files. The remaining check is two-plane presentation on a DLSS-G card, with a visible overlay while switching generation off and back on. [81d9ff31](https://github.com/andrewpozdnakov7-jpg/VIctory-NVIDIA/commit/81d9ff3103b59c80db4e32af68493491801b03d3) is a follow-up on the same branch series for two-plane presentation. It uses the typed view already accepted by the compositor, so a compatible typeless or sRGB display plane can be copied into the UI texture. The DLSS and FSR paths use the overlay actually drawn by the compositor. The copy still requires a matching size, one mip, and the same sample description. [D3D12 CopyResource format rules](https://learn.microsoft.com/en-us/windows/win32/api/d3d12/nf-d3d12-id3d12graphicscommandlist-copyresource) `cargo check --locked -p victory-gpu` passed on Windows with both commits. The staged asset policy passed on the additional file change. Please keep the Git author on cherry-pick or rebase, or add `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>` if folding the change in. AI-assisted with OpenAI Codex.
github-bot closed this pull request 2026-12-01 18:30:36 +00:00
Author
Owner

@⁠trustno1-coder on GitHub · 2026-12-01 18:28 UTC · original

Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.

**@⁠trustno1-coder** on GitHub · 2026-12-01 18:28 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4899#issuecomment-7321015307) Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.

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