feat(settings): NVIDIA's shader cache size in Settings, with what it holds now #265

Open
Mone wants to merge 2 commits from Mone/LongshotLauncher:feat/nvidia-cache-setting into main
Contributor

The launcher never says how large NVIDIA's shader cache is, and changes it only through the home's one-time card, always to 10 GB. A player whose Windows drive is nearly full may want 4 GB instead, and one who wants more has only the control panel. This adds the setting to Settings.

Builds on #264 (Driver Default read as 1 GB): it carries that commit until #264 is merged. Review #264 first.

What changed

  • Settings › NVIDIA SHADER CACHE (Windows, an NVIDIA driver with its cache on): a size picker (4 GB, 10 GB, 100 GB, Unlimited: never under the 4 GB Longshot needs, never off), Change, and "Now 1 GB, 1.0 GB of it used" (the driver's size, and the driver's GLCache folder on the disk). The picker starts at the current size, or 10 GB when that is not one of the choices.
  • Change sets it at once where the driver lets the launcher save; otherwise the launcher starts again as an administrator for that alone (--set-nvidia-shader-cache <MB>, Windows asks), as the card does. That launcher takes only a size Settings offers (DriverSettings.CacheChoice); anything else sets nothing. A toast says the outcome, and a change clears the home's card.
  • Read on a pool thread (NVAPI loads the driver's settings; the folder can hold thousands of files).
  • New texts in every catalog.

Testing

Tested

  • dotnet build LongshotLauncher.slnx -c Release: 0 warnings, 0 errors; the app tests (tests/launcher_app) pass.
  • NvidiaCacheChecks (extended): the four choices, all at least 4 GB; their names (100 GB, Unlimited); the administrator's argument takes only those (1024, 0, -1, +10240, "10 GB", a trailing space, an overflow: refused); the cache folder from LOCALAPPDATA.
  • In the installed launcher (Windows 11, RTX 4050 Laptop, Driver Default): the row read "Now 1 GB, 1.0 GB of it used"; 4 GB picked and Change: Windows asked, accepted, the toast and "Now 4 GB"; the driver read back 4096 MB through NVAPI, and the home has nothing to offer any more. Screenshots below.

Still to test

  • Declining Windows' prompt (the toast "was not changed" and the size as it was).
  • A PC with no NVIDIA driver, and one with the cache off in the control panel (the row is hidden in both).
  • On this Windows PC the core suite stops at SavesChecks, and scripts/translations.py reports catalog texts left over: both on main as it is too, not from this change.

Screenshots follow in a comment.

The launcher never says how large NVIDIA's shader cache is, and changes it only through the home's one-time card, always to 10 GB. A player whose Windows drive is nearly full may want 4 GB instead, and one who wants more has only the control panel. This adds the setting to Settings. **Builds on #264** (Driver Default read as 1 GB): it carries that commit until #264 is merged. Review #264 first. ## What changed - **Settings › NVIDIA SHADER CACHE** (Windows, an NVIDIA driver with its cache on): a size picker (**4 GB**, **10 GB**, **100 GB**, **Unlimited**: never under the 4 GB Longshot needs, never off), **Change**, and "Now 1 GB, 1.0 GB of it used" (the driver's size, and the driver's `GLCache` folder on the disk). The picker starts at the current size, or 10 GB when that is not one of the choices. - **Change** sets it at once where the driver lets the launcher save; otherwise the launcher starts again as an administrator for that alone (`--set-nvidia-shader-cache <MB>`, Windows asks), as the card does. That launcher takes only a size Settings offers (`DriverSettings.CacheChoice`); anything else sets nothing. A toast says the outcome, and a change clears the home's card. - Read on a pool thread (NVAPI loads the driver's settings; the folder can hold thousands of files). - New texts in every catalog. ## Testing **Tested** - `dotnet build LongshotLauncher.slnx -c Release`: 0 warnings, 0 errors; the app tests (`tests/launcher_app`) pass. - `NvidiaCacheChecks` (extended): the four choices, all at least 4 GB; their names (100 GB, Unlimited); the administrator's argument takes only those (`1024`, `0`, `-1`, `+10240`, `"10 GB"`, a trailing space, an overflow: refused); the cache folder from `LOCALAPPDATA`. - In the installed launcher (Windows 11, RTX 4050 Laptop, Driver Default): the row read "Now 1 GB, 1.0 GB of it used"; 4 GB picked and **Change**: Windows asked, accepted, the toast and "Now 4 GB"; the driver read back 4096 MB through NVAPI, and the home has nothing to offer any more. Screenshots below. **Still to test** - Declining Windows' prompt (the toast "was not changed" and the size as it was). - A PC with no NVIDIA driver, and one with the cache off in the control panel (the row is hidden in both). - On this Windows PC the core suite stops at `SavesChecks`, and `scripts/translations.py` reports catalog texts left over: both on `main` as it is too, not from this change. Screenshots follow in a comment.
fix(play): NVIDIA's shader cache on its Driver Default (1 GB) is raised and offered, not taken for a driver without the setting
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Compile and test (pull_request) Blocked by required conditions
a20f2fcc9b
A player who never changed Shader Cache Size has no such setting in the driver's global profile: NvAPI_DRS_GetSetting answers
NVAPI_SETTING_NOT_FOUND (-160), which the launcher read as "this driver does not know the setting". So the 10 GB raise before
Play and builds, and the home's card that asks for an administrator, never happened for them, the most common case.

Now -160 for a setting the driver knows (NvAPI_DRS_GetSettingNameFromId names it) is its Driver Default: on for the cache,
1 GB for its size (DriverSettings.DriverDefaultCacheMb, the 1025 MB caches players' logs show). On an RTX 4050 Laptop the
cache stayed at 1025 MB, and after a rebuild the game built its 40,749 noted pipelines again before the title (~9 minutes):
the launcher now reads 1024 MB there and offers 10 GB.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
feat(settings): NVIDIA's shader cache size in Settings, with what it holds now
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Compile and test (pull_request) Blocked by required conditions
fee3193f49
The home's card raises NVIDIA's shader cache to 10 GB only when it is under 4 GB, once, and the launcher never says what the
cache is. A player whose Windows drive is nearly full may want 4 GB rather than 10; one who wants it larger has the control
panel only. Settings (Windows, with an NVIDIA driver whose cache is on) now has an NVIDIA SHADER CACHE row: its size and how
much of it is used (the driver's GLCache folder), and 4 GB, 10 GB, 100 GB or Unlimited to change it to. Never under what
Longshot needs nor off: those stay the control panel's.

Change sets it at once where the driver lets the launcher save, else starts the launcher again as an administrator
(--set-nvidia-shader-cache <MB>, Windows asks) for that alone, as the card does; that launcher takes only a size Settings
offers. A change clears the home's card.

Builds on fix/nvidia-cache-default (Driver Default read as its 1 GB).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Contributor

Screenshots (Windows 11, launcher in Italian, a local build with the other open PRs in it too). The folders' paths are blanked out.

Before, on Driver Default (1 GB, full):

Before

After picking 4 GB and Change (Windows asked first):

After

Screenshots (Windows 11, launcher in Italian, a local build with the other open PRs in it too). The folders' paths are blanked out. Before, on Driver Default (1 GB, full): ![Before](https://git.magicbean.dev/attachments/0cede568-38d5-4945-b07c-cbb5d8df3cfd) After picking 4 GB and Change (Windows asked first): ![After](https://git.magicbean.dev/attachments/ae780b9c-abe7-4960-be28-08ec99712011)
Owner

Please rebase on new launcher!

Please rebase on new launcher!
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Compile and test (pull_request) Blocked by required conditions
This pull request has changes conflicting with the target branch.
  • App/LauncherService.cs
  • App/Program.cs
  • App/ViewModels/SettingsViewModel.cs
  • App/Views/SettingsView.axaml
  • Core/DriverSettings.cs
  • Core/Lang/de.json
  • Core/Lang/es.json
  • Core/Lang/fr.json
  • Core/Lang/it.json
  • Core/Lang/ja.json
  • Core/Lang/ko.json
  • Core/Lang/nl.json
  • Core/Lang/pl.json
  • Core/Lang/pt-BR.json
  • Core/Lang/ru.json
  • Core/Lang/zh-Hans.json
  • Core/Lang/zh-Hant.json
  • tests/launcher_core/DriverSettingsChecks.cs
Some workflows are waiting to be reviewed.
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 'feat/nvidia-cache-setting:Mone-feat/nvidia-cache-setting'
git switch 'Mone-feat/nvidia-cache-setting'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
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
MagicBeanDev/LongshotLauncher!265
No description provided.