summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-16 22:02:43 -0300
committerGabriel Schneider <[email protected]>2026-11-17 12:15:01 -0300
commit1cb36ee39a8bbc2cf61c28003670d760841d6d3e (patch)
treed7d01eb5b3a40920a8f71d091a106561ca56b282 /README.md
parent6933f99ddb2d7103515d26838496309a807bba26 (diff)
downloadsketchbook-1cb36ee39a8bbc2cf61c28003670d760841d6d3e.tar.gz
sketchbook-1cb36ee39a8bbc2cf61c28003670d760841d6d3e.zip
gpu: add a post-process pass with optional depth sampling, and describe the executor pardes shares
`f.postProcess(source, target, .{...})` records a fullscreen pass that samples a completed render into a distinct target image: colour at fragment binding 0 and, with `sample_depth`, depth at 1, which needs the source's latest pass to have depth and one sample (missing depth, multisampled depth and feedback loops are rejected). The scene format's version 4 carries it, the executor records it on the caller's command buffer and owns the sampler, the web host does the same with its texture and sampler pairs, and native profiling reports the work as `postprocess`. The README says how to use it. docs/pardes-rendering.md describes the executor as pardes uses it for addon scenes: a borrowed SDL GPU device, `record` into the caller's command buffer, `run`, `output` and `postProcess`. The working copy as it stood on 2026-11-16; message written by Claude from the diff, at the author's request.
Diffstat (limited to 'README.md')
-rw-r--r--README.md11
1 files changed, 11 insertions, 0 deletions
diff --git a/README.md b/README.md
index e38889f..225f87c 100644
--- a/README.md
+++ b/README.md
@@ -1170,6 +1170,17 @@ released by the host on session reset; call `model.release(host)` to release the
earlier. Vertex storage layout and shader uniform layout are checked at comptime;
GLSL uniform declarations are generated from the Zig types.
+A separate fullscreen pass can sample a completed render with
+`f.postProcess(source, target, .{ .vertex = vertex_shader, .fragment = fragment_shader,
+.sample_depth = true, .fragment_uniforms = uniforms })`. Allocate distinct source
+and target images in setup, then draw the target image after this command.
+Native fragment bindings are color at 0 and depth at 1 (set 2). Web GLSL uses
+separate texture/sampler pairs at 0/1 and 2/3 (set 2). Fragment uniforms use set 3,
+binding 0. Depth sampling requires the source's latest pass to have `.depth = true`
+and `.samples = 1`; missing depth, multisampled depth and feedback loops are
+rejected. Omit `sample_depth` for a color-only pass. Native profiling reports this
+work separately as `postprocess`.
+
`profile` also includes `p95_ms` and `p99_ms`: nearest-rank percentiles of the
latest 2048 measured commands per label. Mean and worst cover every command since
reset. `profile-trace` exposes those retained samples as CSV (`label,sample,ns`),