From 409c1accefeb7a775c0914c888b469a1e78fc69a Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Fri, 13 Nov 2026 12:12:22 -0300 Subject: 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. --- src/sketch/root.zig | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/sketch/root.zig') 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 { -- cgit v1.3