vello/piet-wgsl/shader/shared/clip.wgsl
Chad Brokaw 28082af9ec clip changes/blend group alpha
Adds blend group alpha. Also changes the clip logic to sync blend mode and alpha from BeginClip to EndClip in clip_leaf.
2022-11-29 13:28:25 -05:00

22 lines
327 B
WebGPU Shading Language

// SPDX-License-Identifier: Apache-2.0 OR MIT OR Unlicense
struct Bic {
a: u32,
b: u32,
}
fn bic_combine(x: Bic, y: Bic) -> Bic {
let m = min(x.b, y.a);
return Bic(x.a + y.a - m, x.b + y.b - m);
}
struct ClipInp {
ix: u32,
path_ix: i32,
}
struct ClipEl {
parent_ix: u32,
bbox: vec4<f32>,
}