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/windowops.golden | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'test/snapshots/windowops.golden') diff --git a/test/snapshots/windowops.golden b/test/snapshots/windowops.golden index 4101fa86..2ec3e46f 100644 --- a/test/snapshots/windowops.golden +++ b/test/snapshots/windowops.golden @@ -279,16 +279,16 @@ | == snap debug-on grid=100x30 cursor=44,4 |New Newcol Find Grep Help Tutor Dump NextColor Debug Kill -| /tmp/pardes-snap/windowops/cwd New Del /tmp/pardes-snap/windowops/c╭────────────────────────────╮ -| ls ls │pardes resizes=1 │ -| w.txt w.txt │terms 4 cols 2 │ -| │active #2 58x28 │ -| │scroll 0/28 │ -| │pinch 1.0000 │ -| │tscroll 0.0000 │ -| ╰────────────────────────────╯ -| -| +| /tmp/pardes-snap/windowops/cwd New Del /tmp/pardes-snap/win╭────────────────────────────────────╮ +| ls ls │pardes resizes=1 │ +| w.txt w.txt │theme helix │ +| │font default │ +| │terms 4 cols 2 │ +| │active #2 58x28 │ +| │scroll 0/28 │ +| │pinch 1.0000 │ +| │tscroll 0.0000 │ +| ╰────────────────────────────────────╯ | | /tmp/pardes-snap/windowops/cwd New Del | ls @@ -310,16 +310,16 @@ | == style debug-on |0: 0-56 #949494,#121212, 57-99 d,#121212, -|1: 0-1 #ffffff,#262626, 2-39 #949494,#121212, 40-41 #ffffff,#626262, 42-69 #949494,#121212, 70-99 d,d, -|2: 0-0 d,#444444, 1-1 d,#080808, 2-39 #bdbdbd,#080808, 40-40 d,#444444, 41-41 d,#080808, 42-69 #bdbdbd,#080808, 70-70 d,d, 71-87 #949494,d, 88-98 d,#121212, 99-99 d,d, -|3: 0-0 d,#444444, 1-1 d,#080808, 2-39 #bdbdbd,#080808, 40-40 d,#444444, 41-41 d,#080808, 42-69 #bdbdbd,#080808, 70-70 d,d, 71-85 #949494,d, 86-98 d,#121212, 99-99 d,d, -|4: 0-0 d,#444444, 1-1 d,#080808, 2-39 #bdbdbd,#080808, 40-40 d,#444444, 41-41 d,#080808, 42-69 #bdbdbd,#080808, 70-70 d,d, 71-86 #949494,d, 87-98 d,#121212, 99-99 d,d, -|5: 0-0 d,#444444, 1-1 d,#080808, 2-39 #bdbdbd,#080808, 40-40 d,#444444, 41-41 d,#080808, 42-69 #bdbdbd,#080808, 70-70 d,d, 71-81 #949494,d, 82-98 d,#121212, 99-99 d,d, -|6: 0-0 d,#444444, 1-1 d,#080808, 2-39 #bdbdbd,#080808, 40-40 d,#444444, 41-41 d,#080808, 42-69 #bdbdbd,#080808, 70-70 d,d, 71-83 #949494,d, 84-98 d,#121212, 99-99 d,d, -|7: 0-0 d,#444444, 1-1 d,#080808, 2-39 #bdbdbd,#080808, 40-40 d,#444444, 41-41 d,#080808, 42-69 #bdbdbd,#080808, 70-70 d,d, 71-85 #949494,d, 86-98 d,#121212, 99-99 d,d, -|8: 0-0 d,#444444, 1-1 d,#080808, 2-39 #bdbdbd,#080808, 40-40 d,#444444, 41-41 d,#080808, 42-69 #bdbdbd,#080808, 70-99 d,d, -|9: 0-0 d,#444444, 1-1 d,#080808, 2-39 #bdbdbd,#080808, 40-40 d,#444444, 41-41 d,#080808, 42-99 #bdbdbd,#080808, -|10: 0-0 d,#444444, 1-1 d,#080808, 2-39 #bdbdbd,#080808, 40-40 d,#444444, 41-41 d,#080808, 42-99 #bdbdbd,#080808, +|1: 0-1 #ffffff,#262626, 2-39 #949494,#121212, 40-41 #ffffff,#626262, 42-61 #949494,#121212, 62-99 d,d, +|2: 0-0 d,#444444, 1-1 d,#080808, 2-39 #bdbdbd,#080808, 40-40 d,#444444, 41-41 d,#080808, 42-61 #bdbdbd,#080808, 62-62 d,d, 63-79 #949494,d, 80-98 d,#121212, 99-99 d,d, +|3: 0-0 d,#444444, 1-1 d,#080808, 2-39 #bdbdbd,#080808, 40-40 d,#444444, 41-41 d,#080808, 42-61 #bdbdbd,#080808, 62-62 d,d, 63-74 #949494,d, 75-98 d,#121212, 99-99 d,d, +|4: 0-0 d,#444444, 1-1 d,#080808, 2-39 #bdbdbd,#080808, 40-40 d,#444444, 41-41 d,#080808, 42-61 #bdbdbd,#080808, 62-62 d,d, 63-76 #949494,d, 77-98 d,#121212, 99-99 d,d, +|5: 0-0 d,#444444, 1-1 d,#080808, 2-39 #bdbdbd,#080808, 40-40 d,#444444, 41-41 d,#080808, 42-61 #bdbdbd,#080808, 62-62 d,d, 63-77 #949494,d, 78-98 d,#121212, 99-99 d,d, +|6: 0-0 d,#444444, 1-1 d,#080808, 2-39 #bdbdbd,#080808, 40-40 d,#444444, 41-41 d,#080808, 42-61 #bdbdbd,#080808, 62-62 d,d, 63-78 #949494,d, 79-98 d,#121212, 99-99 d,d, +|7: 0-0 d,#444444, 1-1 d,#080808, 2-39 #bdbdbd,#080808, 40-40 d,#444444, 41-41 d,#080808, 42-61 #bdbdbd,#080808, 62-62 d,d, 63-73 #949494,d, 74-98 d,#121212, 99-99 d,d, +|8: 0-0 d,#444444, 1-1 d,#080808, 2-39 #bdbdbd,#080808, 40-40 d,#444444, 41-41 d,#080808, 42-61 #bdbdbd,#080808, 62-62 d,d, 63-75 #949494,d, 76-98 d,#121212, 99-99 d,d, +|9: 0-0 d,#444444, 1-1 d,#080808, 2-39 #bdbdbd,#080808, 40-40 d,#444444, 41-41 d,#080808, 42-61 #bdbdbd,#080808, 62-62 d,d, 63-77 #949494,d, 78-98 d,#121212, 99-99 d,d, +|10: 0-0 d,#444444, 1-1 d,#080808, 2-39 #bdbdbd,#080808, 40-40 d,#444444, 41-41 d,#080808, 42-61 #bdbdbd,#080808, 62-99 d,d, |11: 0-0 d,#444444, 1-1 d,#080808, 2-39 #bdbdbd,#080808, 40-40 d,#444444, 41-41 d,#080808, 42-99 #bdbdbd,#080808, |12: 0-1 #ffffff,#262626, 2-39 #949494,#121212, 40-40 d,#444444, 41-41 d,#080808, 42-99 #bdbdbd,#080808, |13: 0-0 d,#444444, 1-1 d,#080808, 2-39 #bdbdbd,#080808, 40-40 d,#444444, 41-41 d,#080808, 42-99 #bdbdbd,#080808, -- cgit v1.3