Alastair Donaldson | f7e73d4 | 2021-07-23 13:10:12 +0000 | [diff] [blame] | 1 | struct struct_base { |
| 2 | data : i32; |
| 3 | leftIndex : i32; |
| 4 | rightIndex : i32; |
| 5 | }; |
| 6 | |
| 7 | [[block]] |
| 8 | struct buf0 { |
| 9 | injectionSwitch : vec2<f32>; |
| 10 | }; |
| 11 | |
| 12 | var<private> struct_array : array<struct_base, 3>; |
| 13 | |
| 14 | [[group(0), binding(0)]] var<uniform> x_8 : buf0; |
| 15 | |
| 16 | var<private> x_GLF_color : vec4<f32>; |
| 17 | |
| 18 | fn 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 | |
| 42 | struct main_out { |
| 43 | [[location(0)]] |
| 44 | x_GLF_color_1 : vec4<f32>; |
| 45 | }; |
| 46 | |
| 47 | [[stage(fragment)]] |
| 48 | fn main() -> main_out { |
| 49 | main_1(); |
| 50 | return main_out(x_GLF_color); |
| 51 | } |