2021-05-06 04:04:43 +00:00
|
|
|
struct PushConstants {
|
2022-03-12 21:48:10 +00:00
|
|
|
index: u32,
|
|
|
|
double: vec2<f64>,
|
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,
|
2021-07-17 02:18:20 +00:00
|
|
|
};
|
|
|
|
|
2022-01-19 15:33:06 +00:00
|
|
|
@stage(fragment)
|
|
|
|
fn main(in: FragmentIn) -> @location(0) vec4<f32> {
|
2022-03-09 04:02:20 +00:00
|
|
|
if in.primitive_index == pc.index {
|
2021-07-17 02:18:20 +00:00
|
|
|
return in.color;
|
|
|
|
} else {
|
|
|
|
return vec4<f32>(vec3<f32>(1.0) - in.color.rgb, in.color.a);
|
|
|
|
}
|
2021-05-06 04:04:43 +00:00
|
|
|
}
|