2021-05-06 04:04:43 +00:00
|
|
|
struct PushConstants {
|
2022-03-12 21:48:10 +00:00
|
|
|
index: u32,
|
|
|
|
double: vec2<f64>,
|
2022-03-27 05:35:08 +00:00
|
|
|
}
|
2021-05-06 04:04:43 +00:00
|
|
|
var<push_constant> pc: PushConstants;
|
|
|
|
|
2021-07-17 02:18:20 +00:00
|
|
|
struct FragmentIn {
|
2022-03-12 21:48:10 +00:00
|
|
|
@location(0) color: vec4<f32>,
|
|
|
|
@builtin(primitive_index) primitive_index: u32,
|
2022-03-27 05:35:08 +00:00
|
|
|
}
|
2021-07-17 02:18:20 +00:00
|
|
|
|
2022-04-15 09:54:15 +00:00
|
|
|
@fragment
|
2022-04-29 17:48:27 +00:00
|
|
|
fn main(in: FragmentIn) -> @location(0) vec4<f32> {
|
|
|
|
if in.primitive_index == pc.index {
|
|
|
|
return in.color;
|
2021-07-17 02:18:20 +00:00
|
|
|
} else {
|
2022-04-29 17:48:27 +00:00
|
|
|
return vec4<f32>(vec3<f32>(1.0) - in.color.rgb, in.color.a);
|
2021-07-17 02:18:20 +00:00
|
|
|
}
|
2021-05-06 04:04:43 +00:00
|
|
|
}
|