Add native Graphics settings alongside F1 #1382

Open
AwkGrep256 wants to merge 1 commit from upstream-pr/1382 into main
AwkGrep256 commented 2026-11-28 18:26:58 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by AwkGrep256 on 2026-11-28T18:26:58Z.


🎮 Shared typed Graphics settings foundation

PR #1382 carries the typed settings and stock Graphics research that PR #1981 can use for the game's own Settings menu.

The F1 menu and the native menu need one source of truth for stored values, labels, ordering, defaults, and dependencies. This PR keeps those rules in idiomatic Rust types and leaves each UI to provide its own adapter.

🦀 What this PR provides

  • Choice and Opt for saved values and labels shared by both menus.
  • GraphicsChoice, Requirement, and restart_choices! for declarative graphics rows.
  • Console profile, Series X picture, Series S render resolution, upscaler, DLSS quality, Frame Generation provider, Frame Generation multiplier, and the other typed graphics rows.
  • Stock Graphics names, descriptions, subsection headings, and catalogue data.
  • The driver-aware DLSS Frame Generation multiplier limit.
  • Safe loader primitives for verified code writes and near call or tail-jump redirects.

🧩 Native row abstractions

The core settings module covers more than fieldless choices. Each native row type can use the same metadata and validation while its owning UI supplies the callback and presentation:

pub struct Opt<C> {
    pub value: C,
    pub stored: &'static str,
    pub label: &'static str,
}

pub struct ChoiceSetting<C: Choice>(PhantomData<C>);
pub struct ToggleSetting { /* key, name, on, off */ }
pub struct RangeSetting { /* key, name, min, max, step, default */ }
pub struct InfoSetting { /* read-only title and description */ }
pub struct ActionSetting { /* action token, title, help */ }

pub trait DynamicChoice {
    type Value: Clone + Eq;
    fn choices(&self) -> Vec<DynamicOption<Self::Value>>;
}

Ordered native sections use typed registration entries:

pub enum SettingRef {
    Choice(Text),
    Toggle(Text),
    Range(Text),
    Action(Text),
    Info(Text),
}

pub struct SettingGroup {
    name: Text,
    settings: &'static [SettingRef],
}

A graphics choice is declared once and can be adapted by F1 or the native menu:

restart_choices! {
    #[depends_on(Requirement::DlssUpscaler)]
    DlssQuality {
        key: DLSS,
        name: ("victory_dlss_quality", "DLSS quality"),

        #[default]
        Quality => ("quality", "QUALITY"),
        Balanced => ("balanced", "BALANCED"),
        Performance => ("performance", "PERFORMANCE"),
        UltraPerformance => ("ultraperformance", "ULTRA PERFORMANCE"),
        Dlaa => ("dlaa", "DLAA (NATIVE)"),
        Off => ("off", "OFF"),
    }
}

🏷️ Stock Graphics research

The stock catalogue carries the row names, descriptions, missing subsection headings, and nameless-row mappings gathered from the retail menu. Stock setters remain read-only until their save and reset behavior is verified.

🧱 Safe loader writing

The reusable code writer validates the image range, restores page protection, flushes the instruction cache, and reports cleanup failures. Redirects read only their verified five-byte site before installing a near stub.

🔌 What PR #1981 owns

PR #1981 owns the native tab registration, text-lookup hook, site writer, PC display and runtime lifecycle, pending save and revert flow, and hook-specific integration.

This branch does not discover or mutate the title's text map. It does not scan DirectStorage reads, mapped memory, or executable sections. It does not add a second native-menu hook path, duplicate site writer, or PC-specific display callback layer.

🤝 Integration contract

PR #1981 consumes the typed declarations and stock label research. Its native-menu adapters translate those declarations into the game's widgets, while its runtime keeps the live Frame Generation lifecycle and PC display behavior. Both menus use the same saved values and dependency rules.

🧪 Validation

  • Typed choices, toggles, ranges, dynamic choices, setting groups, dependencies, and stock labels have focused tests.
  • Safe code-write refusal cases and redirect encoding have focused tests.
  • The combined native menu still needs the in-game validation owned by PR #1981.

Related work is tracked in PR #1981 and the native Graphics design notes.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5543301712 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1382). Originally posted by [AwkGrep256](https://github.com/AwkGrep256) on 2026-11-28T18:26:58Z. --- # 🎮 Shared typed Graphics settings foundation PR #1382 carries the typed settings and stock Graphics research that PR #1981 can use for the game's own Settings menu. The F1 menu and the native menu need one source of truth for stored values, labels, ordering, defaults, and dependencies. This PR keeps those rules in idiomatic Rust types and leaves each UI to provide its own adapter. ## 🦀 What this PR provides - `Choice` and `Opt` for saved values and labels shared by both menus. - `GraphicsChoice`, `Requirement`, and `restart_choices!` for declarative graphics rows. - Console profile, Series X picture, Series S render resolution, upscaler, DLSS quality, Frame Generation provider, Frame Generation multiplier, and the other typed graphics rows. - Stock Graphics names, descriptions, subsection headings, and catalogue data. - The driver-aware DLSS Frame Generation multiplier limit. - Safe loader primitives for verified code writes and near call or tail-jump redirects. ## 🧩 Native row abstractions The core settings module covers more than fieldless choices. Each native row type can use the same metadata and validation while its owning UI supplies the callback and presentation: ```rust pub struct Opt<C> { pub value: C, pub stored: &'static str, pub label: &'static str, } pub struct ChoiceSetting<C: Choice>(PhantomData<C>); pub struct ToggleSetting { /* key, name, on, off */ } pub struct RangeSetting { /* key, name, min, max, step, default */ } pub struct InfoSetting { /* read-only title and description */ } pub struct ActionSetting { /* action token, title, help */ } pub trait DynamicChoice { type Value: Clone + Eq; fn choices(&self) -> Vec<DynamicOption<Self::Value>>; } ``` Ordered native sections use typed registration entries: ```rust pub enum SettingRef { Choice(Text), Toggle(Text), Range(Text), Action(Text), Info(Text), } pub struct SettingGroup { name: Text, settings: &'static [SettingRef], } ``` A graphics choice is declared once and can be adapted by F1 or the native menu: ```rust restart_choices! { #[depends_on(Requirement::DlssUpscaler)] DlssQuality { key: DLSS, name: ("victory_dlss_quality", "DLSS quality"), #[default] Quality => ("quality", "QUALITY"), Balanced => ("balanced", "BALANCED"), Performance => ("performance", "PERFORMANCE"), UltraPerformance => ("ultraperformance", "ULTRA PERFORMANCE"), Dlaa => ("dlaa", "DLAA (NATIVE)"), Off => ("off", "OFF"), } } ``` ## 🏷️ Stock Graphics research The stock catalogue carries the row names, descriptions, missing subsection headings, and nameless-row mappings gathered from the retail menu. Stock setters remain read-only until their save and reset behavior is verified. ## 🧱 Safe loader writing The reusable code writer validates the image range, restores page protection, flushes the instruction cache, and reports cleanup failures. Redirects read only their verified five-byte site before installing a near stub. ## 🔌 What PR #1981 owns PR #1981 owns the native tab registration, text-lookup hook, site writer, PC display and runtime lifecycle, pending save and revert flow, and hook-specific integration. This branch does not discover or mutate the title's text map. It does not scan DirectStorage reads, mapped memory, or executable sections. It does not add a second native-menu hook path, duplicate site writer, or PC-specific display callback layer. ## 🤝 Integration contract PR #1981 consumes the typed declarations and stock label research. Its native-menu adapters translate those declarations into the game's widgets, while its runtime keeps the live Frame Generation lifecycle and PC display behavior. Both menus use the same saved values and dependency rules. ## 🧪 Validation - Typed choices, toggles, ranges, dynamic choices, setting groups, dependencies, and stock labels have focused tests. - Safe code-write refusal cases and redirect encoding have focused tests. - The combined native menu still needs the in-game validation owned by PR #1981. Related work is tracked in [PR #1981](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1981) and the [native Graphics design notes](https://github.com/trustno1-coder/VIctory-NVIDIA/blob/main/docs/native-graphics-proposal.md).
AwkGrep256 commented 2026-11-28 22:17:41 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by AwkGrep256 on 2026-11-28T22:17:41Z.


@trustno1-coder Could you review the typed Choice approach before I push the follow-up?

🎮 Latest 4K test

Check Result
Stock and custom controls together 77 stock rows and seven VIctory controls loaded
Stock subsection headings Display and Advanced now show
Multiplier without reopening Graphics DLSS reached 5×. FSR 3 wrapped between Off and 2×.

🦀 Adding a dependent choice

The macro generates the Choice implementation and the F1 option table from one declaration.

restart_choices! {
    #[depends_on(Requirement::DlssUpscaler)]
    DlssQuality {
        key: DLSS, name: ("victory_dlss_quality", "DLSS quality"),
        #[default] Quality => ("quality", "QUALITY"),
        Balanced => ("balanced", "BALANCED"),
        Performance => ("performance", "PERFORMANCE"),
        Dlaa => ("dlaa", "DLAA (NATIVE)"),
        Off => ("off", "OFF"),
    }
}

// In the Display row list
ListSetting::of::<DlssQuality>()

🧪 Retest

  1. Open Settings → Graphics in the combined 4K build.
  2. Select DLSS and step past 2× without leaving the tab.
  3. Switch to FSR 3 and check wrapping in both directions.

█████░ 5 of 6 in-game checks confirmed on the previous build. The local refactor passed 47 focused tests.

Important

The typed-choice refactor is still local and needs an in-game retest. Stock confirm, save, and reset still need verification on a copied profile.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7246634353 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1382#issuecomment-7246634353). Originally posted by [AwkGrep256](https://github.com/AwkGrep256) on 2026-11-28T22:17:41Z. --- @trustno1-coder Could you review the typed `Choice` approach before I push the follow-up? ### 🎮 Latest 4K test | Check | Result | | --- | --- | | Stock and custom controls together | 77 stock rows and seven VIctory controls loaded | | Stock subsection headings | **Display** and **Advanced** now show | | Multiplier without reopening Graphics | DLSS reached **5×**. FSR 3 wrapped between **Off** and **2×**. | ### 🦀 Adding a dependent choice The macro generates the `Choice` implementation and the F1 option table from one declaration. ```rust restart_choices! { #[depends_on(Requirement::DlssUpscaler)] DlssQuality { key: DLSS, name: ("victory_dlss_quality", "DLSS quality"), #[default] Quality => ("quality", "QUALITY"), Balanced => ("balanced", "BALANCED"), Performance => ("performance", "PERFORMANCE"), Dlaa => ("dlaa", "DLAA (NATIVE)"), Off => ("off", "OFF"), } } // In the Display row list ListSetting::of::<DlssQuality>() ``` ### 🧪 Retest 1. Open **Settings → Graphics** in the combined 4K build. 2. Select **DLSS** and step past **2×** without leaving the tab. 3. Switch to **FSR 3** and check wrapping in both directions. `█████░` **5 of 6 in-game checks confirmed** on the previous build. The local refactor passed **47 focused tests**. > [!IMPORTANT] > The typed-choice refactor is still local and needs an in-game retest. Stock confirm, save, and reset still need verification on a copied profile.
spook40 commented 2026-11-29 01:37:20 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by spook40 on 2026-11-29T01:37:20Z.


Findings on 8 GB RTX 3060 Ti (1080to1440, 60 fps) — Issue #1382

  • Root cause in draw.rs: When the texture pool hits no room, indexed texture slots without an existing host copy are deferred with Told::Held(frame + most) and capped at 1,024 refused per pass, leaving newly requested ground/prop textures reading null/black while over budget.
  • Test bypassing !room deferral: Allowing those slots to upload even under no room restored the missing porch, ground, and environment textures near Sunrise RV Park, confirming the black rendering came from upload deferral rather than unmapped slots or depth planes.
  • VRAM / performance trade-off: Unconditionally bypassing !room on an 8 GB card pushed the pool to 148 blocks (9,472 MB) (11,676 MB in use vs. 6,313 MB line) and dropped performance to ~1.9 fps (~530 ms/frame) due to shared-memory spillover—so a bounded per-pass allowance or priority eviction when !room is needed rather than a blanket bypass.

Follow-up on main (f9dfb76) — 8 GB RTX 3060 Ti (1080to1440, 60 fps)

  • Default first-upload allowance (128 MB): Heavy over-line admission (4,184 in 5s) pushed system memory load to 94% and crashed during shader/pipeline compilation.
  • Lower allowances (64 MB / 32 MB): Prevented the crash and kept core scene textures visible, but once texture copies reached the ceiling (~5.5–6.15 GB in texture copies, ~8.3–9.3 GB in use), remaining first uploads were refused (11,801–17,538 at the texture-copy ceiling), leaving some bushes/props untextured at ~6.6–8.8 fps (~113–160 ms/frame).
<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7248904418 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1382#issuecomment-7248904418). Originally posted by [spook40](https://github.com/spook40) on 2026-11-29T01:37:20Z. --- ### Findings on 8 GB RTX 3060 Ti (`1080to1440`, `60 fps`) — Issue #1382 - **Root cause in `draw.rs`:** When the texture pool hits `no room`, indexed texture slots without an existing host copy are deferred with `Told::Held(frame + most)` and capped at `1,024` refused per pass, leaving newly requested ground/prop textures reading null/black while over budget. - **Test bypassing `!room` deferral:** Allowing those slots to upload even under `no room` restored the missing porch, ground, and environment textures near Sunrise RV Park, confirming the black rendering came from upload deferral rather than unmapped slots or depth planes. - **VRAM / performance trade-off:** Unconditionally bypassing `!room` on an 8 GB card pushed the pool to **148 blocks (9,472 MB)** (`11,676 MB` in use vs. `6,313 MB` line) and dropped performance to **~1.9 fps (~530 ms/frame)** due to shared-memory spillover—so a bounded per-pass allowance or priority eviction when `!room` is needed rather than a blanket bypass. ### Follow-up on `main` (`f9dfb76`) — 8 GB RTX 3060 Ti (`1080to1440`, `60 fps`) - **Default first-upload allowance (`128 MB`):** Heavy over-line admission (`4,184` in 5s) pushed system memory load to **94%** and crashed during shader/pipeline compilation. - **Lower allowances (`64 MB` / `32 MB`):** Prevented the crash and kept core scene textures visible, but once texture copies reached the ceiling (`~5.5–6.15 GB` in texture copies, `~8.3–9.3 GB` in use), remaining first uploads were refused (`11,801–17,538` at the texture-copy ceiling), leaving some bushes/props untextured at **~6.6–8.8 fps** (~113–160 ms/frame).
AwkGrep256 commented 2026-11-29 12:40:02 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by AwkGrep256 on 2026-11-29T12:40:02Z.


@spook40 I'm not really seeing how this is related to #1382. This PR is focused on the native Graphics menu and sharing settings with F1. It doesn't touch draw.rs or any of the texture streaming, allocation, or VRAM management code you're describing.

I'm not dismissing the issue, but I don't think it's fair to attribute it to this PR without showing what change here could be causing it.

If you've found a specific connection, feel free to point it out. Otherwise, I think this is probably better tracked as a separate issue so it doesn't hold up unrelated work.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7255976773 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1382#issuecomment-7255976773). Originally posted by [AwkGrep256](https://github.com/AwkGrep256) on 2026-11-29T12:40:02Z. --- @spook40 I'm not really seeing how this is related to #1382. This PR is focused on the native Graphics menu and sharing settings with F1. It doesn't touch `draw.rs` or any of the texture streaming, allocation, or VRAM management code you're describing. I'm not dismissing the issue, but I don't think it's fair to attribute it to this PR without showing what change here could be causing it. If you've found a specific connection, feel free to point it out. Otherwise, I think this is probably better tracked as a separate issue so it doesn't hold up unrelated work.
spook40 commented 2026-11-29 13:02:05 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by spook40 on 2026-11-29T13:02:05Z.


@spook40 I'm not really seeing how this is related to #1382. This PR is focused on the native Graphics menu and sharing settings with F1. It doesn't touch draw.rs or any of the texture streaming, allocation, or VRAM management code you're describing.

I'm not dismissing the issue, but I don't think it's fair to attribute it to this PR without showing what change here could be causing it.

If you've found a specific connection, feel free to point it out. Otherwise, I think this is probably better tracked as a separate issue so it doesn't hold up unrelated work.

My mistake; I mixed up the number and posted this on the wrong thread. Didn't mean to attribute this to your PR; I'll move it over to its own issue so it's out of your way.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7256239447 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1382#issuecomment-7256239447). Originally posted by [spook40](https://github.com/spook40) on 2026-11-29T13:02:05Z. --- > @spook40 I'm not really seeing how this is related to #1382. This PR is focused on the native Graphics menu and sharing settings with F1. It doesn't touch `draw.rs` or any of the texture streaming, allocation, or VRAM management code you're describing. > > I'm not dismissing the issue, but I don't think it's fair to attribute it to this PR without showing what change here could be causing it. > > If you've found a specific connection, feel free to point it out. Otherwise, I think this is probably better tracked as a separate issue so it doesn't hold up unrelated work. My mistake; I mixed up the number and posted this on the wrong thread. Didn't mean to attribute this to your PR; I'll move it over to its own issue so it's out of your way.
AwkGrep256 commented 2026-11-29 13:04:00 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by AwkGrep256 on 2026-11-29T13:04:00Z.


@spook40 I'm not really seeing how this is related to #1382. This PR is focused on the native Graphics menu and sharing settings with F1. It doesn't touch draw.rs or any of the texture streaming, allocation, or VRAM management code you're describing.
I'm not dismissing the issue, but I don't think it's fair to attribute it to this PR without showing what change here could be causing it.
If you've found a specific connection, feel free to point it out. Otherwise, I think this is probably better tracked as a separate issue so it doesn't hold up unrelated work.

My mistake; I mixed up the number and posted this on the wrong thread. Didn't mean to attribute this to your PR; I'll move it over to its own issue so it's out of your way.

Thank you!

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7256263242 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1382#issuecomment-7256263242). Originally posted by [AwkGrep256](https://github.com/AwkGrep256) on 2026-11-29T13:04:00Z. --- > > @spook40 I'm not really seeing how this is related to #1382. This PR is focused on the native Graphics menu and sharing settings with F1. It doesn't touch `draw.rs` or any of the texture streaming, allocation, or VRAM management code you're describing. > > I'm not dismissing the issue, but I don't think it's fair to attribute it to this PR without showing what change here could be causing it. > > If you've found a specific connection, feel free to point it out. Otherwise, I think this is probably better tracked as a separate issue so it doesn't hold up unrelated work. > > My mistake; I mixed up the number and posted this on the wrong thread. Didn't mean to attribute this to your PR; I'll move it over to its own issue so it's out of your way. Thank you!
AwkGrep256 commented 2026-11-29 21:25:13 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by AwkGrep256 on 2026-11-29T21:25:13Z.


Summary

  • Add typed graphics setting abstractions shared by the native Graphics menu and F1.
  • Add runtime DynamicChoice support for connected display options.
  • Add Windows display-output enumeration through EnumDisplayDevicesW.
  • Add regression coverage for dynamic choices and restored Series S values.
  • Update the native Graphics proposal with the setting model, monitor work, verification checklist, and remaining Monitor setter work.
  • Fix diagnostics build issues in GPU memory and host submission tracing.

Validation

  • cargo check -p victory --features diagnostics --locked
  • Diagnostics release build completed successfully.
  • Focused setting and graphics tests pass.
<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7262860608 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1382#issuecomment-7262860608). Originally posted by [AwkGrep256](https://github.com/AwkGrep256) on 2026-11-29T21:25:13Z. --- ## Summary - Add typed graphics setting abstractions shared by the native Graphics menu and F1. - Add runtime `DynamicChoice` support for connected display options. - Add Windows display-output enumeration through `EnumDisplayDevicesW`. - Add regression coverage for dynamic choices and restored Series S values. - Update the native Graphics proposal with the setting model, monitor work, verification checklist, and remaining Monitor setter work. - Fix diagnostics build issues in GPU memory and host submission tracing. ## Validation - `cargo check -p victory --features diagnostics --locked` - Diagnostics release build completed successfully. - Focused setting and graphics tests pass.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/1382:upstream-pr/1382'
git switch 'upstream-pr/1382'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/1382'
git switch 'upstream-pr/1382'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1382'
git switch 'upstream-pr/1382'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1382'
git switch 'main'
git merge --squash 'upstream-pr/1382'
git switch 'main'
git merge --ff-only 'upstream-pr/1382'
git switch 'main'
git merge 'upstream-pr/1382'
git push origin 'main'
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
trustno1-coder/VIctory-NVIDIA!1382
No description provided.