F1 menu: clear the shader cache (#496) #629
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!629
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-629"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Luqueze on GitHub · 2026-11-28 02:03 UTC · original
Luqueze:feat/menu-clear-shader-cache→main· +168 −24 · 4 files · 1 commits · openCloses #496.
What this adds
A line in the F1 menu, CLEAR SHADER CACHE (RESTARTS THE GAME), right after PRELOAD SHADERS. It works the way PRELOAD SHADERS does:
ENTER AGAIN: SAVE, CLOSE THE GAME AND CLEAR SHADERS;VICTORY_CLEAR_SHADERS=1;shadersandpipelinesfolders before the game runs.Shaders are then made again as the game goes, or all at once with PRELOAD SHADERS. Three lines under the menu say so while the line is picked.
Deleted:
shadersandpipelines. The second holds the pipeline book, the library and the warm-up's progress, so the start really is from scratch.Kept:
images(the translated title, which is not made of shaders and takes a while to make again), settings, saves and logs. The driver's own shader cache is left to Windows' Disk Cleanup, as you said in the issue.Changes
menu.rs: the new action, withCLEAR,ABOUT_CLEAR,CONFIRM_CLEARandRESETin place of the literal3.restart(bool)becomesrestart(Then)(Play,Preload,ClearShaders), andThen::switchgives the PowerShell that sets the start's variable.play.rs:clear_shaders()andclear_shaders_in(cache), which report the MB freed. A folder that isn't there is fine. An error, for example a file still held, is reported, andvictory playstill starts the game.main.rs:victory clear-shadersdoes it by hand.victory playreadsVICTORY_CLEAR_SHADERSbeforeprepare, next toVICTORY_PRELOAD.scripts/play-foxhound.ps1: readsVICTORY_CLEAR_SHADERSand runsvictory clear-shadersfrom the repository folder (sovictory.toml'scache_dirapplies) before the preload. Its lines go to the log as# clear-shaders: ....Tested
RTX 4070 SUPER, Ryzen 7 5700X3D, Windows 11 build 26300, release build of this branch on
a4d05e7,scripts\play-nvidia.ps1, Series X profile.VICTORY_CACHE_DIRset to a throwaway folder, then F1, CLEAR SHADER CACHE, Enter, Enter. The game closed and started again, and the new log shows# clear-shaders: Shader cache cleared: 130 MB freed. Afterwardsimageswas untouched and newshaders/pipelineswere being made.victory clear-shaderson a test cache withshaders,pipelinesandimagesdeleted the first two and keptimages.victory.exealone (double click). It takes the sameclear_shaders()path inmain.rs.cargo test -p victory-gpu --lib menu: 6 passed, including the newa_restart_asks_its_start_for_what_it_was_picked_for. Every menu line still fits and has its glyphs.cargo test -p victory --bin victory: 25 passed, including the newclearing_the_shader_cache_leaves_the_translated_title.cargo xtask policy: ok.cargo clippy -p victory -p victory-gpu --all-targets: nothing in the lines changed here. The two findings in the touched files,play.rs:772andmain.rs:580, are also onmain, so-D warningsfails with or without this change.@hussainmussa on GitHub · 2026-11-28 02:12 UTC · original
One thing from testing the same idea on an RTX 4070 12 GB, which may be worth a line in the menu text.
I had built the same clear for #496 locally before seeing this (same scope:
shadersandpipelines, deleted at the next start). I did not run this branch, so this is about the behaviour after a clear, not about your code.In the first run after the clear, a character's head was not drawn for the whole session (about 10 minutes, cap and glasses floating). The log's "dropped without a host pipeline" stayed at 250-290 draws a frame with 0 being made.
The shaders the game made again were identical to the preloaded ones (2,466 files compared byte for byte), so nothing is damaged: it looks like pipelines that are not ready in that first run, as on a fresh install, and the next start has them.
A user who clears from F1 and sees that may think the clear broke the game. Saying "the first run after it may miss parts of the picture; start the game once more, or preload" in the text would cover it.
One run each, played by hand. Release build on
a4d05e7, Series X, 1440p, DLSS Quality.Written with help from Claude; everything above was built and run on my machine.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.