blob: 323b9875a24a037ed106f3f80b8ca053823ce27c [file] [log] [blame]
Alastair Donaldsonf7e73d42021-07-23 13:10:12 +00001 OpCapability Shader
2 %1 = OpExtInstImport "GLSL.std.450"
3 OpMemoryModel Logical GLSL450
4 OpEntryPoint Fragment %main "main" %_GLF_color
5 OpExecutionMode %main OriginUpperLeft
6 OpSource ESSL 310
7 OpName %main "main"
8 OpName %swap_i1_i1_ "swap(i1;i1;"
9 OpName %i "i"
10 OpName %j "j"
11 OpName %performPartition_i1_i1_ "performPartition(i1;i1;"
12 OpName %l "l"
13 OpName %h "h"
14 OpName %quicksort_ "quicksort("
15 OpName %temp "temp"
16 OpName %QuicksortObject "QuicksortObject"
17 OpMemberName %QuicksortObject 0 "numbers"
18 OpName %obj "obj"
19 OpName %pivot "pivot"
20 OpName %i_0 "i"
21 OpName %j_0 "j"
22 OpName %param "param"
23 OpName %param_0 "param"
24 OpName %param_1 "param"
25 OpName %param_2 "param"
26 OpName %l_0 "l"
27 OpName %h_0 "h"
28 OpName %top "top"
29 OpName %stack "stack"
30 OpName %p "p"
31 OpName %param_3 "param"
32 OpName %param_4 "param"
33 OpName %i_1 "i"
34 OpName %_GLF_color "_GLF_color"
35 OpName %buf0 "buf0"
36 OpMemberName %buf0 0 "resolution"
37 OpName %_ ""
38 OpDecorate %_GLF_color Location 0
39 OpMemberDecorate %buf0 0 Offset 0
40 OpDecorate %buf0 Block
41 OpDecorate %_ DescriptorSet 0
42 OpDecorate %_ Binding 0
43 %void = OpTypeVoid
44 %32 = OpTypeFunction %void
45 %int = OpTypeInt 32 1
46%_ptr_Function_int = OpTypePointer Function %int
47 %35 = OpTypeFunction %void %_ptr_Function_int %_ptr_Function_int
48 %36 = OpTypeFunction %int %_ptr_Function_int %_ptr_Function_int
49 %uint = OpTypeInt 32 0
50 %uint_10 = OpConstant %uint 10
51%_arr_int_uint_10 = OpTypeArray %int %uint_10
52%QuicksortObject = OpTypeStruct %_arr_int_uint_10
53%_ptr_Private_QuicksortObject = OpTypePointer Private %QuicksortObject
54 %obj = OpVariable %_ptr_Private_QuicksortObject Private
55 %int_0 = OpConstant %int 0
56%_ptr_Private_int = OpTypePointer Private %int
57 %int_1 = OpConstant %int 1
58 %bool = OpTypeBool
59 %int_9 = OpConstant %int 9
60 %int_n1 = OpConstant %int -1
61%_ptr_Function__arr_int_uint_10 = OpTypePointer Function %_arr_int_uint_10
62 %int_10 = OpConstant %int 10
63 %int_4 = OpConstant %int 4
64 %float = OpTypeFloat 32
65 %v4float = OpTypeVector %float 4
66%_ptr_Output_v4float = OpTypePointer Output %v4float
67 %_GLF_color = OpVariable %_ptr_Output_v4float Output
68 %float_1 = OpConstant %float 1
69 %float_0 = OpConstant %float 0
70 %55 = OpConstantComposite %v4float %float_1 %float_0 %float_0 %float_1
71 %56 = OpConstantComposite %v4float %float_0 %float_1 %float_0 %float_1
72 %v2float = OpTypeVector %float 2
73 %buf0 = OpTypeStruct %v2float
74%_ptr_Uniform_buf0 = OpTypePointer Uniform %buf0
75 %_ = OpVariable %_ptr_Uniform_buf0 Uniform
76 %main = OpFunction %void None %32
77 %59 = OpLabel
78 %i_1 = OpVariable %_ptr_Function_int Function
79 OpStore %i_1 %int_0
80 OpBranch %60
81 %60 = OpLabel
82 OpLoopMerge %61 %62 None
83 OpBranch %63
84 %63 = OpLabel
85 %64 = OpLoad %int %i_1
86 %65 = OpSLessThan %bool %64 %int_10
87 OpBranchConditional %65 %66 %61
88 %66 = OpLabel
89 %67 = OpLoad %int %i_1
90 %68 = OpLoad %int %i_1
91 %69 = OpISub %int %int_10 %68
92 %70 = OpAccessChain %_ptr_Private_int %obj %int_0 %67
93 OpStore %70 %69
94 %71 = OpLoad %int %i_1
95 %72 = OpLoad %int %i_1
96 %73 = OpAccessChain %_ptr_Private_int %obj %int_0 %72
97 %74 = OpLoad %int %73
98 %75 = OpLoad %int %i_1
99 %76 = OpAccessChain %_ptr_Private_int %obj %int_0 %75
100 %77 = OpLoad %int %76
101 %78 = OpIMul %int %74 %77
102 %79 = OpAccessChain %_ptr_Private_int %obj %int_0 %71
103 OpStore %79 %78
104 OpBranch %62
105 %62 = OpLabel
106 %80 = OpLoad %int %i_1
107 %81 = OpIAdd %int %80 %int_1
108 OpStore %i_1 %81
109 OpBranch %60
110 %61 = OpLabel
111 %82 = OpFunctionCall %void %quicksort_
112 %83 = OpAccessChain %_ptr_Private_int %obj %int_0 %int_0
113 %84 = OpLoad %int %83
114 %85 = OpAccessChain %_ptr_Private_int %obj %int_0 %int_4
115 %86 = OpLoad %int %85
116 %87 = OpSLessThan %bool %84 %86
117 OpSelectionMerge %88 None
118 OpBranchConditional %87 %89 %90
119 %89 = OpLabel
120 OpStore %_GLF_color %55
121 OpBranch %88
122 %90 = OpLabel
123 OpStore %_GLF_color %56
124 OpBranch %88
125 %88 = OpLabel
126 OpReturn
127 OpFunctionEnd
128%swap_i1_i1_ = OpFunction %void None %35
129 %i = OpFunctionParameter %_ptr_Function_int
130 %j = OpFunctionParameter %_ptr_Function_int
131 %91 = OpLabel
132 %temp = OpVariable %_ptr_Function_int Function
133 %92 = OpLoad %int %i
134 %93 = OpAccessChain %_ptr_Private_int %obj %int_0 %92
135 %94 = OpLoad %int %93
136 OpStore %temp %94
137 %95 = OpLoad %int %i
138 %96 = OpLoad %int %j
139 %97 = OpAccessChain %_ptr_Private_int %obj %int_0 %96
140 %98 = OpLoad %int %97
141 %99 = OpAccessChain %_ptr_Private_int %obj %int_0 %95
142 OpStore %99 %98
143 %100 = OpLoad %int %j
144 %101 = OpLoad %int %temp
145 %102 = OpAccessChain %_ptr_Private_int %obj %int_0 %100
146 OpStore %102 %101
147 OpReturn
148 OpFunctionEnd
149%performPartition_i1_i1_ = OpFunction %int None %36
150 %l = OpFunctionParameter %_ptr_Function_int
151 %h = OpFunctionParameter %_ptr_Function_int
152 %103 = OpLabel
153 %pivot = OpVariable %_ptr_Function_int Function
154 %i_0 = OpVariable %_ptr_Function_int Function
155 %j_0 = OpVariable %_ptr_Function_int Function
156 %param = OpVariable %_ptr_Function_int Function
157 %param_0 = OpVariable %_ptr_Function_int Function
158 %param_1 = OpVariable %_ptr_Function_int Function
159 %param_2 = OpVariable %_ptr_Function_int Function
160 %104 = OpLoad %int %h
161 %105 = OpAccessChain %_ptr_Private_int %obj %int_0 %104
162 %106 = OpLoad %int %105
163 OpStore %pivot %106
164 %107 = OpLoad %int %l
165 %108 = OpISub %int %107 %int_1
166 OpStore %i_0 %108
167 %109 = OpLoad %int %l
168 OpStore %j_0 %109
169 OpBranch %110
170 %110 = OpLabel
171 OpLoopMerge %111 %112 None
172 OpBranch %113
173 %113 = OpLabel
174 %114 = OpLoad %int %j_0
175 %115 = OpLoad %int %h
176 %116 = OpISub %int %115 %int_1
177 %117 = OpSLessThanEqual %bool %114 %116
178 OpBranchConditional %117 %118 %111
179 %118 = OpLabel
180 %119 = OpLoad %int %j_0
181 %120 = OpAccessChain %_ptr_Private_int %obj %int_0 %119
182 %121 = OpLoad %int %120
183 %122 = OpLoad %int %pivot
184 %123 = OpSLessThanEqual %bool %121 %122
185 OpSelectionMerge %124 None
186 OpBranchConditional %123 %125 %124
187 %125 = OpLabel
188 %126 = OpLoad %int %i_0
189 %127 = OpIAdd %int %126 %int_1
190 OpStore %i_0 %127
191 %128 = OpLoad %int %i_0
192 OpStore %param %128
193 %129 = OpLoad %int %j_0
194 OpStore %param_0 %129
195 %130 = OpFunctionCall %void %swap_i1_i1_ %param %param_0
196 OpBranch %124
197 %124 = OpLabel
198 OpBranch %112
199 %112 = OpLabel
200 %131 = OpLoad %int %j_0
201 %132 = OpIAdd %int %131 %int_1
202 OpStore %j_0 %132
203 OpBranch %110
204 %111 = OpLabel
205 %133 = OpLoad %int %i_0
206 %134 = OpIAdd %int %133 %int_1
207 OpStore %param_1 %134
208 %135 = OpLoad %int %h
209 OpStore %param_2 %135
210 %136 = OpFunctionCall %void %swap_i1_i1_ %param_1 %param_2
211 %137 = OpLoad %int %i_0
212 %138 = OpIAdd %int %137 %int_1
213 OpReturnValue %138
214 OpFunctionEnd
215 %quicksort_ = OpFunction %void None %32
216 %139 = OpLabel
217 %l_0 = OpVariable %_ptr_Function_int Function
218 %h_0 = OpVariable %_ptr_Function_int Function
219 %top = OpVariable %_ptr_Function_int Function
220 %stack = OpVariable %_ptr_Function__arr_int_uint_10 Function
221 %p = OpVariable %_ptr_Function_int Function
222 %param_3 = OpVariable %_ptr_Function_int Function
223 %param_4 = OpVariable %_ptr_Function_int Function
224 OpStore %l_0 %int_0
225 OpStore %h_0 %int_9
226 OpStore %top %int_n1
227 %140 = OpLoad %int %top
228 %141 = OpIAdd %int %140 %int_1
229 OpStore %top %141
230 %142 = OpLoad %int %l_0
231 %143 = OpAccessChain %_ptr_Function_int %stack %141
232 OpStore %143 %142
233 %144 = OpLoad %int %top
234 %145 = OpIAdd %int %144 %int_1
235 OpStore %top %145
236 %146 = OpLoad %int %h_0
237 %147 = OpAccessChain %_ptr_Function_int %stack %145
238 OpStore %147 %146
239 OpBranch %148
240 %148 = OpLabel
241 OpLoopMerge %149 %150 None
242 OpBranch %151
243 %151 = OpLabel
244 %152 = OpLoad %int %top
245 %153 = OpSGreaterThanEqual %bool %152 %int_0
246 OpBranchConditional %153 %154 %149
247 %154 = OpLabel
248 %155 = OpLoad %int %top
249 %156 = OpISub %int %155 %int_1
250 OpStore %top %156
251 %157 = OpAccessChain %_ptr_Function_int %stack %155
252 %158 = OpLoad %int %157
253 OpStore %h_0 %158
254 %159 = OpLoad %int %top
255 %160 = OpISub %int %159 %int_1
256 OpStore %top %160
257 %161 = OpAccessChain %_ptr_Function_int %stack %159
258 %162 = OpLoad %int %161
259 OpStore %l_0 %162
260 %163 = OpLoad %int %l_0
261 OpStore %param_3 %163
262 %164 = OpLoad %int %h_0
263 OpStore %param_4 %164
264 %165 = OpFunctionCall %int %performPartition_i1_i1_ %param_3 %param_4
265 OpStore %p %165
266 %166 = OpLoad %int %p
267 %167 = OpISub %int %166 %int_1
268 %168 = OpLoad %int %l_0
269 %169 = OpSGreaterThan %bool %167 %168
270 OpSelectionMerge %170 None
271 OpBranchConditional %169 %171 %170
272 %171 = OpLabel
273 %172 = OpLoad %int %top
274 %173 = OpIAdd %int %172 %int_1
275 OpStore %top %173
276 %174 = OpLoad %int %l_0
277 %175 = OpAccessChain %_ptr_Function_int %stack %173
278 OpStore %175 %174
279 %176 = OpLoad %int %top
280 %177 = OpIAdd %int %176 %int_1
281 OpStore %top %177
282 %178 = OpLoad %int %p
283 %179 = OpISub %int %178 %int_1
284 %180 = OpAccessChain %_ptr_Function_int %stack %177
285 OpStore %180 %179
286 OpBranch %170
287 %170 = OpLabel
288 %181 = OpLoad %int %p
289 %182 = OpIAdd %int %181 %int_1
290 %183 = OpLoad %int %h_0
291 %184 = OpSLessThan %bool %182 %183
292 OpSelectionMerge %185 None
293 OpBranchConditional %184 %186 %185
294 %186 = OpLabel
295 %187 = OpLoad %int %top
296 %188 = OpIAdd %int %187 %int_1
297 OpStore %top %188
298 %189 = OpLoad %int %p
299 %190 = OpIAdd %int %189 %int_1
300 %191 = OpAccessChain %_ptr_Function_int %stack %188
301 OpStore %191 %190
302 %192 = OpLoad %int %top
303 %193 = OpIAdd %int %192 %int_1
304 OpStore %top %193
305 %194 = OpLoad %int %h_0
306 %195 = OpAccessChain %_ptr_Function_int %stack %193
307 OpStore %195 %194
308 OpBranch %185
309 %185 = OpLabel
310 OpBranch %150
311 %150 = OpLabel
312 OpBranch %148
313 %149 = OpLabel
314 OpReturn
315 OpFunctionEnd