Compare commits

...
10 Commits
Author SHA1 Message Date
theme613 5d62b86f4a docs: update README benchmark stats and latest optimization changelog
CI / check (push) Canceled after 0s
2026-11-29 01:10:04 +08:00
theme613 ebd07c1dbb gpu/launcher: direct in-place CBVs, CBV dedup, coalesced fills, and cutscene texture-pass optimizations
CI / check (push) Canceled after 0s
2026-11-29 01:02:30 +08:00
theme613 b78c91f127 docs: add dedicated troubleshooting guide and link it from README
CI / check (push) Canceled after 0s
2026-11-28 23:11:13 +08:00
theme613 e4f94bc86f launcher: remove VICTORY_AMBIENT_ONCE to stop indoor flashing and use 0.65 ambient
CI / check (push) Canceled after 0s
2026-11-28 22:59:38 +08:00
theme613 9a97e0a537 launcher: enable VICTORY_AMBIENT_ONCE=1 (0.7) to prevent overexposed sunlight feedback
CI / check (push) Canceled after 0s
2026-11-28 22:42:01 +08:00
theme613 21f8d46d02 launcher/docs: enable FSR 3 2X Frame Generation by default on 6 GB preset
CI / check (push) Canceled after 0s
2026-11-28 22:37:07 +08:00
theme613 a7c7819db4 launcher/docs: restore sharp 1080p Half-texture preset with safe VRAM headroom
CI / check (push) Canceled after 0s
2026-11-28 22:32:11 +08:00
theme613 f0114565e0 docs: fix README git clone/pull URL and sync 6 GB preset defaults
CI / check (push) Canceled after 0s
2026-11-28 22:01:19 +08:00
theme613 6a9d4732e9 gpu/launcher: add VICTORY_WINDOWS_VRAM_PERCENT, F1 DLSS UltraPerf option, and enable ReBAR 768MB + COPY/STORE_BESIDE
CI / check (push) Canceled after 0s
2026-11-28 21:06:47 +08:00
theme613 604908e486 gpu: fix STAGING pool cap leak and tighten idle snapshot/send pool caps on <=20GB RAM hosts
CI / check (push) Canceled after 0s
2026-11-28 20:28:10 +08:00
12 changed files with 556 additions and 78 deletions

No files matched your search

+64 -26
View File
@@ -9,17 +9,19 @@
A performance- and low-memory-tuned fork of [VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA) (built on [foxhound](https://github.com/readmet3xt-lab/foxhound) / [VIctory](https://github.com/Marvisak/VIctory)) that runs a game file natively on Windows from files **you** supply.
> **This repository contains no game files, code, or assets.** You must supply your own legally obtained game file (`.exe`). Not affiliated with or endorsed by any developer, publisher, NVIDIA, or AMD. See [docs/asset-policy.md](docs/asset-policy.md).
>
> **Having issues? (crashes, pagefile, flashing/lighting, low FPS, DLSS/FSR, build errors)** → Open the full **[Troubleshooting Guide (`docs/troubleshooting.md`)](docs/troubleshooting.md)**.
---
## What This Fork Adds
- **6 GB / 4 GB VRAM support (`VICTORY_TEXTURE_DROP_MIPS`):** Drops top texture mip levels (`1` = Half for 6 GB GPUs, `2` = Quarter for 4 GB GPUs) to keep VRAM comfortably under budget. Toggleable in the **F1** menu (`TEXTURE SCALE (VRAM)`).
- **16 GB RAM stability & OOM recovery:** Caps idle upload/list pools automatically on `<= 32 GB` hosts, drains idle pools under critical commit pressure, and retries `E_OUTOFMEMORY` in command-list preludes instead of crashing.
- **Custom windowed output sizes (`VICTORY_OUTPUT`):** True `1280x720` and `1664x936` output patching that works cleanly alongside DLSS and FSR 3 Frame Generation. Toggleable in **F1** (`OUTPUT SIZE (WINDOW)`).
- **CPU submit-thread & refresh optimizations:** Fused single-pass write-watch `ask_once` with guarded-view skip, chunked `JOURNAL`-batched `nothing_new` filtering, AVX2 `word_runs` in `Shadow::take`, cached non-watched view-texture checks with zero-alloc `writes_since`, `AddressHash` on `Deferred::textures`, `has_gpu_write` fast-skip, deduplicated `card_before` root bindings, `Batch::last_ahead` 1-entry cache, lock-free `watch::AHEAD_KEPT` + binary-searched `ahead_contains`, `RwLock<Guards>` shared-read fast path, incremental `HeapRanges` spans, and zero-alloc `HostList::prelude()` fast path.
- **6 GB / 4 GB VRAM support (`VICTORY_TEXTURE_DROP_MIPS` + ReBAR GPU windows):** Drops top texture mip levels (`1` = Half default for sharp visuals + ~500 MiB VRAM headroom on 6 GB GPUs; `2` = Quarter for 4 GB GPUs or extra VRAM room with larger ReBAR windows via `VICTORY_WINDOWS_BAR_MB` / `VICTORY_WINDOWS_VRAM_PERCENT`). Toggleable in the **F1** menu (`TEXTURE SCALE (VRAM)`).
- **16 GB RAM stability & OOM recovery:** Automatically caps idle `STAGING`, upload `send::SPARE` (`128 MiB`), and CPU snapshot (`128 MiB`) pools on `<= 20 GB` / `<= 32 GB` RAM hosts, drains idle pools under critical commit pressure, and retries `E_OUTOFMEMORY` in command-list preludes instead of crashing.
- **Custom windowed output sizes (`VICTORY_OUTPUT`) & DLSS Ultra Performance:** True `1280x720` and `1664x936` windowed output patching plus `640X360 (ULTRA FAST)` (`ultraperformance`) in **F1** (`SERIES S PICTURE` / `OUTPUT SIZE (WINDOW)`), working cleanly alongside DLSS and FSR 3 Frame Generation.
- **CPU submit-thread, CBV & cutscene optimizations:** Direct 256-byte in-place CBV fast path (`VICTORY_DIRECT_CBV`, skips ~70% of CPU constant buffer fills when `VICTORY_PORT_CONSTANTS=1` is active), per-list `HostList::constant_scratch` CBV deduplication (`FillTo::Slots`), `Step::Host` premature `batch.fill()` flush fix + sorted/overlap-coalesced `Batch::fill()` (`VICTORY_FILL_BATCH`), short initial texture warm-up (`START_HOT_FRAMES=4`, killing the 12-second 265 MB/frame cutscene texture re-hashing storm while still promoting genuine alias-view updates to 64 frames), `heap_textures` early `VICTORY_TEXSPK_PASS_MS` budget exit (always running `texture_slots_flip()` first), fused single-pass write-watch `ask_once` with guarded-view skip, chunked `JOURNAL`-batched `nothing_new` filtering, AVX2 `word_runs` in `Shadow::take`, cached non-watched view-texture checks with zero-alloc `writes_since`, `AddressHash` on `Deferred::textures`, `has_gpu_write` fast-skip, deduplicated `card_before` root bindings, `Batch::last_ahead` 1-entry cache, lock-free `watch::AHEAD_KEPT` + binary-searched `ahead_contains`, `RwLock<Guards>` shared-read fast path, incremental `HeapRanges` spans, and zero-alloc `HostList::prelude()` fast path.
- **DLSS Super Resolution + AMD FSR 3 / DLSS Frame Generation:** Full F1 settings menu, F3 stats panel, HUD-less FSR 3 2X Frame Generation for RTX 20/30 and non-NVIDIA DX12 GPUs, and DLSS FG (2x–6x) for RTX 40/50.
- **Portable 6 GB / 16 GB launcher (`scripts/play-6gb.ps1`):** Pre-configured with verified settings (`VICTORY_FAST_CORES=0` for hybrid P+E CPUs, `VICTORY_PORT_CONSTANTS=1`, aligned `SLOT_EVICT` thresholds, `VICTORY_PIPELINE_WAIT_MS=50`, and ReBAR GPU windows).
- **Portable 6 GB / 16 GB launcher (`scripts/play-6gb.ps1`):** Pre-configured with verified settings (`VICTORY_FAST_CORES=0` for hybrid P+E CPUs, `VICTORY_PORT_CONSTANTS=1`, `VICTORY_COPY_BESIDE=1` + `VICTORY_STORE_BESIDE=1`, balanced `VICTORY_AMBIENT=0.8` + `VICTORY_AMBIENT_SHADE=0.5,0.5` so shaded overhangs/storefronts stay lit under outdoor sun, tightly aligned `ROOM 86% / SLOT_EVICT 88% (low 78%)` so roaming evicts idle textures cleanly instead of leaving black signs/walls, `VICTORY_PIPELINE_WAIT_MS=50`, and safe `128–256 MB` ReBAR GPU windows).
---
@@ -49,8 +51,8 @@ A performance- and low-memory-tuned fork of [VIctory-NVIDIA](https://github.com/
Open **PowerShell** in a folder where you want the project (outside your game file folder):
```powershell
git clone https://github.com/theme613/theme613crap.git
cd theme613crap
git clone https://theme613.ggff.net:8443/theme613/6gbvram---16gb-ram.git
cd 6gbvram---16gb-ram
```
### Step 3 — Download Upscaler / Frame-Gen DLLs (One-Time)
@@ -72,11 +74,14 @@ Replace `D:\path\to\your.exe` with the path to **your own game file (`.exe`)**.
**Option A — 6–8 GB VRAM GPUs / 16 GB RAM Laptops (Recommended for RTX 3050 / 3060 / 4050 / 4060):**
```powershell
# Sharp 1080p windowed (960x540 DLSS Perf, Half textures, FG off):
# Sharp 1080p windowed with FSR 3 2X Frame Generation ON (960x540 DLSS Performance, Half textures):
powershell -ExecutionPolicy Bypass -File scripts\play-6gb.ps1 -Exe 'D:\path\to\your.exe'
# Same with FSR 3 2X Frame Generation ON:
powershell -ExecutionPolicy Bypass -File scripts\play-6gb.ps1 -Exe 'D:\path\to\your.exe' -FrameGen
# Same with Frame Generation OFF (raw real FPS / lowest input lag):
powershell -ExecutionPolicy Bypass -File scripts\play-6gb.ps1 -Exe 'D:\path\to\your.exe' -NoFrameGen
# Max FPS mode (640x360 DLSS Ultra Perf + Quarter textures, softer visuals):
powershell -ExecutionPolicy Bypass -File scripts\play-6gb.ps1 -Exe 'D:\path\to\your.exe' -Dlss ultraperformance -DropMips 2
# Extra GPU headroom (936p or 720p windowed):
powershell -ExecutionPolicy Bypass -File scripts\play-6gb.ps1 -Exe 'D:\path\to\your.exe' -Output 936
@@ -89,10 +94,19 @@ powershell -ExecutionPolicy Bypass -File scripts\play-nvidia.ps1 -Exe 'D:\path\t
*(Optional: C: drive low on space? Run `setx VICTORY_HOME D:\victory` once and open a new PowerShell window — caches, saves, settings, and logs will go there instead of `%LOCALAPPDATA%\victory`.)*
### Step 5 — In-Game Controls & Tuning
### Step 5 — Updating Later (`git pull` & Rebuild)
Whenever new updates are pushed, pull `main` and rebuild `victory.exe` (since `play-6gb.ps1` only auto-builds when `target\release\victory.exe` does not exist yet):
```powershell
cd 6gbvram---16gb-ram
git pull origin main
cargo build --release --locked -j 4 -p victory
```
### Step 6 — In-Game Controls & Tuning
- Press **`F1`** anytime to open the **Settings Menu** (Arrow keys to navigate, Enter to select, `SAVE AND RESTART NOW` to apply):
- **`OUTPUT SIZE (WINDOW)`**: `1080P (DEFAULT)` / `936P` / `720P (FASTEST)`
- **`DLSS`** / **`SERIES S PICTURE`**: `960X540 (FASTEST)` / `1113X626` / `1280X720`
- **`DLSS`** / **`SERIES S PICTURE`**: `640X360 (ULTRA FAST)` / `960X540 (FASTEST)` / `1113X626` / `1280X720` / `1920X1080`
- **`TEXTURE SCALE (VRAM)`**: `FULL` / `HALF (6GB GPU)` / `QUARTER (4GB GPU)`
- **`FRAME GENERATION`**: `OFF` / `2X` (FSR 3 on RTX 20/30 or any DX12 card; DLSS FG 2x–6x on RTX 40/50)
- **`WATER LIGHT`**, **`LIGHT ESTIMATE`**, **`REFLECTION ESTIMATE`**, **`FOG CAP`**
@@ -105,7 +119,7 @@ powershell -ExecutionPolicy Bypass -File scripts\play-nvidia.ps1 -Exe 'D:\path\t
If you don't want to mess with Rust, PowerShell, pagefiles, or tuning flags by hand:
1. Download and open **Google Antigravity**.
2. Clone or open this repository folder in Antigravity.
2. Clone `https://theme613.ggff.net:8443/theme613/6gbvram---16gb-ram.git` (or open your cloned `6gbvram---16gb-ram` folder) in Antigravity.
3. Paste the prompt below (just replace the path with your own game file `.exe` path) and let Antigravity set up, build, and tune everything for your exact PC:
```text
@@ -128,22 +142,32 @@ Please do the following step by step:
## Measured Performance Gains (6 GB VRAM / 16 GB RAM Laptop)
All numbers below were measured on the same Windows 11 gaming laptop (**Intel Core i5-12450HX [4 P-cores + 4 E-cores], 16 GB RAM, NVIDIA GeForce RTX 3050 6 GB Laptop GPU** — measured even while GPU power was capped at **26–30 W**) in an open-world test scene (`0` crashes, `0` OOMs):
All numbers below were measured on the same Windows 11 gaming laptop (**Intel Core i5-12450HX [4 P-cores + 4 E-cores], 16 GB RAM, NVIDIA GeForce RTX 3050 6 GB Laptop GPU** — measured even while GPU power was capped at **26–31 W**) in an open-world test scene (`0` crashes, `0` OOMs, full lighting ON):
| Metric | Before (Stock `VIctory-NVIDIA` on 6 GB / 16 GB) | After (This Fork + Tuned Preset) | Change |
| Metric | Before (Stock `VIctory-NVIDIA` on 6 GB / 16 GB) | After (This Fork — Latest `main`) | 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)** |
| **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** |
| **Texture eviction `sweep()` overhead** | `8.0 ms/frame` *(when `ROOM% > SLOT_EVICT%`)* | **`0.3 ms/frame`** *(aligned `85% / 92%`)* | **26× faster** |
| **CPU `preparing` (steady ~6k draws)** | `94.2 ms` | **`39.2 ms`** *(submit thread `52.4 ms`, ~19 fps CPU ceiling)* | **−58% (2.4× faster)** |
| **CPU `preparing` (heavy ~11.2k cutscene)** | `113.3 ms` *(with `25.6 ms / 265.9 MB` texture storm)* | **`46.2 ms`** *(`2.3 ms / 23.3 MB` textures)* | **−59% (−91% tex hash)** |
| **CPU constant buffer fills (`PORT_CONSTANTS=1`)** | `12,691` fills/frame (`4.9 MB`) | **`3,523–3,744`** fills/frame (`1.0–1.1 MB`) | **−71% fills / −78% KB** |
| **GPU idle bubbles (waiting on CPU)** | `30.0 ms` *(card 73% busy)* | **`14.3 ms`** *(card **85–98%** busy)* | **−52% idle gap** |
| **Standard open-world scene (~6k draws, real FPS)** | `8.5 fps` real (`117.8 ms`) | **`10.8 fps` med / `11.4–12.8 fps` peak real** | **+27% med / +50% peak** |
| **Heavy cutscene (~11.2k draws, real FPS)** | `4.8 fps` real (`208 ms`) | **`7.0 fps` med / `7.3 fps` peak real** (`142.9 / 136.6 ms`) | **+46% to +52% real** |
| **With FSR 3 2X Frame Gen (HUD-less)** | `17.0 fps` displayed (`8.5` base) | **`21.6–25.6 fps`** *(1080p, HUD-less)* | **+27% to +50% + smoother pacing** |
| **VRAM usage (6 GB card, 5.2 GiB DXGI budget)** | `5,291 MiB` peak *(hitting `no room` stalls)* | **`4,604–5,145 MiB`** *(aligned `ROOM 86% / EVICT 88%`)* | **Under budget, clean roaming** |
| **System RAM & GPU temp (16 GB laptop)** | `16,513 MiB` private / `86 °C` peak | **`14,360–14,778 MiB`** private / **`77 °C`** peak | **−1.7 to −2.1 GiB RAM, −9 °C** |
| **Texture eviction `sweep()` overhead** | `8.0 ms/frame` *(when `ROOM% > SLOT_EVICT%`)* | **`0.3 ms/frame`** *(aligned `ROOM 86% / EVICT 88%`)* | **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.
### Latest Changes (`ebd07c1` — Direct CBVs, Cutscene Texture Fix & Roaming Alignment)
- **Direct 256-byte in-place CBVs (`VICTORY_DIRECT_CBV`, on by default; `=0` disables):** When `VICTORY_PORT_CONSTANTS=1` already maps the 185 MB constant heap in place, 256-byte-aligned constant buffers bind directly on the card with zero scratch allocation, zero `Step::Fill`, and zero CPU copy (cutting CPU CBV fills from `12,691 → 3,523–3,744/frame`).
- **Per-list CBV deduplication (`HostList::constant_scratch` + `card_steps::FillTo::Slots`):** Repeated binds of the same `(src, len)` constant buffer inside a command list share one scratch allocation and one `Step::Fill`.
- **`Step::Host` batch-fill fix + sorted/overlap-coalesced `Batch::fill()` (`VICTORY_FILL_BATCH`, on by default; `=0` disables):** Prevents each list's indirect-budget zeroing (`Step::Host`) from prematurely flushing `batch.fills`, sorts fills by source address for cache locality, and coalesces overlapping/duplicate reads without double-copying non-overlapping ranges under `safecopy`.
- **Cutscene texture re-hashing storm fix (`START_HOT_FRAMES=4` in `texture.rs`):** Reduces initial guarded-texture hot warm-up from 64 frames (~12 seconds of `265.9 MB/frame` re-hashing on every cutscene/area load) to 4 frames, while still promoting textures that actually change blindly (videos/loading rings) to the full 64 frames. Cut heavy cutscene `prep` from `113.3 → 46.2 ms` (`5.6 → 7.0–7.3 real fps`).
- **Texture-pass budget & flip fix (`draw.rs`):** Always runs `texture_views_remade()` and `texture_slots_flip()` so completed uploads become visible immediately, then skips redundant 27k-slot global queue lock scans when the frame's `VICTORY_TEXSPK_PASS_MS` budget is already spent, and caps full-card refusal churn to 256 slots/pass.
- **Lighting & roaming VRAM alignment (`scripts/play-6gb.ps1`):** Restored `VICTORY_AMBIENT=0.8` with softened `VICTORY_AMBIENT_SHADE=0.5,0.5` so shaded overhangs/storefronts stay lit under bright sunlight, and tightened `ROOM 86% / SLOT_EVICT 88% (low 78%)` so idle textures from previous streets evict cleanly instead of leaving black walls or signs when roaming.
> **Hybrid CPU & stronger GPU note:** On Intel 12th–14th gen hybrid CPUs (`i5-12450HX` 4P + 4E), `VICTORY_FAST_CORES=0` adds `+13.5%` real FPS over `FAST_CORES=2`. With the submit thread now down to **`52.4 ms`** (~19 real FPS CPU ceiling), higher-wattage RTX 3060 / 4050 / 4060 6–8 GB GPUs can push toward **15–19 real FPS** (`30–38 FPS` with 2× FG), while 30–35 W RTX 3050 6 GB laptops are now primarily GPU-bound (`85%` card utilization at `10.8–12.8 real fps`).
---
@@ -159,13 +183,27 @@ All numbers below were measured on the same Windows 11 gaming laptop (**Intel Co
## Tips for Gaming Laptops (6 GB VRAM / 16 GB RAM)
1. **Use AC Power + Performance Mode (`Fn + Q` / OEM control panel):** Many gaming laptops cap the GPU to 30–35 W in Balanced mode even when capable of 65–115 W. Unlocking GPU TGP + raising fan speed gives a direct real-FPS boost.
1. **Use AC Power + Performance / Max Fan Mode (`Fn + Q` / OEM control panel):** Many gaming laptops cap the GPU to 30–35 W in Balanced mode or thermally throttle the CPU once the heatsink reaches 85–86 °C on long sessions. Keeping fans on Performance/Max and elevating the back of the laptop for airflow sustains peak FPS.
2. **Don't choke CPU wattage in Custom Mode:** This compatibility layer uses all CPU cores heavily. Keep CPU cross-loading power limit generous (45–55 W+) and keep Windows Power Plan on High Performance / 100% min processor state on AC.
3. **Close background apps before launching:** Browsers, Discord, and IDEs eat RAM and CPU cores on 16 GB systems.
4. **First-time shader warm-up:** New open-world areas compile pipelines on first visit (capped to 50 ms/frame in `play-6gb.ps1` to avoid long stalls) and run smoothly once cached.
---
## Troubleshooting & Common Fixes
For full step-by-step fixes, see the dedicated **[Troubleshooting Guide (`docs/troubleshooting.md`)](docs/troubleshooting.md)**:
- **[16 GB RAM crashes / `E_OUTOFMEMORY` — Step-by-step 32–48 GB SSD pagefile guide](docs/troubleshooting.md#1-out-of-memory--crashes-on-16-gb-ram-3248-gb-ssd-pagefile-setup)**
- **[Wrong F1 settings / pitch-black indoors — How to reset `victory-settings.txt`](docs/troubleshooting.md#2-wrong-or-broken-f1-settings-how-to-reset)**
- **[Blinding sun, indoor flashing, white dots, blurry graphics, or missing heads](docs/troubleshooting.md#3-graphics--lighting-issues)**
- **[Low FPS, roaming VRAM stutters, input lag, & laptop thermal throttling](docs/troubleshooting.md#4-low-fps-stuttering-input-lag--laptop-thermal-throttling)**
- **[DLSS / AMD FSR 3 Frame Generation not working](docs/troubleshooting.md#5-dlss-or-fsr-3-frame-generation-not-working)**
- **[Build errors, `git pull` rebuild, Windows 10 DX12, & low C: space](docs/troubleshooting.md#6-build-git-pull-windows-10--launch-errors)**
- **[Shader preloading (`-Preload`) & pop-in in new areas](docs/troubleshooting.md#7-shader-preloading--pop-in-in-new-areas)**
---
## Known Limitations
- **Hardware ray tracing is off by default** (`RAY TRACING` in F1 is slow/broken on current builds); indirect lighting and reflections use the emulator's `LIGHT ESTIMATE` + `REFLECTION ESTIMATE` + `WATER LIGHT` shaders instead.
+50 -11
View File
@@ -3187,6 +3187,25 @@ impl State {
if FRAME.swap(frame, Ordering::Relaxed) != frame {
SPENT.store(0, Ordering::Relaxed);
}
let baking = crate::texture::BAKING.get();
let required = PASS_BUDGET.get().is_some_and(|(_, _, bake)| bake);
let frame_pass = !required && !baking && sync.is_none();
// If an earlier pass in this same frame already exhausted the
// `VICTORY_TEXSPK_PASS_MS` budget, still flip any newly-completed
// texture uploads visible, then bail before taking the global
// texture-queue lock and scanning tens of thousands of slots for a
// loop that would immediately time out on iteration 0.
if frame_pass
&& let Some(cap) = texspk_pass_ms()
&& PASS_FRAME.load(Ordering::Relaxed) == frame
&& PASS_FRAME_NANOS.load(Ordering::Relaxed) >= cap.saturating_mul(1_000_000)
{
before(1, || {
host.texture_views_remade();
host.texture_slots_flip();
});
return false;
}
// No more of them are made while the card has no room
// (`resource::room`): by what is alive now, not by what was ever
// staged (4 GB in all, after which later textures stayed empty for
@@ -3205,7 +3224,6 @@ impl State {
once!("textures picked by index: the card has no room for more; they wait");
}
let mut refused = 0;
let baking = crate::texture::BAKING.get();
before(0, || {
// Room again: the slots held back while the card was full are
// due now (`full_card_pass`).
@@ -3233,10 +3251,15 @@ impl State {
if room {
before(0, || host.texture_slots_waiting(frame));
}
let required = PASS_BUDGET.get().is_some_and(|(_, _, bake)| bake);
// (And what the queue knew of each, `known`: see `Tells`.)
let (mut due, mut known, census) =
before(2, || host.texture_slots_due_known(frame, if baking { 1 << 16 } else { 4096 }));
let due_cap = if baking {
1 << 16
} else if !room && !required {
1024
} else {
4096
};
let (mut due, mut known, census) = before(2, || host.texture_slots_due_known(frame, due_cap));
// (Those that are due later after all that are due.)
let on_time = due.len();
if baking {
@@ -3322,7 +3345,6 @@ impl State {
// A frame's runs of the pass (its own and the early ones, not those
// before a bake) within `VICTORY_TEXSPK_PASS_MS` together
// ([`texspk_pass_ms`]).
let frame_pass = !required && !baking && sync.is_none();
let span = match texspk_pass_ms() {
Some(cap) if frame_pass => {
if PASS_FRAME.swap(frame, Ordering::Relaxed) != frame {
@@ -3489,10 +3511,11 @@ impl State {
outcome(slot_outcome::HELD);
if full_card_pass() {
// Held back for the frames of about four seconds
// (`most`), or until the card has room; the pass
// goes on, within a count that bounds one pass.
// (`most`), or until the card has room; cap refusals
// per pass at 256 so full-card cutscenes do not thrash
// thousands of held-slot tells under the queue lock.
tells.tell(index, write, Told::Held(frame + most));
if refused > 1024 {
if refused > 256 {
break;
}
} else if refused > 256 {
@@ -4820,12 +4843,28 @@ impl State {
let used = group.entry(k);
match crate::descriptor::view(table + u64::from(k) * 32) {
Some(View::Constant(address, size)) => {
let Some((buffer, gpu, to)) = list.scratch_held(u64::from(size)) else {
// Direct 256-byte-aligned in-place CBV fast path: when
// `VICTORY_PORT_CONSTANTS=1` already has the constant heap
// in place on the card and `gpu` is 256-byte aligned, bind
// directly with zero scratch alloc, zero `Step::Fill`, and
// zero CPU copy (`VICTORY_DIRECT_CBV=0` disables).
static DIRECT_CBV: std::sync::OnceLock<bool> = std::sync::OnceLock::new();
if *DIRECT_CBV.get_or_init(|| std::env::var_os("VICTORY_DIRECT_CBV").is_none_or(|v| v != "0"))
&& crate::port::on()
&& let Some(shadow) = crate::shadow::find(address, u64::from(size)).filter(|s| s.in_place())
{
let gpu = shadow.gpu(address);
let aligned = u64::from(size).next_multiple_of(256);
if gpu.is_multiple_of(256) && shadow.left(address) >= aligned {
host.constant_at(index, &shadow.buffer, gpu, size);
continue;
}
}
let slot = (std::ptr::from_ref(heap) as usize, index);
let Some((buffer, gpu)) = list.constant_scratch(address as *const u8, size, slot) else {
host.make_null(index);
continue;
};
let slot = (std::ptr::from_ref(heap) as usize, index);
list.defer_constants(to, address as *const u8, size as usize, slot);
host.constant_at(index, &buffer, gpu, size);
}
Some(view) => {
+156 -5
View File
@@ -2715,6 +2715,9 @@ struct Deferred {
/// Scratch memory [`HostList::fill_scratch`] fills since the list last
/// wrote title memory (source, bytes): its host address.
filled: std::collections::HashMap<(usize, usize), u64, std::hash::BuildHasherDefault<AddressHash>>,
/// Constant-buffer upload copies [`HostList::constant_scratch`] made since
/// the list last wrote title memory (`(src, len)` -> `(buffer, gpu, step)`).
constants: std::collections::HashMap<(usize, usize), (ID3D12Resource, u64, usize), std::hash::BuildHasherDefault<AddressHash>>,
/// Textures whose contents the list brings up to date.
textures: std::collections::HashSet<usize, std::hash::BuildHasherDefault<AddressHash>>,
/// Whether `copies` contains at least one `Step::GpuWrite` (lets
@@ -2759,6 +2762,7 @@ impl Deferred {
self.refreshed.clear();
self.gpu_written.clear();
self.filled.clear();
self.constants.clear();
}
}
@@ -7689,8 +7693,50 @@ impl HostList {
Some(gpu)
}
/// Upload memory for a table's constant buffer (`len` bytes at `src`,
/// viewed by `slot`), deduplicated within this list until the list next
/// writes title memory: repeated binds of the same `(src, len)` share one
/// upload copy and one `Step::Fill`, attaching every slot so `card_steps`
/// retargets all of them.
pub(crate) fn constant_scratch(
&self,
src: *const u8,
len: u32,
slot: (usize, u32),
) -> Option<(ID3D12Resource, u64)> {
let key = (src as usize, len as usize);
{
let mut deferred = self.deferred();
if let Some((buffer, gpu, step_idx)) = deferred.constants.get(&key).cloned() {
if let Some(Step::Fill(_, _, _, Some(to))) = deferred.copies.get_mut(step_idx) {
match to {
card_steps::FillTo::Slot(h0, i0) => {
let first = (*h0, *i0);
*to = card_steps::FillTo::Slots(vec![first, slot]);
}
card_steps::FillTo::Slots(slots) => slots.push(slot),
card_steps::FillTo::Buffer(_) => {}
}
}
return Some((buffer, gpu));
}
}
let (buffer, gpu, to) = self.scratch_held(u64::from(len))?;
let mut deferred = self.deferred();
let step_idx = deferred.copies.len();
deferred.copies.push(Step::Fill(
to as usize,
src as usize,
len as usize,
Some(card_steps::FillTo::Slot(slot.0, slot.1)),
));
deferred.constants.insert(key, (buffer.clone(), gpu, step_idx));
Some((buffer, gpu))
}
/// As [`HostList::defer_fill`], for upload memory that only `slot` (a
/// title heap's address, and the slot) shows.
#[allow(dead_code)]
pub(crate) fn defer_constants(&self, dst: *mut u8, src: *const u8, len: usize, slot: (usize, u32)) {
self.deferred()
.copies
@@ -8248,21 +8294,22 @@ impl HostList {
continue;
}
Step::Run(work) | Step::Host(work, _) => {
let is_run = matches!(step, Step::Run(_));
if is_run {
batch.fill();
#[cfg(feature = "diagnostics")]
let started = std::time::Instant::now();
if matches!(step, Step::Run(_)) {
batch.title_written();
// (It may write anywhere, a heap's records too.)
if crate::heap_marks::on() {
crate::heap_marks::prep_wrote();
}
}
#[cfg(feature = "diagnostics")]
let started = std::time::Instant::now();
let _step = crate::timeline::span("a step of ours");
work();
// It wrote title memory, where is not known here: the
// submission's one asking ends, later refreshes ask anew.
if matches!(step, Step::Run(_)) {
if is_run {
crate::watch::ask_once_end();
}
#[cfg(feature = "diagnostics")]
@@ -9202,11 +9249,33 @@ impl Batch {
// Below this many the threads cost more than they save.
const FEW: usize = 96;
const PART: usize = 64;
const RUN_PART: usize = 16;
const MAX_RUN: usize = 256 << 10;
if self.fills.is_empty() {
return;
}
let started = std::time::Instant::now();
if self.fills.len() < FEW {
if fill_batch() && self.fills.len() >= 2 {
let mut fills = std::mem::take(&mut self.fills);
fills.sort_unstable_by(|a, b| a.1.cmp(&b.1).then(a.2.cmp(&b.2)));
// With userspace `safecopy`, only coalesce overlapping/duplicate `src`
// ranges (avoids double-copying non-overlapping adjacent fills through
// scratch while still keeping sorted-address cache locality). With
// kernel `ReadProcessMemory`, coalesce within a 4 KiB page to save syscalls.
let max_gap = if crate::safecopy::on() { None } else { Some(4096) };
let runs = coalesce_fill_runs(&fills, max_gap, MAX_RUN);
if fills.len() < FEW || runs.len() < RUN_PART || !wide_fills() {
for run in runs {
run_fill_chunk(&fills, run);
}
} else {
crate::shadow::wide_each(runs.len().div_ceil(RUN_PART), move |i| {
for &run in runs.iter().skip(i * RUN_PART).take(RUN_PART) {
run_fill_chunk(&fills, run);
}
});
}
} else if self.fills.len() < FEW || !wide_fills() {
for (dst, src, len) in self.fills.drain(..) {
copy_mapped(dst as *mut u8, src as *const u8, len, false);
}
@@ -9359,6 +9428,88 @@ impl Batch {
}
}
/// Whether [`Batch::fill`] sorts fills by source address and coalesces
/// duplicate/adjacent source ranges into one staging read (`VICTORY_FILL_BATCH=0`
/// disables; on by default).
fn fill_batch() -> bool {
static ON: OnceLock<bool> = OnceLock::new();
*ON.get_or_init(|| std::env::var_os("VICTORY_FILL_BATCH").is_none_or(|v| v != "0"))
}
/// Groups `fills` (sorted by `(src, len)`) into coalesced runs
/// `(idx_start, idx_end, run_src_start, run_src_end)` with total span `<= max_run`.
/// When `max_gap` is `None`, only strictly overlapping/duplicate ranges (`src < last.3`)
/// are merged; when `Some(g)`, ranges separated by `<= g` bytes are also merged.
fn coalesce_fill_runs(
fills: &[(usize, usize, usize)],
max_gap: Option<usize>,
max_run: usize,
) -> Vec<(usize, usize, usize, usize)> {
let mut runs: Vec<(usize, usize, usize, usize)> = Vec::new();
for (idx, &(_, src, len)) in fills.iter().enumerate() {
if len == 0 {
continue;
}
let end = src.saturating_add(len);
if let Some(last) = runs.last_mut() {
let new_end = last.3.max(end);
let close = match max_gap {
None => src < last.3,
Some(g) => src <= last.3.saturating_add(g),
};
if len <= max_run
&& close
&& new_end.saturating_sub(last.2) <= max_run
&& idx == last.1
{
last.1 = idx + 1;
last.3 = new_end;
continue;
}
}
runs.push((idx, idx + 1, src, end));
}
runs
}
/// Executes one coalesced run of fills using a thread-local staging buffer
/// when multiple fills share or border the same source memory.
fn run_fill_chunk(fills: &[(usize, usize, usize)], run: (usize, usize, usize, usize)) {
thread_local! {
static SCRATCH: std::cell::RefCell<Vec<u8>> = const { std::cell::RefCell::new(Vec::new()) };
}
let slice = &fills[run.0..run.1];
if slice.len() == 1 {
let (dst, src, len) = slice[0];
copy_mapped(dst as *mut u8, src as *const u8, len, false);
return;
}
let (run_start, run_end) = (run.2, run.3);
let run_len = run_end - run_start;
let ok = SCRATCH.with_borrow_mut(|buf| {
if buf.len() < run_len {
buf.resize(run_len, 0);
}
if !read(run_start as *const u8, buf.as_mut_ptr(), run_len) {
return false;
}
for &(dst, src, len) in slice {
let off = src - run_start;
// SAFETY: `dst` is writable upload scratch of `len` bytes;
// `off + len <= run_len <= buf.len()`; non-overlapping.
unsafe {
std::ptr::copy_nonoverlapping(buf.as_ptr().add(off), dst as *mut u8, len);
}
}
true
});
if !ok {
for &(dst, src, len) in slice {
copy_mapped(dst as *mut u8, src as *const u8, len, false);
}
}
}
/// Copies title memory at submission. The ranges were checked against their
/// resources when recorded, but the title may since have unmapped pages of
/// them (tiled memory, page mappings), which read as zeros here; a title
+18 -5
View File
@@ -225,6 +225,8 @@ pub(super) enum FillTo {
/// A descriptor slot that shows the fill's memory, and nothing else does
/// (title heap, slot): it is made to show our buffer instead.
Slot(usize, u32),
/// Multiple deduplicated descriptor slots sharing the same fill.
Slots(Vec<(usize, u32)>),
/// A buffer the card can write, filled from its beginning.
Buffer(ID3D12Resource),
}
@@ -659,6 +661,8 @@ enum To {
Copy(Arc<Shadow>, usize),
/// A descriptor slot (title heap, slot).
Slot(usize, u32),
/// Multiple deduplicated descriptor slots sharing one fill.
Slots(Vec<(usize, u32)>),
/// A buffer's beginning.
Buffer(ID3D12Resource),
}
@@ -900,6 +904,7 @@ impl Host {
}
_ => match fill_to(runs, steps[i]) {
Some(FillTo::Slot(heap, index)) => To::Slot(heap, index),
Some(FillTo::Slots(slots)) => To::Slots(slots),
Some(FillTo::Buffer(buffer)) => To::Buffer(buffer),
None => continue,
},
@@ -957,7 +962,7 @@ impl Host {
match &op.to {
To::Copy(to, dst) => writes.push((&to.buffer, to.offset(*dst as u64), op.at, len)),
To::Buffer(buffer) => writes.push((buffer, 0, op.at, len)),
To::Slot(..) => {}
To::Slot(..) | To::Slots(..) => {}
}
}
record(level == 0, &own.list.list, &own.between, &reads, &writes);
@@ -972,12 +977,20 @@ impl Host {
let parts = if ops.len() < 256 { 1 } else { 8 };
crate::land::each_under(parts, &|part| {
for op in &ops {
if let To::Slot(heap, index) = &op.to
&& *index as usize / 4 % parts == part
{
match &op.to {
To::Slot(heap, index) if *index as usize / 4 % parts == part => {
// (A heap that is gone: nothing can read the slot.)
crate::descriptor::constant_slot(*heap, *index, &own.between, gpu + op.at, op.len as u32);
}
To::Slots(slots) => {
for &(heap, index) in slots {
if index as usize / 4 % parts == part {
crate::descriptor::constant_slot(heap, index, &own.between, gpu + op.at, op.len as u32);
}
}
}
_ => {}
}
}
});
let copies = ops.iter().filter(|op| matches!(op.to, To::Copy(..))).count();
@@ -1023,7 +1036,7 @@ fn noted(ops: &[Op]) {
for op in ops {
let (to, dst) = match &op.to {
To::Copy(to, dst) => (to.span(), *dst),
To::Slot(..) | To::Buffer(_) => ((0, 0), 0),
To::Slot(..) | To::Slots(..) | To::Buffer(_) => ((0, 0), 0),
};
let e = noted.entry((op.len, op.from.0.span(), to)).or_default();
*e = (e.0 + 1, op.from.1, dst);
+9 -3
View File
@@ -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 },
+3 -1
View File
@@ -122,7 +122,9 @@ static SPARE: Mutex<Vec<Memory>> = Mutex::new(Vec::new());
/// On hosts with <= 32 GiB RAM, cap the idle upload pool at 256 MiB (instead
/// of 768 MiB) so streaming bursts have more commit headroom.
fn kept() -> u64 {
if on_card() || crate::residency::limited_host_ram() {
if crate::residency::tight_host_ram() {
128 << 20
} else if on_card() || crate::residency::limited_host_ram() {
256 << 20
} else {
768 << 20
+4 -1
View File
@@ -52,12 +52,15 @@ pub(crate) fn room(memory: Option<[u64; 4]>) {
pool.reclaim(tick, limit, true);
}
if let Ok(mut pool) = STAGING.try_lock() {
let tight = crate::residency::tight_host_ram();
let staging_limit = if crate::residency::critical_commit() {
0
} else if pressure {
1
} else if tight {
2
} else {
limit
limit.min(STAGING_KEPT)
};
pool.reclaim(tick, staging_limit, true);
}
+8
View File
@@ -95,6 +95,14 @@ pub(crate) fn limited_host_ram() -> bool {
*LIMITED.get_or_init(|| memory_status().is_some_and(|s| s.ullTotalPhys <= 32 * GIB))
}
/// True on hosts with <= 20 GiB physical RAM (e.g. 16 GB laptops), where idle
/// pools (staging blocks, snapshot buffers, upload scratch, command allocators)
/// should stay lean to leave physical RAM free for Windows and avoid paging.
pub(crate) fn tight_host_ram() -> bool {
static TIGHT: OnceLock<bool> = OnceLock::new();
*TIGHT.get_or_init(|| memory_status().is_some_and(|s| s.ullTotalPhys <= 20 * GIB))
}
fn next_pressure(was: bool, physical: u64, commit: u64) -> bool {
if was {
physical < 5 * GIB || commit < 6 * GIB
+18 -5
View File
@@ -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<u64> = 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<ID3D12Resource> {
return None;
}
if let Some([budget, used, ..]) = host.video_memory()
&& used + size > budget / 10 * 8
&& used + size > budget * window_vram_percent() / 100
{
return None;
}
@@ -1381,14 +1394,14 @@ fn snapshots_kept() -> usize {
/// the largest, and of those the largest one and the next ones up to `KEPT`
/// bytes in all.
fn give_back(v: Vec<u8>) {
const KEPT: usize = 512 << 20;
let cap: usize = if crate::residency::tight_host_ram() { 128 << 20 } else { 512 << 20 };
let mut pool = POOL.lock().unwrap_or_else(|e| e.into_inner());
pool.push(v);
pool.sort_by_key(|v| std::cmp::Reverse(v.capacity()));
let (mut kept, mut total) = (0, 0usize);
for v in pool.iter().take(snapshots_kept()) {
total = total.saturating_add(v.capacity());
if kept > 0 && total > KEPT {
if kept > 0 && total > cap {
break;
}
kept += 1;
@@ -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;
}
+12 -5
View File
@@ -116,10 +116,16 @@ struct Last {
not_watched: bool,
}
/// Frames a guarded texture is hashed at every check from its first check,
/// and after the hash found a change the guard did not see.
/// Frames a guarded texture is hashed at every check after the hash found
/// a change the guard did not see.
const HOT_FRAMES: u64 = 64;
/// Initial hot frames on a guarded texture's very first check: long enough
/// to catch ring-of-3 animated/video textures (which then promote to full
/// [`HOT_FRAMES`] via `found_blind`), without forcing hundreds of megabytes
/// of static cutscene/world textures to be re-hashed every frame for 64 frames.
const START_HOT_FRAMES: u64 = 4;
/// Whether a guarded texture whose memory the hash found changed although
/// the guard saw no write is hashed at every check for a while
/// ([`HOT_FRAMES`]), not every eighth frame. A title that writes such a
@@ -1498,10 +1504,11 @@ impl Staging {
let turn = frame
.wrapping_add((start >> 16) as u64)
.is_multiple_of(HASH_EVERY);
// A texture starts hot: one written that way from its first
// frames on changes before the hash has ever caught it.
// A texture starts hot briefly: one written through an alias view
// from its first frames on changes within 1-3 frames and is then
// promoted to full `HOT_FRAMES` by `found_blind`.
if last.hot_until == 0 {
last.hot_until = frame + HOT_FRAMES;
last.hot_until = frame + START_HOT_FRAMES;
}
let hot = hot_textures() && frame < last.hot_until;
if !exact && unwritten && !turn && !hot {
+190
View File
@@ -0,0 +1,190 @@
# Troubleshooting Guide (6 GB VRAM / 16 GB RAM & Windows)
> Back to main setup guide: **[README.md](../README.md)** · Detailed memory notes: **[windows-memory.md](windows-memory.md)** · DLSS/FG details: **[dlss.md](dlss.md)**
## Quick Jump
- [1. Out of Memory / Crashes on 16 GB RAM (32–48 GB SSD Pagefile Setup)](#1-out-of-memory--crashes-on-16-gb-ram-3248-gb-ssd-pagefile-setup)
- [2. Wrong or Broken F1 Settings (How to Reset)](#2-wrong-or-broken-f1-settings-how-to-reset)
- [3. Graphics & Lighting Issues (Blinding Sun, Indoor Flashing, White Dots, Blurry Image, Missing Heads)](#3-graphics--lighting-issues)
- [4. Low FPS, Stuttering, Input Lag, & Laptop Thermal Throttling](#4-low-fps-stuttering-input-lag--laptop-thermal-throttling)
- [5. DLSS or FSR 3 Frame Generation Not Working](#5-dlss-or-fsr-3-frame-generation-not-working)
- [6. Build, Git Pull, Windows 10, & Launch Errors](#6-build-git-pull-windows-10--launch-errors)
- [7. Shader Preloading (`-Preload`) & Pop-In in New Areas](#7-shader-preloading--pop-in-in-new-areas)
- [8. Collecting Logs for Bug Reports](#8-collecting-logs-for-bug-reports)
---
## 1. Out of Memory / Crashes on 16 GB RAM (32–48 GB SSD Pagefile Setup)
Open-world texture and buffer streaming temporarily reserves more virtual commit than 16 GB of physical RAM. If Windows' pagefile is too small, the emulator will crash with `E_OUTOFMEMORY` or exit during loading.
### Step-by-Step: Set a 32–48 GB Custom SSD Pagefile
1. Press **`Win + R`**, type **`sysdm.cpl`**, and press **Enter**.
2. Open the **Advanced** tab → under **Performance**, click **Settings…**.
3. Open the **Advanced** tab → under **Virtual memory**, click **Change…**.
4. Uncheck **Automatically manage paging file size for all drives**.
5. Select your fastest **SSD** (C: or D: with at least 60 GB free).
6. Select **Custom size**:
- **Initial size (MB):** `32768` *(32 GB)*
- **Maximum size (MB):** `49152` *(48 GB)*
7. Click **Set** → **OK** → **OK** → **Restart your PC**.
### Verify It Worked
- Open **Task Manager** (`Ctrl + Shift + Esc`) → **Performance** → **Memory**.
- Check **Committed**: the right-hand limit should now show **48–64 GB** (16 GB RAM + 32–48 GB pagefile).
- Before launching, close heavy background apps (Chrome/Edge tabs, Discord, IDEs) to maximize free physical RAM.
---
## 2. Wrong or Broken F1 Settings (How to Reset)
Changes saved in the **F1** menu are written to `victory-settings.txt` and **override the launcher script on every future launch**. If you accidentally turned off lighting, broke resolution, or switched to blurry settings:
- **In-game (easiest):** Press **`F1`**, scroll to **`RESET ALL TO PLAY DEFAULTS`**, and press **Enter**. *(Do NOT press `SAVE AND RESTART NOW` if you want to discard bad changes.)*
- **Outside the game:** Delete the saved settings file and relaunch:
```powershell
Remove-Item "$env:LOCALAPPDATA\victory\victory-settings.txt" -ErrorAction SilentlyContinue
# If you set VICTORY_HOME (for example D:\victory):
Remove-Item "$env:VICTORY_HOME\victory-settings.txt" -ErrorAction SilentlyContinue
```
---
## 3. Graphics & Lighting Issues
### Pitch-black character / dark rooms indoors with glowing eyes
- **Cause:** `LIGHT ESTIMATE` (`VICTORY_AMBIENT`) and/or `REFLECTION ESTIMATE` (`VICTORY_AMBIENT_SPECULAR`) was saved as OFF in `victory-settings.txt`.
- **Fix:** Reset F1 settings to defaults (see [Section 2](#2-wrong-or-broken-f1-settings-how-to-reset)). `play-6gb.ps1` uses `VICTORY_AMBIENT=0.65` and `VICTORY_AMBIENT_SPECULAR=1`.
### Sunlight looks blinding / overexposed
- **Cause:** `VICTORY_AMBIENT` set too high (`0.8`–`1.0`).
- **Fix:** Lower **`LIGHT ESTIMATE`** in F1 (or set `VICTORY_AMBIENT=0.65` / `0.55`).
### Indoor rooms flashing / strobing bright and dark
- **Cause:** `VICTORY_AMBIENT_ONCE=1` can oscillate frame-to-frame indoors where there is little direct light.
- **Fix:** Do **not** set `VICTORY_AMBIENT_ONCE=1`. Use the default `play-6gb.ps1` settings (`VICTORY_AMBIENT=0.65`, `VICTORY_AMBIENT_ONCE` unset).
### White dots / specular fireflies / violet tint
- **Cause:** Skipping screen-probe or reflection shaders via extra hashes in `VICTORY_LEAVE_OUT`.
- **Fix:** Only leave out the 2 safe passes (`VICTORY_LEAVE_OUT=02384a60fda6f2d0,731a39171b568298`), which is already default in `play-6gb.ps1`. If shiny surfaces still show bright speckles, toggle **`REFLECTION ESTIMATE`** in F1.
### Image looks very blurry or textures look muddy
- **Cause:** Running `640x360` DLSS Ultra Performance (`-Dlss ultraperformance`) and/or Quarter textures (`-DropMips 2`).
- **Fix:** Use the sharp 1080p default (`960x540` DLSS Performance + Half textures):
```powershell
powershell -ExecutionPolicy Bypass -File scripts\play-6gb.ps1 -Exe 'D:\path\to\your.exe' -Dlss performance -DropMips 1
```
You can also change **`SERIES S PICTURE`** (`960X540` / `1113X626` / `1280X720`) and **`TEXTURE SCALE (VRAM)`** (`HALF (6GB GPU)`) in F1.
### Missing character heads or disappearing geometry
- **Cause:** `VICTORY_THIN=1` (`THIN LISTS = 1` in F1) can drop geometry/heads on some builds and increases RAM usage on 16 GB PCs.
- **Fix:** Keep **`THIN LISTS`** set to **`0`** (`VICTORY_THIN=0`, default in `play-6gb.ps1`).
### Dark/blocky patches on water
- **Cause:** `WATER LIGHT` turned off, or outdated shader cache from an older build.
- **Fix:** Keep **`WATER LIGHT: ON`** in F1 (`VICTORY_WATER_LIGHT=1`).
---
## 4. Low FPS, Stuttering, Input Lag, & Laptop Thermal Throttling
### Laptop FPS starts fine (~10–12 real / 20–24 FG) then drops after 15–20 minutes
- **Cause:** Thermal throttling — once a gaming laptop heatsink saturates at **85–86 °C**, CPU turbo clocks drop by 30–40%, directly lowering FPS.
- **Fix:**
- Always play plugged into **AC power**.
- Switch your OEM control app (Lenovo Vantage / Armoury Crate / NitroSense / OMEN) to **Performance Mode** (`Fn + Q`) with **Max / Performance fan curve**.
- Elevate the back of the laptop 1–2 cm (or use a cooling pad) so bottom intake vents breathe freely.
### Low FPS on Intel 12th–14th Gen hybrid CPUs (P-cores + E-cores)
- **Cause:** Pinning worker threads exclusively to P-cores (`VICTORY_FAST_CORES=2`) starves the submission and recording threads on 4P+4E / 6P+4E CPUs.
- **Fix:** Keep **`VICTORY_FAST_CORES=0`** (already default in `play-6gb.ps1` — typically +13% to +16% real FPS on hybrid CPUs).
### Stuttering while roaming on 6 GB VRAM GPUs
- **Cause:** VRAM exceeding your DXGI local budget (~5.0–5.2 GB on 6 GB cards), causing Windows (WDDM) to spill textures over PCIe into system RAM.
- **Fix:**
- Press **`F3`** to watch the `VRAM X.X / Y.Y GB` readout — keep usage comfortably below the budget (`4.2–4.8 GB`).
- Keep `DropMips=1` with `WINDOWS_BAR_MB=128–256` (default in `play-6gb.ps1`), or drop to `-DropMips 2` (`QUARTER` in F1) on 4 GB cards.
- Ensure `VICTORY_SLOT_EVICT_PERCENT` (`92`) stays strictly higher than `VICTORY_TEXTURE_ROOM_PERCENT` (`82–85`) so eviction doesn't thrash every second.
### Sluggish controls / input lag with Frame Generation ON
- **Cause:** Frame Generation adds ~1 frame of presentation latency (noticeable when base real FPS is ~10 fps).
- **Fix:** Launch with **`-NoFrameGen`** or set **`FRAME GENERATION: OFF`** in F1 for lowest input latency:
```powershell
powershell -ExecutionPolicy Bypass -File scripts\play-6gb.ps1 -Exe 'D:\path\to\your.exe' -NoFrameGen
```
---
## 5. DLSS or FSR 3 Frame Generation Not Working
- **Missing DLLs:** Make sure you ran the one-time download scripts from inside the repository folder:
```powershell
.\Get-NVIDIA-DLSS.cmd
.\Get-AMD-FSR.cmd
```
- **Window not focused:** Both DLSS FG and FSR 3 FG only generate interpolated frames while the game window is the active focused window.
- **RTX 20 / 30 or AMD / Intel GPU:** Use **AMD FSR 3 (`-FgType fsr`, default in `play-6gb.ps1`)** for 2X Frame Generation. Native DLSS Frame Generation (`-FgType dlss`) requires **RTX 40 / 50** plus **Hardware-Accelerated GPU Scheduling (HAGS)** enabled in *Windows Settings → System → Display → Graphics → Default graphics settings*.
- **Do not enable `MFG UNLOCKER` on RTX 20/30:** Multi-Frame Generation unlocker only applies to RTX 40/50 DLSS FG.
---
## 6. Build, Git Pull, Windows 10, & Launch Errors
### PowerShell says "running scripts is disabled on this system"
Always launch with `-ExecutionPolicy Bypass`:
```powershell
powershell -ExecutionPolicy Bypass -File scripts\play-6gb.ps1 -Exe 'D:\path\to\your.exe'
```
### `cargo build` fails with `linker 'link.exe' not found` or missing Windows SDK
1. Open **Visual Studio Installer** → **Modify** Visual Studio Build Tools.
2. Check **"Desktop development with C++"** (ensure **MSVC v143 build tools** and **Windows 10/11 SDK** are checked on the right).
3. Install, close PowerShell, open a **new** PowerShell window, and retry.
### Ran `git pull`, but nothing changed in-game
`scripts\play-6gb.ps1` only builds automatically when `target\release\victory.exe` does not exist yet. After pulling new code, always rebuild:
```powershell
git pull origin main
cargo build --release --locked -j 4 -p victory
```
### Windows 10 DX12 / Shader Model 6.6 error on startup
Run the Agility SDK helper script once and update your GPU driver:
```powershell
powershell -ExecutionPolicy Bypass -File scripts\get-d3d12.ps1
```
### C: drive running out of disk space (shader cache / saves)
Move caches, saves, settings, and logs to another drive (e.g. `D:\victory`) once, then open a new PowerShell window:
```powershell
setx VICTORY_HOME D:\victory
```
### "Game file (.exe) not found"
Wrap paths containing spaces in single quotes:
```powershell
powershell -ExecutionPolicy Bypass -File scripts\play-6gb.ps1 -Exe 'D:\My Folder\your.exe'
```
---
## 7. Shader Preloading (`-Preload`) & Pop-In in New Areas
- Every shader translated during gameplay is automatically cached on disk (`%LOCALAPPDATA%\victory\cache\shaders` or `$env:VICTORY_HOME\cache\shaders`), so areas you have already visited load cleanly on future runs.
- When entering **brand-new areas** for the first time, new shaders compile in the background (capped at 50 ms/frame by `VICTORY_PIPELINE_WAIT_MS=50` to avoid 500 ms freezes, which can briefly cause objects to pop in).
- To translate all shaders ahead of time once (~10–20 minutes on a laptop CPU, eliminates new-area pop-in; does not change steady FPS in already-cached areas):
```powershell
powershell -ExecutionPolicy Bypass -File scripts\play-6gb.ps1 -Exe 'D:\path\to\your.exe' -Preload
```
Or select **`PRELOAD SHADERS (RESTARTS THE GAME)`** in the F1 menu.
---
## 8. Collecting Logs for Bug Reports
If you hit a crash, freeze, or graphical bug, capture a log with `-LogFile` and share the last ~100 lines along with your CPU, GPU, RAM, Windows version, and a screenshot of the **`F3`** stats panel:
```powershell
powershell -ExecutionPolicy Bypass -File scripts\play-6gb.ps1 -Exe 'D:\path\to\your.exe' -LogFile D:\victory.log
```
+24 -16
View File
@@ -4,14 +4,15 @@
.EXAMPLE
powershell -ExecutionPolicy Bypass -File scripts\play-6gb.ps1 -Exe 'D:\path\to\your.exe'
.EXAMPLE
powershell -ExecutionPolicy Bypass -File scripts\play-6gb.ps1 -Exe 'D:\path\to\your.exe' -FrameGen -Output 936
powershell -ExecutionPolicy Bypass -File scripts\play-6gb.ps1 -Exe 'D:\path\to\your.exe' -NoFrameGen
#>
param(
[string]$Exe = '',
[ValidateSet('1080', '936', '720')][string]$Output = '1080',
[ValidateSet('performance', 'balanced', 'quality', 'dlaa', 'off')][string]$Dlss = 'performance',
[ValidateSet('ultraperformance', 'performance', 'balanced', 'quality', 'dlaa', 'off')][string]$Dlss = 'performance',
[ValidateRange(0, 2)][int]$DropMips = 1,
[switch]$FrameGen,
[switch]$NoFrameGen,
[ValidateSet('fsr', 'dlss', 'auto')][string]$FgType = 'fsr',
[ValidateRange(2, 6)][int]$FrameGenX = 2,
[switch]$Preload,
@@ -76,19 +77,19 @@ 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
$fgOn = if ($NoFrameGen) { $false } else { $true }
$timesWanted = $FrameGenX
$fgKind = $FgType
$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 +136,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 = '80'
# Texture streaming + 6 GB VRAM mip scale
VICTORY_TEXTURE_POOL = '1'
@@ -160,6 +164,7 @@ $settings = [ordered]@{
# Visuals (windowed by default; toggleable in F1 menu)
VICTORY_AMBIENT = '0.8'
VICTORY_AMBIENT_AIR = '1.5'
VICTORY_AMBIENT_SHADE = '0.5,0.5'
VICTORY_AMBIENT_SPECULAR = '1'
VICTORY_WATER_LIGHT = '1'
VICTORY_EARLY_DEPTH = '1'
@@ -169,10 +174,10 @@ $settings = [ordered]@{
VICTORY_PIPELINE_BOOK = '1'
VICTORY_PIPELINE_WAIT_MS = '50'
# Memory stack (SLOT_EVICT aligned above ROOM% to prevent eviction thrashing)
# Memory stack (SLOT_EVICT sits just above ROOM% so idle textures evict cleanly when roaming)
VICTORY_SLOT_EVICT = '1'
VICTORY_SLOT_EVICT_PERCENT = '92'
VICTORY_SLOT_EVICT_LOW_PERCENT = '82'
VICTORY_SLOT_EVICT_PERCENT = '88'
VICTORY_SLOT_EVICT_LOW_PERCENT = '78'
VICTORY_ALLOCATOR_TRIM = '1'
VICTORY_BUDGET_PACK = '1'
VICTORY_TEARING = '1'
@@ -193,22 +198,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) { '75' } else { '78' } } else { '86' }
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)