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 | |
| 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')
| -rw-r--r-- | src/Output.zig | 7 | ||||
| -rw-r--r-- | src/config.zig | 7 | ||||
| -rw-r--r-- | src/effect_sources.zig | 38 |
3 files changed, 1 insertions, 51 deletions
diff --git a/src/Output.zig b/src/Output.zig index fb8fe7a3..8cf57591 100644 --- a/src/Output.zig +++ b/src/Output.zig @@ -19,7 +19,6 @@ const Pane = panes.Pane; const File = panes.File; const Builtin = builtins.registry.Builtin(); -const gui_shader_source_mode = effect_sources.guiShaderSourceMode(); const fonts = if (builtins.capabilities.font_picker) @import("fonts.zig") else struct {}; @@ -825,10 +824,6 @@ pub fn openConfig(p: *Pardes, id: usize) !void { .platform = @tagName(pardes.platform), .theme_name = p.theme().name, .compiled_default_shell = config.defaultShell(), - .gui_shader_source_mode = if (gui_shader_source_mode) |mode| - mode.label() - else - null, .hover_delay_frames = config.look_preview_delay_frames, .native_images = p.native_images, .capabilities = builtins.capabilities, @@ -882,8 +877,6 @@ pub fn openEffectCode(p: *Pardes, id: usize, argument: []const u8) !void { var out: std.Io.Writer.Allocating = .init(p.gpa); errdefer out.deinit(); try out.writer.print("EffectCode {s} ({s})\n", .{ setting.word, @tagName(effect_sources.backend) }); - if (gui_shader_source_mode) |mode| - try out.writer.print("GUI shader source: {s}\n", .{mode.label()}); try out.writer.writeByte('\n'); for (paths) |path| try out.writer.print("/virtual/{s}\n", .{path}); const content = try out.toOwnedSlice(); diff --git a/src/config.zig b/src/config.zig index ea7a877a..a8b4c24e 100644 --- a/src/config.zig +++ b/src/config.zig @@ -1267,7 +1267,6 @@ pub const Runtime = struct { platform: []const u8, theme_name: []const u8, compiled_default_shell: []const u8, - gui_shader_source_mode: ?[]const u8 = null, hover_delay_frames: ?u16, /// Where dumps go when `DumpDir` is unset; empty without a host /// filesystem. @@ -1436,8 +1435,6 @@ pub const Runtime = struct { "Default shell ($SHELL, else /bin/sh): {s}\n", .{ context.platform, context.compiled_default_shell }, ); - if (context.gui_shader_source_mode) |mode| - try out.print("GUI shader source: {s}\n", .{mode}); if (context.hover_delay_frames) |frames| try out.print("Look hover delay: {d} frames\n", .{frames}) else @@ -1662,7 +1659,6 @@ pub const Runtime = struct { .platform = "gui", .theme_name = "acme", .compiled_default_shell = "/bin/sh", - .gui_shader_source_mode = "live GLSL compiled during this build", .hover_delay_frames = 18, .native_images = true, .capabilities = .{ @@ -1801,7 +1797,6 @@ pub const Runtime = struct { "Startup config: /tmp/pardes/init\n", "Platform: gui\n", "Default shell ($SHELL, else /bin/sh): /bin/sh\n", - "GUI shader source: live GLSL compiled during this build\n", "Look hover delay: 18 frames\n", "Native images: on\n", }) |expected| try std.testing.expect(std.mem.indexOf(u8, report, expected) != null); @@ -1810,7 +1805,6 @@ pub const Runtime = struct { var defaults_context = context; defaults_context.startup_config_path = null; defaults_context.platform = "tty"; - defaults_context.gui_shader_source_mode = null; defaults_context.hover_delay_frames = null; defaults_context.native_images = false; defaults_context.capabilities = .{ @@ -1832,7 +1826,6 @@ pub const Runtime = struct { try std.testing.expect(std.mem.indexOf(u8, defaults_report, "Shell effective (last spawn) (none)\n") != null); try std.testing.expect(std.mem.indexOf(u8, defaults_report, "Shell pending on\n") != null); try std.testing.expect(std.mem.indexOf(u8, defaults_report, "Startup config: no per-user config path\n") != null); - try std.testing.expect(std.mem.indexOf(u8, defaults_report, "GUI shader source:") == null); try std.testing.expect(std.mem.indexOf(u8, defaults_report, "Font unsupported\n") != null); try std.testing.expect(std.mem.indexOf(u8, defaults_report, "Font requested") == null); try std.testing.expect(std.mem.indexOf(u8, defaults_report, "Panel transition off\n") != null); 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); -} |
