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. --- shaders/prebuilt/crt.frag.spv | Bin 0 -> 4108 bytes shaders/prebuilt/crt.vert.spv | Bin 0 -> 1208 bytes shaders/prebuilt/image.frag.spv | Bin 0 -> 624 bytes shaders/prebuilt/image.vert.spv | Bin 0 -> 3152 bytes shaders/prebuilt/overlay.frag.spv | Bin 0 -> 444 bytes shaders/prebuilt/overlay.vert.spv | Bin 0 -> 1040 bytes shaders/prebuilt/ui.frag.spv | Bin 0 -> 1148 bytes shaders/prebuilt/ui.vert.spv | Bin 0 -> 3520 bytes 8 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 shaders/prebuilt/crt.frag.spv create mode 100644 shaders/prebuilt/crt.vert.spv create mode 100644 shaders/prebuilt/image.frag.spv create mode 100644 shaders/prebuilt/image.vert.spv create mode 100644 shaders/prebuilt/overlay.frag.spv create mode 100644 shaders/prebuilt/overlay.vert.spv create mode 100644 shaders/prebuilt/ui.frag.spv create mode 100644 shaders/prebuilt/ui.vert.spv (limited to 'shaders') diff --git a/shaders/prebuilt/crt.frag.spv b/shaders/prebuilt/crt.frag.spv new file mode 100644 index 00000000..326aa534 Binary files /dev/null and b/shaders/prebuilt/crt.frag.spv differ diff --git a/shaders/prebuilt/crt.vert.spv b/shaders/prebuilt/crt.vert.spv new file mode 100644 index 00000000..8a75ebb3 Binary files /dev/null and b/shaders/prebuilt/crt.vert.spv differ diff --git a/shaders/prebuilt/image.frag.spv b/shaders/prebuilt/image.frag.spv new file mode 100644 index 00000000..84a174ad Binary files /dev/null and b/shaders/prebuilt/image.frag.spv differ diff --git a/shaders/prebuilt/image.vert.spv b/shaders/prebuilt/image.vert.spv new file mode 100644 index 00000000..1105bae2 Binary files /dev/null and b/shaders/prebuilt/image.vert.spv differ diff --git a/shaders/prebuilt/overlay.frag.spv b/shaders/prebuilt/overlay.frag.spv new file mode 100644 index 00000000..59bbb9d4 Binary files /dev/null and b/shaders/prebuilt/overlay.frag.spv differ diff --git a/shaders/prebuilt/overlay.vert.spv b/shaders/prebuilt/overlay.vert.spv new file mode 100644 index 00000000..a518c576 Binary files /dev/null and b/shaders/prebuilt/overlay.vert.spv differ diff --git a/shaders/prebuilt/ui.frag.spv b/shaders/prebuilt/ui.frag.spv new file mode 100644 index 00000000..8d57242a Binary files /dev/null and b/shaders/prebuilt/ui.frag.spv differ diff --git a/shaders/prebuilt/ui.vert.spv b/shaders/prebuilt/ui.vert.spv new file mode 100644 index 00000000..186a91fc Binary files /dev/null and b/shaders/prebuilt/ui.vert.spv differ -- cgit v1.3