summaryrefslogtreecommitdiff
path: root/src/sketch/root.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-13 12:12:22 -0300
committerGabriel Schneider <[email protected]>2026-11-13 12:12:22 -0300
commit409c1accefeb7a775c0914c888b469a1e78fc69a (patch)
tree21af5f4b0e82e5c36d129421a7257be6d8bebd8d /src/sketch/root.zig
parent91a34124880d932f97718b959b11bc5375c0dd79 (diff)
downloadsketchbook-409c1accefeb7a775c0914c888b469a1e78fc69a.tar.gz
sketchbook-409c1accefeb7a775c0914c888b469a1e78fc69a.zip
Add reusable GPU backdrop filtering to the shared canvas
Draw native GPU frames through the same bounded canvas used by headless capture. Backdrop commands reuse one snapshot and shader state, with an unchanged fallback on unsupported renderers. Verified through native debugger lenses, restart, and repeated font zoom checks.
Diffstat (limited to 'src/sketch/root.zig')
-rw-r--r--src/sketch/root.zig3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/sketch/root.zig b/src/sketch/root.zig
index b2f9136..52f05b2 100644
--- a/src/sketch/root.zig
+++ b/src/sketch/root.zig
@@ -142,6 +142,9 @@ pub const Frame = struct {
pub fn target(f: *Frame, img: Image) void {
f.emit(.{ .target = img });
}
+ pub fn backdrop(f: *Frame, dst: Rect, fragment: []const u8, uniforms: []const u8) void {
+ f.emit(.{ .backdrop = .{ .dst = dst, .fragment = fragment, .uniforms = f.keep(u8, uniforms) } });
+ }
/// How the 2D commands after it blend, until the next `blend` or the
/// frame ends (which goes back to `.alpha`).
pub fn blend(f: *Frame, mode: BlendMode) void {