xref: /aosp_15_r20/external/skia/tests/sksl/blend/BlendSoftLight.asm.frag (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
1               OpCapability Shader
2          %1 = OpExtInstImport "GLSL.std.450"
3               OpMemoryModel Logical GLSL450
4               OpEntryPoint Fragment %main "main" %sk_FragColor
5               OpExecutionMode %main OriginUpperLeft
6               OpName %_kGuardedDivideEpsilon "$kGuardedDivideEpsilon"
7               OpName %sk_FragColor "sk_FragColor"
8               OpName %_UniformBuffer "_UniformBuffer"
9               OpMemberName %_UniformBuffer 0 "src"
10               OpMemberName %_UniformBuffer 1 "dst"
11               OpName %soft_light_component_Qhh2h2 "soft_light_component_Qhh2h2"
12               OpName %DSqd "DSqd"
13               OpName %DCub "DCub"
14               OpName %DaSqd "DaSqd"
15               OpName %DaCub "DaCub"
16               OpName %main "main"
17               OpDecorate %_kGuardedDivideEpsilon RelaxedPrecision
18               OpDecorate %sk_FragColor RelaxedPrecision
19               OpDecorate %sk_FragColor Location 0
20               OpDecorate %sk_FragColor Index 0
21               OpMemberDecorate %_UniformBuffer 0 Offset 0
22               OpMemberDecorate %_UniformBuffer 0 RelaxedPrecision
23               OpMemberDecorate %_UniformBuffer 1 Offset 16
24               OpMemberDecorate %_UniformBuffer 1 RelaxedPrecision
25               OpDecorate %_UniformBuffer Block
26               OpDecorate %15 Binding 0
27               OpDecorate %15 DescriptorSet 0
28               OpDecorate %25 RelaxedPrecision
29               OpDecorate %26 RelaxedPrecision
30               OpDecorate %27 RelaxedPrecision
31               OpDecorate %28 RelaxedPrecision
32               OpDecorate %29 RelaxedPrecision
33               OpDecorate %34 RelaxedPrecision
34               OpDecorate %35 RelaxedPrecision
35               OpDecorate %36 RelaxedPrecision
36               OpDecorate %37 RelaxedPrecision
37               OpDecorate %38 RelaxedPrecision
38               OpDecorate %39 RelaxedPrecision
39               OpDecorate %40 RelaxedPrecision
40               OpDecorate %41 RelaxedPrecision
41               OpDecorate %42 RelaxedPrecision
42               OpDecorate %43 RelaxedPrecision
43               OpDecorate %44 RelaxedPrecision
44               OpDecorate %45 RelaxedPrecision
45               OpDecorate %46 RelaxedPrecision
46               OpDecorate %47 RelaxedPrecision
47               OpDecorate %48 RelaxedPrecision
48               OpDecorate %49 RelaxedPrecision
49               OpDecorate %50 RelaxedPrecision
50               OpDecorate %52 RelaxedPrecision
51               OpDecorate %53 RelaxedPrecision
52               OpDecorate %54 RelaxedPrecision
53               OpDecorate %55 RelaxedPrecision
54               OpDecorate %56 RelaxedPrecision
55               OpDecorate %57 RelaxedPrecision
56               OpDecorate %58 RelaxedPrecision
57               OpDecorate %59 RelaxedPrecision
58               OpDecorate %60 RelaxedPrecision
59               OpDecorate %61 RelaxedPrecision
60               OpDecorate %62 RelaxedPrecision
61               OpDecorate %63 RelaxedPrecision
62               OpDecorate %64 RelaxedPrecision
63               OpDecorate %65 RelaxedPrecision
64               OpDecorate %66 RelaxedPrecision
65               OpDecorate %67 RelaxedPrecision
66               OpDecorate %68 RelaxedPrecision
67               OpDecorate %69 RelaxedPrecision
68               OpDecorate %70 RelaxedPrecision
69               OpDecorate %72 RelaxedPrecision
70               OpDecorate %73 RelaxedPrecision
71               OpDecorate %74 RelaxedPrecision
72               OpDecorate %75 RelaxedPrecision
73               OpDecorate %76 RelaxedPrecision
74               OpDecorate %DSqd RelaxedPrecision
75               OpDecorate %83 RelaxedPrecision
76               OpDecorate %84 RelaxedPrecision
77               OpDecorate %85 RelaxedPrecision
78               OpDecorate %86 RelaxedPrecision
79               OpDecorate %87 RelaxedPrecision
80               OpDecorate %DCub RelaxedPrecision
81               OpDecorate %89 RelaxedPrecision
82               OpDecorate %90 RelaxedPrecision
83               OpDecorate %91 RelaxedPrecision
84               OpDecorate %DaSqd RelaxedPrecision
85               OpDecorate %93 RelaxedPrecision
86               OpDecorate %94 RelaxedPrecision
87               OpDecorate %95 RelaxedPrecision
88               OpDecorate %96 RelaxedPrecision
89               OpDecorate %97 RelaxedPrecision
90               OpDecorate %DaCub RelaxedPrecision
91               OpDecorate %99 RelaxedPrecision
92               OpDecorate %100 RelaxedPrecision
93               OpDecorate %101 RelaxedPrecision
94               OpDecorate %102 RelaxedPrecision
95               OpDecorate %103 RelaxedPrecision
96               OpDecorate %104 RelaxedPrecision
97               OpDecorate %105 RelaxedPrecision
98               OpDecorate %107 RelaxedPrecision
99               OpDecorate %108 RelaxedPrecision
100               OpDecorate %109 RelaxedPrecision
101               OpDecorate %111 RelaxedPrecision
102               OpDecorate %112 RelaxedPrecision
103               OpDecorate %113 RelaxedPrecision
104               OpDecorate %114 RelaxedPrecision
105               OpDecorate %115 RelaxedPrecision
106               OpDecorate %116 RelaxedPrecision
107               OpDecorate %117 RelaxedPrecision
108               OpDecorate %118 RelaxedPrecision
109               OpDecorate %120 RelaxedPrecision
110               OpDecorate %121 RelaxedPrecision
111               OpDecorate %122 RelaxedPrecision
112               OpDecorate %123 RelaxedPrecision
113               OpDecorate %124 RelaxedPrecision
114               OpDecorate %125 RelaxedPrecision
115               OpDecorate %126 RelaxedPrecision
116               OpDecorate %127 RelaxedPrecision
117               OpDecorate %128 RelaxedPrecision
118               OpDecorate %129 RelaxedPrecision
119               OpDecorate %130 RelaxedPrecision
120               OpDecorate %131 RelaxedPrecision
121               OpDecorate %133 RelaxedPrecision
122               OpDecorate %134 RelaxedPrecision
123               OpDecorate %135 RelaxedPrecision
124               OpDecorate %136 RelaxedPrecision
125               OpDecorate %137 RelaxedPrecision
126               OpDecorate %138 RelaxedPrecision
127               OpDecorate %139 RelaxedPrecision
128               OpDecorate %140 RelaxedPrecision
129               OpDecorate %141 RelaxedPrecision
130               OpDecorate %142 RelaxedPrecision
131               OpDecorate %143 RelaxedPrecision
132               OpDecorate %144 RelaxedPrecision
133               OpDecorate %145 RelaxedPrecision
134               OpDecorate %146 RelaxedPrecision
135               OpDecorate %147 RelaxedPrecision
136               OpDecorate %148 RelaxedPrecision
137               OpDecorate %149 RelaxedPrecision
138               OpDecorate %150 RelaxedPrecision
139               OpDecorate %151 RelaxedPrecision
140               OpDecorate %152 RelaxedPrecision
141               OpDecorate %153 RelaxedPrecision
142               OpDecorate %154 RelaxedPrecision
143               OpDecorate %155 RelaxedPrecision
144               OpDecorate %156 RelaxedPrecision
145               OpDecorate %157 RelaxedPrecision
146               OpDecorate %158 RelaxedPrecision
147               OpDecorate %159 RelaxedPrecision
148               OpDecorate %160 RelaxedPrecision
149               OpDecorate %161 RelaxedPrecision
150               OpDecorate %162 RelaxedPrecision
151               OpDecorate %163 RelaxedPrecision
152               OpDecorate %164 RelaxedPrecision
153               OpDecorate %165 RelaxedPrecision
154               OpDecorate %166 RelaxedPrecision
155               OpDecorate %167 RelaxedPrecision
156               OpDecorate %168 RelaxedPrecision
157               OpDecorate %169 RelaxedPrecision
158               OpDecorate %170 RelaxedPrecision
159               OpDecorate %171 RelaxedPrecision
160               OpDecorate %172 RelaxedPrecision
161               OpDecorate %173 RelaxedPrecision
162               OpDecorate %174 RelaxedPrecision
163               OpDecorate %175 RelaxedPrecision
164               OpDecorate %176 RelaxedPrecision
165               OpDecorate %177 RelaxedPrecision
166               OpDecorate %178 RelaxedPrecision
167               OpDecorate %179 RelaxedPrecision
168               OpDecorate %180 RelaxedPrecision
169               OpDecorate %181 RelaxedPrecision
170               OpDecorate %189 RelaxedPrecision
171               OpDecorate %190 RelaxedPrecision
172               OpDecorate %199 RelaxedPrecision
173               OpDecorate %201 RelaxedPrecision
174               OpDecorate %202 RelaxedPrecision
175               OpDecorate %205 RelaxedPrecision
176               OpDecorate %206 RelaxedPrecision
177               OpDecorate %210 RelaxedPrecision
178               OpDecorate %211 RelaxedPrecision
179               OpDecorate %214 RelaxedPrecision
180               OpDecorate %215 RelaxedPrecision
181               OpDecorate %219 RelaxedPrecision
182               OpDecorate %220 RelaxedPrecision
183               OpDecorate %223 RelaxedPrecision
184               OpDecorate %224 RelaxedPrecision
185               OpDecorate %228 RelaxedPrecision
186               OpDecorate %229 RelaxedPrecision
187               OpDecorate %231 RelaxedPrecision
188               OpDecorate %232 RelaxedPrecision
189               OpDecorate %233 RelaxedPrecision
190               OpDecorate %235 RelaxedPrecision
191               OpDecorate %236 RelaxedPrecision
192               OpDecorate %237 RelaxedPrecision
193               OpDecorate %238 RelaxedPrecision
194               OpDecorate %239 RelaxedPrecision
195               OpDecorate %240 RelaxedPrecision
196      %float = OpTypeFloat 32
197%_ptr_Private_float = OpTypePointer Private %float
198%_kGuardedDivideEpsilon = OpVariable %_ptr_Private_float Private
199       %bool = OpTypeBool
200      %false = OpConstantFalse %bool
201%float_9_99999994en09 = OpConstant %float 9.99999994e-09
202    %float_0 = OpConstant %float 0
203    %v4float = OpTypeVector %float 4
204%_ptr_Output_v4float = OpTypePointer Output %v4float
205%sk_FragColor = OpVariable %_ptr_Output_v4float Output
206%_UniformBuffer = OpTypeStruct %v4float %v4float
207%_ptr_Uniform__UniformBuffer = OpTypePointer Uniform %_UniformBuffer
208         %15 = OpVariable %_ptr_Uniform__UniformBuffer Uniform
209    %v2float = OpTypeVector %float 2
210%_ptr_Function_v2float = OpTypePointer Function %v2float
211         %20 = OpTypeFunction %float %_ptr_Function_v2float %_ptr_Function_v2float
212    %float_2 = OpConstant %float 2
213    %float_1 = OpConstant %float 1
214    %float_4 = OpConstant %float 4
215%_ptr_Function_float = OpTypePointer Function %float
216    %float_3 = OpConstant %float 3
217    %float_6 = OpConstant %float 6
218   %float_12 = OpConstant %float 12
219   %float_16 = OpConstant %float 16
220       %void = OpTypeVoid
221        %183 = OpTypeFunction %void
222%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
223        %int = OpTypeInt 32 1
224      %int_1 = OpConstant %int 1
225%_ptr_Function_v4float = OpTypePointer Function %v4float
226      %int_0 = OpConstant %int 0
227%soft_light_component_Qhh2h2 = OpFunction %float None %20
228         %21 = OpFunctionParameter %_ptr_Function_v2float
229         %22 = OpFunctionParameter %_ptr_Function_v2float
230         %23 = OpLabel
231       %DSqd = OpVariable %_ptr_Function_float Function
232       %DCub = OpVariable %_ptr_Function_float Function
233      %DaSqd = OpVariable %_ptr_Function_float Function
234      %DaCub = OpVariable %_ptr_Function_float Function
235         %25 = OpLoad %v2float %21
236         %26 = OpCompositeExtract %float %25 0
237         %27 = OpFMul %float %float_2 %26
238         %28 = OpLoad %v2float %21
239         %29 = OpCompositeExtract %float %28 1
240         %30 = OpFOrdLessThanEqual %bool %27 %29
241               OpSelectionMerge %33 None
242               OpBranchConditional %30 %31 %32
243         %31 = OpLabel
244         %34 = OpLoad %v2float %22
245         %35 = OpCompositeExtract %float %34 0
246         %36 = OpLoad %v2float %22
247         %37 = OpCompositeExtract %float %36 0
248         %38 = OpFMul %float %35 %37
249         %39 = OpLoad %v2float %21
250         %40 = OpCompositeExtract %float %39 1
251         %41 = OpLoad %v2float %21
252         %42 = OpCompositeExtract %float %41 0
253         %43 = OpFMul %float %float_2 %42
254         %44 = OpFSub %float %40 %43
255         %45 = OpFMul %float %38 %44
256         %46 = OpLoad %v2float %22
257         %47 = OpCompositeExtract %float %46 1
258         %48 = OpLoad %float %_kGuardedDivideEpsilon
259         %49 = OpFAdd %float %47 %48
260         %50 = OpFDiv %float %45 %49
261         %52 = OpLoad %v2float %22
262         %53 = OpCompositeExtract %float %52 1
263         %54 = OpFSub %float %float_1 %53
264         %55 = OpLoad %v2float %21
265         %56 = OpCompositeExtract %float %55 0
266         %57 = OpFMul %float %54 %56
267         %58 = OpFAdd %float %50 %57
268         %59 = OpLoad %v2float %22
269         %60 = OpCompositeExtract %float %59 0
270         %61 = OpLoad %v2float %21
271         %62 = OpCompositeExtract %float %61 1
272         %63 = OpFNegate %float %62
273         %64 = OpLoad %v2float %21
274         %65 = OpCompositeExtract %float %64 0
275         %66 = OpFMul %float %float_2 %65
276         %67 = OpFAdd %float %63 %66
277         %68 = OpFAdd %float %67 %float_1
278         %69 = OpFMul %float %60 %68
279         %70 = OpFAdd %float %58 %69
280               OpReturnValue %70
281         %32 = OpLabel
282         %72 = OpLoad %v2float %22
283         %73 = OpCompositeExtract %float %72 0
284         %74 = OpFMul %float %float_4 %73
285         %75 = OpLoad %v2float %22
286         %76 = OpCompositeExtract %float %75 1
287         %77 = OpFOrdLessThanEqual %bool %74 %76
288               OpSelectionMerge %80 None
289               OpBranchConditional %77 %78 %79
290         %78 = OpLabel
291         %83 = OpLoad %v2float %22
292         %84 = OpCompositeExtract %float %83 0
293         %85 = OpLoad %v2float %22
294         %86 = OpCompositeExtract %float %85 0
295         %87 = OpFMul %float %84 %86
296               OpStore %DSqd %87
297         %89 = OpLoad %v2float %22
298         %90 = OpCompositeExtract %float %89 0
299         %91 = OpFMul %float %87 %90
300               OpStore %DCub %91
301         %93 = OpLoad %v2float %22
302         %94 = OpCompositeExtract %float %93 1
303         %95 = OpLoad %v2float %22
304         %96 = OpCompositeExtract %float %95 1
305         %97 = OpFMul %float %94 %96
306               OpStore %DaSqd %97
307         %99 = OpLoad %v2float %22
308        %100 = OpCompositeExtract %float %99 1
309        %101 = OpFMul %float %97 %100
310               OpStore %DaCub %101
311        %102 = OpLoad %v2float %21
312        %103 = OpCompositeExtract %float %102 0
313        %104 = OpLoad %v2float %22
314        %105 = OpCompositeExtract %float %104 0
315        %107 = OpLoad %v2float %21
316        %108 = OpCompositeExtract %float %107 1
317        %109 = OpFMul %float %float_3 %108
318        %111 = OpLoad %v2float %21
319        %112 = OpCompositeExtract %float %111 0
320        %113 = OpFMul %float %float_6 %112
321        %114 = OpFSub %float %109 %113
322        %115 = OpFSub %float %114 %float_1
323        %116 = OpFMul %float %105 %115
324        %117 = OpFSub %float %103 %116
325        %118 = OpFMul %float %97 %117
326        %120 = OpLoad %v2float %22
327        %121 = OpCompositeExtract %float %120 1
328        %122 = OpFMul %float %float_12 %121
329        %123 = OpFMul %float %122 %87
330        %124 = OpLoad %v2float %21
331        %125 = OpCompositeExtract %float %124 1
332        %126 = OpLoad %v2float %21
333        %127 = OpCompositeExtract %float %126 0
334        %128 = OpFMul %float %float_2 %127
335        %129 = OpFSub %float %125 %128
336        %130 = OpFMul %float %123 %129
337        %131 = OpFAdd %float %118 %130
338        %133 = OpFMul %float %float_16 %91
339        %134 = OpLoad %v2float %21
340        %135 = OpCompositeExtract %float %134 1
341        %136 = OpLoad %v2float %21
342        %137 = OpCompositeExtract %float %136 0
343        %138 = OpFMul %float %float_2 %137
344        %139 = OpFSub %float %135 %138
345        %140 = OpFMul %float %133 %139
346        %141 = OpFSub %float %131 %140
347        %142 = OpLoad %v2float %21
348        %143 = OpCompositeExtract %float %142 0
349        %144 = OpFMul %float %101 %143
350        %145 = OpFSub %float %141 %144
351        %146 = OpLoad %float %_kGuardedDivideEpsilon
352        %147 = OpFAdd %float %97 %146
353        %148 = OpFDiv %float %145 %147
354               OpReturnValue %148
355         %79 = OpLabel
356        %149 = OpLoad %v2float %22
357        %150 = OpCompositeExtract %float %149 0
358        %151 = OpLoad %v2float %21
359        %152 = OpCompositeExtract %float %151 1
360        %153 = OpLoad %v2float %21
361        %154 = OpCompositeExtract %float %153 0
362        %155 = OpFMul %float %float_2 %154
363        %156 = OpFSub %float %152 %155
364        %157 = OpFAdd %float %156 %float_1
365        %158 = OpFMul %float %150 %157
366        %159 = OpLoad %v2float %21
367        %160 = OpCompositeExtract %float %159 0
368        %161 = OpFAdd %float %158 %160
369        %163 = OpLoad %v2float %22
370        %164 = OpCompositeExtract %float %163 1
371        %165 = OpLoad %v2float %22
372        %166 = OpCompositeExtract %float %165 0
373        %167 = OpFMul %float %164 %166
374        %162 = OpExtInst %float %1 Sqrt %167
375        %168 = OpLoad %v2float %21
376        %169 = OpCompositeExtract %float %168 1
377        %170 = OpLoad %v2float %21
378        %171 = OpCompositeExtract %float %170 0
379        %172 = OpFMul %float %float_2 %171
380        %173 = OpFSub %float %169 %172
381        %174 = OpFMul %float %162 %173
382        %175 = OpFSub %float %161 %174
383        %176 = OpLoad %v2float %22
384        %177 = OpCompositeExtract %float %176 1
385        %178 = OpLoad %v2float %21
386        %179 = OpCompositeExtract %float %178 0
387        %180 = OpFMul %float %177 %179
388        %181 = OpFSub %float %175 %180
389               OpReturnValue %181
390         %80 = OpLabel
391               OpBranch %33
392         %33 = OpLabel
393               OpUnreachable
394               OpFunctionEnd
395       %main = OpFunction %void None %183
396        %184 = OpLabel
397        %192 = OpVariable %_ptr_Function_v4float Function
398        %203 = OpVariable %_ptr_Function_v2float Function
399        %207 = OpVariable %_ptr_Function_v2float Function
400        %212 = OpVariable %_ptr_Function_v2float Function
401        %216 = OpVariable %_ptr_Function_v2float Function
402        %221 = OpVariable %_ptr_Function_v2float Function
403        %225 = OpVariable %_ptr_Function_v2float Function
404          %9 = OpSelect %float %false %float_9_99999994en09 %float_0
405               OpStore %_kGuardedDivideEpsilon %9
406        %185 = OpAccessChain %_ptr_Uniform_v4float %15 %int_1
407        %189 = OpLoad %v4float %185
408        %190 = OpCompositeExtract %float %189 3
409        %191 = OpFOrdEqual %bool %190 %float_0
410               OpSelectionMerge %196 None
411               OpBranchConditional %191 %194 %195
412        %194 = OpLabel
413        %197 = OpAccessChain %_ptr_Uniform_v4float %15 %int_0
414        %199 = OpLoad %v4float %197
415               OpStore %192 %199
416               OpBranch %196
417        %195 = OpLabel
418        %200 = OpAccessChain %_ptr_Uniform_v4float %15 %int_0
419        %201 = OpLoad %v4float %200
420        %202 = OpVectorShuffle %v2float %201 %201 0 3
421               OpStore %203 %202
422        %204 = OpAccessChain %_ptr_Uniform_v4float %15 %int_1
423        %205 = OpLoad %v4float %204
424        %206 = OpVectorShuffle %v2float %205 %205 0 3
425               OpStore %207 %206
426        %208 = OpFunctionCall %float %soft_light_component_Qhh2h2 %203 %207
427        %209 = OpAccessChain %_ptr_Uniform_v4float %15 %int_0
428        %210 = OpLoad %v4float %209
429        %211 = OpVectorShuffle %v2float %210 %210 1 3
430               OpStore %212 %211
431        %213 = OpAccessChain %_ptr_Uniform_v4float %15 %int_1
432        %214 = OpLoad %v4float %213
433        %215 = OpVectorShuffle %v2float %214 %214 1 3
434               OpStore %216 %215
435        %217 = OpFunctionCall %float %soft_light_component_Qhh2h2 %212 %216
436        %218 = OpAccessChain %_ptr_Uniform_v4float %15 %int_0
437        %219 = OpLoad %v4float %218
438        %220 = OpVectorShuffle %v2float %219 %219 2 3
439               OpStore %221 %220
440        %222 = OpAccessChain %_ptr_Uniform_v4float %15 %int_1
441        %223 = OpLoad %v4float %222
442        %224 = OpVectorShuffle %v2float %223 %223 2 3
443               OpStore %225 %224
444        %226 = OpFunctionCall %float %soft_light_component_Qhh2h2 %221 %225
445        %227 = OpAccessChain %_ptr_Uniform_v4float %15 %int_0
446        %228 = OpLoad %v4float %227
447        %229 = OpCompositeExtract %float %228 3
448        %230 = OpAccessChain %_ptr_Uniform_v4float %15 %int_0
449        %231 = OpLoad %v4float %230
450        %232 = OpCompositeExtract %float %231 3
451        %233 = OpFSub %float %float_1 %232
452        %234 = OpAccessChain %_ptr_Uniform_v4float %15 %int_1
453        %235 = OpLoad %v4float %234
454        %236 = OpCompositeExtract %float %235 3
455        %237 = OpFMul %float %233 %236
456        %238 = OpFAdd %float %229 %237
457        %239 = OpCompositeConstruct %v4float %208 %217 %226 %238
458               OpStore %192 %239
459               OpBranch %196
460        %196 = OpLabel
461        %240 = OpLoad %v4float %192
462               OpStore %sk_FragColor %240
463               OpReturn
464               OpFunctionEnd
465