F1 menu: CLEAR SHADERS removes the preloaded shader caches (#496) #607

Open
github-bot wants to merge 3 commits from github-bot/gh-607 into main AGit
Owner

@⁠bekandev on GitHub · 2026-11-28 01:50 UTC · original
bekandev:feat/f1-clear-shader-cache-v2 → main · +343 −29 · 8 files · 3 commits · open

Closes #496.

F1 menu: CLEAR SHADERS (RESTARTS THE GAME), right after PRELOAD SHADERS. It asks for a second Enter like PRELOAD does, then saves and restarts through the menu's restart path with VICTORY_CLEAR_SHADERS=1 for that one start. Before the caches open, the start removes only the shader cache folder (cache_subdir("shaders")) and its sibling pipelines. Settings, saves, logs, images and NVIDIA/AMD files stay. It logs the files and bytes removed to the play log. A missing folder is not an error.

Safety:

  • Only those two fixed folders one level under the cache dir can go; the cache is still checked to be outside a source tree. A link in place of either folder is removed as a link (what it points at stays), and a clear creates no folders.
  • One start only: the variable is read before prepare and never kept. A --set or saved VICTORY_CLEAR_SHADERS/VICTORY_PRELOAD doesn't reach the environment or a menu restart (restart_args), so restarts that keep their options (#197) don't clear again.
  • Clearing always runs before a preload (victory play --preload, victory preload, and play-foxhound.ps1 -Preload), so a fresh preload isn't wiped.
  • The help text and README say the clear also forgets the pipelines earlier runs recorded (known-pipelines.bin/known-shaders.bin), so a preload right after only translates shaders until play records them again.

Tests: crates/victory-core/src/config.rs has 5 tests: deletion scope, missing folders, no folders created, links, source-tree refusal. apps/victory/src/play.rs has a_clear_or_a_preload_is_not_a_setting. The menu layout tests cover the new item order (CLEAR=3, RESET=4, EXPORT=5, IMPORT=6).

Checked on Windows (GitHub windows-latest, my fork): cargo build --workspace --locked --all-targets is ok. cargo test --workspace --locked: victory-core 18 passed, victory 25 passed, menu tests ok. victory-gpu is 440 passed, 3 failed: indirect::tests::host_list_budget_starts_empty_at_each_submission, indirect::tests::warp_batch_charges_every_execution and pipeline::host::tests::depth_bounds_pipeline_loads_and_filters_draws. The same 3 fail on main a4d05e7 with the same workflow, so they're not from this change. Clippy with -D warnings stops on lints that are already on main (about 40, in victory-gpu and victory-loader, none in files this touches). The second commit fixes the one in victory-formats/src/texture.rs:1346 so that crate passes; drop it if you prefer.

**@⁠bekandev** on GitHub · 2026-11-28 01:50 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/607) `bekandev:feat/f1-clear-shader-cache-v2` → `main` · +343 −29 · 8 files · 3 commits · open Closes #496. **F1 menu: CLEAR SHADERS (RESTARTS THE GAME)**, right after PRELOAD SHADERS. It asks for a second Enter like PRELOAD does, then saves and restarts through the menu's restart path with `VICTORY_CLEAR_SHADERS=1` for that one start. Before the caches open, the start removes only the shader cache folder (`cache_subdir("shaders")`) and its sibling `pipelines`. Settings, saves, logs, images and NVIDIA/AMD files stay. It logs the files and bytes removed to the play log. A missing folder is not an error. Safety: - Only those two fixed folders one level under the cache dir can go; the cache is still checked to be outside a source tree. A link in place of either folder is removed as a link (what it points at stays), and a clear creates no folders. - One start only: the variable is read before `prepare` and never kept. A `--set` or saved `VICTORY_CLEAR_SHADERS`/`VICTORY_PRELOAD` doesn't reach the environment or a menu restart (`restart_args`), so restarts that keep their options (#197) don't clear again. - Clearing always runs before a preload (`victory play --preload`, `victory preload`, and `play-foxhound.ps1 -Preload`), so a fresh preload isn't wiped. - The help text and README say the clear also forgets the pipelines earlier runs recorded (`known-pipelines.bin`/`known-shaders.bin`), so a preload right after only translates shaders until play records them again. Tests: `crates/victory-core/src/config.rs` has 5 tests: deletion scope, missing folders, no folders created, links, source-tree refusal. `apps/victory/src/play.rs` has `a_clear_or_a_preload_is_not_a_setting`. The menu layout tests cover the new item order (CLEAR=3, RESET=4, EXPORT=5, IMPORT=6). Checked on Windows (GitHub `windows-latest`, my fork): `cargo build --workspace --locked --all-targets` is ok. `cargo test --workspace --locked`: victory-core 18 passed, victory 25 passed, menu tests ok. victory-gpu is 440 passed, 3 failed: `indirect::tests::host_list_budget_starts_empty_at_each_submission`, `indirect::tests::warp_batch_charges_every_execution` and `pipeline::host::tests::depth_bounds_pipeline_loads_and_filters_draws`. The same 3 fail on main a4d05e7 with the same workflow, so they're not from this change. Clippy with `-D warnings` stops on lints that are already on main (about 40, in victory-gpu and victory-loader, none in files this touches). The second commit fixes the one in `victory-formats/src/texture.rs:1346` so that crate passes; drop it if you prefer.
CLEAR SHADERS asks for a second Enter like PRELOAD SHADERS, saves and
restarts through the menu's restart path with VICTORY_CLEAR_SHADERS=1 for
that one start. victory play/run remove only the shaders cache folder and
its sibling pipelines folder before the caches open, log the files and
bytes removed, and drop the variable so later restarts keep the caches.
Upstream main CI fails on this lint; the parentheses keep the same
evaluation order.
A --set or saved VICTORY_CLEAR_SHADERS/VICTORY_PRELOAD no longer reaches the
environment or a menu restart; victory preload and the script clear before
precompiling. A linked cache folder is removed as a link, a clear creates no
folders, and the help text says the recorded pipelines go too.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 01:51:57 +00:00
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

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

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-607'
git switch 'github-bot/gh-607'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-607'
git switch 'github-bot/gh-607'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-607'
git switch 'main'
git merge --squash 'github-bot/gh-607'
git switch 'main'
git merge --ff-only 'github-bot/gh-607'
git switch 'main'
git merge 'github-bot/gh-607'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.