summaryrefslogtreecommitdiff
path: root/src/abi.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/abi.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/abi.zig')
-rw-r--r--src/abi.zig4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/abi.zig b/src/abi.zig
index a7a5cce..77a737d 100644
--- a/src/abi.zig
+++ b/src/abi.zig
@@ -335,6 +335,10 @@ pub const Command = union(enum) {
/// is unused. Native samples nearest; the web antialiases the edges of
/// a turned image.
image: struct { image: Image, dst: Rect, src: Rect = .{}, tint: Color = .white, corners: ?Corners = null },
+ /// Filter the canvas underneath `dst`. Native GPU renderer only; other
+ /// renderers leave the backdrop unchanged. The fragment shader receives
+ /// color at location 0, UV at 1, sampler at set 2/binding 0 and uniforms at set 3.
+ backdrop: struct { dst: Rect, fragment: []const u8, uniforms: []const u8 },
/// Where the 2D commands after it draw: an image made by
/// `Host.newImage` (an offscreen target, kept between frames), or
/// `.none` for the canvas. Each frame starts on the canvas. Switching