Add native Graphics settings alongside F1 #1382

Open
github-bot wants to merge 1 commit from github-bot/gh-1382 into main AGit
Owner

@⁠AwkGrep256 on GitHub · 2026-11-28 18:26 UTC · original
AwkGrep256:native-graphics-shared-settings → main · +3667 −2256 · 17 files · 1 commits · open

🎮 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.

**@⁠AwkGrep256** on GitHub · 2026-11-28 18:26 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1382) `AwkGrep256:native-graphics-shared-settings` → `main` · +3667 −2256 · 17 files · 1 commits · open # 🎮 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://git.gtahub.st/github/trustno1-coder--VIctory-NVIDIA/pulls/1981) and the [native Graphics design notes](https://github.com/trustno1-coder/VIctory-NVIDIA/blob/main/docs/native-graphics-proposal.md).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 18:29:16 +00:00
Author
Owner

@⁠AwkGrep256 on GitHub · 2026-11-28 22:17 UTC · original · edited 2026-11-28 22:20 UTC

@⁠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.

**@⁠AwkGrep256** on GitHub · 2026-11-28 22:17 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1382#issuecomment-7246634353) · edited 2026-11-28 22:20 UTC @⁠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.
github-bot force-pushed github-bot/gh-1382 from fade6e7604 to a013d46303 2026-11-29 12:38:15 +00:00 Compare
Author
Owner

@⁠AwkGrep256 on GitHub · 2026-11-29 12:40 UTC · original

@⁠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.

**@⁠AwkGrep256** on GitHub · 2026-11-29 12:40 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1382#issuecomment-7255976773) @⁠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.
Author
Owner

@⁠spook40 on GitHub · 2026-11-29 13:02 UTC · original

@⁠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.

**@⁠spook40** on GitHub · 2026-11-29 13:02 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1382#issuecomment-7256239447) > @⁠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.
Author
Owner

@⁠AwkGrep256 on GitHub · 2026-11-29 13:04 UTC · original

@⁠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** on GitHub · 2026-11-29 13:04 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1382#issuecomment-7256263242) > > @⁠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!
Author
Owner

@⁠AwkGrep256 on GitHub · 2026-11-29 21:25 UTC · original

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.
**@⁠AwkGrep256** on GitHub · 2026-11-29 21:25 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1382#issuecomment-7262860608) ## 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.
github-bot force-pushed github-bot/gh-1382 from 85a6c0be4e to 317bf7d583 2026-11-30 20:24:45 +00:00 Compare
github-bot force-pushed github-bot/gh-1382 from 317bf7d583 to 52f5bc6eeb 2026-11-30 20:30:23 +00:00 Compare
github-bot force-pushed github-bot/gh-1382 from 8df227c9cb to b9e149a832 2026-12-01 13:44:01 +00:00 Compare
github-bot force-pushed github-bot/gh-1382 from b9e149a832 to 6b6f56ba32 2026-12-01 14:22:41 +00:00 Compare
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/host.rs
  • crates/victory-gpu/src/host/menu.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1382/head:github-bot/gh-1382'
git switch 'github-bot/gh-1382'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1382'
git switch 'github-bot/gh-1382'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1382'
git switch 'github-bot/gh-1382'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1382'
git switch 'main'
git merge --squash 'github-bot/gh-1382'
git switch 'main'
git merge --ff-only 'github-bot/gh-1382'
git switch 'main'
git merge 'github-bot/gh-1382'
git push origin 'main'
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/trustno1-coder--VIctory-NVIDIA!1382
No description provided.