Alastair Donaldson | f7e73d4 | 2021-07-23 13:10:12 +0000 | [diff] [blame] | 1 | struct S { |
James Price | 3b671cb | 2022-03-28 14:31:22 +0000 | [diff] [blame] | 2 | data : i32, |
James Price | 1a72a76 | 2022-03-21 16:09:17 +0000 | [diff] [blame] | 3 | } |
Alastair Donaldson | f7e73d4 | 2021-07-23 13:10:12 +0000 | [diff] [blame] | 4 | |
Alastair Donaldson | f7e73d4 | 2021-07-23 13:10:12 +0000 | [diff] [blame] | 5 | struct buf1 { |
James Price | 3b671cb | 2022-03-28 14:31:22 +0000 | [diff] [blame] | 6 | v1 : vec2<f32>, |
James Price | 1a72a76 | 2022-03-21 16:09:17 +0000 | [diff] [blame] | 7 | } |
Alastair Donaldson | f7e73d4 | 2021-07-23 13:10:12 +0000 | [diff] [blame] | 8 | |
James Price | 1a72a76 | 2022-03-21 16:09:17 +0000 | [diff] [blame] | 9 | struct strided_arr { |
| 10 | @size(16) |
James Price | 3b671cb | 2022-03-28 14:31:22 +0000 | [diff] [blame] | 11 | el : i32, |
James Price | 1a72a76 | 2022-03-21 16:09:17 +0000 | [diff] [blame] | 12 | } |
| 13 | |
Ben Clayton | 9dc48bc | 2023-01-24 14:55:17 +0000 | [diff] [blame] | 14 | alias Arr = array<strided_arr, 5u>; |
Alastair Donaldson | f7e73d4 | 2021-07-23 13:10:12 +0000 | [diff] [blame] | 15 | |
Alastair Donaldson | f7e73d4 | 2021-07-23 13:10:12 +0000 | [diff] [blame] | 16 | struct buf0 { |
James Price | 3b671cb | 2022-03-28 14:31:22 +0000 | [diff] [blame] | 17 | x_GLF_uniform_int_values : Arr, |
James Price | 1a72a76 | 2022-03-21 16:09:17 +0000 | [diff] [blame] | 18 | } |
Alastair Donaldson | f7e73d4 | 2021-07-23 13:10:12 +0000 | [diff] [blame] | 19 | |
Ben Clayton | 01e4b6f | 2022-01-19 22:46:57 +0000 | [diff] [blame] | 20 | @group(0) @binding(1) var<uniform> x_8 : buf1; |
Alastair Donaldson | f7e73d4 | 2021-07-23 13:10:12 +0000 | [diff] [blame] | 21 | |
Ben Clayton | 01e4b6f | 2022-01-19 22:46:57 +0000 | [diff] [blame] | 22 | @group(0) @binding(0) var<uniform> x_10 : buf0; |
Alastair Donaldson | f7e73d4 | 2021-07-23 13:10:12 +0000 | [diff] [blame] | 23 | |
| 24 | var<private> x_GLF_color : vec4<f32>; |
| 25 | |
| 26 | fn func_struct_S_i11_(s : ptr<function, S>) { |
| 27 | loop { |
| 28 | let x_174 : f32 = x_8.v1.x; |
| 29 | let x_176 : f32 = x_8.v1.y; |
| 30 | if ((x_174 > x_176)) { |
| 31 | } else { |
| 32 | break; |
| 33 | } |
| 34 | return; |
| 35 | } |
James Price | 1a72a76 | 2022-03-21 16:09:17 +0000 | [diff] [blame] | 36 | let x_180 : i32 = x_10.x_GLF_uniform_int_values[0].el; |
Alastair Donaldson | f7e73d4 | 2021-07-23 13:10:12 +0000 | [diff] [blame] | 37 | (*(s)).data = x_180; |
| 38 | return; |
| 39 | } |
| 40 | |
| 41 | fn main_1() { |
| 42 | var i : i32; |
James Price | 1a72a76 | 2022-03-21 16:09:17 +0000 | [diff] [blame] | 43 | var arr : array<S, 3u>; |
Alastair Donaldson | f7e73d4 | 2021-07-23 13:10:12 +0000 | [diff] [blame] | 44 | var i_1 : i32; |
| 45 | var param : S; |
| 46 | var j : i32; |
| 47 | var x_136 : bool; |
| 48 | var x_146 : bool; |
| 49 | var x_137_phi : bool; |
| 50 | var x_147_phi : bool; |
James Price | 1a72a76 | 2022-03-21 16:09:17 +0000 | [diff] [blame] | 51 | let x_46 : i32 = x_10.x_GLF_uniform_int_values[2].el; |
Alastair Donaldson | f7e73d4 | 2021-07-23 13:10:12 +0000 | [diff] [blame] | 52 | i = x_46; |
| 53 | loop { |
| 54 | let x_51 : i32 = i; |
James Price | 1a72a76 | 2022-03-21 16:09:17 +0000 | [diff] [blame] | 55 | let x_53 : i32 = x_10.x_GLF_uniform_int_values[1].el; |
Alastair Donaldson | f7e73d4 | 2021-07-23 13:10:12 +0000 | [diff] [blame] | 56 | if ((x_51 < x_53)) { |
| 57 | } else { |
| 58 | break; |
| 59 | } |
| 60 | let x_56 : i32 = i; |
| 61 | let x_57 : i32 = i; |
| 62 | arr[x_56].data = x_57; |
| 63 | |
| 64 | continuing { |
| 65 | let x_59 : i32 = i; |
| 66 | i = (x_59 + 1); |
| 67 | } |
| 68 | } |
James Price | 1a72a76 | 2022-03-21 16:09:17 +0000 | [diff] [blame] | 69 | let x_62 : i32 = x_10.x_GLF_uniform_int_values[2].el; |
Alastair Donaldson | f7e73d4 | 2021-07-23 13:10:12 +0000 | [diff] [blame] | 70 | i_1 = x_62; |
| 71 | loop { |
| 72 | let x_67 : i32 = i_1; |
James Price | 1a72a76 | 2022-03-21 16:09:17 +0000 | [diff] [blame] | 73 | let x_69 : i32 = x_10.x_GLF_uniform_int_values[1].el; |
Alastair Donaldson | f7e73d4 | 2021-07-23 13:10:12 +0000 | [diff] [blame] | 74 | if ((x_67 < x_69)) { |
| 75 | } else { |
| 76 | break; |
| 77 | } |
| 78 | let x_73 : f32 = x_8.v1.x; |
| 79 | let x_75 : f32 = x_8.v1.y; |
| 80 | if ((x_73 > x_75)) { |
| 81 | break; |
| 82 | } |
| 83 | let x_79 : i32 = i_1; |
| 84 | let x_81 : i32 = arr[x_79].data; |
James Price | 1a72a76 | 2022-03-21 16:09:17 +0000 | [diff] [blame] | 85 | let x_83 : i32 = x_10.x_GLF_uniform_int_values[0].el; |
Alastair Donaldson | f7e73d4 | 2021-07-23 13:10:12 +0000 | [diff] [blame] | 86 | if ((x_81 == x_83)) { |
| 87 | let x_88 : i32 = i_1; |
James Price | 1a72a76 | 2022-03-21 16:09:17 +0000 | [diff] [blame] | 88 | let x_91 : i32 = x_10.x_GLF_uniform_int_values[3].el; |
Alastair Donaldson | f7e73d4 | 2021-07-23 13:10:12 +0000 | [diff] [blame] | 89 | arr[clamp(x_88, 0, 3)].data = x_91; |
| 90 | let x_94 : S = arr[2]; |
| 91 | param = x_94; |
| 92 | func_struct_S_i11_(&(param)); |
| 93 | let x_96 : S = param; |
| 94 | arr[2] = x_96; |
| 95 | } else { |
James Price | 1a72a76 | 2022-03-21 16:09:17 +0000 | [diff] [blame] | 96 | let x_99 : i32 = x_10.x_GLF_uniform_int_values[2].el; |
Alastair Donaldson | f7e73d4 | 2021-07-23 13:10:12 +0000 | [diff] [blame] | 97 | j = x_99; |
| 98 | loop { |
| 99 | let x_104 : i32 = j; |
James Price | 1a72a76 | 2022-03-21 16:09:17 +0000 | [diff] [blame] | 100 | let x_106 : i32 = x_10.x_GLF_uniform_int_values[1].el; |
Alastair Donaldson | f7e73d4 | 2021-07-23 13:10:12 +0000 | [diff] [blame] | 101 | if ((x_104 < x_106)) { |
| 102 | } else { |
| 103 | break; |
| 104 | } |
| 105 | let x_109 : i32 = j; |
| 106 | let x_111 : i32 = arr[x_109].data; |
James Price | 1a72a76 | 2022-03-21 16:09:17 +0000 | [diff] [blame] | 107 | let x_113 : i32 = x_10.x_GLF_uniform_int_values[4].el; |
Alastair Donaldson | f7e73d4 | 2021-07-23 13:10:12 +0000 | [diff] [blame] | 108 | if ((x_111 > x_113)) { |
| 109 | discard; |
| 110 | } |
| 111 | |
| 112 | continuing { |
| 113 | let x_117 : i32 = j; |
| 114 | j = (x_117 + 1); |
| 115 | } |
| 116 | } |
| 117 | } |
| 118 | |
| 119 | continuing { |
| 120 | let x_119 : i32 = i_1; |
| 121 | i_1 = (x_119 + 1); |
| 122 | } |
| 123 | } |
James Price | 1a72a76 | 2022-03-21 16:09:17 +0000 | [diff] [blame] | 124 | let x_122 : i32 = x_10.x_GLF_uniform_int_values[2].el; |
Alastair Donaldson | f7e73d4 | 2021-07-23 13:10:12 +0000 | [diff] [blame] | 125 | let x_124 : i32 = arr[x_122].data; |
James Price | 1a72a76 | 2022-03-21 16:09:17 +0000 | [diff] [blame] | 126 | let x_126 : i32 = x_10.x_GLF_uniform_int_values[2].el; |
Alastair Donaldson | f7e73d4 | 2021-07-23 13:10:12 +0000 | [diff] [blame] | 127 | let x_127 : bool = (x_124 == x_126); |
| 128 | x_137_phi = x_127; |
| 129 | if (x_127) { |
James Price | 1a72a76 | 2022-03-21 16:09:17 +0000 | [diff] [blame] | 130 | let x_131 : i32 = x_10.x_GLF_uniform_int_values[0].el; |
Alastair Donaldson | f7e73d4 | 2021-07-23 13:10:12 +0000 | [diff] [blame] | 131 | let x_133 : i32 = arr[x_131].data; |
James Price | 1a72a76 | 2022-03-21 16:09:17 +0000 | [diff] [blame] | 132 | let x_135 : i32 = x_10.x_GLF_uniform_int_values[3].el; |
Alastair Donaldson | f7e73d4 | 2021-07-23 13:10:12 +0000 | [diff] [blame] | 133 | x_136 = (x_133 == x_135); |
| 134 | x_137_phi = x_136; |
| 135 | } |
| 136 | let x_137 : bool = x_137_phi; |
| 137 | x_147_phi = x_137; |
| 138 | if (x_137) { |
James Price | 1a72a76 | 2022-03-21 16:09:17 +0000 | [diff] [blame] | 139 | let x_141 : i32 = x_10.x_GLF_uniform_int_values[3].el; |
Alastair Donaldson | f7e73d4 | 2021-07-23 13:10:12 +0000 | [diff] [blame] | 140 | let x_143 : i32 = arr[x_141].data; |
James Price | 1a72a76 | 2022-03-21 16:09:17 +0000 | [diff] [blame] | 141 | let x_145 : i32 = x_10.x_GLF_uniform_int_values[0].el; |
Alastair Donaldson | f7e73d4 | 2021-07-23 13:10:12 +0000 | [diff] [blame] | 142 | x_146 = (x_143 == x_145); |
| 143 | x_147_phi = x_146; |
| 144 | } |
| 145 | let x_147 : bool = x_147_phi; |
| 146 | if (x_147) { |
James Price | 1a72a76 | 2022-03-21 16:09:17 +0000 | [diff] [blame] | 147 | let x_152 : i32 = x_10.x_GLF_uniform_int_values[0].el; |
| 148 | let x_155 : i32 = x_10.x_GLF_uniform_int_values[2].el; |
| 149 | let x_158 : i32 = x_10.x_GLF_uniform_int_values[2].el; |
| 150 | let x_161 : i32 = x_10.x_GLF_uniform_int_values[0].el; |
Alastair Donaldson | f7e73d4 | 2021-07-23 13:10:12 +0000 | [diff] [blame] | 151 | x_GLF_color = vec4<f32>(f32(x_152), f32(x_155), f32(x_158), f32(x_161)); |
| 152 | } else { |
James Price | 1a72a76 | 2022-03-21 16:09:17 +0000 | [diff] [blame] | 153 | let x_165 : i32 = x_10.x_GLF_uniform_int_values[2].el; |
Alastair Donaldson | f7e73d4 | 2021-07-23 13:10:12 +0000 | [diff] [blame] | 154 | let x_166 : f32 = f32(x_165); |
| 155 | x_GLF_color = vec4<f32>(x_166, x_166, x_166, x_166); |
| 156 | } |
| 157 | return; |
| 158 | } |
| 159 | |
| 160 | struct main_out { |
Ben Clayton | 01e4b6f | 2022-01-19 22:46:57 +0000 | [diff] [blame] | 161 | @location(0) |
James Price | 3b671cb | 2022-03-28 14:31:22 +0000 | [diff] [blame] | 162 | x_GLF_color_1 : vec4<f32>, |
James Price | 1a72a76 | 2022-03-21 16:09:17 +0000 | [diff] [blame] | 163 | } |
Alastair Donaldson | f7e73d4 | 2021-07-23 13:10:12 +0000 | [diff] [blame] | 164 | |
dan sinclair | b29892b | 2022-06-07 13:55:34 +0000 | [diff] [blame] | 165 | @fragment |
Alastair Donaldson | f7e73d4 | 2021-07-23 13:10:12 +0000 | [diff] [blame] | 166 | fn main() -> main_out { |
| 167 | main_1(); |
| 168 | return main_out(x_GLF_color); |
| 169 | } |