blob: 914402c7c4bfbbdc92e2e1e307c74c75437a7460 [file] [log] [blame]
Alastair Donaldsonf7e73d42021-07-23 13:10:12 +00001struct struct_base {
2 data : i32;
3 leftIndex : i32;
4 rightIndex : i32;
5};
6
7[[block]]
8struct buf0 {
9 injectionSwitch : vec2<f32>;
10};
11
12var<private> struct_array : array<struct_base, 3>;
13
14[[group(0), binding(0)]] var<uniform> x_8 : buf0;
15
16var<private> x_GLF_color : vec4<f32>;
17
18fn main_1() {
19 var index : i32;
20 struct_array = array<struct_base, 3>(struct_base(1, 1, 1), struct_base(1, 1, 1), struct_base(1, 1, 1));
21 index = 1;
22 struct_array[1].rightIndex = 1;
23 let x_39 : i32 = struct_array[1].leftIndex;
24 if ((x_39 == 1)) {
25 let x_45 : f32 = x_8.injectionSwitch.x;
26 let x_48 : i32 = struct_array[i32(x_45)].rightIndex;
27 index = x_48;
28 } else {
29 let x_50 : f32 = x_8.injectionSwitch.y;
30 let x_53 : i32 = struct_array[i32(x_50)].leftIndex;
31 index = x_53;
32 }
33 let x_55 : i32 = struct_array[1].leftIndex;
34 if ((x_55 == 1)) {
35 x_GLF_color = vec4<f32>(1.0, 0.0, 0.0, 1.0);
36 } else {
37 x_GLF_color = vec4<f32>(1.0, 1.0, 1.0, 1.0);
38 }
39 return;
40}
41
42struct main_out {
43 [[location(0)]]
44 x_GLF_color_1 : vec4<f32>;
45};
46
47[[stage(fragment)]]
48fn main() -> main_out {
49 main_1();
50 return main_out(x_GLF_color);
51}