framegen: an interface plane of another size than the screen's is drawn to it, not interpolated #135

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

@⁠Frtuchinno on GitHub · 2026-12-01 23:48 UTC · original
Frtuchinno:fg-hud-plane-scaled → main · +250 −5 · 2 files · 1 commits · closed without merging

With frame generation (#68) at an output smaller than 4K, the HUD was interpolated with the scene and shook against the world in every generated frame. The proxy composes an interface plane only at the swap chain's size, so Presentation::ui_plane gave up on any other size. But VICTORY_UI_PLANE=3840x2160 is exactly what a smaller output needs for the HUD to be laid out at its right size (#63), so the two did not go together below 4K:

VICTORY_FSR_4K=performance VICTORY_OUTPUT=2560x1440 VICTORY_FIDELITYFX_FRAMEGEN=1 VICTORY_UI_PLANE=3840x2160

WARN victory_gpu::framegen: FidelityFX frame generation: the interface plane is interpolated with the scene plane=[3840, 2160] plane_format=28 screen=[2560, 1440] scene=28

Change

  • compose::Scaler: a one-plane sibling of Composer. It draws a texture over the whole of a render target of any size, linearly filtered, with colour and alpha as they are (a premultiplied interface stays premultiplied). It has its own root signature and pipeline, and a ring of 16 SRV/RTV slots, so a view is rewritten only well after the presents that read it.
  • framegen::Presentation::ui_plane: a plane of another size than the screen's (RGBA8, and viewable by compose::view) is drawn by the scaler into our texture, which is now made at the screen's size. That texture is registered with the proxy as before and left in copy-destination state for the F3 panel, as the copy path leaves it. A plane of the screen's size is still copied as before, so 4K is unchanged.

The scaler is made on first need and logs it once:

INFO victory_gpu::framegen: FidelityFX frame generation: the interface plane is drawn to the screen's size plane=[3840, 2160] screen=[2560, 1440]
INFO victory_gpu::framegen: FidelityFX frame generation: the interface plane is composed over every frame

Tested

RX 7800 XT (RDNA3, 16 GB), Ryzen 5 7600, CachyOS (kernel 7.3.6), proton-cachyos-slr, Mesa 26.3.1 + mesa.patch. On f7f0360 (plus #113 to get past #112). Series X, VICTORY_FSR_4K=performance VICTORY_OUTPUT=2560x1440 VICTORY_FIDELITYFX_FRAMEGEN=1 VICTORY_UI_PLANE=3840x2160, VICTORY_BVH_HARDWARE=0.

  • Before (same build without this commit, ~10 min in the world): the warning above, no "composed over every frame" line, and the HUD shook all the time.
  • After (~22 min in the world): the two lines above, and the interface plane is registered again after menus and cutscenes. The HUD no longer shakes. No errors, hang watch or crashes, no presentation wait over 50 ms. Median game frame rate in the world was 21.9 fps against 20.0 before (different routes, so I can't tell any cost of the extra draw).
  • rustfmt clean on both files, no clippy warnings in them, and framegen::tests pass (3) under Wine.

Not checked / notes

  • Only 3840x2160 over 2560x1440 has been tried. A plane smaller than the screen would be scaled up the same way.
  • Linear filtering at 1.5x down is what Composer already does for the non-frame-generation path. Small HUD text may be a little softer than at 4K.
  • No GPU unit test like compose::tests::composes_scaled_premultiplied_plane_on_gpu for the scaler yet. I can add one if you want it.
  • Separate from this PR, and harmless as far as I can tell: on the FSR path run.rs calls apply_ui_plane with a fixed (3840, 2160) output. With #58's smaller outputs, this sizes the back buffer pool for a 4K output (144 MiB rather than 112 MiB at 2560x1440). The pool check then logs Differs, because prepare_output has already put the same jump there.
  • cargo xtask policy on the whole tree reports two files already on main (replay/play/visual/header.html, emit/lower.rs size). This PR touches neither.

🤖 Generated with Claude Code

**@⁠Frtuchinno** on GitHub · 2026-12-01 23:48 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/135) `Frtuchinno:fg-hud-plane-scaled` → `main` · +250 −5 · 2 files · 1 commits · closed without merging With frame generation (#68) at an output smaller than 4K, the HUD was interpolated with the scene and shook against the world in every generated frame. The proxy composes an interface plane only at the swap chain's size, so `Presentation::ui_plane` gave up on any other size. But `VICTORY_UI_PLANE=3840x2160` is exactly what a smaller output needs for the HUD to be laid out at its right size (#63), so the two did not go together below 4K: ``` VICTORY_FSR_4K=performance VICTORY_OUTPUT=2560x1440 VICTORY_FIDELITYFX_FRAMEGEN=1 VICTORY_UI_PLANE=3840x2160 WARN victory_gpu::framegen: FidelityFX frame generation: the interface plane is interpolated with the scene plane=[3840, 2160] plane_format=28 screen=[2560, 1440] scene=28 ``` ## Change - `compose::Scaler`: a one-plane sibling of `Composer`. It draws a texture over the whole of a render target of any size, linearly filtered, with colour and alpha as they are (a premultiplied interface stays premultiplied). It has its own root signature and pipeline, and a ring of 16 SRV/RTV slots, so a view is rewritten only well after the presents that read it. - `framegen::Presentation::ui_plane`: a plane of another size than the screen's (RGBA8, and viewable by `compose::view`) is drawn by the scaler into our texture, which is now made at the screen's size. That texture is registered with the proxy as before and left in copy-destination state for the F3 panel, as the copy path leaves it. A plane of the screen's size is still copied as before, so 4K is unchanged. The scaler is made on first need and logs it once: ``` INFO victory_gpu::framegen: FidelityFX frame generation: the interface plane is drawn to the screen's size plane=[3840, 2160] screen=[2560, 1440] INFO victory_gpu::framegen: FidelityFX frame generation: the interface plane is composed over every frame ``` ## Tested RX 7800 XT (RDNA3, 16 GB), Ryzen 5 7600, CachyOS (kernel 7.3.6), `proton-cachyos-slr`, Mesa 26.3.1 + `mesa.patch`. On `f7f0360` (plus #113 to get past #112). Series X, `VICTORY_FSR_4K=performance VICTORY_OUTPUT=2560x1440 VICTORY_FIDELITYFX_FRAMEGEN=1 VICTORY_UI_PLANE=3840x2160`, `VICTORY_BVH_HARDWARE=0`. - **Before** (same build without this commit, ~10 min in the world): the warning above, no "composed over every frame" line, and the HUD shook all the time. - **After** (~22 min in the world): the two lines above, and the interface plane is registered again after menus and cutscenes. The HUD no longer shakes. No errors, hang watch or crashes, no presentation wait over 50 ms. Median game frame rate in the world was 21.9 fps against 20.0 before (different routes, so I can't tell any cost of the extra draw). - `rustfmt` clean on both files, no `clippy` warnings in them, and `framegen::tests` pass (3) under Wine. ## Not checked / notes - Only 3840x2160 over 2560x1440 has been tried. A plane smaller than the screen would be scaled up the same way. - Linear filtering at 1.5x down is what `Composer` already does for the non-frame-generation path. Small HUD text may be a little softer than at 4K. - No GPU unit test like `compose::tests::composes_scaled_premultiplied_plane_on_gpu` for the scaler yet. I can add one if you want it. - Separate from this PR, and harmless as far as I can tell: on the FSR path `run.rs` calls `apply_ui_plane` with a fixed `(3840, 2160)` output. With #58's smaller outputs, this sizes the back buffer pool for a 4K output (144 MiB rather than 112 MiB at 2560x1440). The pool check then logs `Differs`, because `prepare_output` has already put the same jump there. - `cargo xtask policy` on the whole tree reports two files already on `main` (`replay/play/visual/header.html`, `emit/lower.rs` size). This PR touches neither. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The proxy composes an interface plane only at the swap chain's size, so
`ui_plane` gave up on any other and left the interface to be interpolated
with the scene. With `VICTORY_UI_PLANE=3840x2160` (the size the title lays
its interface out for) and a smaller output, e.g. `VICTORY_FSR_4K` with
`VICTORY_OUTPUT=2560x1440`, the HUD shook against the world in every
generated frame ("the interface plane is interpolated with the scene
plane=[3840, 2160] screen=[2560, 1440]").

Such a plane is now drawn, linearly filtered and with its premultiplied
alpha as it is, over a texture of the screen's size (`compose::Scaler`, a
one-plane sibling of `Composer`), which is registered with the proxy as
before and left in copy-destination state for the panel. A plane of the
screen's size is still copied as it was.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 23:48:54 +00:00
Author
Owner

@⁠DecayingEagle on GitHub · 2026-12-02 14:06 UTC · original

Linux test of e84edcd on an RX 7900 XT, Wine 11.22 and RADV 26.3.1. I used Series X, 2560×1440 render/output, FSR 4 Native AA (#178), VICTORY_UI_PLANE=3840x2160, VICTORY_FIDELITYFX_FRAMEGEN=1 and RT off.

On d044248 with the local patches below, the log warned that the UI plane was interpolated with the scene. Adding this PR produced both the scaled-plane and separate-composition messages. In 124.79 s of camera pans the counters advanced by 3,384 rendered and 3,384 generated frames. DXGI reported 54.23 presents/s. That is a proxy statistic. I did not measure physical display delivery or quantify ghosting.

Three pause/resume cycles via Start worked with FG on and three with FG off. B didn't close the top-level menu in either configuration with the test pad. No device loss or kernel GPU reset was recorded during the sweeps or pause tests.

Both variants included #163, #164, #173, #178, #179, #188 and a private in-process controller. I enabled per-present logging in the scaled run for the counts. I wouldn't infer a performance difference from these runs.

Test automation and write-up assisted by OpenAI Codex.

**@⁠DecayingEagle** on GitHub · 2026-12-02 14:06 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/135#issuecomment-7348002043) Linux test of `e84edcd` on an RX 7900 XT, Wine 11.22 and RADV 26.3.1. I used Series X, 2560×1440 render/output, FSR 4 Native AA (#178), `VICTORY_UI_PLANE=3840x2160`, `VICTORY_FIDELITYFX_FRAMEGEN=1` and RT off. On `d044248` with the local patches below, the log warned that the UI plane was interpolated with the scene. Adding this PR produced both the scaled-plane and separate-composition messages. In 124.79 s of camera pans the counters advanced by 3,384 rendered and 3,384 generated frames. DXGI reported 54.23 presents/s. That is a proxy statistic. I did not measure physical display delivery or quantify ghosting. Three pause/resume cycles via Start worked with FG on and three with FG off. B didn't close the top-level menu in either configuration with the test pad. No device loss or kernel GPU reset was recorded during the sweeps or pause tests. Both variants included #163, #164, #173, #178, #179, #188 and a private in-process controller. I enabled per-present logging in the scaled run for the counts. I wouldn't infer a performance difference from these runs. Test automation and write-up assisted by OpenAI Codex.
Author
Owner

@⁠ARustyOven on GitHub · 2026-12-02 19:29 UTC · original · edited 2026-12-02 19:30 UTC

#161
I believe this has been addressed now following the merge of PR 161.

**@⁠ARustyOven** on GitHub · 2026-12-02 19:29 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/135#issuecomment-7356253170) · edited 2026-12-02 19:30 UTC #161 I believe this has been addressed now following the merge of PR 161.
Author
Owner

@⁠Luxuride on GitHub · 2026-12-04 12:01 UTC · original · edited 2026-12-05 11:24 UTC

This was fixed upstream on 1 December, in the same file: ed52726 added crates/victory-gpu/src/framegen.rs:1692 pub(crate) fn ui_plane(…, rect: [u32; 4], scene), which compares [desc.Width, desc.Height] == display && rect == [0,0,display[0],display[1]] and resamples through the existing Composer (crates/victory-gpu/src/compose.rs:156 pub(crate) fn resample(…)). Landing this PR would replace that with a parallel implementation, and pub(crate) struct Scaler in compose.rs:228 now collides by name with crates/victory-gpu/src/pillarbox.rs:122.

One thing your version had that main's does not: compose.rs:226 const SCALE_RING: u32 = 16; is a 16-deep descriptor ring written while presents can still be in flight, with no fence — that is the intermittent-HUD-corruption class of bug.

That is what I can see from the code. If you think ui_plane lacks the letterbox awareness or the ring you needed, open an issue against it so the discussion lands in one place rather than in a 334-commit-old branch.

Whether it still has work of its own is the maintainer's call, not mine.

**@⁠Luxuride** on GitHub · 2026-12-04 12:01 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/135#issuecomment-7410867815) · edited 2026-12-05 11:24 UTC This was fixed upstream on 1 December, in the same file: `ed52726` added `crates/victory-gpu/src/framegen.rs:1692 pub(crate) fn ui_plane(…, rect: [u32; 4], scene)`, which compares `[desc.Width, desc.Height] == display && rect == [0,0,display[0],display[1]]` and resamples through the existing `Composer` (`crates/victory-gpu/src/compose.rs:156 pub(crate) fn resample(…)`). Landing this PR would replace that with a parallel implementation, and `pub(crate) struct Scaler` in `compose.rs:228` now collides by name with `crates/victory-gpu/src/pillarbox.rs:122`. One thing your version had that main's does not: `compose.rs:226 const SCALE_RING: u32 = 16;` is a 16-deep descriptor ring written while presents can still be in flight, with no fence — that is the intermittent-HUD-corruption class of bug. That is what I can see from the code. If you think `ui_plane` lacks the letterbox awareness or the ring you needed, open an issue against it so the discussion lands in one place rather than in a 334-commit-old branch. Whether it still has work of its own is the maintainer's call, not mine.
github-bot closed this pull request 2026-12-05 17:31:52 +00:00

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.