summaryrefslogtreecommitdiff
path: root/build.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-17 03:44:32 -0300
committerGabriel Schneider <[email protected]>2026-11-17 12:15:01 -0300
commit7100c95a2a42e69fac9e834ddcca4524ee026b1f (patch)
treefd0718dce6a930dd119df1d15395623ea27fdb61 /build.zig
parent85452cbb28ec78913d72017fdcb666c40e2fc153 (diff)
parent6af3c07190e7aec46596e00afb3c6b613c9e02eb (diff)
downloadsketchbook-7100c95a2a42e69fac9e834ddcca4524ee026b1f.tar.gz
sketchbook-7100c95a2a42e69fac9e834ddcca4524ee026b1f.zip
Merge the GPU move's font shim, glyph atlas and cell shaders
sketchbook-next with gpu-s2 (vendor/font.{c,h}, src/font/Atlas.zig, src/gpu/Cells.zig, src/gpu/shaders/): no conflicts. Nothing of sketchbook's own uses them yet. Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'build.zig')
-rw-r--r--build.zig10
1 files changed, 10 insertions, 0 deletions
diff --git a/build.zig b/build.zig
index 41502b1..dc58962 100644
--- a/build.zig
+++ b/build.zig
@@ -54,6 +54,16 @@ pub fn build(b: *Build) void {
const abi = b.addModule("abi", .{ .root_source_file = b.path("src/abi.zig"), .imports = &.{.{ .name = "abi_hash", .module = b.createModule(.{ .root_source_file = abi_hash }) }} });
const gpu = b.addModule("gpu", .{ .root_source_file = b.path("src/gpu/Executor.zig"), .imports = &.{.{ .name = "abi", .module = abi }} });
_ = b.addModule("gpu_scene", .{ .root_source_file = b.path("src/gpu/scene.zig"), .imports = &.{.{ .name = "abi", .module = abi }} });
+ // The cell renderer's shaders (src/gpu/Cells.zig): embedders compile the
+ // GLSL or embed these committed copies; this refreshes the copies.
+ const update_shaders = b.addUpdateSourceFiles();
+ for ([_][]const u8{ "ui.vert", "ui.frag", "decor.frag", "overlay.vert", "overlay.frag", "image.vert", "image.frag" }) |name| {
+ const glslc = b.addSystemCommand(&.{ "glslc", b.fmt("-fshader-stage={s}", .{if (std.mem.endsWith(u8, name, ".vert")) "vertex" else "fragment"}) });
+ glslc.addFileArg(b.path(b.fmt("src/gpu/shaders/{s}.glsl", .{name})));
+ glslc.addArg("-o");
+ update_shaders.addCopyFileToSource(glslc.addOutputFileArg(b.fmt("{s}.spv", .{name})), b.fmt("src/gpu/shaders/prebuilt/{s}.spv", .{name}));
+ }
+ b.step("shaders", "refresh the committed src/gpu/shaders/prebuilt/*.spv (glslc)").dependOn(&update_shaders.step);
// Embedders provide their existing SDL translation and device.
if (b.option(bool, "gpu-only", "export GPU modules without building the sketch host") orelse false) return;
// The host's session database (src/host/Sessions.zig).