xref: /aosp_15_r20/external/skia/tests/sksl/blend/BlendSaturation.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 %blend_color_saturation_Qhh3 "blend_color_saturation_Qhh3"
12               OpName %blend_hslc_h4h2h4h4 "blend_hslc_h4h2h4h4"
13               OpName %alpha "alpha"
14               OpName %sda "sda"
15               OpName %dsa "dsa"
16               OpName %l "l"
17               OpName %r "r"
18               OpName %_2_mn "_2_mn"
19               OpName %_3_mx "_3_mx"
20               OpName %_4_lum "_4_lum"
21               OpName %_5_result "_5_result"
22               OpName %_6_minComp "_6_minComp"
23               OpName %_7_maxComp "_7_maxComp"
24               OpName %main "main"
25               OpDecorate %_kGuardedDivideEpsilon RelaxedPrecision
26               OpDecorate %sk_FragColor RelaxedPrecision
27               OpDecorate %sk_FragColor Location 0
28               OpDecorate %sk_FragColor Index 0
29               OpMemberDecorate %_UniformBuffer 0 Offset 0
30               OpMemberDecorate %_UniformBuffer 0 RelaxedPrecision
31               OpMemberDecorate %_UniformBuffer 1 Offset 16
32               OpMemberDecorate %_UniformBuffer 1 RelaxedPrecision
33               OpDecorate %_UniformBuffer Block
34               OpDecorate %16 Binding 0
35               OpDecorate %16 DescriptorSet 0
36               OpDecorate %26 RelaxedPrecision
37               OpDecorate %27 RelaxedPrecision
38               OpDecorate %28 RelaxedPrecision
39               OpDecorate %29 RelaxedPrecision
40               OpDecorate %30 RelaxedPrecision
41               OpDecorate %31 RelaxedPrecision
42               OpDecorate %34 RelaxedPrecision
43               OpDecorate %35 RelaxedPrecision
44               OpDecorate %36 RelaxedPrecision
45               OpDecorate %37 RelaxedPrecision
46               OpDecorate %38 RelaxedPrecision
47               OpDecorate %39 RelaxedPrecision
48               OpDecorate %40 RelaxedPrecision
49               OpDecorate %alpha RelaxedPrecision
50               OpDecorate %51 RelaxedPrecision
51               OpDecorate %52 RelaxedPrecision
52               OpDecorate %53 RelaxedPrecision
53               OpDecorate %54 RelaxedPrecision
54               OpDecorate %55 RelaxedPrecision
55               OpDecorate %sda RelaxedPrecision
56               OpDecorate %57 RelaxedPrecision
57               OpDecorate %58 RelaxedPrecision
58               OpDecorate %59 RelaxedPrecision
59               OpDecorate %60 RelaxedPrecision
60               OpDecorate %61 RelaxedPrecision
61               OpDecorate %dsa RelaxedPrecision
62               OpDecorate %63 RelaxedPrecision
63               OpDecorate %64 RelaxedPrecision
64               OpDecorate %65 RelaxedPrecision
65               OpDecorate %66 RelaxedPrecision
66               OpDecorate %67 RelaxedPrecision
67               OpDecorate %l RelaxedPrecision
68               OpDecorate %69 RelaxedPrecision
69               OpDecorate %70 RelaxedPrecision
70               OpDecorate %76 RelaxedPrecision
71               OpDecorate %r RelaxedPrecision
72               OpDecorate %78 RelaxedPrecision
73               OpDecorate %79 RelaxedPrecision
74               OpDecorate %85 RelaxedPrecision
75               OpDecorate %86 RelaxedPrecision
76               OpDecorate %87 RelaxedPrecision
77               OpDecorate %_2_mn RelaxedPrecision
78               OpDecorate %94 RelaxedPrecision
79               OpDecorate %95 RelaxedPrecision
80               OpDecorate %96 RelaxedPrecision
81               OpDecorate %_3_mx RelaxedPrecision
82               OpDecorate %105 RelaxedPrecision
83               OpDecorate %106 RelaxedPrecision
84               OpDecorate %109 RelaxedPrecision
85               OpDecorate %110 RelaxedPrecision
86               OpDecorate %112 RelaxedPrecision
87               OpDecorate %113 RelaxedPrecision
88               OpDecorate %115 RelaxedPrecision
89               OpDecorate %_4_lum RelaxedPrecision
90               OpDecorate %117 RelaxedPrecision
91               OpDecorate %122 RelaxedPrecision
92               OpDecorate %_5_result RelaxedPrecision
93               OpDecorate %124 RelaxedPrecision
94               OpDecorate %125 RelaxedPrecision
95               OpDecorate %126 RelaxedPrecision
96               OpDecorate %127 RelaxedPrecision
97               OpDecorate %128 RelaxedPrecision
98               OpDecorate %129 RelaxedPrecision
99               OpDecorate %_6_minComp RelaxedPrecision
100               OpDecorate %133 RelaxedPrecision
101               OpDecorate %134 RelaxedPrecision
102               OpDecorate %135 RelaxedPrecision
103               OpDecorate %_7_maxComp RelaxedPrecision
104               OpDecorate %146 RelaxedPrecision
105               OpDecorate %147 RelaxedPrecision
106               OpDecorate %148 RelaxedPrecision
107               OpDecorate %150 RelaxedPrecision
108               OpDecorate %151 RelaxedPrecision
109               OpDecorate %152 RelaxedPrecision
110               OpDecorate %153 RelaxedPrecision
111               OpDecorate %154 RelaxedPrecision
112               OpDecorate %155 RelaxedPrecision
113               OpDecorate %163 RelaxedPrecision
114               OpDecorate %164 RelaxedPrecision
115               OpDecorate %165 RelaxedPrecision
116               OpDecorate %166 RelaxedPrecision
117               OpDecorate %167 RelaxedPrecision
118               OpDecorate %168 RelaxedPrecision
119               OpDecorate %169 RelaxedPrecision
120               OpDecorate %170 RelaxedPrecision
121               OpDecorate %171 RelaxedPrecision
122               OpDecorate %172 RelaxedPrecision
123               OpDecorate %173 RelaxedPrecision
124               OpDecorate %174 RelaxedPrecision
125               OpDecorate %175 RelaxedPrecision
126               OpDecorate %176 RelaxedPrecision
127               OpDecorate %177 RelaxedPrecision
128               OpDecorate %178 RelaxedPrecision
129               OpDecorate %179 RelaxedPrecision
130               OpDecorate %180 RelaxedPrecision
131               OpDecorate %181 RelaxedPrecision
132               OpDecorate %182 RelaxedPrecision
133               OpDecorate %183 RelaxedPrecision
134               OpDecorate %184 RelaxedPrecision
135               OpDecorate %185 RelaxedPrecision
136               OpDecorate %186 RelaxedPrecision
137               OpDecorate %187 RelaxedPrecision
138               OpDecorate %188 RelaxedPrecision
139               OpDecorate %189 RelaxedPrecision
140               OpDecorate %190 RelaxedPrecision
141               OpDecorate %191 RelaxedPrecision
142               OpDecorate %192 RelaxedPrecision
143               OpDecorate %193 RelaxedPrecision
144               OpDecorate %203 RelaxedPrecision
145               OpDecorate %207 RelaxedPrecision
146      %float = OpTypeFloat 32
147%_ptr_Private_float = OpTypePointer Private %float
148%_kGuardedDivideEpsilon = OpVariable %_ptr_Private_float Private
149       %bool = OpTypeBool
150      %false = OpConstantFalse %bool
151%float_9_99999994en09 = OpConstant %float 9.99999994e-09
152    %float_0 = OpConstant %float 0
153    %v4float = OpTypeVector %float 4
154%_ptr_Output_v4float = OpTypePointer Output %v4float
155%sk_FragColor = OpVariable %_ptr_Output_v4float Output
156%_UniformBuffer = OpTypeStruct %v4float %v4float
157%_ptr_Uniform__UniformBuffer = OpTypePointer Uniform %_UniformBuffer
158         %16 = OpVariable %_ptr_Uniform__UniformBuffer Uniform
159    %v3float = OpTypeVector %float 3
160%_ptr_Function_v3float = OpTypePointer Function %v3float
161         %21 = OpTypeFunction %float %_ptr_Function_v3float
162    %v2float = OpTypeVector %float 2
163%_ptr_Function_v2float = OpTypePointer Function %v2float
164%_ptr_Function_v4float = OpTypePointer Function %v4float
165         %44 = OpTypeFunction %v4float %_ptr_Function_v2float %_ptr_Function_v4float %_ptr_Function_v4float
166%_ptr_Function_float = OpTypePointer Function %float
167    %float_1 = OpConstant %float 1
168        %114 = OpConstantComposite %v3float %float_0 %float_0 %float_0
169%float_0_300000012 = OpConstant %float 0.300000012
170%float_0_589999974 = OpConstant %float 0.589999974
171%float_0_109999999 = OpConstant %float 0.109999999
172        %121 = OpConstantComposite %v3float %float_0_300000012 %float_0_589999974 %float_0_109999999
173%float_6_10351562en05 = OpConstant %float 6.10351562e-05
174       %void = OpTypeVoid
175        %195 = OpTypeFunction %void
176        %197 = OpConstantComposite %v2float %float_1 %float_1
177%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
178        %int = OpTypeInt 32 1
179      %int_0 = OpConstant %int 0
180      %int_1 = OpConstant %int 1
181%blend_color_saturation_Qhh3 = OpFunction %float None %21
182         %22 = OpFunctionParameter %_ptr_Function_v3float
183         %23 = OpLabel
184         %26 = OpLoad %v3float %22
185         %27 = OpCompositeExtract %float %26 0
186         %28 = OpLoad %v3float %22
187         %29 = OpCompositeExtract %float %28 1
188         %25 = OpExtInst %float %1 FMax %27 %29
189         %30 = OpLoad %v3float %22
190         %31 = OpCompositeExtract %float %30 2
191         %24 = OpExtInst %float %1 FMax %25 %31
192         %34 = OpLoad %v3float %22
193         %35 = OpCompositeExtract %float %34 0
194         %36 = OpLoad %v3float %22
195         %37 = OpCompositeExtract %float %36 1
196         %33 = OpExtInst %float %1 FMin %35 %37
197         %38 = OpLoad %v3float %22
198         %39 = OpCompositeExtract %float %38 2
199         %32 = OpExtInst %float %1 FMin %33 %39
200         %40 = OpFSub %float %24 %32
201               OpReturnValue %40
202               OpFunctionEnd
203%blend_hslc_h4h2h4h4 = OpFunction %v4float None %44
204         %45 = OpFunctionParameter %_ptr_Function_v2float
205         %46 = OpFunctionParameter %_ptr_Function_v4float
206         %47 = OpFunctionParameter %_ptr_Function_v4float
207         %48 = OpLabel
208      %alpha = OpVariable %_ptr_Function_float Function
209        %sda = OpVariable %_ptr_Function_v3float Function
210        %dsa = OpVariable %_ptr_Function_v3float Function
211          %l = OpVariable %_ptr_Function_v3float Function
212         %72 = OpVariable %_ptr_Function_v3float Function
213          %r = OpVariable %_ptr_Function_v3float Function
214         %81 = OpVariable %_ptr_Function_v3float Function
215      %_2_mn = OpVariable %_ptr_Function_float Function
216      %_3_mx = OpVariable %_ptr_Function_float Function
217        %101 = OpVariable %_ptr_Function_v3float Function
218        %107 = OpVariable %_ptr_Function_v3float Function
219     %_4_lum = OpVariable %_ptr_Function_float Function
220  %_5_result = OpVariable %_ptr_Function_v3float Function
221 %_6_minComp = OpVariable %_ptr_Function_float Function
222 %_7_maxComp = OpVariable %_ptr_Function_float Function
223         %51 = OpLoad %v4float %47
224         %52 = OpCompositeExtract %float %51 3
225         %53 = OpLoad %v4float %46
226         %54 = OpCompositeExtract %float %53 3
227         %55 = OpFMul %float %52 %54
228               OpStore %alpha %55
229         %57 = OpLoad %v4float %46
230         %58 = OpVectorShuffle %v3float %57 %57 0 1 2
231         %59 = OpLoad %v4float %47
232         %60 = OpCompositeExtract %float %59 3
233         %61 = OpVectorTimesScalar %v3float %58 %60
234               OpStore %sda %61
235         %63 = OpLoad %v4float %47
236         %64 = OpVectorShuffle %v3float %63 %63 0 1 2
237         %65 = OpLoad %v4float %46
238         %66 = OpCompositeExtract %float %65 3
239         %67 = OpVectorTimesScalar %v3float %64 %66
240               OpStore %dsa %67
241         %69 = OpLoad %v2float %45
242         %70 = OpCompositeExtract %float %69 0
243         %71 = OpFUnordNotEqual %bool %70 %float_0
244               OpSelectionMerge %75 None
245               OpBranchConditional %71 %73 %74
246         %73 = OpLabel
247               OpStore %72 %67
248               OpBranch %75
249         %74 = OpLabel
250               OpStore %72 %61
251               OpBranch %75
252         %75 = OpLabel
253         %76 = OpLoad %v3float %72
254               OpStore %l %76
255         %78 = OpLoad %v2float %45
256         %79 = OpCompositeExtract %float %78 0
257         %80 = OpFUnordNotEqual %bool %79 %float_0
258               OpSelectionMerge %84 None
259               OpBranchConditional %80 %82 %83
260         %82 = OpLabel
261               OpStore %81 %61
262               OpBranch %84
263         %83 = OpLabel
264               OpStore %81 %67
265               OpBranch %84
266         %84 = OpLabel
267         %85 = OpLoad %v3float %81
268               OpStore %r %85
269         %86 = OpLoad %v2float %45
270         %87 = OpCompositeExtract %float %86 1
271         %88 = OpFUnordNotEqual %bool %87 %float_0
272               OpSelectionMerge %90 None
273               OpBranchConditional %88 %89 %90
274         %89 = OpLabel
275         %94 = OpCompositeExtract %float %76 0
276         %95 = OpCompositeExtract %float %76 1
277         %93 = OpExtInst %float %1 FMin %94 %95
278         %96 = OpCompositeExtract %float %76 2
279         %92 = OpExtInst %float %1 FMin %93 %96
280               OpStore %_2_mn %92
281         %99 = OpExtInst %float %1 FMax %94 %95
282         %98 = OpExtInst %float %1 FMax %99 %96
283               OpStore %_3_mx %98
284        %100 = OpFOrdGreaterThan %bool %98 %92
285               OpSelectionMerge %104 None
286               OpBranchConditional %100 %102 %103
287        %102 = OpLabel
288        %105 = OpCompositeConstruct %v3float %92 %92 %92
289        %106 = OpFSub %v3float %76 %105
290               OpStore %107 %85
291        %108 = OpFunctionCall %float %blend_color_saturation_Qhh3 %107
292        %109 = OpVectorTimesScalar %v3float %106 %108
293        %110 = OpFSub %float %98 %92
294        %112 = OpFDiv %float %float_1 %110
295        %113 = OpVectorTimesScalar %v3float %109 %112
296               OpStore %101 %113
297               OpBranch %104
298        %103 = OpLabel
299               OpStore %101 %114
300               OpBranch %104
301        %104 = OpLabel
302        %115 = OpLoad %v3float %101
303               OpStore %l %115
304               OpStore %r %67
305               OpBranch %90
306         %90 = OpLabel
307        %122 = OpLoad %v3float %r
308        %117 = OpDot %float %121 %122
309               OpStore %_4_lum %117
310        %125 = OpLoad %v3float %l
311        %124 = OpDot %float %121 %125
312        %126 = OpFSub %float %117 %124
313        %127 = OpLoad %v3float %l
314        %128 = OpCompositeConstruct %v3float %126 %126 %126
315        %129 = OpFAdd %v3float %128 %127
316               OpStore %_5_result %129
317        %133 = OpCompositeExtract %float %129 0
318        %134 = OpCompositeExtract %float %129 1
319        %132 = OpExtInst %float %1 FMin %133 %134
320        %135 = OpCompositeExtract %float %129 2
321        %131 = OpExtInst %float %1 FMin %132 %135
322               OpStore %_6_minComp %131
323        %138 = OpExtInst %float %1 FMax %133 %134
324        %137 = OpExtInst %float %1 FMax %138 %135
325               OpStore %_7_maxComp %137
326        %139 = OpFOrdLessThan %bool %131 %float_0
327               OpSelectionMerge %141 None
328               OpBranchConditional %139 %140 %141
329        %140 = OpLabel
330        %142 = OpFUnordNotEqual %bool %117 %131
331               OpBranch %141
332        %141 = OpLabel
333        %143 = OpPhi %bool %false %90 %142 %140
334               OpSelectionMerge %145 None
335               OpBranchConditional %143 %144 %145
336        %144 = OpLabel
337        %146 = OpCompositeConstruct %v3float %117 %117 %117
338        %147 = OpFSub %v3float %129 %146
339        %148 = OpFSub %float %117 %131
340        %150 = OpFAdd %float %148 %float_6_10351562en05
341        %151 = OpLoad %float %_kGuardedDivideEpsilon
342        %152 = OpFAdd %float %150 %151
343        %153 = OpFDiv %float %117 %152
344        %154 = OpVectorTimesScalar %v3float %147 %153
345        %155 = OpFAdd %v3float %146 %154
346               OpStore %_5_result %155
347               OpBranch %145
348        %145 = OpLabel
349        %156 = OpFOrdGreaterThan %bool %137 %55
350               OpSelectionMerge %158 None
351               OpBranchConditional %156 %157 %158
352        %157 = OpLabel
353        %159 = OpFUnordNotEqual %bool %137 %117
354               OpBranch %158
355        %158 = OpLabel
356        %160 = OpPhi %bool %false %145 %159 %157
357               OpSelectionMerge %162 None
358               OpBranchConditional %160 %161 %162
359        %161 = OpLabel
360        %163 = OpLoad %v3float %_5_result
361        %164 = OpCompositeConstruct %v3float %117 %117 %117
362        %165 = OpFSub %v3float %163 %164
363        %166 = OpFSub %float %55 %117
364        %167 = OpVectorTimesScalar %v3float %165 %166
365        %168 = OpFSub %float %137 %117
366        %169 = OpFAdd %float %168 %float_6_10351562en05
367        %170 = OpLoad %float %_kGuardedDivideEpsilon
368        %171 = OpFAdd %float %169 %170
369        %172 = OpFDiv %float %float_1 %171
370        %173 = OpVectorTimesScalar %v3float %167 %172
371        %174 = OpFAdd %v3float %164 %173
372               OpStore %_5_result %174
373               OpBranch %162
374        %162 = OpLabel
375        %175 = OpLoad %v3float %_5_result
376        %176 = OpLoad %v4float %47
377        %177 = OpVectorShuffle %v3float %176 %176 0 1 2
378        %178 = OpFAdd %v3float %175 %177
379        %179 = OpFSub %v3float %178 %67
380        %180 = OpLoad %v4float %46
381        %181 = OpVectorShuffle %v3float %180 %180 0 1 2
382        %182 = OpFAdd %v3float %179 %181
383        %183 = OpFSub %v3float %182 %61
384        %184 = OpCompositeExtract %float %183 0
385        %185 = OpCompositeExtract %float %183 1
386        %186 = OpCompositeExtract %float %183 2
387        %187 = OpLoad %v4float %46
388        %188 = OpCompositeExtract %float %187 3
389        %189 = OpLoad %v4float %47
390        %190 = OpCompositeExtract %float %189 3
391        %191 = OpFAdd %float %188 %190
392        %192 = OpFSub %float %191 %55
393        %193 = OpCompositeConstruct %v4float %184 %185 %186 %192
394               OpReturnValue %193
395               OpFunctionEnd
396       %main = OpFunction %void None %195
397        %196 = OpLabel
398        %198 = OpVariable %_ptr_Function_v2float Function
399        %204 = OpVariable %_ptr_Function_v4float Function
400        %208 = OpVariable %_ptr_Function_v4float Function
401         %10 = OpSelect %float %false %float_9_99999994en09 %float_0
402               OpStore %_kGuardedDivideEpsilon %10
403               OpStore %198 %197
404        %199 = OpAccessChain %_ptr_Uniform_v4float %16 %int_0
405        %203 = OpLoad %v4float %199
406               OpStore %204 %203
407        %205 = OpAccessChain %_ptr_Uniform_v4float %16 %int_1
408        %207 = OpLoad %v4float %205
409               OpStore %208 %207
410        %209 = OpFunctionCall %v4float %blend_hslc_h4h2h4h4 %198 %204 %208
411               OpStore %sk_FragColor %209
412               OpReturn
413               OpFunctionEnd
414