GPU: fit fallback host window to work area and honor VICTORY_WINDOW_MAX #2908
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2910"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from Marvisak/VIctory. Originally posted by alexandruiulian201-bot on 2026-11-25T23:47:00Z.
When a title has not created its own visible window (
title_window()isNone),crates/victory-gpu/src/host.rs::make_windowcreates a fallback Win32 host window sized directly to the presented swap-chain resolution (width x height). Unlikevictory-hle'slifecycle::fit, that fallback path did not shrink oversized windows to the primary monitor'sSPI_GETWORKAREAand did not honorVICTORY_WINDOW_MAX=WIDTHxHEIGHT.Changes
make_windowagainstSPI_GETWORKAREAand optionalVICTORY_WINDOW_MAX=WIDTHxHEIGHT(matchingvictory-hle'slifecycle.rsparsing, proportional scaling, and centering), without introducing a second env var or altering the swap chain's presented resolution.host::tests::host_window_limit_and_work_area_fittingcoveringVICTORY_WINDOW_MAXparsing, no-op when already fitting, proportional work-area scaling + centering, andVICTORY_WINDOW_MAXclamping.Verification
cargo test -p victory-gpu --locked host::tests::host_window_limit_and_work_area_fitting— 1 passed, 0 failedcargo clippy -p victory-gpu --all-targets --locked -- -D warnings(default and--all-features) — 0 warningscargo test -p xtask --bin xtask --locked— 6 passed, 0 failed (asset policy: 1 files ok)AI-assisted. Synthetic unit test only.
Imported from Marvisak/VIctory. Originally posted by kotekompotek on 2026-11-25T23:52:52Z.
Review: COMMENTED
Clean knob: parse is strict (bare width implies 16:9, range 320x180..16384x16384, whitespace and case tolerated), invalid values warn rather than silently ignore, OnceLock parses once, and the override lands in AdjustWindowRect so the client size is what was asked for, not the frame size. LGTM.
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-25T23:56:59Z.
Review: COMMENTED
Verified head
a09eb589cleanly merged ontoorigin/main(63bcca43) on Windows 11 x64.Findings / Overlap Note
host.rs::make_windowis bypassed when a title creates its own window, andlifecycle.rsalready implementsVICTORY_WINDOW_MAX:Presenter::new(crates/victory-gpu/src/host.rs) checkstitle_window()first and only callswindow(width, height)->make_window(...)when the title has not created a visible window of its own.victory-hle(crates/victory-hle/src/modules/lifecycle.rs),fit()already shrinks oversized windows to the monitor'sSPI_GETWORKAREAautomatically and already supportsVICTORY_WINDOW_MAX=WIDTHxHEIGHT(parse_window_limit/window_limit).VICTORY_WINDOW_SIZEhere only affects the fallbackvictory-windowpath whentitle_window()isNone, and introduces a second overlapping window-sizing env var alongsideVICTORY_WINDOW_MAX(worth either wiringmake_windowto honorVICTORY_WINDOW_MAX+ work-area fitting or clarifying scope).Local Verification
cargo test --locked -p victory-gpu --lib host::tests::window: 1/1 passed (window_size_parsing_accepts_wxh_and_width_and_rejects_invalid).cargo clippy --locked -p victory-gpu --all-targets -- -D warnings(default and--features diagnostics) &cargo xtask policy(191 files ok): clean.[PR #2910] GPU: add VICTORY_WINDOW_SIZE to size the host windowto [PR #2910] GPU: fit fallback host window to work area and honor VICTORY_WINDOW_MAXImported from Marvisak/VIctory. Originally posted by alexandruiulian201-bot on 2026-11-26T00:04:06Z.
Thanks for the catch @fuzeofficlal! Updated the PR to drop VICTORY_WINDOW_SIZE and instead wire host.rs::make_window to honor the existing VICTORY_WINDOW_MAX=WIDTHxHEIGHT and SPI_GETWORKAREA work-area fitting (matching lifecycle::fit).
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-26T02:20:24Z.
Automated triage for the maintainers.
Merge candidate (a recommendation to look, not an approval). The fallback host window (
host.rsmake_window) is now shrunk proportionally and centred to fit the work area (SPI_GETWORKAREA) and the existingVICTORY_WINDOW_MAX, as the title window already is throughvictory-hle'slifecycle::fit. When it fits, it stays atCW_USEDEFAULT. I checkedfit_window_rectagainst its test cases. CIcheckpasses. A small nit:parse_window_limitcopies the one invictory-hlerather than sharing it.Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by Dukestar69 on 2026-11-26T05:47:14Z.
Review: APPROVED
Tested locally merged onto
origin/main(63bcca4) on Windows 11 x64 (NVIDIA GeForce RTX 5090):parse_window_limit,fit_into, andfit_window_rectinhost.rsand fitting the fallback host window to the monitor work area /VICTORY_WINDOW_MAXcleanly keeps oversized fallback windows centered and on-screen while leaving windows that already fit atCW_USEDEFAULT.cargo test -p victory-gpu host::tests -- --test-threads=1: all 13host::tests::*tests passed (includinghost_window_limit_and_work_area_fitting). (Pre-existingdescriptor::host::tests::dynamic_slots_are_held_until_releasedfails on NVIDIA's 1M view-heap cap #1744, unrelated to this PR.)cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
Imported from Marvisak/VIctory. Originally posted by alexandruiulian201-bot on 2026-11-26T09:06:39Z.
@Marvisak Note on the nit: kept parse_window_limit local because victory-gpu intentionally doesn't depend on victory-hle or victory-core.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.