From 9280c597b000eed661fd98793e182fdcb640f6cd Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Wed, 12 Aug 2026 16:33:14 -0300 Subject: shaders: -Dprebuilt-shaders, so a gui build needs no Vulkan SDK glslc is the one build input that wants a tool a stock machine does not have, and it is also the input that changes least often: eight GLSL files that have outlived several rewrites of everything around them. Asking every machine that wants to run the SDL shell for shaderc is the wrong trade. The SPIR-V is now COMMITTED, under shaders/prebuilt/, and -Dprebuilt-shaders embeds that copy instead of shelling out. The default stays the honest one -- compile the shaders that are actually in the tree -- because the flag trades a dependency for a freshness problem: with it on, the .glsl sources are not build inputs at all, so editing one changes nothing. `zig build shaders` is the other half, and it is deliberately independent of -Dplatform: it recompiles every shader and writes the result back into the tracked directory, so whoever changes a shader refreshes the cache on a machine that has the compiler and commits the diff. `jj diff shaders/prebuilt` after it is the freshness check -- empty means the cache was already current. The shader list is also spelled once now (gui_shaders): the eight embeds, the eight glslc runs and the refresh step all read it, so adding a shader is a name there plus the @embedFile in gui.zig, not three edits in two places. Verified: -Dplatform=gui -Dprebuilt-shaders builds with glslc absent from PATH, and image-harness passes on that binary -- real SDL GPU pipelines built from the committed SPIR-V, 512 source pixels read back. The default gui build still runs the eight glslc steps; tty runs none. The committed bytes are identical to a fresh glslc run, and `zig build shaders` is idempotent. --- docs/design.typ | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'docs/design.typ') diff --git a/docs/design.typ b/docs/design.typ index ff013f49..bd8b767c 100644 --- a/docs/design.typ +++ b/docs/design.typ @@ -253,8 +253,12 @@ zig-tree-sitter + 26 grammars — all pinned through `zig fetch` and wired in `build.zig`. Generated during the build: `highlights.scm` → an options module; the vendored helix/zed theme sources → the generated half of the theme ring; the tracked `.zig` sources → -the web shell's read-only archive; eight GLSL shaders → SPIR-V. The tutor and -the embedded font are plain `@embedFile`s, not codegen. Debug builds are +the web shell's read-only archive; eight GLSL shaders → SPIR-V. That last one is +the only build input wanting a tool a stock machine lacks (`glslc`), so it is +also the only one whose output is committed: `zig build shaders` writes +`shaders/prebuilt/*.spv` and `-Dprebuilt-shaders` embeds that copy rather than +shelling out, which is what lets a gui build need nothing but a C toolchain. The +tutor and the embedded font are plain `@embedFile`s, not codegen. Debug builds are incremental for the seconds-loop; release builds are the product. = What is deliberately absent -- cgit v1.3