Search across packages, versions, files, declarations, and comments. Use multiple terms to narrow results (AND), and add @vertex, @fragment, or @compute to filter by shader stage.
1const POS = array(
2 vec2f(0, -1) * 0.5,
3 vec2f(1, 1) * 0.5,
4 vec2f(-1, 1) * 0.5,
5);
7@vertex
8fn vertex(@builtin(vertex_index) vertex_index: u32) -> @builtin(position) vec4f {
9 if vertex_index == 0 {
10 return vec4f(POS[0], 0, 1);
11 } else if vertex_index == 1 {
12 return vec4f(POS[1], 0, 1);
13 } else {
14 return vec4f(POS[2], 0, 1);
15 }
18@fragment
19fn fragment() -> @location(0) vec4f {
20 return vec4f(1, 1, 0, 1);
Contents