diff options
| author | Gabriel Schneider <[email protected]> | 2026-08-02 13:13:53 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-08-10 09:17:07 -0300 |
| commit | 487434a0b55fa7cf479f39481b51da0a7eda79e1 (patch) | |
| tree | ce410e0c52eb030e1de76079834e6697975c9c17 /build.zig | |
| parent | d59397d4146ffa23adbbe6dc99c64ebb22a93b2d (diff) | |
| download | pardes-487434a0b55fa7cf479f39481b51da0a7eda79e1.tar.gz pardes-487434a0b55fa7cf479f39481b51da0a7eda79e1.zip | |
gui: draw image surfaces as GPU quads via glsl shaders
Diffstat (limited to 'build.zig')
| -rw-r--r-- | build.zig | 31 |
1 files changed, 31 insertions, 0 deletions
@@ -485,6 +485,12 @@ pub fn build(b: *std.Build) void { root_mod.addAnonymousImport("overlay.frag.spv", .{ .root_source_file = compileGlsl(b, "shaders/overlay.frag.glsl", "fragment", "overlay.frag.spv"), }); + root_mod.addAnonymousImport("image.vert.spv", .{ + .root_source_file = compileGlsl(b, "shaders/image.vert.glsl", "vertex", "image.vert.spv"), + }); + root_mod.addAnonymousImport("image.frag.spv", .{ + .root_source_file = compileGlsl(b, "shaders/image.frag.glsl", "fragment", "image.frag.spv"), + }); root_mod.addAnonymousImport("crt.vert.spv", .{ .root_source_file = compileGlsl(b, "shaders/crt.vert.glsl", "vertex", "crt.vert.spv"), }); @@ -552,6 +558,31 @@ pub fn build(b: *std.Build) void { .ghostty_vt = ghostty_vt_for_snap, }); + // Native image regression harness. TTY builds emulate Kitty over a + // pty and inspect the real APC stream; GUI builds drive PARDES_TEST's + // real SDL GPU readback and inspect source-colored pixels. It is a + // separate explicit step because the GUI arm needs a graphical/GPU + // session, while unit-test remains safe on headless builders. + const image_harness = b.addExecutable(.{ + .name = "pardes-image-harness", + .root_module = b.createModule(.{ + .target = target, + .optimize = optimize, + .root_source_file = b.path("test/image_harness.zig"), + .link_libc = true, + }), + }); + if (ghostty_vt_for_snap) |vt| image_harness.root_module.addImport("ghostty-vt", vt); + switch (target.result.os.tag) { + .freebsd, .netbsd, .openbsd => image_harness.root_module.linkSystemLibrary("util", .{}), + else => {}, + } + const run_image_harness = b.addRunArtifact(image_harness); + run_image_harness.addArtifactArg(exe); + run_image_harness.addArg(if (platform == .gui) "gui" else "tty"); + run_image_harness.has_side_effects = true; + b.step("image-harness", "exercise native Kitty/SDL image rendering end to end").dependOn(&run_image_harness.step); + // helix differential harness: drive the sans-IO core headlessly over // JSON-Lines cases, one contract result line per case on stdout — // the pardes half of the pardes-vs-helix diff (helix's hx-harness on |
