2022-12-24 23:41:59 +00:00
|
|
|
/// This code is prepended to gradient/common.wgsl and is specialised for storage buffers
|
2021-10-20 21:44:06 +00:00
|
|
|
|
|
|
|
struct Gradient {
|
2022-07-02 12:18:30 +00:00
|
|
|
colors: array<vec4<f32>,16u>,
|
|
|
|
ratios: array<f32,16u>,
|
|
|
|
gradient_type: i32,
|
|
|
|
num_colors: u32,
|
|
|
|
interpolation: i32,
|
|
|
|
focal_point: f32,
|
2021-10-20 21:44:06 +00:00
|
|
|
};
|
|
|
|
|
2022-12-27 22:18:03 +00:00
|
|
|
@group(3) @binding(1) var<storage> gradient: Gradient;
|
2021-10-20 21:44:06 +00:00
|
|
|
|
2022-12-24 23:41:59 +00:00
|
|
|
fn ratio(i: u32) -> f32 {
|
|
|
|
return gradient.ratios[i];
|
|
|
|
}
|