@echo off rem Makes every shader and every pipeline of the title ahead of play (the program's own "warm"), so that a rem session starts with nothing left to compile. ASCII only. rem rem Build-Shaders.cmd the title's executable is looked for as play looks for it rem Build-Shaders.cmd ... or given rem Build-Shaders.cmd <title exe> <options> the SAME options you give "play" (--res, --series-s, --set NAME=VALUE): rem pipelines are made for the settings a session will have rem Without options: --res 1080to1440, the settings the README's numbers are measured with. rem rem More options of the program's own (victory warm --help): rem --used only the pipelines earlier sessions drew with (a few minutes) rem --jobs N processes at once (default: every logical core) rem --verify makes nothing: asks for what was made once more and counts what came from where rem rem How long (measured on a GeForce RTX 4070 with 28 threads): about 20 minutes the first time for all rem of about 83,500 pipelines; about 12 minutes when most are already in the pipeline library; --used rem about 3 minutes. It can be stopped with Ctrl+C and started again: what is made stays made. rem rem Three things that matter: rem 1. Run it with the SAME victory.exe, in the SAME folder, that you play with. The graphics driver keeps rem its own shader cache by the program's path: the same pipelines took 11 seconds to load from the rem path they were made from and about 1,100 seconds from another. rem 2. Run it from a normal window, not as administrator (the driver then keeps its cache elsewhere). rem 3. It uses every core and up to 0.7 GB of memory a process. Close the game first. It starts no further rem process while less than about 8 GB of memory is free and stops below 3 GB (--min-free-mb). setlocal EnableExtensions DisableDelayedExpansion set "runner=%VICTORY_EXE%" if not defined runner set "runner=%~dp0target\release\victory.exe" if not exist "%runner%" set "runner=%~dp0victory.exe" if not exist "%runner%" ( echo No victory.exe found. Build it first: cargo build --release --locked -p victory 1>&2 echo ^(or set VICTORY_EXE to the one you play with^) 1>&2 exit /b 2 ) set "title=" if not "%~1"=="" ( set "first=%~1" setlocal EnableDelayedExpansion if not "!first:~0,2!"=="--" ( endlocal set "title=%~1" shift ) else ( endlocal ) ) if defined title if not exist "%title%" ( echo No such file: %title% 1>&2 exit /b 2 ) set "options=" :collect if "%~1"=="" goto :collected set "options=%options% %1" shift goto :collect :collected if not defined options set "options= --res 1080to1440" echo Making the title's shaders and pipelines ahead of play. echo program: %runner% if defined title echo title: %title% echo options:%options% echo. if defined title ( "%runner%" warm%options% "%title%" ) else ( "%runner%" warm%options% ) set "code=%errorlevel%" echo. if "%code%"=="0" (echo Done. Start the game as usual.) else (echo Ended with code %code%. Run it again to go on where it stopped.) exit /b %code%