diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-29 22:05:58 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 00:12:17 -0300 |
| commit | 813a0b2bf3c110f2287d7136f0dfc540c0978cd6 (patch) | |
| tree | 8250da85fde87d8cc4ccbbceaa304b1bed82be4e /src/effect_sources.zig | |
| parent | 714da820136ac89d6a79ed0141e7325829ab8204 (diff) | |
| download | pardes-813a0b2bf3c110f2287d7136f0dfc540c0978cd6.tar.gz pardes-813a0b2bf3c110f2287d7136f0dfc540c0978cd6.zip | |
The GUI embeds its shaders' GLSL from shaders/ always: the 14 prebuilt copies, identical to their sources, go, and so does the label saying which was used
shaders/prebuilt/*.glsl were byte-identical to shaders/X.glsl or to prefix.glsl + post/X.glsl (checked with cmp, all 14), kept only so a -Dprebuilt-shaders build could name them; EffectCode and Config then labelled the GUI's shader source as live or prebuilt. The GUI embeds shaderSource (a concatenation, no glslc) either way now; the prebuilt SPIR-V stays, and zig build shaders refreshes only it. Config's report and EffectCode lose their GUI shader source line.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/effect_sources.zig')
| -rw-r--r-- | src/effect_sources.zig | 38 |
1 files changed, 1 insertions, 37 deletions
diff --git a/src/effect_sources.zig b/src/effect_sources.zig index 328ce730..f45bf293 100644 --- a/src/effect_sources.zig +++ b/src/effect_sources.zig @@ -3,10 +3,7 @@ const build_config = @import("pardes_config"); const config = @import("config.zig"); const filesystem = @import("fs.zig"); -const shader_dir = if (build_config.gui_shader_sources_prebuilt) - "shaders/prebuilt/" -else - "shaders/"; +const shader_dir = "shaders/"; const ui_vertex_path = shader_dir ++ "ui.vert.glsl"; const ui_fragment_path = shader_dir ++ "ui.frag.glsl"; const image_vertex_path = shader_dir ++ "image.vert.glsl"; @@ -23,28 +20,6 @@ const bloom_up_path = shader_dir ++ "bloom-up.frag.glsl"; pub const Backend = @TypeOf(build_config.platform); pub const backend: Backend = build_config.platform; -pub const GuiShaderSourceMode = enum { - live, - prebuilt_snapshot, - - pub fn label(mode: GuiShaderSourceMode) []const u8 { - return switch (mode) { - .live => "live GLSL compiled during this build", - .prebuilt_snapshot => "paired GLSL snapshot for committed SPIR-V", - }; - } -}; - -/// Only the SDL backend consumes GLSL/SPIR-V. Other backends deliberately have -/// no shader-source mode rather than being mislabeled "live" or "prebuilt". -pub fn guiShaderSourceMode() ?GuiShaderSourceMode { - if (backend != .gui) return null; - return if (build_config.gui_shader_sources_prebuilt) - .prebuilt_snapshot - else - .live; -} - pub const files = switch (backend) { .tty => [_]filesystem.Source{ .{ .path = "src/tty/panel_compositor.zig", .contents = @embedFile("tty/panel_compositor.zig") }, @@ -123,14 +98,3 @@ test "EffectCode paths resolve uniquely to this backend's archived inputs" { try std.testing.expectEqual(backend == .gui, filesystem.sourceBytes("src/gui/gui.zig") != null); try std.testing.expectEqual(backend == .macos, filesystem.sourceBytes("src/macos/Sources/PardesView.swift") != null); } - -test "shader source provenance is GUI-only and follows the build input" { - if (comptime backend == .gui) { - const expected: GuiShaderSourceMode = if (build_config.gui_shader_sources_prebuilt) - .prebuilt_snapshot - else - .live; - try std.testing.expectEqual(expected, guiShaderSourceMode().?); - try std.testing.expect(expected.label().len > 0); - } else try std.testing.expect(guiShaderSourceMode() == null); -} |
