GPU, Shaders, UI: DXGI tearing presents, underwater shader fallback, and FG warmup guard #53

Manually merged
github merged 1 commit from gh-pr/53/head into gh-pr/53/base 2026-12-01 20:05:00 +00:00
Owner

@⁠Androtim on GitHub · 2026-11-28 15:29 UTC · original
Androtim:feat/iter67-tearing-underwater-warmup → main · +36 −0 · 2 files · 1 commits · merged 2026-11-29 02:05 UTC

Summary

Ported from trustno1-coder/VIctory-NVIDIA@8fc2254 ("Frames shown as soon as presented, underwater shader back, warm-up restart only with frame generation"):

  • Underwater shader fallback (crates/victory-shader/src/emit/mod.rs): when a wave64 compute shader fails with ShaderError::Unsupported under loops_wave, emit() retries emit_once() once without wave-wide loop branches, restoring underwater compute shader 926c46bab3b86bd6 (untranslated_shaders in 75s open-world run dropped from 2 to 1).
  • DXGI tearing support (crates/victory-gpu/src/host.rs): queries DXGI_FEATURE_PRESENT_ALLOW_TEARING (disabled with VICTORY_TEARING=0), preserves flags across ResizeBuffers, and falls back cleanly on Present error if refused.
  • Warm-up restart & F1 notice (apps/victory/src/play.rs, crates/victory-gpu/src/host/menu.rs): gates VICTORY_WARMUP_RESTART on VICTORY_FRAMEGEN=1 and shows RESTART REQUIRED TO ENABLE FRAME GENERATION when toggling Frame Gen on in a run started without it.

Rig Specs Tested On

  • CPU: Intel Core i7-13700F
  • GPU & VRAM: NVIDIA GeForce RTX 4060 Ti (8 GiB VRAM)
  • System RAM: 32 GiB
  • OS & GPU Driver: Windows 11 Build 26300, NVIDIA driver 32.0.16.2124

Run Settings & Profile

  • Build & Commit SHA: diag @ 9c8b3f7 (after verifying plain --release has zero non-system MinGW DLL imports)
  • Console Profile & Internal Resolution / Scale: series-s — 720p (0.6666667)
  • Ray Tracing: off
  • Upscaling: DLSS quality
  • Frame Generation: off
  • Launcher Command / Preset & Extra VICTORY_* Overrides: verify-world.ps1 default settings (tearing=true confirmed in stderr.log with 0 refused presents)
  • Scene / Area & Session Length: In-world pier/house scene (draws >= 500), 75s capture across 15 world windows

Measurements & Verification

  • Base FPS (without Frame Gen): 9.9 mean / 11.2 median (min 1.6, p10 6.7, max draws 11851; vs baseline 8.9 fps median)
  • Frame-Gen FPS (if enabled): N/A (off)
  • VRAM / RAM Usage: 5685.5 MB median / 5704 MB max against 6885 MB min budget (0 MB over budget, room=false 8.3%; baseline 5864 MB max)
  • Crashes / DRED Resets: 0 (no_host_texture_errors=0, untranslated_shaders=1 vs 2 on PR #52, final_waiting=2088 vs 7121 baseline, mapped_rate=33.95 ms/s, median_dropped_no_pipeline=246 vs 261.0 baseline, lit=19/24, luma=105.21, edge_energy=7.07, magenta=0.0%; all 11/11 verifier gates PASS)
  • Automated Checks:
    • cargo +1.98.1-x86_64-pc-windows-gnu run -p xtask -- policy (297 files ok)
    • cargo +1.98.1-x86_64-pc-windows-gnu test -p xtask (6 passed; 0 failed)
    • cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets -- -D warnings (0 warnings)
    • cargo +1.98.1-x86_64-pc-windows-gnu clippy -p victory-shader -p victory-gpu -p victory --features diagnostics --all-targets -- -D warnings (0 warnings)
    • cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-shader --lib wave64_tests (12 passed; 0 failed)
    • cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu --lib host::menu::tests -- --test-threads=1 (4 passed; 0 failed)
    • cargo +1.98.1-x86_64-pc-windows-gnu test -p victory --bin victory (23 passed; 0 failed)
    • cargo +1.98.1-x86_64-pc-windows-gnu build -p victory --release + objdump -p (0 non-system MinGW DLLs)
**@⁠Androtim** on GitHub · 2026-11-28 15:29 UTC · [original](https://github.com/Androtim/MiniVI/pull/53) `Androtim:feat/iter67-tearing-underwater-warmup` → `main` · +36 −0 · 2 files · 1 commits · merged 2026-11-29 02:05 UTC ## Summary Ported from `trustno1-coder/VIctory-NVIDIA@8fc2254` (*"Frames shown as soon as presented, underwater shader back, warm-up restart only with frame generation"*): - **Underwater shader fallback** (`crates/victory-shader/src/emit/mod.rs`): when a wave64 compute shader fails with `ShaderError::Unsupported` under `loops_wave`, `emit()` retries `emit_once()` once without wave-wide loop branches, restoring underwater compute shader `926c46bab3b86bd6` (`untranslated_shaders` in 75s open-world run dropped from `2` to `1`). - **DXGI tearing support** (`crates/victory-gpu/src/host.rs`): queries `DXGI_FEATURE_PRESENT_ALLOW_TEARING` (disabled with `VICTORY_TEARING=0`), preserves flags across `ResizeBuffers`, and falls back cleanly on `Present` error if refused. - **Warm-up restart & F1 notice** (`apps/victory/src/play.rs`, `crates/victory-gpu/src/host/menu.rs`): gates `VICTORY_WARMUP_RESTART` on `VICTORY_FRAMEGEN=1` and shows `RESTART REQUIRED TO ENABLE FRAME GENERATION` when toggling Frame Gen on in a run started without it. ## Rig Specs Tested On - **CPU:** Intel Core i7-13700F - **GPU & VRAM:** NVIDIA GeForce RTX 4060 Ti (8 GiB VRAM) - **System RAM:** 32 GiB - **OS & GPU Driver:** Windows 11 Build 26300, NVIDIA driver 32.0.16.2124 ## Run Settings & Profile - **Build & Commit SHA:** `diag` @ `9c8b3f7` (after verifying plain `--release` has zero non-system MinGW DLL imports) - **Console Profile & Internal Resolution / Scale:** `series-s` — 720p (`0.6666667`) - **Ray Tracing:** `off` - **Upscaling:** `DLSS quality` - **Frame Generation:** `off` - **Launcher Command / Preset & Extra `VICTORY_*` Overrides:** `verify-world.ps1` default settings (`tearing=true` confirmed in `stderr.log` with 0 refused presents) - **Scene / Area & Session Length:** In-world pier/house scene (`draws >= 500`), 75s capture across 15 world windows ## Measurements & Verification - **Base FPS (without Frame Gen):** `9.9` mean / `11.2` median (min `1.6`, p10 `6.7`, max draws `11851`; vs baseline `8.9` fps median) - **Frame-Gen FPS (if enabled):** N/A (off) - **VRAM / RAM Usage:** `5685.5 MB` median / `5704 MB` max against `6885 MB` min budget (`0 MB` over budget, `room=false` `8.3%`; baseline `5864 MB` max) - **Crashes / DRED Resets:** `0` (`no_host_texture_errors=0`, `untranslated_shaders=1` vs `2` on PR #52, `final_waiting=2088` vs `7121` baseline, `mapped_rate=33.95 ms/s`, `median_dropped_no_pipeline=246` vs `261.0` baseline, `lit=19/24`, `luma=105.21`, `edge_energy=7.07`, `magenta=0.0%`; all 11/11 verifier gates PASS) - **Automated Checks:** - [x] `cargo +1.98.1-x86_64-pc-windows-gnu run -p xtask -- policy` (`297 files ok`) - [x] `cargo +1.98.1-x86_64-pc-windows-gnu test -p xtask` (`6 passed; 0 failed`) - [x] `cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets -- -D warnings` (`0` warnings) - [x] `cargo +1.98.1-x86_64-pc-windows-gnu clippy -p victory-shader -p victory-gpu -p victory --features diagnostics --all-targets -- -D warnings` (`0` warnings) - [x] `cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-shader --lib wave64_tests` (`12 passed; 0 failed`) - [x] `cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu --lib host::menu::tests -- --test-threads=1` (`4 passed; 0 failed`) - [x] `cargo +1.98.1-x86_64-pc-windows-gnu test -p victory --bin victory` (`23 passed; 0 failed`) - [x] `cargo +1.98.1-x86_64-pc-windows-gnu build -p victory --release` + `objdump -p` (`0` non-system MinGW DLLs)
Ported from trustno1-coder/VIctory-NVIDIA@8fc2254:
- crates/victory-shader/src/emit/mod.rs: retry wave64 compute emission once without wave-wide loop branches when loops_wave fails with ShaderError::Unsupported, restoring underwater compute shader 926c46bab3b86bd6.
- crates/victory-gpu/src/host.rs: enable DXGI_FEATURE_PRESENT_ALLOW_TEARING (VICTORY_TEARING=0 disables) with runtime Present fallback so uncomposited foreground windows do not round frame times up to whole display refreshes.
- apps/victory/src/play.rs & crates/victory-gpu/src/host/menu.rs: gate automatic VICTORY_WARMUP_RESTART on VICTORY_FRAMEGEN=1 and show a restart-required notice when turning Frame Generation on in a non-Streamline-FG run.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 20:04:58 +00:00
github manually merged commit 66c776a5ed into gh-pr/53/base 2026-12-01 20:05:00 +00:00
Author
Owner

@⁠Androtim on GitHub · 2026-11-28 18:49 UTC · original · edited 2026-11-29 01:03 UTC

Automated triage for the maintainers (not an approval).

Verdict: merge-candidate · CI (check): passing

Review Summary

CI is passing and the diff is small, clean, and well-tested.

  • apps/victory/src/play.rs (prepare): Gates VICTORY_WARMUP_RESTART on s.get("VICTORY_FRAMEGEN").is_some_and(|v| v == "1"). This aligns with settings(), which sets VICTORY_FRAMEGEN=1 when Streamline frame generation is active or ready (and removes it when fg_type == "fsr"). Because warmup_mark is only created once a warm-up actually runs, a user who starts without FG and later enables it will still get the one-time warm-up on their first FG-enabled launch.
  • crates/victory-gpu/src/host/menu.rs (Menu::lines, Menu::change, the_link_is_always_right_under_the_note): Adds ABOUT_FRAMEGEN_RESTART and sets self.note to "RESTART REQUIRED TO ENABLE FRAME GENERATION" when VICTORY_MENU_FRAMEGEN (FRAMEGEN) is changed to a non-OFF value in a run where live(item) is false. Line lengths (max 53 <= COLUMNS 60) and glyph coverage are verified by the added unit assertions.

Minor Note (non-blocking)

  • The PR title and description still mention DXGI tearing (crates/victory-gpu/src/host.rs) and the underwater shader fallback (crates/victory-shader/src/emit/mod.rs), neither of which appear in the current diff against origin/main. Worth trimming the title/body before merge so the commit history stays accurate.
  • Minor cleanup opportunity: ITEMS and live() in crates/victory-gpu/src/host/menu.rs still use the literal "VICTORY_MENU_FRAMEGEN" rather than the new FRAMEGEN constant.

Generated with Antigravity CLI (agy).

**@⁠Androtim** on GitHub · 2026-11-28 18:49 UTC · [original](https://github.com/Androtim/MiniVI/pull/53#issuecomment-7244080689) · edited 2026-11-29 01:03 UTC <!-- minivi-triage v1 head=66c776a5ed2e8a10dc75c341ca4afee0a5775500 verdict=merge-candidate ci=passing at=2026-11-29T01:04:20Z --> Automated triage for the maintainers (not an approval). **Verdict:** `merge-candidate` · **CI (`check`):** `passing` ### Review Summary CI is passing and the diff is small, clean, and well-tested. - **`apps/victory/src/play.rs` (`prepare`)**: Gates `VICTORY_WARMUP_RESTART` on `s.get("VICTORY_FRAMEGEN").is_some_and(|v| v == "1")`. This aligns with `settings()`, which sets `VICTORY_FRAMEGEN=1` when Streamline frame generation is active or ready (and removes it when `fg_type == "fsr"`). Because `warmup_mark` is only created once a warm-up actually runs, a user who starts without FG and later enables it will still get the one-time warm-up on their first FG-enabled launch. - **`crates/victory-gpu/src/host/menu.rs` (`Menu::lines`, `Menu::change`, `the_link_is_always_right_under_the_note`)**: Adds `ABOUT_FRAMEGEN_RESTART` and sets `self.note` to `"RESTART REQUIRED TO ENABLE FRAME GENERATION"` when `VICTORY_MENU_FRAMEGEN` (`FRAMEGEN`) is changed to a non-OFF value in a run where `live(item)` is false. Line lengths (max 53 <= `COLUMNS` 60) and glyph coverage are verified by the added unit assertions. #### Minor Note (non-blocking) - The PR title and description still mention DXGI tearing (`crates/victory-gpu/src/host.rs`) and the underwater shader fallback (`crates/victory-shader/src/emit/mod.rs`), neither of which appear in the current diff against `origin/main`. Worth trimming the title/body before merge so the commit history stays accurate. - Minor cleanup opportunity: `ITEMS` and `live()` in `crates/victory-gpu/src/host/menu.rs` still use the literal `"VICTORY_MENU_FRAMEGEN"` rather than the new `FRAMEGEN` constant. --- _Generated with Antigravity CLI (`agy`)._
Author
Owner

@⁠Androtim on GitHub · 2026-11-29 00:25 UTC · original

Rebased onto origin/main (6e935d7 -> 66c776a):

Changes

  • Retained the non-duplicate portions not yet on main:
    • apps/victory/src/play.rs: gate automatic VICTORY_WARMUP_RESTART on VICTORY_FRAMEGEN=1 so non-FG runs do not perform an unnecessary warmup restart.
    • crates/victory-gpu/src/host/menu.rs: show ABOUT_FRAMEGEN_RESTART and "RESTART REQUIRED TO ENABLE FRAME GENERATION" when turning Frame Generation on in a run that started without it, while preserving main's Series S picture row and match_series_s logic.
  • Dropped the crates/victory-gpu/src/host.rs DXGI tearing and crates/victory-shader/src/emit/mod.rs wave-loop fallback hunks cleanly because equivalent implementations are already merged on main.

Verification (66c776a)

  • Policy & Lints: cargo run -p xtask -- policy (301 files ok), cargo test -p xtask (6 passed), clippy --workspace --all-targets -- -D warnings (0 warnings, both plain and --features diagnostics).
  • Unit & Integration Tests: victory-gpu --lib host::menu, victory (25 passed), and census (2 passed).
  • Release Build & DLL Check: plain --release (2m 11s, objdump -p confirmed Windows system DLLs only, zero non-system MinGW runtime DLLs).
**@⁠Androtim** on GitHub · 2026-11-29 00:25 UTC · [original](https://github.com/Androtim/MiniVI/pull/53#issuecomment-7248106239) Rebased onto `origin/main` (`6e935d7` -> `66c776a`): ### Changes - Retained the non-duplicate portions not yet on `main`: - `apps/victory/src/play.rs`: gate automatic `VICTORY_WARMUP_RESTART` on `VICTORY_FRAMEGEN=1` so non-FG runs do not perform an unnecessary warmup restart. - `crates/victory-gpu/src/host/menu.rs`: show `ABOUT_FRAMEGEN_RESTART` and `"RESTART REQUIRED TO ENABLE FRAME GENERATION"` when turning Frame Generation on in a run that started without it, while preserving `main`'s Series S picture row and `match_series_s` logic. - Dropped the `crates/victory-gpu/src/host.rs` DXGI tearing and `crates/victory-shader/src/emit/mod.rs` wave-loop fallback hunks cleanly because equivalent implementations are already merged on `main`. ### Verification (`66c776a`) - **Policy & Lints:** `cargo run -p xtask -- policy` (`301 files ok`), `cargo test -p xtask` (`6 passed`), `clippy --workspace --all-targets -- -D warnings` (`0` warnings, both plain and `--features diagnostics`). - **Unit & Integration Tests:** `victory-gpu --lib host::menu`, `victory` (`25 passed`), and `census` (`2 passed`). - **Release Build & DLL Check:** plain `--release` (`2m 11s`, `objdump -p` confirmed Windows system DLLs only, zero non-system MinGW runtime DLLs).
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/Androtim--MiniVI!53
No description provided.