summaryrefslogtreecommitdiff
path: root/src/gui/Post.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-10-22 09:50:43 -0300
committerGabriel Schneider <[email protected]>2026-10-22 10:03:24 -0300
commita8b457a306a4442975210bcac3f04b56513c61c3 (patch)
tree6e2026ecb15da2fb919a0202f5d8b38e3b36a595 /src/gui/Post.zig
parenta8a1499bdffffc5b6919e24ec957e92fabaf003b (diff)
parent7e9d2c4169245072265b483ffaa6aa05f23f08d3 (diff)
downloadpardes-a8b457a306a4442975210bcac3f04b56513c61c3.tar.gz
pardes-a8b457a306a4442975210bcac3f04b56513c61c3.zip
Merge: Def/Refs, the diff viewer, Helix n/N, Callstack, Zig 0.17, Window mode and the terminal cwd fix onto 0.24
The docs keep both sides: 0.24's Ctrl-i fallbacks and typed ls with this line's Window mode, raw Esc and Helix n/N wording. The CHANGELOG's unreleased entries go above 0.24, Def/Refs and the context rows among them. cheatsheet-a4.pdf rendered again; .scratch/ ignored. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/gui/Post.zig')
-rw-r--r--src/gui/Post.zig33
1 files changed, 16 insertions, 17 deletions
diff --git a/src/gui/Post.zig b/src/gui/Post.zig
index fc256135..17e8d7e9 100644
--- a/src/gui/Post.zig
+++ b/src/gui/Post.zig
@@ -610,30 +610,30 @@ const GhosttyUniforms = extern struct {
};
test "the uniform block is ghostty's, offset for offset, and the prefix names it in that order" {
- const ours = @typeInfo(Uniforms).@"struct".fields;
- const theirs = @typeInfo(GhosttyUniforms).@"struct".fields;
- try std.testing.expectEqual(theirs.len, ours.len);
+ const ours = @typeInfo(Uniforms).@"struct";
+ const theirs = @typeInfo(GhosttyUniforms).@"struct";
+ try std.testing.expectEqual(theirs.field_names.len, ours.field_names.len);
try std.testing.expectEqual(@sizeOf(GhosttyUniforms), @sizeOf(Uniforms));
- inline for (ours, theirs) |a, b| {
- try std.testing.expectEqual(@offsetOf(GhosttyUniforms, b.name), @offsetOf(Uniforms, a.name));
- try std.testing.expectEqual(b.type, a.type);
+ inline for (ours.field_names, ours.field_types, theirs.field_names, theirs.field_types) |a, a_type, b, b_type| {
+ try std.testing.expectEqual(@offsetOf(GhosttyUniforms, b), @offsetOf(Uniforms, a));
+ try std.testing.expectEqual(b_type, a_type);
}
// By NAME: iSelectionForegroundColor sits where ghostty's Zig says
// selection_background, which is where its GLSL puts the foreground.
try std.testing.expectEqual(@offsetOf(GhosttyUniforms, "selection_background_color"), @offsetOf(Uniforms, "selection_foreground_color"));
// The prefix's block, member by member, in ghostty's GLSL names and types.
const glsl = [_]struct { []const u8, []const u8 }{
- .{ "vec3", "iResolution" }, .{ "float", "iTime" }, .{ "float", "iTimeDelta" },
- .{ "float", "iFrameRate" }, .{ "int", "iFrame" }, .{ "float", "iChannelTime[4]" },
- .{ "vec3", "iChannelResolution[4]" }, .{ "vec4", "iMouse" }, .{ "vec4", "iDate" },
- .{ "float", "iSampleRate" }, .{ "vec4", "iCurrentCursor" }, .{ "vec4", "iPreviousCursor" },
- .{ "vec4", "iCurrentCursorColor" }, .{ "vec4", "iPreviousCursorColor" }, .{ "int", "iCurrentCursorStyle" },
- .{ "int", "iPreviousCursorStyle" }, .{ "int", "iCursorVisible" }, .{ "float", "iTimeCursorChange" },
- .{ "float", "iTimeFocus" }, .{ "int", "iFocus" }, .{ "vec3", "iPalette[256]" },
- .{ "vec3", "iBackgroundColor" }, .{ "vec3", "iForegroundColor" }, .{ "vec3", "iCursorColor" },
- .{ "vec3", "iCursorText" }, .{ "vec3", "iSelectionForegroundColor" }, .{ "vec3", "iSelectionBackgroundColor" },
+ .{ "vec3", "iResolution" }, .{ "float", "iTime" }, .{ "float", "iTimeDelta" },
+ .{ "float", "iFrameRate" }, .{ "int", "iFrame" }, .{ "float", "iChannelTime[4]" },
+ .{ "vec3", "iChannelResolution[4]" }, .{ "vec4", "iMouse" }, .{ "vec4", "iDate" },
+ .{ "float", "iSampleRate" }, .{ "vec4", "iCurrentCursor" }, .{ "vec4", "iPreviousCursor" },
+ .{ "vec4", "iCurrentCursorColor" }, .{ "vec4", "iPreviousCursorColor" }, .{ "int", "iCurrentCursorStyle" },
+ .{ "int", "iPreviousCursorStyle" }, .{ "int", "iCursorVisible" }, .{ "float", "iTimeCursorChange" },
+ .{ "float", "iTimeFocus" }, .{ "int", "iFocus" }, .{ "vec3", "iPalette[256]" },
+ .{ "vec3", "iBackgroundColor" }, .{ "vec3", "iForegroundColor" }, .{ "vec3", "iCursorColor" },
+ .{ "vec3", "iCursorText" }, .{ "vec3", "iSelectionForegroundColor" }, .{ "vec3", "iSelectionBackgroundColor" },
};
- try std.testing.expectEqual(ours.len, glsl.len);
+ try std.testing.expectEqual(ours.field_names.len, glsl.len);
// Its three blocks (Globals, Palette, Colors) read as one, in order.
const start = std.mem.indexOf(u8, prefix, "uniform Globals {").?;
const end = std.mem.indexOf(u8, prefix, "uniform PardesPost {").?;
@@ -673,7 +673,6 @@ test "a moved cursor becomes the previous one, stamped with the time of the move
try std.testing.expectEqual([4]f32{ 1.0 / 255.0, 2.0 / 255.0, 3.0 / 255.0, 1 }, post.uniforms.selection_foreground_color);
}
-
test "a still pass asks for no idle frames; one that reads the clock does" {
var post: Post = .{};
const fake: *Pipeline = @ptrFromInt(0x1000);