summaryrefslogtreecommitdiff
path: root/src/abi.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/abi.zig')
-rw-r--r--src/abi.zig8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/abi.zig b/src/abi.zig
index d91fa23..7177f14 100644
--- a/src/abi.zig
+++ b/src/abi.zig
@@ -370,6 +370,8 @@ pub const Command = union(enum) {
/// Renders a GPU pass into an image made by `Host.newImage`, when
/// `Host.gpu` says the host can.
gpu: gpu.Pass,
+ /// Fullscreen pass sampling a completed GPU image, into a different image.
+ post_process: struct { source: Image, target: Image, effect: gpu.PostProcess },
/// Bytes into a buffer made by `Host.newBuffer`, at `offset`.
upload: struct { buffer: Buffer, offset: u32 = 0, bytes: []const u8 },
/// Runs a compute shader over buffers (see `abi.gpu`).
@@ -579,8 +581,10 @@ pub const gpu = struct {
draws: []const Draw,
};
- /// A fullscreen triangle sampling one completed pass at fragment binding 0.
+ /// Fullscreen triangle: color at fragment binding 0, optional depth at 1.
pub const PostProcess = struct {
+ /// Requires a preceding single-sample pass with depth enabled.
+ sample_depth: bool = false,
vertex: Shader,
fragment: Shader,
fragment_uniforms: []const u8 = &.{},
@@ -813,7 +817,7 @@ pub const Sketch = struct {
pub const hash: u64 = blk: {
@setEvalBranchQuota(1_000_000);
var h: u64 = 0;
- for (.{ Rect, Color, BlendMode, Corners, Event, Mode, Stream, Input, Image, Audio, Cursor, Voice, Command, gpu.Pass, gpu.Pipeline, gpu.Draw, gpu.Dispatch, Host, Host.VTable, Context, Field, Layout, Info, Memory, Sketch }) |T| {
+ for (.{ Rect, Color, BlendMode, Corners, Event, Mode, Stream, Input, Image, Audio, Cursor, Voice, Command, gpu.Pass, gpu.Pipeline, gpu.Draw, gpu.Dispatch, gpu.PostProcess, Host, Host.VTable, Context, Field, Layout, Info, Memory, Sketch }) |T| {
h = std.hash.Wyhash.hash(h, @typeName(T) ++ layout.signature(T));
}
break :blk h;