diff options
| -rw-r--r-- | Build-Shaders.cmd | 77 | ||||
| -rw-r--r-- | README.md | 7 |
2 files changed, 82 insertions, 2 deletions
diff --git a/Build-Shaders.cmd b/Build-Shaders.cmd new file mode 100644 index 0000000..568c16d --- /dev/null +++ b/Build-Shaders.cmd | |||
| @@ -0,0 +1,77 @@ | |||
| 1 | @echo off | ||
| 2 | rem Makes every shader and every pipeline of the title ahead of play (the program's own "warm"), so that a | ||
| 3 | rem session starts with nothing left to compile. ASCII only. | ||
| 4 | rem | ||
| 5 | rem Build-Shaders.cmd the title's executable is looked for as play looks for it | ||
| 6 | rem Build-Shaders.cmd <title exe> ... or given | ||
| 7 | rem Build-Shaders.cmd <title exe> <options> the SAME options you give "play" (--res, --series-s, --set NAME=VALUE): | ||
| 8 | rem pipelines are made for the settings a session will have | ||
| 9 | rem Without options: --res 1080to1440, the settings the README's numbers are measured with. | ||
| 10 | rem | ||
| 11 | rem More options of the program's own (victory warm --help): | ||
| 12 | rem --used only the pipelines earlier sessions drew with (a few minutes) | ||
| 13 | rem --jobs N processes at once (default: every logical core) | ||
| 14 | rem --verify makes nothing: asks for what was made once more and counts what came from where | ||
| 15 | rem | ||
| 16 | rem How long (measured on a GeForce RTX 4070 with 28 threads): about 20 minutes the first time for all | ||
| 17 | rem of about 83,500 pipelines; about 12 minutes when most are already in the pipeline library; --used | ||
| 18 | rem about 3 minutes. It can be stopped with Ctrl+C and started again: what is made stays made. | ||
| 19 | rem | ||
| 20 | rem Three things that matter: | ||
| 21 | rem 1. Run it with the SAME victory.exe, in the SAME folder, that you play with. The graphics driver keeps | ||
| 22 | rem its own shader cache by the program's path: the same pipelines took 11 seconds to load from the | ||
| 23 | rem path they were made from and about 1,100 seconds from another. | ||
| 24 | rem 2. Run it from a normal window, not as administrator (the driver then keeps its cache elsewhere). | ||
| 25 | rem 3. It uses every core and up to 0.7 GB of memory a process. Close the game first. It starts no further | ||
| 26 | rem process while less than about 8 GB of memory is free and stops below 3 GB (--min-free-mb). | ||
| 27 | setlocal EnableExtensions DisableDelayedExpansion | ||
| 28 | |||
| 29 | set "runner=%VICTORY_EXE%" | ||
| 30 | if not defined runner set "runner=%~dp0target\release\victory.exe" | ||
| 31 | if not exist "%runner%" set "runner=%~dp0victory.exe" | ||
| 32 | if not exist "%runner%" ( | ||
| 33 | echo No victory.exe found. Build it first: cargo build --release --locked -p victory 1>&2 | ||
| 34 | echo ^(or set VICTORY_EXE to the one you play with^) 1>&2 | ||
| 35 | exit /b 2 | ||
| 36 | ) | ||
| 37 | |||
| 38 | set "title=" | ||
| 39 | if not "%~1"=="" ( | ||
| 40 | set "first=%~1" | ||
| 41 | setlocal EnableDelayedExpansion | ||
| 42 | if not "!first:~0,2!"=="--" ( | ||
| 43 | endlocal | ||
| 44 | set "title=%~1" | ||
| 45 | shift | ||
| 46 | ) else ( | ||
| 47 | endlocal | ||
| 48 | ) | ||
| 49 | ) | ||
| 50 | if defined title if not exist "%title%" ( | ||
| 51 | echo No such file: %title% 1>&2 | ||
| 52 | exit /b 2 | ||
| 53 | ) | ||
| 54 | |||
| 55 | set "options=" | ||
| 56 | :collect | ||
| 57 | if "%~1"=="" goto :collected | ||
| 58 | set "options=%options% %1" | ||
| 59 | shift | ||
| 60 | goto :collect | ||
| 61 | :collected | ||
| 62 | if not defined options set "options= --res 1080to1440" | ||
| 63 | |||
| 64 | echo Making the title's shaders and pipelines ahead of play. | ||
| 65 | echo program: %runner% | ||
| 66 | if defined title echo title: %title% | ||
| 67 | echo options:%options% | ||
| 68 | echo. | ||
| 69 | if defined title ( | ||
| 70 | "%runner%" warm%options% "%title%" | ||
| 71 | ) else ( | ||
| 72 | "%runner%" warm%options% | ||
| 73 | ) | ||
| 74 | set "code=%errorlevel%" | ||
| 75 | echo. | ||
| 76 | 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.) | ||
| 77 | exit /b %code% | ||
| @@ -48,8 +48,11 @@ contributors. Thank you. | |||
| 48 | counts are about as slow a little over the budget as far over it, so that alone is not the | 48 | counts are about as slow a little over the budget as far over it, so that alone is not the |
| 49 | cause. Not known yet what is; the same kind of frame replayed offline takes about 80 ms. | 49 | cause. Not known yet what is; the same kind of frame replayed offline takes about 80 ms. |
| 50 | `play --set VICTORY_RT_NATIVE=0` plays with the old path. | 50 | `play --set VICTORY_RT_NATIVE=0` plays with the old path. |
| 51 | - The first start after this update translates the shaders again (`victory warm` does it | 51 | - The first start after this update translates the shaders again. `Build-Shaders.cmd` (in this |
| 52 | ahead: about 12 minutes here from a filled pipeline library). | 52 | folder; it runs `victory warm` with the options you play with) makes every shader and pipeline |
| 53 | ahead: about 20 minutes the first time for all of about 83,500, about 12 minutes here from a | ||
| 54 | filled pipeline library, a few minutes with `--used`. Run it with the same `victory.exe`, in | ||
| 55 | the same folder, that you play with: the graphics driver keeps its cache by the program's path. | ||
| 53 | - *The title's memory on the card.* The copies of title memory that draws read take card memory | 56 | - *The title's memory on the card.* The copies of title memory that draws read take card memory |
| 54 | only for the 64 KiB pieces in use and are sent from the title's memory without a second copy in | 57 | only for the 64 KiB pieces in use and are sent from the title's memory without a second copy in |
| 55 | RAM (`VICTORY_WINDOWS_SPARSE`, `VICTORY_WINDOWS_DIRECT`, both on; `=0` turns each off): what the | 58 | RAM (`VICTORY_WINDOWS_SPARSE`, `VICTORY_WINDOWS_DIRECT`, both on; `=0` turns each off): what the |