We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7798534 commit 5c29302Copy full SHA for 5c29302
wgpu/examples/msaa-line/shader.wgsl
@@ -1,5 +1,6 @@
1
struct VertexOutput {
2
[[location(0)]] color: vec4<f32>;
3
+ [[location(1), interpolate(flat)]] a: u32;
4
[[builtin(position)]] position: vec4<f32>;
5
};
6
@@ -11,10 +12,16 @@ fn vs_main(
11
12
var out: VertexOutput;
13
out.position = vec4<f32>(position, 0.0, 1.0);
14
out.color = color;
15
+ out.a = 5u32;
16
return out;
17
}
18
19
[[stage(fragment)]]
20
fn fs_main(in: VertexOutput) -> [[location(0)]] vec4<f32> {
- return in.color;
21
+ if (in.a == 0u32) {
22
+ return vec4<f32>(1.0, 0.0, 0.0, 1.0);
23
+ }
24
+ else {
25
+ return vec4<f32>(0.0, 0.0, 1.0, 1.0);
26
27
0 commit comments