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. --- test/snapshots/fsearch.golden | 35 ++--------------------------------- 1 file changed, 2 insertions(+), 33 deletions(-) (limited to 'test/snapshots/fsearch.golden') diff --git a/test/snapshots/fsearch.golden b/test/snapshots/fsearch.golden index bbe7df83..317e7b5e 100644 --- a/test/snapshots/fsearch.golden +++ b/test/snapshots/fsearch.golden @@ -60,7 +60,7 @@ | | | /MARK -== snap results grid=180x30 cursor=7,2 +== snap results grid=180x30 cursor=10,3 |New Newcol Find Grep Help Tutor Dump NextColor Debug Kill | /tmp/pardes-snap/fsearch/cwd/g.txt Save New Del /tmp/pardes-snap/fsearch/cwd New Del /tmp/pardes-snap/fsearch/cwd New Del | 1 l1 ls ls @@ -91,38 +91,7 @@ | 1 g.txt:2:1-4 MARK a | 2 g.txt:6:1-4 MARK b | 3 g.txt:10:1-4 MARK c -== snap first grid=180x30 cursor=10,3 -|New Newcol Find Grep Help Tutor Dump NextColor Debug Kill -| /tmp/pardes-snap/fsearch/cwd/g.txt Save New Del /tmp/pardes-snap/fsearch/cwd New Del /tmp/pardes-snap/fsearch/cwd New Del -| 1 l1 ls ls -| 2 MARK a g.txt g.txt -| 3 l3 -| 4 l4 -| 5 l5 -| 6 MARK b g.txt -| 7 l7 -| 8 l8 -| 9 l9 -| 10 MARK c -| 11 l11 -| 12 l12 -| -| -| /tmp/pardes-snap/fsearch/cwd New Del -| ls -| g.txt -| -| -| -| -| -| -| -| /tmp/pardes-snap/fsearch/cwd/+Search New Del -| 1 g.txt:2:1-4 MARK a -| 2 g.txt:6:1-4 MARK b -| 3 g.txt:10:1-4 MARK c -== style first +== style results |0: 0-56 #949494,#121212, 57-179 d,#121212, |1: 0-1 #ffffff,#626262, 2-48 #949494,#121212, 49-59 d,#121212, 60-61 #ffffff,#262626, 62-99 #949494,#121212, 100-119 d,#121212, 120-121 #ffffff,#262626, 122-159 #949494,#121212, 160-179 d,#121212, |2: 0-0 d,#444444, 1-1 d,#080808, 2-6 #626262,#080808, 7-8 #bdbdbd,#080808, 9-59 d,#080808, 60-60 d,#444444, 61-61 d,#080808, 62-119 #bdbdbd,#080808, 120-120 d,#444444, 121-121 d,#080808, 122-179 #bdbdbd,#080808, -- cgit v1.3