hookshot --prepare-shaders: the shaders prepared with no game and no window #320

Closed
gab9281 wants to merge 1 commit from prepare-shaders-cli into main
gab9281 commented 2026-11-07 20:34:16 +00:00 (Migrated from github.com)

Part of splitting #83 into small PRs.

hookshot --prepare-shaders prepares every shader of the game (the list make_game.py writes, hookshot_shaders.bin) and exits. It opens no window and starts no game, so a builder can run it right after the build, with its own progress display, instead of the player waiting for it at the game's first start.

  • The output uses make_game.py's @@ lines: @@stage shaders, then @@progress, then @@done shaders (exit 0), or @@error <why> (exit 3) when there is no usable Vulkan. In that case the game prepares its shaders at its first start, as before.
  • HOOKSHOT_PREPARE_ONLY (gpu/vk/vk_main.cpp) has the back end prepare, then stop.
  • A builder that offers to skip the step leaves hookshot_prepare_skipped beside the game. While that file is there, the game's own starts skip the preparation too (each shader is built when first drawn), and the next --prepare-shaders run removes it.

Tested on Linux (game built from this branch, shader caches deleted first):

  • ./hookshot --prepare-shaders: no window while it ran, @@done shaders and exit 0 after 86 s, hookshot_prepared.bin and hookshot_programs.bin written.
  • The same with no hookshot_vk.so beside it: @@error no usable Vulkan here: the game prepares its shaders at its first start, exit 3.
  • tests/ gives the same result as on main (the 4 test_cpp_preflight checks need Visual Studio).

🤖 Generated with Claude Code

Part of splitting #83 into small PRs. `hookshot --prepare-shaders` prepares every shader of the game (the list `make_game.py` writes, `hookshot_shaders.bin`) and exits. It opens no window and starts no game, so a builder can run it right after the build, with its own progress display, instead of the player waiting for it at the game's first start. - The output uses `make_game.py`'s `@@` lines: `@@stage shaders`, then `@@progress`, then `@@done shaders` (exit 0), or `@@error <why>` (exit 3) when there is no usable Vulkan. In that case the game prepares its shaders at its first start, as before. - `HOOKSHOT_PREPARE_ONLY` (gpu/vk/vk_main.cpp) has the back end prepare, then stop. - A builder that offers to skip the step leaves `hookshot_prepare_skipped` beside the game. While that file is there, the game's own starts skip the preparation too (each shader is built when first drawn), and the next `--prepare-shaders` run removes it. **Tested on Linux** (game built from this branch, shader caches deleted first): - `./hookshot --prepare-shaders`: no window while it ran, `@@done shaders` and exit 0 after 86 s, `hookshot_prepared.bin` and `hookshot_programs.bin` written. - The same with no `hookshot_vk.so` beside it: `@@error no usable Vulkan here: the game prepares its shaders at its first start`, exit 3. - `tests/` gives the same result as on main (the 4 `test_cpp_preflight` checks need Visual Studio). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
gab9281 commented 2026-11-07 23:26:32 +00:00 (Migrated from github.com)

@NotRexed rebased on current main (9e8fb5b).

@NotRexed rebased on current main (9e8fb5b).
NotRexed commented 2026-11-07 23:46:26 +00:00 (Migrated from github.com)

Thanks! Applied to main by hand in c3459dc (you're credited as co-author there), tested in a windowed Kokiri run (no new flashes; with #345/#349/#362: 27.1 -> 30.9 fps median). Closing as merged.

Thanks! Applied to main by hand in c3459dc (you're credited as co-author there), tested in a windowed Kokiri run (no new flashes; with #345/#349/#362: 27.1 -> 30.9 fps median). Closing as merged.
Commenting is not possible because the repository is archived.
No description provided.