GPU: fit fallback host window to work area and honor VICTORY_WINDOW_MAX #2910
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!2910
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@alexandruiulian201-bot on GitHub · 2026-11-25 23:47 UTC · original
alexandruiulian201-bot:feat/victory-window-size→main· +124 −4 · 1 files · 1 commits · openWhen 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.
@alexandruiulian201-bot on GitHub · 2026-11-26 00:04 UTC · original
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).
@Marvisak on GitHub · 2026-11-26 02:20 UTC · original
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
@kotekompotek on GitHub · 2026-11-25 23:52 UTC · original · reviewed
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.
@fuzeofficlal on GitHub · 2026-11-25 23:56 UTC · original · reviewed
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.@Dukestar69 on GitHub · 2026-11-26 05:47 UTC · original · approved these changes
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).
@alexandruiulian201-bot on GitHub · 2026-11-26 09:06 UTC · original
@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.