From 09aa38799dbad45e9b49c5c4066ed0c0b0fb4cb0 Mon Sep 17 00:00:00 2001 From: Raph Levien Date: Fri, 25 Nov 2022 09:51:11 -0800 Subject: [PATCH] More cleanup Missed a few cases (and I'm still not 100% sure I've got them all). --- piet-wgsl/shader/clip_reduce.wgsl | 2 +- piet-wgsl/shader/draw_leaf.wgsl | 2 +- piet-wgsl/shader/shared/blend.wgsl | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/piet-wgsl/shader/clip_reduce.wgsl b/piet-wgsl/shader/clip_reduce.wgsl index 7e5d433..b314fe8 100644 --- a/piet-wgsl/shader/clip_reduce.wgsl +++ b/piet-wgsl/shader/clip_reduce.wgsl @@ -61,7 +61,7 @@ fn main( let path_ix = sh_path_ix[local_id.x]; let path_bbox = path_bboxes[path_ix]; let parent_ix = sh_parent[local_id.x] + wg_id.x * WG_SIZE; - let bbox = vec4(f32(path_bbox.x0), f32(path_bbox.y0), f32(path_bbox.x1), f32(path_bbox.y1)); + let bbox = vec4(f32(path_bbox.x0), f32(path_bbox.y0), f32(path_bbox.x1), f32(path_bbox.y1)); clip_out[global_id.x] = ClipEl(parent_ix, bbox); } } diff --git a/piet-wgsl/shader/draw_leaf.wgsl b/piet-wgsl/shader/draw_leaf.wgsl index 36fade8..cd3f843 100644 --- a/piet-wgsl/shader/draw_leaf.wgsl +++ b/piet-wgsl/shader/draw_leaf.wgsl @@ -150,7 +150,7 @@ fn main( let r0 = bitcast(scene[dd + 5u]); let r1 = bitcast(scene[dd + 6u]); let inv_det = 1.0 / (matrx.x * matrx.w - matrx.y * matrx.z); - let inv_mat = inv_det * vec4(matrx.w, -matrx.y, -matrx.z, matrx.x); + let inv_mat = inv_det * vec4(matrx.w, -matrx.y, -matrx.z, matrx.x); var inv_tr = inv_mat.xz * translate.x + inv_mat.yw * translate.y; inv_tr += p0; let center1 = p1 - p0; diff --git a/piet-wgsl/shader/shared/blend.wgsl b/piet-wgsl/shader/shared/blend.wgsl index fcd51ac..7b72f2e 100644 --- a/piet-wgsl/shader/shared/blend.wgsl +++ b/piet-wgsl/shader/shared/blend.wgsl @@ -61,7 +61,7 @@ fn soft_light(cb: vec3, cs: vec3) -> vec3 { return select( cb + (2.0 * cs - 1.0) * (d - cb), cb - (1.0 - 2.0 * cs) * cb * (1.0 - cb), - (cs <= vec3(0.5)) + cs <= vec3(0.5) ); }