diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-17 14:45:02 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-17 14:53:20 -0300 |
| commit | b4faa9da0530be0391a7cc61eb4ea1e4cdbfa038 (patch) | |
| tree | 33e7a733af74d2718cb4a133228e37dbdc25e0a1 | |
| parent | 3e77fdcd57693b337d915873e9919de2e1ec6521 (diff) | |
| parent | 5467df693e6aba8fd17d6acd035ac28cc1b620ef (diff) | |
| download | pardes-b4faa9da0530be0391a7cc61eb4ea1e4cdbfa038.tar.gz pardes-b4faa9da0530be0391a7cc61eb4ea1e4cdbfa038.zip | |
integration: the build script made readable, with sketchbook's files where step 1 of its reorganisation put them
A merge of pardes-build-2 (uukslmmu) and reorg-1 (nrsxpmro). One conflict, build.zig: the restructured script is kept and the moved paths (sketchbook's src/gpu/ is dev/draw/, src/font/Atlas.zig is dev/text/Atlas.zig) are applied where those lines live now, build/gui.zig and one option's description. Against sketchbook's reorg-1: frame corpus 77/77 identical in Debug (baseline .scratch/sketch/gpu/mbase), unit-test on gui 1587/1595 with no failure the baseline has not; on tui core-test 811/950 (139 skipped), shell-test 993/996, syntax-test 40/40.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
| -rw-r--r-- | build.zig | 2 | ||||
| -rw-r--r-- | build/gui.zig | 20 | ||||
| -rw-r--r-- | docs/typ/building.typ | 2 | ||||
| -rw-r--r-- | docs/typ/reference.typ | 4 | ||||
| -rw-r--r-- | src/gui/gui.zig | 6 |
5 files changed, 17 insertions, 17 deletions
@@ -111,7 +111,7 @@ pub fn build(b: *std.Build) void { const tracy = b.option([]const u8, "tracy", "enable Tracy profiling; supply the path to a Tracy source checkout"); const macos_sdk = b.option([]const u8, "macos-sdk", "the macOS SDK a gui built for macOS from another system takes SDL's headers and frameworks from"); const macos_identity = b.option([]const u8, "macos-identity", "codesigning identity for pardes.app (default: ad-hoc)") orelse "-"; - const prebuilt_shaders = b.option(bool, "prebuilt-shaders", "embed sketchbook's committed src/gpu/shaders/prebuilt/*.spv instead of running glslc over its GLSL (default: on for a bare `zig build`, off when -Dplatform names a shell)") orelse also_gui; + const prebuilt_shaders = b.option(bool, "prebuilt-shaders", "embed sketchbook's committed dev/draw/shaders/prebuilt/*.spv instead of running glslc over its GLSL (default: on for a bare `zig build`, off when -Dplatform names a shell)") orelse also_gui; // The macOS shell carries the workspace tag row's commands in its native // menu bar; the row itself goes away. `-Dworkspace-tag=true` puts it back. const workspace_tag = b.option(bool, "workspace-tag", "draw the workspace tag row (default: on except on macOS, whose menu bar carries its commands)"); diff --git a/build/gui.zig b/build/gui.zig index 9b46f6c5..24aa6277 100644 --- a/build/gui.zig +++ b/build/gui.zig @@ -94,25 +94,25 @@ pub fn make(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.lang. const gui_c_mod = gui_c.createModule(); var sdl: Window.Sdl = .{ .lib = sdl_lib, .include = dep.path("include"), .gui_c = gui_c_mod }; if (sketchbook) |sb| { - const gpu = b.createModule(.{ .root_source_file = sb.path("src/gpu/Executor.zig"), .imports = &.{ .{ .name = "abi", .module = sb.module("abi") }, .{ .name = "c", .module = gui_c_mod } } }); - // The glyph atlas (src/font/Atlas.zig) over the font shim + const gpu = b.createModule(.{ .root_source_file = sb.path("dev/draw/Executor.zig"), .imports = &.{ .{ .name = "abi", .module = sb.module("abi") }, .{ .name = "c", .module = gui_c_mod } } }); + // The glyph atlas (dev/text/Atlas.zig) over the font shim // (vendor/font.{c,h}), compiled below against pardes's // FreeType and HarfBuzz. - const atlas_mod = b.createModule(.{ .root_source_file = sb.path("src/font/Atlas.zig"), .imports = &.{.{ .name = "c", .module = gui_c_mod }} }); - // pardes's renderer, moved to sketchbook (src/gpu/), compiled + const atlas_mod = b.createModule(.{ .root_source_file = sb.path("dev/text/Atlas.zig"), .imports = &.{.{ .name = "c", .module = gui_c_mod }} }); + // pardes's renderer, moved to sketchbook (dev/draw/), compiled // against pardes's SDL; its tests run with unit-test. Its // SPIR-V is sketchbook's GLSL through glslc, or the prebuilt // copies with -Dprebuilt-shaders. - const cells_mod = b.createModule(.{ .root_source_file = sb.path("src/gpu/Cells.zig"), .imports = &.{ .{ .name = "c", .module = gui_c_mod }, .{ .name = "font_atlas", .module = atlas_mod } } }); + const cells_mod = b.createModule(.{ .root_source_file = sb.path("dev/draw/Cells.zig"), .imports = &.{ .{ .name = "c", .module = gui_c_mod }, .{ .name = "font_atlas", .module = atlas_mod } } }); for (gui_shaders) |name| cells_mod.addAnonymousImport(b.fmt("{s}.spv", .{name}), .{ .root_source_file = if (prebuilt_shaders) - sb.path(b.fmt("src/gpu/shaders/prebuilt/{s}.spv", .{name})) + sb.path(b.fmt("dev/draw/shaders/prebuilt/{s}.spv", .{name})) else - compileGlsl(b, sb.path(b.fmt("src/gpu/shaders/{s}.glsl", .{name})), name), + compileGlsl(b, sb.path(b.fmt("dev/draw/shaders/{s}.glsl", .{name})), name), }); - const present = b.createModule(.{ .root_source_file = sb.path("src/gpu/Present.zig"), .imports = &.{ .{ .name = "c", .module = gui_c_mod }, .{ .name = "gpu_cells", .module = cells_mod } } }); + const present = b.createModule(.{ .root_source_file = sb.path("dev/draw/Present.zig"), .imports = &.{ .{ .name = "c", .module = gui_c_mod }, .{ .name = "gpu_cells", .module = cells_mod } } }); sdl.renderer = .{ .{ .name = "sketch_gpu", .module = gpu }, .{ .name = "font_atlas", .module = atlas_mod }, .{ .name = "gpu_cells", .module = cells_mod }, .{ .name = "gpu_present", .module = present }, .{ .name = "gpu_scene", .module = sb.module("gpu_scene") } }; - w.cells_test = b.addTest(.{ .root_module = b.createModule(.{ .root_source_file = sb.path("src/gpu/Cells.zig"), .target = target, .optimize = optimize, .imports = &.{ .{ .name = "c", .module = gui_c_mod }, .{ .name = "font_atlas", .module = atlas_mod } } }), .filters = test_filters }); + w.cells_test = b.addTest(.{ .root_module = b.createModule(.{ .root_source_file = sb.path("dev/draw/Cells.zig"), .target = target, .optimize = optimize, .imports = &.{ .{ .name = "c", .module = gui_c_mod }, .{ .name = "font_atlas", .module = atlas_mod } } }), .filters = test_filters }); gui_c.addIncludePath(sb.path("vendor")); } if (target.result.os.tag == .macos) { @@ -169,7 +169,7 @@ pub fn make(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.lang. // The Atlas's own tests, over the same FreeType, HarfBuzz and // shim, the embedded face theirs to draw. if (w.sdl) |sdl| if (sketchbook) |sb| { - const atlas_mod = b.createModule(.{ .root_source_file = sb.path("src/font/Atlas.zig"), .target = target, .optimize = optimize, .link_libc = true, .imports = &.{.{ .name = "c", .module = sdl.gui_c }} }); + const atlas_mod = b.createModule(.{ .root_source_file = sb.path("dev/text/Atlas.zig"), .target = target, .optimize = optimize, .link_libc = true, .imports = &.{.{ .name = "c", .module = sdl.gui_c }} }); atlas_mod.linkLibrary(ft); atlas_mod.linkLibrary(harfbuzz); atlas_mod.addIncludePath(upstream.path("src")); diff --git a/docs/typ/building.typ b/docs/typ/building.typ index 0c95914c..6b0e812a 100644 --- a/docs/typ/building.typ +++ b/docs/typ/building.typ @@ -65,7 +65,7 @@ must share with its session; `pardes --help` lists every flag. [`-Dstamp-commit`], [bool: the git commit in `--version` and crash records; on for release builds and the `~/.local` install], [`-Dworkspace-tag`], [bool: draw the workspace tag row; on except for macOS, whose menu bar carries it], [`-Dmacos-sdk`], [path: the macOS SDK SDL's headers and frameworks come from, for a gui built for macOS elsewhere], - [`-Dprebuilt-shaders`], [bool: embed the committed SPIR-V; on for a bare `zig build`, off with `-Dplatform`; the shaders are sketchbook's (`src/gpu/shaders/`), and its `zig build shaders` refreshes the SPIR-V with glslc], + [`-Dprebuilt-shaders`], [bool: embed the committed SPIR-V; on for a bare `zig build`, off with `-Dplatform`; the shaders are sketchbook's (`dev/draw/shaders/`), and its `zig build shaders` refreshes the SPIR-V with glslc], [`-Dtracy`], [path to a Tracy checkout; off], [`-Dmacos-identity`], [codesigning identity for `pardes.app`; `-` (ad hoc)], [`-Dtest-filter`], [run only tests whose name contains it; a filter that matches nothing fails], diff --git a/docs/typ/reference.typ b/docs/typ/reference.typ index 5ecbf476..db4f9c77 100644 --- a/docs/typ/reference.typ +++ b/docs/typ/reference.typ @@ -1493,8 +1493,8 @@ the scene, not that every view can render it. The SDL frontend runs scenes on its own GPU and composites their target textures; replicas carry the scene alongside the authoritative pane frame. -The scene codec and executor live in sketchbook (`src/gpu/scene.zig` and -`src/gpu/Executor.zig`). GPU support adds no required addon operation. +The scene codec and executor live in sketchbook (`dev/draw/scene.zig` and +`dev/draw/Executor.zig`). GPU support adds no required addon operation. `zig build snake-shader` builds `zig-out/lib/libsnake_shader.so` (with `glslc`). Load it with `Addon load /absolute/path/libsnake_shader.so`, then diff --git a/src/gui/gui.zig b/src/gui/gui.zig index aa6fc92b..5ffaa649 100644 --- a/src/gui/gui.zig +++ b/src/gui/gui.zig @@ -1,7 +1,7 @@ const SketchGpu = @import("sketch_gpu"); -const Cells = @import("gpu_cells"); // sketchbook's src/gpu/Cells.zig -const Atlas = @import("font_atlas"); // sketchbook's src/font/Atlas.zig -const Present = @import("gpu_present"); // sketchbook's src/gpu/Present.zig +const Cells = @import("gpu_cells"); // sketchbook's dev/draw/Cells.zig +const Atlas = @import("font_atlas"); // sketchbook's dev/text/Atlas.zig +const Present = @import("gpu_present"); // sketchbook's dev/draw/Present.zig const GpuScene = @import("gpu_scene"); const filesystem = @import("../fs.zig"); const std = @import("std"); |
