blob: eafec0bf61767f79495ffcf8036c71507deddaad [file] [log] [blame]
Alastair Donaldsonf7e73d42021-07-23 13:10:12 +00001struct S {
James Price3b671cb2022-03-28 14:31:22 +00002 data : i32,
James Price1a72a762022-03-21 16:09:17 +00003}
Alastair Donaldsonf7e73d42021-07-23 13:10:12 +00004
Alastair Donaldsonf7e73d42021-07-23 13:10:12 +00005struct buf1 {
James Price3b671cb2022-03-28 14:31:22 +00006 v1 : vec2<f32>,
James Price1a72a762022-03-21 16:09:17 +00007}
Alastair Donaldsonf7e73d42021-07-23 13:10:12 +00008
James Price1a72a762022-03-21 16:09:17 +00009struct strided_arr {
10 @size(16)
James Price3b671cb2022-03-28 14:31:22 +000011 el : i32,
James Price1a72a762022-03-21 16:09:17 +000012}
13
Ben Clayton9dc48bc2023-01-24 14:55:17 +000014alias Arr = array<strided_arr, 5u>;
Alastair Donaldsonf7e73d42021-07-23 13:10:12 +000015
Alastair Donaldsonf7e73d42021-07-23 13:10:12 +000016struct buf0 {
James Price3b671cb2022-03-28 14:31:22 +000017 x_GLF_uniform_int_values : Arr,
James Price1a72a762022-03-21 16:09:17 +000018}
Alastair Donaldsonf7e73d42021-07-23 13:10:12 +000019
Ben Clayton01e4b6f2022-01-19 22:46:57 +000020@group(0) @binding(1) var<uniform> x_8 : buf1;
Alastair Donaldsonf7e73d42021-07-23 13:10:12 +000021
Ben Clayton01e4b6f2022-01-19 22:46:57 +000022@group(0) @binding(0) var<uniform> x_10 : buf0;
Alastair Donaldsonf7e73d42021-07-23 13:10:12 +000023
24var<private> x_GLF_color : vec4<f32>;
25
26fn 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 Price1a72a762022-03-21 16:09:17 +000036 let x_180 : i32 = x_10.x_GLF_uniform_int_values[0].el;
Alastair Donaldsonf7e73d42021-07-23 13:10:12 +000037 (*(s)).data = x_180;
38 return;
39}
40
41fn main_1() {
42 var i : i32;
James Price1a72a762022-03-21 16:09:17 +000043 var arr : array<S, 3u>;
Alastair Donaldsonf7e73d42021-07-23 13:10:12 +000044 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 Price1a72a762022-03-21 16:09:17 +000051 let x_46 : i32 = x_10.x_GLF_uniform_int_values[2].el;
Alastair Donaldsonf7e73d42021-07-23 13:10:12 +000052 i = x_46;
53 loop {
54 let x_51 : i32 = i;
James Price1a72a762022-03-21 16:09:17 +000055 let x_53 : i32 = x_10.x_GLF_uniform_int_values[1].el;
Alastair Donaldsonf7e73d42021-07-23 13:10:12 +000056 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 Price1a72a762022-03-21 16:09:17 +000069 let x_62 : i32 = x_10.x_GLF_uniform_int_values[2].el;
Alastair Donaldsonf7e73d42021-07-23 13:10:12 +000070 i_1 = x_62;
71 loop {
72 let x_67 : i32 = i_1;
James Price1a72a762022-03-21 16:09:17 +000073 let x_69 : i32 = x_10.x_GLF_uniform_int_values[1].el;
Alastair Donaldsonf7e73d42021-07-23 13:10:12 +000074 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 Price1a72a762022-03-21 16:09:17 +000085 let x_83 : i32 = x_10.x_GLF_uniform_int_values[0].el;
Alastair Donaldsonf7e73d42021-07-23 13:10:12 +000086 if ((x_81 == x_83)) {
87 let x_88 : i32 = i_1;
James Price1a72a762022-03-21 16:09:17 +000088 let x_91 : i32 = x_10.x_GLF_uniform_int_values[3].el;
Alastair Donaldsonf7e73d42021-07-23 13:10:12 +000089 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 Price1a72a762022-03-21 16:09:17 +000096 let x_99 : i32 = x_10.x_GLF_uniform_int_values[2].el;
Alastair Donaldsonf7e73d42021-07-23 13:10:12 +000097 j = x_99;
98 loop {
99 let x_104 : i32 = j;
James Price1a72a762022-03-21 16:09:17 +0000100 let x_106 : i32 = x_10.x_GLF_uniform_int_values[1].el;
Alastair Donaldsonf7e73d42021-07-23 13:10:12 +0000101 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 Price1a72a762022-03-21 16:09:17 +0000107 let x_113 : i32 = x_10.x_GLF_uniform_int_values[4].el;
Alastair Donaldsonf7e73d42021-07-23 13:10:12 +0000108 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 Price1a72a762022-03-21 16:09:17 +0000124 let x_122 : i32 = x_10.x_GLF_uniform_int_values[2].el;
Alastair Donaldsonf7e73d42021-07-23 13:10:12 +0000125 let x_124 : i32 = arr[x_122].data;
James Price1a72a762022-03-21 16:09:17 +0000126 let x_126 : i32 = x_10.x_GLF_uniform_int_values[2].el;
Alastair Donaldsonf7e73d42021-07-23 13:10:12 +0000127 let x_127 : bool = (x_124 == x_126);
128 x_137_phi = x_127;
129 if (x_127) {
James Price1a72a762022-03-21 16:09:17 +0000130 let x_131 : i32 = x_10.x_GLF_uniform_int_values[0].el;
Alastair Donaldsonf7e73d42021-07-23 13:10:12 +0000131 let x_133 : i32 = arr[x_131].data;
James Price1a72a762022-03-21 16:09:17 +0000132 let x_135 : i32 = x_10.x_GLF_uniform_int_values[3].el;
Alastair Donaldsonf7e73d42021-07-23 13:10:12 +0000133 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 Price1a72a762022-03-21 16:09:17 +0000139 let x_141 : i32 = x_10.x_GLF_uniform_int_values[3].el;
Alastair Donaldsonf7e73d42021-07-23 13:10:12 +0000140 let x_143 : i32 = arr[x_141].data;
James Price1a72a762022-03-21 16:09:17 +0000141 let x_145 : i32 = x_10.x_GLF_uniform_int_values[0].el;
Alastair Donaldsonf7e73d42021-07-23 13:10:12 +0000142 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 Price1a72a762022-03-21 16:09:17 +0000147 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 Donaldsonf7e73d42021-07-23 13:10:12 +0000151 x_GLF_color = vec4<f32>(f32(x_152), f32(x_155), f32(x_158), f32(x_161));
152 } else {
James Price1a72a762022-03-21 16:09:17 +0000153 let x_165 : i32 = x_10.x_GLF_uniform_int_values[2].el;
Alastair Donaldsonf7e73d42021-07-23 13:10:12 +0000154 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
160struct main_out {
Ben Clayton01e4b6f2022-01-19 22:46:57 +0000161 @location(0)
James Price3b671cb2022-03-28 14:31:22 +0000162 x_GLF_color_1 : vec4<f32>,
James Price1a72a762022-03-21 16:09:17 +0000163}
Alastair Donaldsonf7e73d42021-07-23 13:10:12 +0000164
dan sinclairb29892b2022-06-07 13:55:34 +0000165@fragment
Alastair Donaldsonf7e73d42021-07-23 13:10:12 +0000166fn main() -> main_out {
167 main_1();
168 return main_out(x_GLF_color);
169}