HLE: allow an explicit maximum title window size #1454

Merged
fluffyflattershy-afk merged 1 commit from upstream-pr/1455 into main 2026-11-25 00:14:22 +00:00
fluffyflattershy-afk commented 2026-11-24 18:07:26 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fluffyflattershy-afk on 2026-11-24T18:07:26Z.


The title requests a 3840×2160 top-level window on the tested Series X configuration. Existing fitting only limits it to the monitor work area, leaving a 2560×1440 window when the user wants 1920×1080.

Add optional VICTORY_WINDOW_MAX=1920x1080. Preserve aspect ratio, retain smaller windows, respect the work area, and leave child windows and default sizing unchanged. Invalid values warn once and retain the existing behavior. Document that this controls the displayed window, not console render resolution or swap-chain buffers.

Validation:

  • HLE unit/integration tests: 98 passed. The existing loopback-connect test was excluded because this execution environment denies local socket connections (Windows error 10013).
  • HLE Clippy, all targets/features, warnings denied: passed.
  • Staged asset-policy and whitespace checks: passed.
  • Bounded live smoke test on i9-13900HX / RTX 5070 Ti Laptop: requested 3840×2160 was fitted to 1920×1080; swap-chain dimensions remained 3840×2160. The harness requested shutdown after 20 seconds and forced termination after the grace period. No world-rendering or performance improvement is claimed.

AI-assisted implementation and testing with Codex. No game assets, captures or derived dumps are included.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6588296144 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1455). Originally posted by [fluffyflattershy-afk](https://github.com/fluffyflattershy-afk) on 2026-11-24T18:07:26Z. --- The title requests a 3840×2160 top-level window on the tested Series X configuration. Existing fitting only limits it to the monitor work area, leaving a 2560×1440 window when the user wants 1920×1080. Add optional VICTORY_WINDOW_MAX=1920x1080. Preserve aspect ratio, retain smaller windows, respect the work area, and leave child windows and default sizing unchanged. Invalid values warn once and retain the existing behavior. Document that this controls the displayed window, not console render resolution or swap-chain buffers. Validation: - HLE unit/integration tests: 98 passed. The existing loopback-connect test was excluded because this execution environment denies local socket connections (Windows error 10013). - HLE Clippy, all targets/features, warnings denied: passed. - Staged asset-policy and whitespace checks: passed. - Bounded live smoke test on i9-13900HX / RTX 5070 Ti Laptop: requested 3840×2160 was fitted to 1920×1080; swap-chain dimensions remained 3840×2160. The harness requested shutdown after 20 seconds and forced termination after the grace period. No world-rendering or performance improvement is claimed. AI-assisted implementation and testing with Codex. No game assets, captures or derived dumps are included.
pfhandler commented 2026-11-24 21:03:42 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by pfhandler on 2026-11-24T20:50:19Z.


Local patches for two issues hit while running GTA VI 1.0.2.1 through VIctory on Linux (GE-Proton 11-14, vkd3d-proton 3.2.0, RTX 4060 Ti 8 GB):

  • VICTORY_NO_HOST_PAD=1 — a connected host pad (e.g. DualShock appearing as XInput pad 0) keeps the keyboard stand-in pad from being enumerated. Hiding the host pad lets VICTORY_KEYS drive the title again.
  • VICTORY_MODE=1920x1080 — the DXGI output mode list is fixed at the console's 3840x2160. Reporting 1920x1080 instead keeps the title's render targets and VRAM use down on smaller hosts (Series S profile + 1080p settled around 3.5 GB VRAM here).

Both are local uncommitted diffs, posted here for reuse. Tested only on the configuration above.

diff --git a/crates/victory-gpu/src/dxgi.rs b/crates/victory-gpu/src/dxgi.rs
index c7f7c45..2535b68 100644
--- a/crates/victory-gpu/src/dxgi.rs
+++ b/crates/victory-gpu/src/dxgi.rs
@@ -219,6 +219,19 @@ struct Mode {
 }
 const _: () = assert!(size_of::<Mode>() == 32);
 
+/// The console's fixed output mode, overridable for hosts smaller than the
+/// console's 4K target: `VICTORY_MODE=1920x1080` reports that instead.
+fn mode_size() -> (u32, u32) {
+    const DEFAULT: (u32, u32) = (3840, 2160);
+    let Some(text) = std::env::var_os("VICTORY_MODE") else {
+        return DEFAULT;
+    };
+    let text = text.to_string_lossy();
+    text.split_once('x')
+        .and_then(|(w, h)| Some((w.trim().parse().ok()?, h.trim().parse().ok()?)))
+        .unwrap_or(DEFAULT)
+}
+
 /// The console's mode list: one 4K mode at 60 Hz (Grand Theft Auto VI looks
 /// for a 120 Hz one to allow 120 Hz frame intervals).
 /// shortcut: fixed mode, not the host display's; report the host's rates if
@@ -242,9 +255,10 @@ extern "system" fn modes(
         return MORE_DATA;
     }
     *count = 1;
+    let (width, height) = mode_size();
     let mode = Mode {
-        width: 3840,
-        height: 2160,
+        width,
+        height,
         refresh: [60, 1],
         format: 0,
         scanlines: 1, // progressive
diff --git a/crates/victory-hle/src/modules/gameinput.rs b/crates/victory-hle/src/modules/gameinput.rs
index a411bd0..da8d66c 100644
--- a/crates/victory-hle/src/modules/gameinput.rs
+++ b/crates/victory-hle/src/modules/gameinput.rs
@@ -1134,6 +1134,11 @@ mod host {
 
     impl Source for Host {
         fn pad(&mut self, slot: usize) -> Option<PadState> {
+            // The keyboard stand-in pad only exists while no host pad is
+            // connected; this hides a host pad the title mis-handles.
+            if std::env::var_os("VICTORY_NO_HOST_PAD").is_some() {
+                return None;
+            }
             if self.empty_until[slot].is_some_and(|until| Instant::now() < until) {
                 return None;
             }
<!-- greyfinch-sync:Marvisak/VIctory:comment:7144123984 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1455#issuecomment-7144123984). Originally posted by [pfhandler](https://github.com/pfhandler) on 2026-11-24T20:50:19Z. --- Local patches for two issues hit while running GTA VI 1.0.2.1 through VIctory on Linux (GE-Proton 11-14, vkd3d-proton 3.2.0, RTX 4060 Ti 8 GB): - `VICTORY_NO_HOST_PAD=1` — a connected host pad (e.g. DualShock appearing as XInput pad 0) keeps the keyboard stand-in pad from being enumerated. Hiding the host pad lets `VICTORY_KEYS` drive the title again. - `VICTORY_MODE=1920x1080` — the DXGI output mode list is fixed at the console's 3840x2160. Reporting 1920x1080 instead keeps the title's render targets and VRAM use down on smaller hosts (Series S profile + 1080p settled around 3.5 GB VRAM here). Both are local uncommitted diffs, posted here for reuse. Tested only on the configuration above. ```diff diff --git a/crates/victory-gpu/src/dxgi.rs b/crates/victory-gpu/src/dxgi.rs index c7f7c45..2535b68 100644 --- a/crates/victory-gpu/src/dxgi.rs +++ b/crates/victory-gpu/src/dxgi.rs @@ -219,6 +219,19 @@ struct Mode { } const _: () = assert!(size_of::<Mode>() == 32); +/// The console's fixed output mode, overridable for hosts smaller than the +/// console's 4K target: `VICTORY_MODE=1920x1080` reports that instead. +fn mode_size() -> (u32, u32) { + const DEFAULT: (u32, u32) = (3840, 2160); + let Some(text) = std::env::var_os("VICTORY_MODE") else { + return DEFAULT; + }; + let text = text.to_string_lossy(); + text.split_once('x') + .and_then(|(w, h)| Some((w.trim().parse().ok()?, h.trim().parse().ok()?))) + .unwrap_or(DEFAULT) +} + /// The console's mode list: one 4K mode at 60 Hz (Grand Theft Auto VI looks /// for a 120 Hz one to allow 120 Hz frame intervals). /// shortcut: fixed mode, not the host display's; report the host's rates if @@ -242,9 +255,10 @@ extern "system" fn modes( return MORE_DATA; } *count = 1; + let (width, height) = mode_size(); let mode = Mode { - width: 3840, - height: 2160, + width, + height, refresh: [60, 1], format: 0, scanlines: 1, // progressive diff --git a/crates/victory-hle/src/modules/gameinput.rs b/crates/victory-hle/src/modules/gameinput.rs index a411bd0..da8d66c 100644 --- a/crates/victory-hle/src/modules/gameinput.rs +++ b/crates/victory-hle/src/modules/gameinput.rs @@ -1134,6 +1134,11 @@ mod host { impl Source for Host { fn pad(&mut self, slot: usize) -> Option<PadState> { + // The keyboard stand-in pad only exists while no host pad is + // connected; this hides a host pad the title mis-handles. + if std::env::var_os("VICTORY_NO_HOST_PAD").is_some() { + return None; + } if self.empty_until[slot].is_some_and(|until| Instant::now() < until) { return None; } ```
upstream-sync closed this pull request 2026-11-25 01:06:36 +00:00
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
Marvisak/VIctory!1454
No description provided.