M13.6: Classic 3D bokeh depth of field on the GPU (WGSL); 3D-matte GPU check

Planes prepared for the GPU carry their depth of field (padding, radius map, levels) and the
bokeh_boost / bokeh_prefix / bokeh_gather kernels blur them where they are drawn, with the CPU's
spans; GPU-vs-CPU agreement tests for iris shapes, highlights, fringe, Fast Rectangle, tilted
planes and a 2D layer with a 3D track matte.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Brandon Thomas
2026-10-03 07:44:43 -04:00
co-authored by Claude Opus 5.5
parent f89af341a6
commit a2693c9d15
10 changed files with 400 additions and 34 deletions
+10 -3
View File
@@ -136,11 +136,18 @@ pub(crate) fn draw_run(e: &mut Enc, run: &Run3d, canvas: &GpuImage) -> Option<Gp
{
return None;
}
// Plane textures: the layer uploads (cached per buffer; bokeh depth of field is already in
// them).
// Plane textures: the layer uploads (cached per buffer), with bokeh depth of field blurred
// here when the plane has it.
let mut texs: Vec<(GpuImage, [f64; 2])> = Vec::with_capacity(run.planes.len());
for p in &run.planes {
texs.push((e.g.upload_buf(&p.buf)?, p.buf.offset));
let up = e.g.upload_buf(&p.buf)?;
match &p.dof {
Some(d) => {
let pad = d.pad as f64;
texs.push((crate::bokeh::apply(e, &up, d)?, [p.buf.offset[0] + pad, p.buf.offset[1] + pad]));
}
None => texs.push((up, p.buf.offset)),
}
}
let sizes: Vec<(u32, u32)> = texs.iter().map(|(t, _)| (t.width, t.height)).collect();
let (aw, ah, pos) = pack(&sizes, e.g.max_dim)?;