Options: ASPECT RATIO shapes the picture the game draws, not just the window #2689

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

@⁠gnastnosaj on GitHub · 2026-11-29 16:05 UTC · original
gnastnosaj:pr/fullscreen-aspect → main · +867 −107 · 11 files · 1 commits · open

What it changes

F1's ASPECT RATIO names the picture's shape now, not only the window's:

ASPECT RATIO what the title draws
16:9 (unset) 2560x1440, as before
21:9 / 32:9 that shape at 1440 lines (3360x1440, 5120x1440)
NATIVE the display's own shape, at most the console's 3840x2160; a display smaller than the UI targets keeps its shape drawn larger (a 3:2 2420x1668 display draws 2600x1792)
STRETCH, 16:10, 4:3 window only, as before

The output size is written into the title's settings before it starts, the SDR display mode takes the same shape so window and picture agree, the UI pool is sized for the output and the UI is laid out on a stage of the output's shape (the HUD, minimap and subtitles keep their proportions), while the scene stays at 1440 lines whatever the output asks for. Every patched field is checked against the stock bytes first, and 16:9 writes exactly what it wrote before.

F1's DISPLAY row is shown whatever the aspect row says, and the window opens on the display it names (AUTO: the display closest to a named shape, the largest for NATIVE and STRETCH), so the game is played on that panel and its full screen lands there.

This builds on main's fullscreen_box/fit_into/backdrop (e080431a), which fits the picture into the window it is in. Three things on top of it, all found while testing:

  • the window is placed on the output's display, so Alt+Enter returns to that panel instead of the primary one;
  • Alt+Enter enters through the same fitting step, with the picture's own size rather than the window's client size (a frame-dressed client is smaller, which letterboxed the re-entered picture by a few dozen pixels);
  • leaving full screen shows, activates and repaints the window: without SWP_SHOWWINDOW and the foreground, leaving it during the loading screen left a white window that took no keys, and Alt+Enter could not come back.

VICTORY_NATIVE_WIDE keeps its meaning: unset, NATIVE still draws 2560x1440 on every monitor; the aspect row's own values are the explicit way to ask for a wider output.

Switches: VICTORY_ASPECT_RATIO, VICTORY_NATIVE_SIZE, VICTORY_NATIVE_DISPLAY, VICTORY_UI_POOL_MB, VICTORY_UI_STAGE, VICTORY_FULLSCREEN_BARS; VICTORY_WINDOW_RECT is internal (written by victory run from the chosen display). All are in docs/README-nvidia.md's table.

How it was tested

  • GPU and profile (Series X or S, resolution, DLSS, frame generation, ray tracing):
    RTX 4090, i9-14900KF, Series X, DLSS on through the title's FidelityFX path (quality), frame generation on, ray tracing off, two displays (2560x1440 and 5120x2160).
  • Before: no ASPECT RATIO row; NATIVE stopped at 2560x1440 on every monitor (main 550bcec5), and the window always opened on the primary display.
  • After:
    • NATIVE on a 3:2 2420x1668 display: drawn 2600x1792, panel filled, HUD, minimap and subtitles normal.
    • NATIVE on a 5120x2160 display: drawn 3840x1616 (the console's cap), scene 2560x1077.
    • 21:9 on the 5120x2160 display: 3360x1440 output, scene 2240x960, no seam past 2560 columns and no ghosting (the failure mode of the opt-in wide output, #4331).
    • DISPLAY row lists the panels at their physical sizes (a 200% DPI desktop reports them unscaled now), and 16:9, 21:9, NATIVE and STRETCH each open on the panel the rules pick.
    • Alt+Enter several times, during the loading screens and in game: out to a windowed rectangle on the game's panel, back to full screen with the same picture shape, no white window, no lost keyboard.
    • The full screen covers the taskbar as main's fullscreen_box already does; this branch adds no window ordering of its own for it.
  • For shader changes, the wave sizes tested (32 and/or 64 lanes): no shader changes.
  • cargo test passed for the crates it touches: yes — victory (native_display 9), victory-hle (lifecycle 19), victory-gpu (host::menu 1: the aspect row's console lock); cargo xtask policy over the tree. Not tested: a 32:9 display (nothing to plug in) and the Series S profile.

A note on cost: the scene is what the output asks for — a 3:2 2600x1792 output draws a 1733x1194 scene against 1706x960 at 2560x1440, 26% more pixels and a lower frame rate on the same card; a lower DLSS mode or 21:9 brings it back.

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches. Related: #4331 (fixes the wide output's rendering: the seam at 74.4%, the 32:9 start), #2400 (an --aspect preset for Series X 1440p profiles), #2210, and main's e080431a (aspect-preserving full screen), which this builds on rather than replaces.
**@⁠gnastnosaj** on GitHub · 2026-11-29 16:05 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2689) `gnastnosaj:pr/fullscreen-aspect` → `main` · +867 −107 · 11 files · 1 commits · open ## What it changes F1's ASPECT RATIO names the picture's shape now, not only the window's: | ASPECT RATIO | what the title draws | |---|---| | 16:9 (unset) | 2560x1440, as before | | 21:9 / 32:9 | that shape at 1440 lines (3360x1440, 5120x1440) | | NATIVE | the display's own shape, at most the console's 3840x2160; a display smaller than the UI targets keeps its shape drawn larger (a 3:2 2420x1668 display draws 2600x1792) | | STRETCH, 16:10, 4:3 | window only, as before | The output size is written into the title's settings before it starts, the SDR display mode takes the same shape so window and picture agree, the UI pool is sized for the output and the UI is laid out on a stage of the output's shape (the HUD, minimap and subtitles keep their proportions), while the scene stays at 1440 lines whatever the output asks for. Every patched field is checked against the stock bytes first, and 16:9 writes exactly what it wrote before. F1's DISPLAY row is shown whatever the aspect row says, and the window opens on the display it names (AUTO: the display closest to a named shape, the largest for NATIVE and STRETCH), so the game is played on that panel and its full screen lands there. This builds on main's `fullscreen_box`/`fit_into`/backdrop (e080431a), which fits the picture into the window it is in. Three things on top of it, all found while testing: - the window is placed on the output's display, so Alt+Enter returns to that panel instead of the primary one; - Alt+Enter enters through the same fitting step, with the picture's own size rather than the window's client size (a frame-dressed client is smaller, which letterboxed the re-entered picture by a few dozen pixels); - leaving full screen shows, activates and repaints the window: without `SWP_SHOWWINDOW` and the foreground, leaving it during the loading screen left a white window that took no keys, and Alt+Enter could not come back. `VICTORY_NATIVE_WIDE` keeps its meaning: unset, NATIVE still draws 2560x1440 on every monitor; the aspect row's own values are the explicit way to ask for a wider output. Switches: `VICTORY_ASPECT_RATIO`, `VICTORY_NATIVE_SIZE`, `VICTORY_NATIVE_DISPLAY`, `VICTORY_UI_POOL_MB`, `VICTORY_UI_STAGE`, `VICTORY_FULLSCREEN_BARS`; `VICTORY_WINDOW_RECT` is internal (written by `victory run` from the chosen display). All are in `docs/README-nvidia.md`'s table. ## How it was tested - GPU and profile (Series X or S, resolution, DLSS, frame generation, ray tracing): RTX 4090, i9-14900KF, Series X, DLSS on through the title's FidelityFX path (quality), frame generation on, ray tracing off, two displays (2560x1440 and 5120x2160). - Before: no ASPECT RATIO row; NATIVE stopped at 2560x1440 on every monitor (main 550bcec5), and the window always opened on the primary display. - After: - NATIVE on a 3:2 2420x1668 display: drawn 2600x1792, panel filled, HUD, minimap and subtitles normal. - NATIVE on a 5120x2160 display: drawn 3840x1616 (the console's cap), scene 2560x1077. - 21:9 on the 5120x2160 display: 3360x1440 output, scene 2240x960, no seam past 2560 columns and no ghosting (the failure mode of the opt-in wide output, #4331). - DISPLAY row lists the panels at their physical sizes (a 200% DPI desktop reports them unscaled now), and 16:9, 21:9, NATIVE and STRETCH each open on the panel the rules pick. - Alt+Enter several times, during the loading screens and in game: out to a windowed rectangle on the game's panel, back to full screen with the same picture shape, no white window, no lost keyboard. - The full screen covers the taskbar as main's `fullscreen_box` already does; this branch adds no window ordering of its own for it. - For shader changes, the wave sizes tested (32 and/or 64 lanes): no shader changes. - `cargo test` passed for the crates it touches: yes — `victory` (native_display 9), `victory-hle` (lifecycle 19), `victory-gpu` (host::menu 1: the aspect row's console lock); `cargo xtask policy` over the tree. Not tested: a 32:9 display (nothing to plug in) and the Series S profile. A note on cost: the scene is what the output asks for — a 3:2 2600x1792 output draws a 1733x1194 scene against 1706x960 at 2560x1440, 26% more pixels and a lower frame rate on the same card; a lower DLSS mode or 21:9 brings it back. ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. Related: #4331 (fixes the wide output's rendering: the seam at 74.4%, the 32:9 start), #2400 (an `--aspect` preset for Series X 1440p profiles), #2210, and main's e080431a (aspect-preserving full screen), which this builds on rather than replaces.
Alt+Enter went straight to `enter_borderless(hwnd, info.rcMonitor)`: the window filled the
monitor and the swap chain stretched whatever the title renders. `VICTORY_FULLSCREEN` already
fitted its window (e080431), so the two ways into full screen disagreed, and the one people
press by habit was the stretched one.

Its backdrop was sized from `VICTORY_FULLSCREEN_RES` and placed at (0, 0): with a limit smaller
than the monitor the black bars covered only the limit, and on a display whose origin is not
the virtual screen's (any second monitor) they landed on the first one.

Now one `fit_rect` gives the largest rectangle of the content's proportions inside an area,
centred, with even edges (a half-pixel scale is never asked of the swap chain), and
`monitor_of` names the monitor the window is on in physical pixels (per-monitor v2 DPI, as
e080431 made it). Both paths use them: Alt+Enter reads the client size before resizing, fits
it inside the monitor and paints the bars; `VICTORY_FULLSCREEN_RES` limits a box centred on
that monitor, and the backdrop covers the whole monitor instead of the request.

`scripts/fullscreen-monitor.ps1` puts a running game on a chosen monitor at a chosen aspect
(`-Aspect 16:9`, `auto` for the window's own) and asks the game for the bars over
`WM_COPYDATA` (magic "VICB", four i32): the backdrop is the game's own window, so it stays
directly behind the title and goes away with it. `-Stretch` keeps the old fill, `-Restore`
puts the window and the desktop back, `-NoBars` leaves the desktop visible.

Tests: `fit_rect` (an ultrawide, a monitor with a negative origin, stretch, sizes that say
nothing), even edges on an odd screen, `centered_rect` under a smaller limit, and the
`WM_COPYDATA` payload (our magic only, short data refused). The existing `fullscreen_box`
assertions run through `fit_rect` unchanged. `cargo test -p victory-hle --lib` passes; the
script was run end to end against a window that answers `WM_COPYDATA`.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 16:10:09 +00:00
github-bot force-pushed github-bot/gh-2689 from dc52f2fc43 to 9ce18e1e7c 2026-11-29 16:27:03 +00:00 Compare
github-bot force-pushed github-bot/gh-2689 from 9ce18e1e7c to acca389188 2026-11-30 00:11:48 +00:00 Compare
github-bot force-pushed github-bot/gh-2689 from acca389188 to 732b5cc324 2026-11-30 00:17:33 +00:00 Compare
github-bot force-pushed github-bot/gh-2689 from 732b5cc324 to 7c5cb1bcfc 2026-11-30 00:23:15 +00:00 Compare
github-bot changed title from fullscreen: keep the picture's proportions on Alt+Enter, bars over the monitor to fullscreen: fitted picture, black bars, and the taskbar of its own monitor 2026-11-30 01:43:11 +00:00
github-bot force-pushed github-bot/gh-2689 from 7c5cb1bcfc to 0f1a10070a 2026-11-30 01:43:12 +00:00 Compare
github-bot changed title from fullscreen: fitted picture, black bars, and the taskbar of its own monitor to Options: ASPECT RATIO keeps the picture's shape (21:9, 32:9, NATIVE), with full screen fitted to it 2026-11-30 06:13:39 +00:00
Two faults from a run that started on the primary screen and went full screen on a second one:

- The taskbars were recorded one monitor at a time, so a start that went full screen on the
  primary hid its taskbar and a later Alt+Enter on the second monitor overwrote the record: the
  primary's stayed hidden until the process ended (and the end restored only the last one). Every
  monitor hidden is kept now, and showing them — on Alt+Enter back, on the window's end, or by the
  watchdog — shows all of them.
- `Fit::Native` filled the monitor whatever the picture's shape, so a run whose output was the
  primary's 2560x1440 (NATIVE takes the primary's size unless a display is named) looked
  stretched once it was dragged to a 5120x2160 screen and Alt+Enter pressed. It fills only a
  monitor of the picture's own shape now, and letterboxes otherwise, saying why and pointing at
  the restart that draws that shape.

The display is picked for you: `VICTORY_NATIVE_DISPLAY=<n>` names one, else 21:9 and 32:9 take
the display closest to that shape (within 3%), and NATIVE the largest one. The window is put on
that display at the start, so a full screen lands on it, and the start says which display was
taken and why.
The output's size is baked before the title's window exists, so the display has to be chosen at
that point; until now the choice was `VICTORY_NATIVE_DISPLAY` alone, and the window still opened
on the primary monitor.

- `victory_gpu::displays` is the one display list: `victory_hle` re-exports it, the app's output
  size picks from it, and F1's DISPLAY row (shown while ASPECT RATIO is NATIVE) names each
  display it can take — "0: 5120x2160" — instead of a bare number. AUTO keeps the rule already
  there: 21:9 and 32:9 take the display closest to that shape (within 3%), NATIVE the largest.
- The title's window opens on that display: `victory run` passes its rectangle as
  `VICTORY_WINDOW_ON=left,top,width,height`, and `lifecycle::fit` fits the window to it and
  centres it there (the title's own position is a default one). A full screen then lands on the
  display the picture's size came from.
- `Centred`, `finish` and the like are untouched; the row needs a restart, as the size it picks
  does.
A start at 5120x2160 ended after five seconds: the title's UI setup allocates two legacy
3840x2160 surfaces and two UI targets of the output's size in one pool, and the pool was still
the 94 MiB the 2560x1440 output needed. Its allocator asserted (`int3` at `0x56A2AFD`, seen in
the run's log behind the crash reporter's frames).

- The pool is 2 x 3840x2160 + 2 x the output's size + 32 MiB now, rounded to 2 MiB, and the
  title's own tightness check (the `jbe` at `0x247AF2B` past the `int3` at `0x247AF2D`, which
  refuses a pool with more than 0x1FFFFF left over) is skipped: the pool is sized for a display
  the title did not compute it for. `VICTORY_UI_POOL_MB=<n>` asks for another size while working
  out a display that does not start; the start's `UI pool NN MiB` line says which was used.
- The window's display and the "which display" line are set before the upscaler match: they were
  inside its fallback arm, so a start with DLSS never got them and the window stayed on the
  primary monitor.

The taskbars fix and the display choice are the commits before this one.
A run that aborts does not get to its own restore, and the watchdog goes with it, so the taskbar
of whatever monitor it was on stayed hidden (seen after a run that stopped in the title's UI
setup: the primary's taskbar was hidden until the shell was poked by hand).

`heal_taskbars` shows every taskbar once per start, before the title's first window is fitted and
before any full screen hides one; `scripts/restore-taskbar.ps1` does the same by hand for a
machine whose game was not started again.
aspect hides the console and picture rows

A 5120x2160 output stopped the title in its own capacity check (`int3` at `0x2473E88`, after the
UI pool one at `0x56A2AFD` that the previous commit fixed): its UI arrays are sized for the
console's 3840x2160. A display bigger than that is taken at that size with its shape kept, so
5120x2160 draws 3840x1620 (the same 64:27 picture, a quarter fewer pixels), and a display whose
shape would come out under 1440 lines is taken as it is. The start says when the display was
taken smaller. A 21:9 output (3360x1440) starts.

While ASPECT RATIO names a shape, CONSOLE and SERIES X PICTURE are hidden rather than left in the
menu: the aspect sets Series X and the picture itself, so either row would offer a change nothing
acts on. The start still forces Series X when it was Series S.
output's shape

- F1's DISPLAY row built its values from a fixed 0..5 table, so a machine with two displays
  offered "2" to "5" with nothing behind them. `Item::values` now answers with the displays this
  desktop has (built once, AUTO first), so cycling visits exactly them.
- `victory run` tells the title the output's size as its display mode (`VICTORY_DISPLAY_MODE`)
  while ASPECT RATIO names a shape: the title makes its window from that mode, and a 64:27
  picture was being presented into a 3840x2160 window and stretched, so an Alt+Enter looked 16:9.
The title makes its window and its screen size from the SDR mode at `0x0615C100`, which the
1440p patch keeps at stock 3840x2160. With a 64:27 output the picture was presented into a 16:9
window and stretched vertically: the run's log had `display mode reported to the title width=3840
height=1616` and `presenting to a window width=3840 height=2160`, and the picture looked like a
wide one pushed into 16:9.

While ASPECT RATIO names a shape, the mode's width and height are the output's, so window,
picture and full screen share the shape; 16:9 keeps the stock mode, and every field is checked
against the stock bytes first.
The window's display and the "which display" line were set on every native output, so a stock
2560x1440 start (ASPECT RATIO 16:9) would open on the largest display instead of the primary one
the title chose. Both belong to the aspects that name a shape; 16:9 and STRETCH are as they were.

The clamp's doc says 3840x1616 (the multiple of 8 the arithmetic gives) rather than 1620, its
width-first case explains which side `width_at` takes as the lines, and the display row's list
says why its strings are leaked (a few bytes, once per process, because menu values are
`&'static str`).
`docs/README-foxhound.md`'s switch table gains `VICTORY_ASPECT_RATIO`, `VICTORY_NATIVE_SIZE`,
`VICTORY_NATIVE_DISPLAY`, `VICTORY_UI_POOL_MB`, `VICTORY_FULLSCREEN_BARS` and
`VICTORY_FULLSCREEN_TASKBAR`, and says that `VICTORY_WINDOW_RECT` is internal.

The internal rectangle was `VICTORY_WINDOW_ON`, which read like a switch: it is
`left,top,width,height` where the title's window goes, filled by `victory run` from the display the
picture's size was taken from, and its doc comment says so.
`VICTORY_NATIVE_1440P` was the only thing that asked for the output-size patch, so `21:9`,
`32:9` or `native` did nothing unless the launcher's picture row also set it (the app even said
so, and a start could fall back to a 16:9 picture). The patch is asked for by the aspect row and
by `VICTORY_NATIVE_SIZE` now, with the picture row's switch still asking for it; that start line
goes away.

The SDR mode, the display the window opens on and its line follow the output's shape whoever
asked for it (`not_sixteen_nine`), so a named 3408x1440 gets them too. `docs/README-foxhound.md`
says the patch is asked for three ways.
The title lays its UI out on the 3840x2160 stage Series S's preset gives it and scales that onto
UI targets the size of the output. A 3360x1440 output scaled it 0.875 across but 0.667 down, so
the HUD, minimap and subtitles came out stretched across while the world was right.

While ASPECT RATIO names a shape the stage takes that shape at 3840 wide (3840x1646 for
3360x1440), so the scale is the same both ways and the elements anchor to the wide edges; the UI
pool follows the same stage. `VICTORY_UI_STAGE=16:9` keeps the stock stage for comparison, and
16:9 outputs are untouched.
`VICTORY_UI_STAGE=16:9` keeps the stock 3840x2160 stage for comparison; the shaped one is the
default while ASPECT RATIO names a shape.
Hiding the shell's own windows (`Shell_TrayWnd` per monitor) left the taskbar hidden whenever a
run did not get to put it back: a crash, a kill, the watchdog's thread ending with the process.
That needed a list of what was hidden, a start-time heal and a repair script.

A full screen is a topmost borderless window now: the game's own window goes into the topmost
band over the taskbar and back out of it on Alt+Enter, so nothing of the desktop is touched and a
killed run leaves it exactly as it was. The other displays' taskbars stay as they are, and the
bars behind a fitted picture are painted by a backdrop placed under that window (which is
topmost too, as the window it goes behind is).

`VICTORY_FULLSCREEN_TASKBAR` and `scripts/restore-taskbar.ps1` are gone with it; the log line
says "full screen: topmost over the taskbar".
The log line the previous commit promised ("full screen: topmost over the taskbar") is written
now, and the `WM_NCDESTROY` arm's closing brace is back where it was before the restore call it
held was removed.
DLSS-G makes no frames while the window is not in front (its own rule, status 0), and the rate
line dropped its `FG:` part when that happened, which reads as frame generation having stopped
working. It says `FG: OFF (WINDOW NOT IN FRONT)` now while frame generation is asked for and the
window is behind, and keeps the plain rate when none is asked for.
A 3:2 2420x1668 display fell back to the 16:9 default (the title's UI targets are sized for
2560x1440, and an output narrower than that is the state its own pool assert refused), so NATIVE
letterboxed a 16:9 picture with black bars above and below. Such a display is drawn at its own
shape, as small as the floor allows (2420x1668 draws 2600x1792, within 0.01% of its shape), and
the output follows it as before.
github-bot force-pushed github-bot/gh-2689 from d88492f5d7 to 877e37e2e3 2026-11-30 15:29:37 +00:00 Compare
github-bot force-pushed github-bot/gh-2689 from 877e37e2e3 to 8ff434fff0 2026-11-30 15:47:46 +00:00 Compare
github-bot force-pushed github-bot/gh-2689 from 8ff434fff0 to 6b99cdad50 2026-11-30 16:05:27 +00:00 Compare
github-bot changed title from Options: ASPECT RATIO keeps the picture's shape (21:9, 32:9, NATIVE), with full screen fitted to it to Options: ASPECT RATIO shapes the picture the game draws, not just the window 2026-12-01 03:10:21 +00:00
github-bot force-pushed github-bot/gh-2689 from 6b99cdad50 to 36885f76eb 2026-12-01 03:10:24 +00:00 Compare
github-bot force-pushed github-bot/gh-2689 from 36885f76eb to f723774e42 2026-12-01 03:28:14 +00:00 Compare
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/host/menu.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

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

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2689'
git switch 'github-bot/gh-2689'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2689'
git switch 'github-bot/gh-2689'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2689'
git switch 'main'
git merge --squash 'github-bot/gh-2689'
git switch 'main'
git merge --ff-only 'github-bot/gh-2689'
git switch 'main'
git merge 'github-bot/gh-2689'
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!2689
No description provided.