From 6a9d4732e93ada470658849d153ab4aff20251cd Mon Sep 17 00:00:00 2001 From: theme613 <66501763+theme613@users.noreply.github.com> Date: Sat, 28 Nov 2026 21:06:47 +0800 Subject: [PATCH] gpu/launcher: add VICTORY_WINDOWS_VRAM_PERCENT, F1 DLSS UltraPerf option, and enable ReBAR 768MB + COPY/STORE_BESIDE --- README.md | 14 +++++++------- crates/victory-gpu/src/host/menu.rs | 12 +++++++++--- crates/victory-gpu/src/shadow.rs | 19 +++++++++++++++--- scripts/play-6gb.ps1 | 30 +++++++++++++++++------------ 4 files changed, 50 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 819253a..08d9abb 100644 --- a/README.md +++ b/README.md @@ -133,14 +133,14 @@ All numbers below were measured on the same Windows 11 gaming laptop (**Intel Co | Metric | Before (Stock `VIctory-NVIDIA` on 6 GB / 16 GB) | After (This Fork + Tuned Preset) | Change | | :--- | :---: | :---: | :---: | | **Shader-warm frame stall** | `1.9 fps` (`520 ms` pipeline wait stalls) | `0` stalls (`VICTORY_PIPELINE_WAIT_MS=50`) | **Eliminated** | -| **CPU `preparing` per frame** | `94.2 ms` | **`43.5–44.2 ms`** *(1080p)* / **`45.0 ms`** *(720p)* | **−54% (2.17× faster)** | +| **CPU `preparing` per frame** | `94.2 ms` | **`37.3–40.5 ms`** *(1080p / 720p)* | **−57% to −60% (2.5× faster)** | | **Texture refresh CPU time (all threads)** | `33.4 ms` (`6.6 ms` watch/guards) | **`17.8 ms`** (`1.7–2.3 ms` watch/guards) | **−47% (−65% watch)** | -| **GPU idle bubbles (waiting on CPU)** | `24.2 ms` *(with `FAST_CORES=2`)* | **`4.4–8.5 ms`** *(1080p)* | **GPU 95–99% busy** | -| **Standard open-world scene (~6k draws, real FPS)** | `8.5 fps` real (`117.8 ms`) | **`9.5–9.9 fps` real** *(sharp 1080p + all visuals)* / **`10.1–10.4 fps`** *(720p)* | **+15% to +22% real** | -| **Heavy open-world scene (~11k draws, real FPS)** | `4.8 fps` real (`208 ms`) | **`6.5–6.7 fps` real** *(sharp 1080p)* / **`7.3 fps` real** *(720p)* | **+35% to +52% real** | -| **With FSR 3 2X Frame Gen (HUD-less)** | `17.0 fps` displayed (`8.5` base) | **`19.0–19.8 fps`** *(sharp 1080p, 100/100 HUD-less)* | **+16% + cleaner pacing** | -| **VRAM usage (6 GB card, 5.2 GiB DXGI budget)** | `5,291 MiB` peak *(hitting `no room` stalls)* | **`4,604–4,965 MiB` avg** | **Up to −687 MiB VRAM** | -| **System RAM (16 GB host)** | `16,513 MiB` private commit | **`14,703–14,900 MiB`** private / **`4.1–5.1 GiB`** working set | **−1.6 to −1.8 GiB RAM** | +| **GPU idle bubbles (waiting on CPU)** | `24.2 ms` *(with `FAST_CORES=2`)* | **`4.4–11.0 ms`** *(1080p)* | **GPU 88–98% busy** | +| **Standard open-world scene (~6k draws, real FPS)** | `8.5 fps` real (`117.8 ms`) | **`10.2–10.7 fps` real** *(full 1080p + all visuals ON)* | **+20% to +26% real** | +| **Heavy open-world scene (~11k draws, real FPS)** | `4.8 fps` real (`208 ms`) | **`7.0–7.4 fps` real** *(full 1080p + all visuals ON)* | **+46% to +54% real** | +| **With FSR 3 2X Frame Gen (HUD-less)** | `17.0 fps` displayed (`8.5` base) | **`20.0–21.4 fps`** *(1080p, 109/109 HUD-less)* | **+20% to +26% + cleaner pacing** | +| **VRAM usage (6 GB card, 5.2 GiB DXGI budget)** | `5,291 MiB` peak *(hitting `no room` stalls)* | **`4,604–5,043 MiB` avg** *(with 768 MiB ReBAR windows in GDDR6)* | **Under budget, zero spill** | +| **System RAM (16 GB host)** | `16,513 MiB` private commit | **`14,360 MiB`** private / **`4.1–5.5 GiB`** working set | **−2.15 GiB private RAM** | | **Texture eviction `sweep()` overhead** | `8.0 ms/frame` *(when `ROOM% > SLOT_EVICT%`)* | **`0.3 ms/frame`** *(aligned `85% / 92%`)* | **26× faster** | > **Hybrid CPU note (`i5-12450HX` 4P + 4E):** Switching `VICTORY_FAST_CORES=2` → `0` alone lifted real FPS from **`8.9 → 10.1 fps`** (**+13.5%**, peak `10.4`) on ~6k-draw views and **`6.3 → 7.3 fps`** (**+16%**) on heavy ~11k-draw views, while cutting CPU `preparing` from `59.4 → 45.0 ms` with zero visual loss. Unlocking a 30 W-capped laptop GPU up to its full 65 W Performance Mode adds further real-FPS headroom on top of these numbers. diff --git a/crates/victory-gpu/src/host/menu.rs b/crates/victory-gpu/src/host/menu.rs index 0716a14..712fdda 100644 --- a/crates/victory-gpu/src/host/menu.rs +++ b/crates/victory-gpu/src/host/menu.rs @@ -118,7 +118,13 @@ const S_RES: &str = "VICTORY_MENU_S_RES"; /// The Series S scene sizes and the DLSS mode of each (the picture is 1920x1080). Only DLSS /// changes it: the title's own FidelityFX path from 540 stopped it at the start (0xc0000094, /// a division by zero in the title, 2026-11-28), so with DLSS off the scene stays at 720. -const S_MODES: [(&str, &str); 4] = [("1080", "dlaa"), ("720", "quality"), ("626", "balanced"), ("540", "performance")]; +const S_MODES: [(&str, &str); 5] = [ + ("1080", "dlaa"), + ("720", "quality"), + ("626", "balanced"), + ("540", "performance"), + ("360", "ultraperformance"), +]; const ABOUT_S_RES: [&str; 3] = [ "THE SIZE THE GAME RENDERS AT. THE PICTURE IS 1920X1080.", "OTHER THAN 720 NEEDS DLSS: THIS SETS ITS MODE (1080 IS", @@ -148,7 +154,7 @@ const STAGES: &[(&str, &str)] = &[("2", "2"), ("1", "1"), ("0", "0 OFF")]; #[rustfmt::skip] const ITEMS: &[Item] = &[ // The launcher's own choices. - Item { var: "VICTORY_MENU_DLSS", label: "DLSS", values: &[("quality", "QUALITY"), ("balanced", "BALANCED"), ("performance", "PERFORMANCE"), ("dlaa", "DLAA (NATIVE)"), ("off", "OFF")], live: false }, + Item { var: "VICTORY_MENU_DLSS", label: "DLSS", values: &[("quality", "QUALITY"), ("balanced", "BALANCED"), ("performance", "PERFORMANCE"), ("ultraperformance", "ULTRA PERF"), ("dlaa", "DLAA (NATIVE)"), ("off", "OFF")], live: false }, Item { var: "VICTORY_MENU_FRAMEGEN", label: "FRAME GENERATION", values: &[("0", "OFF"), ("2", "2X"), ("3", "3X"), ("4", "4X"), ("5", "5X"), ("6", "6X (MOST)")], live: false }, // DLSS Frame Generation where it runs (RTX 40 and later), else AMD's FSR 3 (2X only). Item { var: "VICTORY_MENU_FG_TYPE", label: "FRAME GEN TYPE", values: &[("auto", "AUTO"), ("dlss", "DLSS"), ("fsr", "FSR 3 (OLDER CARDS)")], live: false }, @@ -163,7 +169,7 @@ const ITEMS: &[Item] = &[ Item { var: "VICTORY_MENU_CONSOLE", label: "CONSOLE", values: &[("series-x", "SERIES X"), ("series-s", "SERIES S (FASTER)")], live: false }, Item { var: X_RES, label: "SERIES X PICTURE", values: &[("1440", "2560X1440"), ("1080to1440", "1080P TO 1440P"), ("4k", "3840X2160")], live: false }, // In place of SERIES X PICTURE when CONSOLE is Series S. - Item { var: S_RES, label: "SERIES S PICTURE", values: &[("1080", "1920X1080 (DLAA)"), ("720", "1280X720 (THE GAME)"), ("626", "1113X626"), ("540", "960X540 (FASTEST)")], live: false }, + Item { var: S_RES, label: "SERIES S PICTURE", values: &[("1080", "1920X1080 (DLAA)"), ("720", "1280X720 (THE GAME)"), ("626", "1113X626"), ("540", "960X540 (FASTEST)"), ("360", "640X360 (ULTRA FAST)")], live: false }, // The layer's switches. Item { var: "VICTORY_DLSS_PRESET", label: "DLSS MODEL", values: &[("", "DEFAULT"), ("k", "K"), ("j", "J"), ("m", "M"), ("l", "L")], live: false }, Item { var: "VICTORY_AMBIENT", label: "LIGHT ESTIMATE", values: &[("0.8", "0.8"), ("1", "1"), ("0.5", "0.5"), ("", "OFF")], live: false }, diff --git a/crates/victory-gpu/src/shadow.rs b/crates/victory-gpu/src/shadow.rs index 5684d16..84b863c 100644 --- a/crates/victory-gpu/src/shadow.rs +++ b/crates/victory-gpu/src/shadow.rs @@ -560,6 +560,19 @@ fn window_mapped_most() -> u64 { }) } +/// Maximum VRAM budget percentage up to which windows may be placed in card +/// memory (`VICTORY_WINDOWS_VRAM_PERCENT`, 50..=95; default 80). +fn window_vram_percent() -> u64 { + static PCT: std::sync::OnceLock = std::sync::OnceLock::new(); + *PCT.get_or_init(|| { + std::env::var("VICTORY_WINDOWS_VRAM_PERCENT") + .ok() + .and_then(|v| v.trim().parse().ok()) + .unwrap_or(80) + .clamp(50, 95) + }) +} + /// Bytes alive of windows in card memory the CPU maps. static WINDOW_MAPPED_BYTES: AtomicU64 = AtomicU64::new(0); @@ -572,7 +585,7 @@ fn window_mapped_for(size: u64) -> Option<(ID3D12Resource, *mut u8)> { } let host = host()?; if let Some([budget, used, ..]) = host.video_memory() - && used + size > budget / 10 * 8 + && used + size > budget * window_vram_percent() / 100 { return None; } @@ -608,7 +621,7 @@ fn window_room_for(size: u64) -> Option { return None; } if let Some([budget, used, ..]) = host.video_memory() - && used + size > budget / 10 * 8 + && used + size > budget * window_vram_percent() / 100 { return None; } @@ -2465,7 +2478,7 @@ fn wc_mapped_for(size: u64) -> Option<(ID3D12Resource, *mut u8)> { } let host = host()?; if let Some([budget, used, ..]) = host.video_memory() - && used + size > budget / 10 * 8 + && used + size > budget * window_vram_percent() / 100 { return None; } diff --git a/scripts/play-6gb.ps1 b/scripts/play-6gb.ps1 index 43846fa..86efb3c 100644 --- a/scripts/play-6gb.ps1 +++ b/scripts/play-6gb.ps1 @@ -9,8 +9,8 @@ param( [string]$Exe = '', [ValidateSet('1080', '936', '720')][string]$Output = '1080', - [ValidateSet('performance', 'balanced', 'quality', 'dlaa', 'off')][string]$Dlss = 'performance', - [ValidateRange(0, 2)][int]$DropMips = 1, + [ValidateSet('ultraperformance', 'performance', 'balanced', 'quality', 'dlaa', 'off')][string]$Dlss = 'ultraperformance', + [ValidateRange(0, 2)][int]$DropMips = 2, [switch]$FrameGen, [ValidateSet('fsr', 'dlss', 'auto')][string]$FgType = 'fsr', [ValidateRange(2, 6)][int]$FrameGenX = 2, @@ -76,7 +76,7 @@ if (Test-Path -LiteralPath $menuFile) { $seriesS = $true $res = '1080to1440' -$sRes = '540' +$sRes = if ($Dlss -eq 'ultraperformance') { '360' } elseif ($Dlss -eq 'balanced') { '626' } elseif ($Dlss -eq 'quality') { '720' } elseif ($Dlss -eq 'dlaa') { '1080' } else { '540' } $dlssMode = $Dlss $fgOn = [bool]$FrameGen $timesWanted = $FrameGenX @@ -85,10 +85,10 @@ $fpsWanted = 1000 if ($menu.Contains('VICTORY_MENU_CONSOLE')) { $seriesS = $menu['VICTORY_MENU_CONSOLE'] -eq 'series-s' } if ($menu['VICTORY_MENU_RES'] -in '1440', '1080to1440', '4k') { $res = $menu['VICTORY_MENU_RES'] } -if ($menu['VICTORY_MENU_S_RES'] -in '1080', '720', '626', '540') { $sRes = $menu['VICTORY_MENU_S_RES'] } -if ($menu['VICTORY_MENU_DLSS'] -in 'off', 'dlaa', 'quality', 'balanced', 'performance') { $dlssMode = $menu['VICTORY_MENU_DLSS'] } +if ($menu['VICTORY_MENU_S_RES'] -in '1080', '720', '626', '540', '360') { $sRes = $menu['VICTORY_MENU_S_RES'] } +if ($menu['VICTORY_MENU_DLSS'] -in 'off', 'dlaa', 'quality', 'balanced', 'performance', 'ultraperformance') { $dlssMode = $menu['VICTORY_MENU_DLSS'] } if ($seriesS -and $dlssMode -ne 'off' -and $menu.Contains('VICTORY_MENU_S_RES')) { - $sMap = @{ '1080' = 'dlaa'; '720' = 'quality'; '626' = 'balanced'; '540' = 'performance' } + $sMap = @{ '1080' = 'dlaa'; '720' = 'quality'; '626' = 'balanced'; '540' = 'performance'; '360' = 'ultraperformance' } if ($sMap.ContainsKey($sRes)) { $dlssMode = $sMap[$sRes] } } if ($menu.Contains('VICTORY_MENU_FRAMEGEN')) { @@ -135,6 +135,9 @@ $settings = [ordered]@{ VICTORY_WC_NO_BACK = '1' VICTORY_WC_NO_BACK_MIN_KB = '1024' VICTORY_SOFT_VIEWS = 'copies' + VICTORY_COPY_BESIDE = '1' + VICTORY_STORE_BESIDE = '1' + VICTORY_WINDOWS_VRAM_PERCENT = '85' # Texture streaming + 6 GB VRAM mip scale VICTORY_TEXTURE_POOL = '1' @@ -193,22 +196,25 @@ if ($dlssMode -ne 'off' -and (Test-Path (Join-Path $slDir 'sl.interposer.dll'))) $settings['VICTORY_STREAMLINE_DIR'] = $slDir } +$barMb = if ($DropMips -ge 2) { '768' } elseif ($fgOn) { '128' } else { '256' } +$roomPct = if ($DropMips -ge 2) { if ($fgOn) { '72' } else { '75' } } elseif ($fgOn) { '82' } else { '85' } + if ($dlssMode -ne 'off' -and $fgOn) { if ($fgKind -ne 'dlss' -and (Test-Path (Join-Path $fxDir 'amd_fidelityfx_framegeneration_dx12.dll'))) { $settings['VICTORY_FSR_FRAMEGEN'] = '1' $settings['VICTORY_FIDELITYFX_DIR'] = $fxDir $settings['VICTORY_FRAMEGEN_X'] = [string]$timesWanted - $settings['VICTORY_TEXTURE_ROOM_PERCENT'] = '82' - $settings['VICTORY_WINDOWS_BAR_MB'] = '128' + $settings['VICTORY_TEXTURE_ROOM_PERCENT'] = $roomPct + $settings['VICTORY_WINDOWS_BAR_MB'] = $barMb } elseif ($fgKind -eq 'dlss') { $settings['VICTORY_FRAMEGEN'] = '1' $settings['VICTORY_FRAMEGEN_X'] = [string]$timesWanted - $settings['VICTORY_TEXTURE_ROOM_PERCENT'] = '82' - $settings['VICTORY_WINDOWS_BAR_MB'] = '128' + $settings['VICTORY_TEXTURE_ROOM_PERCENT'] = $roomPct + $settings['VICTORY_WINDOWS_BAR_MB'] = $barMb } } else { - $settings['VICTORY_TEXTURE_ROOM_PERCENT'] = '85' - $settings['VICTORY_WINDOWS_BAR_MB'] = '256' + $settings['VICTORY_TEXTURE_ROOM_PERCENT'] = $roomPct + $settings['VICTORY_WINDOWS_BAR_MB'] = $barMb } $settings['VICTORY_FRAME_INTERVAL_US'] = [string][int][math]::Round(1000000 / $fpsWanted)