diff options
| author | Gabriel Schneider <[email protected]> | 2026-08-17 16:12:56 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-08-18 23:45:04 -0300 |
| commit | 31fece62f56aa2311e2325de83659edbc9e641db (patch) | |
| tree | 13eee1e542d9670ad3fb7badad353265121d668f /src/effect_sources.zig | |
| parent | 1551e409c31992437cb2fa864f576d45c8433801 (diff) | |
| download | pardes-31fece62f56aa2311e2325de83659edbc9e641db.tar.gz pardes-31fece62f56aa2311e2325de83659edbc9e641db.zip | |
animation: core publishes transition records; gui evaluates via shaders, tty over grid cells
Diffstat (limited to 'src/effect_sources.zig')
| -rw-r--r-- | src/effect_sources.zig | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/src/effect_sources.zig b/src/effect_sources.zig index 87026278..6f1c6bb1 100644 --- a/src/effect_sources.zig +++ b/src/effect_sources.zig @@ -9,6 +9,7 @@ const build_config = @import("pardes_config"); const runtime_config = @import("runtime_config.zig"); const panel_math = @embedFile("panel_animation.zig"); +const pardes_core = @embedFile("pardes.zig"); const tty_compositor = @embedFile("tty/panel_compositor.zig"); const panel_vertex = @embedFile("effect-source-ui.vert.glsl"); const panel_fragment = @embedFile("effect-source-ui.frag.glsl"); @@ -59,6 +60,16 @@ const gui_cell_instance = sourceSection( "// EFFECT_CODE_CELL_INSTANCE_BEGIN\n", "// EFFECT_CODE_CELL_INSTANCE_END", ); +const ascii_diff = sourceSection( + pardes_core, + "// EFFECT_CODE_ASCII_DIFF_BEGIN\n", + "// EFFECT_CODE_ASCII_DIFF_END", +); +const ascii_compositor = sourceSection( + pardes_core, + " // EFFECT_CODE_ASCII_COMPOSITOR_BEGIN\n", + " // EFFECT_CODE_ASCII_COMPOSITOR_END", +); const ui_vertex_path = if (build_config.gui_shader_sources_prebuilt) "shaders/prebuilt/ui.vert.glsl" @@ -117,10 +128,14 @@ pub const Segment = struct { const tty_panel = [_]Segment{ .{ .path = "src/panel_animation.zig", .source = panel_math }, + .{ .path = "src/pardes.zig#ascii-diff", .source = ascii_diff }, + .{ .path = "src/pardes.zig#ascii-compositor", .source = ascii_compositor }, .{ .path = "src/tty/panel_compositor.zig", .source = tty_compositor }, }; const gui_panel = [_]Segment{ .{ .path = "src/panel_animation.zig", .source = panel_math }, + .{ .path = "src/pardes.zig#ascii-diff", .source = ascii_diff }, + .{ .path = "src/pardes.zig#ascii-compositor", .source = ascii_compositor }, .{ .path = "src/gui/gui.zig#panel-host", .source = gui_panel_host }, .{ .path = "src/gui/gui.zig#native-panel", .source = gui_native_panel }, .{ .path = "src/gui/gui.zig#frame-submission", .source = gui_frame_submission }, @@ -138,6 +153,8 @@ const gui_scene = [_]Segment{ }; const mac_panel = [_]Segment{ .{ .path = "src/panel_animation.zig", .source = panel_math }, + .{ .path = "src/pardes.zig#ascii-diff", .source = ascii_diff }, + .{ .path = "src/pardes.zig#ascii-compositor", .source = ascii_compositor }, .{ .path = "src/macos/Sources/PardesView.swift", .source = mac_view }, .{ .path = "src/macos/Sources/ScenePostprocessor.swift", .source = mac_postprocessor }, .{ .path = "shaders/crt.ci.metal", .source = mac_scene }, @@ -205,6 +222,8 @@ test "GUI scene EffectCode includes both runtime shader stages" { test "GUI panel EffectCode includes the actual host paint and submission path" { if (comptime backend == .gui) { + try std.testing.expect(std.mem.indexOf(u8, ascii_diff, "pub const PanelCellDiff") != null); + try std.testing.expect(std.mem.indexOf(u8, ascii_compositor, "fn composeAsciiTransitions") != null); try std.testing.expect(std.mem.indexOf(u8, gui_panel_host, "fn makePaintPlan") != null); try std.testing.expect(std.mem.indexOf(u8, gui_panel_host, "fn setTransitionFields") != null); try std.testing.expect(std.mem.indexOf(u8, gui_native_panel, "fn prepareNativeImages") != null); @@ -213,7 +232,8 @@ test "GUI panel EffectCode includes the actual host paint and submission path" { try std.testing.expect(std.mem.indexOf(u8, gui_frame_submission, "for (paint_plan.batches") != null); try std.testing.expect(std.mem.indexOf(u8, gui_cell_instance, "fn emitInstance") != null); try std.testing.expect(std.mem.indexOf(u8, gui_cell_instance, "setTransitionFields") != null); - try std.testing.expect(std.mem.indexOf(u8, image_fragment, "vec3 contrastInk") != null); + try std.testing.expect(std.mem.indexOf(u8, panel_math, "frame_count") != null); + try std.testing.expect(std.mem.indexOf(u8, gui_frame_submission, "active.effect == .dissolve") != null); } } @@ -233,7 +253,7 @@ test "mac EffectCode includes the runtime panel and scene wiring" { try std.testing.expect(std.mem.indexOf(u8, mac_scene, "extern \"C\" float4 pardesPanelClear") != null); try std.testing.expect(std.mem.indexOf(u8, mac_scene, "extern \"C\" float4 pardesPanel") != null); try std.testing.expect(std.mem.indexOf(u8, mac_scene, "extern \"C\" float4 pardesScene") != null); - try std.testing.expect(std.mem.indexOf(u8, mac_scene, "float3 contrastInk") != null); + try std.testing.expect(std.mem.indexOf(u8, mac_scene, "already composed in Pardes core") != null); try std.testing.expect(std.mem.indexOf(u8, mac_view, "hideCursor: !tracks.isEmpty") != null); try std.testing.expect(std.mem.indexOf(u8, mac_postprocessor, "panelClearKernel.apply") != null); try std.testing.expect(std.mem.indexOf(u8, mac_postprocessor, "panelKernel.apply") != null); |
