Fix error in clip reduction One bit of logic from the GLSL (piet-gpu) version of clip_reduce didn't get copied over. Fixes #648
diff --git a/vello_shaders/shader/clip_reduce.wgsl b/vello_shaders/shader/clip_reduce.wgsl index bdbc0e9..a181201 100644 --- a/vello_shaders/shader/clip_reduce.wgsl +++ b/vello_shaders/shader/clip_reduce.wgsl
@@ -47,6 +47,9 @@ workgroupBarrier(); let size = sh_bic[0].b; bic = Bic(); + if local_id.x + 1u < WG_SIZE { + bic = sh_bic[local_id.x + 1u]; + } if is_push && bic.a == 0u { let local_ix = size - bic.b - 1u; sh_parent[local_ix] = local_id.x;
diff --git a/vello_shaders/src/cpu/clip_reduce.rs b/vello_shaders/src/cpu/clip_reduce.rs index b1c2d21..71ad912 100644 --- a/vello_shaders/src/cpu/clip_reduce.rs +++ b/vello_shaders/src/cpu/clip_reduce.rs
@@ -24,10 +24,10 @@ let inp = clip_inp[global_ix].path_ix; let is_push = inp >= 0; let bic = ClipBic::new(1 - is_push as u32, is_push as u32); - bic_reduced = bic.combine(bic_reduced); if is_push && bic_reduced.a == 0 { scratch.push(global_ix as u32); } + bic_reduced = bic.combine(bic_reduced); } reduced[wg_ix as usize] = bic_reduced; for (i, parent_ix) in scratch.iter().rev().enumerate() {