xref: /aosp_15_r20/external/skia/tests/sksl/intrinsics/MaxUint.asm.frag (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
1               OpCapability Shader
2          %1 = OpExtInstImport "GLSL.std.450"
3               OpMemoryModel Logical GLSL450
4               OpEntryPoint Fragment %_entrypoint_v "_entrypoint" %sk_FragColor
5               OpExecutionMode %_entrypoint_v OriginUpperLeft
6               OpName %sk_FragColor "sk_FragColor"
7               OpName %_UniformBuffer "_UniformBuffer"
8               OpMemberName %_UniformBuffer 0 "testInputs"
9               OpMemberName %_UniformBuffer 1 "colorGreen"
10               OpMemberName %_UniformBuffer 2 "colorRed"
11               OpName %_entrypoint_v "_entrypoint_v"
12               OpName %main "main"
13               OpName %uintValues "uintValues"
14               OpName %uintGreen "uintGreen"
15               OpName %expectedA "expectedA"
16               OpName %expectedB "expectedB"
17               OpDecorate %sk_FragColor RelaxedPrecision
18               OpDecorate %sk_FragColor Location 0
19               OpDecorate %sk_FragColor Index 0
20               OpMemberDecorate %_UniformBuffer 0 Offset 0
21               OpMemberDecorate %_UniformBuffer 0 RelaxedPrecision
22               OpMemberDecorate %_UniformBuffer 1 Offset 16
23               OpMemberDecorate %_UniformBuffer 1 RelaxedPrecision
24               OpMemberDecorate %_UniformBuffer 2 Offset 32
25               OpMemberDecorate %_UniformBuffer 2 RelaxedPrecision
26               OpDecorate %_UniformBuffer Block
27               OpDecorate %7 Binding 0
28               OpDecorate %7 DescriptorSet 0
29               OpDecorate %27 RelaxedPrecision
30               OpDecorate %32 RelaxedPrecision
31               OpDecorate %34 RelaxedPrecision
32               OpDecorate %35 RelaxedPrecision
33               OpDecorate %37 RelaxedPrecision
34               OpDecorate %39 RelaxedPrecision
35               OpDecorate %41 RelaxedPrecision
36               OpDecorate %47 RelaxedPrecision
37               OpDecorate %48 RelaxedPrecision
38               OpDecorate %49 RelaxedPrecision
39               OpDecorate %51 RelaxedPrecision
40               OpDecorate %53 RelaxedPrecision
41               OpDecorate %55 RelaxedPrecision
42               OpDecorate %179 RelaxedPrecision
43               OpDecorate %182 RelaxedPrecision
44               OpDecorate %183 RelaxedPrecision
45      %float = OpTypeFloat 32
46    %v4float = OpTypeVector %float 4
47%_ptr_Output_v4float = OpTypePointer Output %v4float
48%sk_FragColor = OpVariable %_ptr_Output_v4float Output
49%_UniformBuffer = OpTypeStruct %v4float %v4float %v4float
50%_ptr_Uniform__UniformBuffer = OpTypePointer Uniform %_UniformBuffer
51          %7 = OpVariable %_ptr_Uniform__UniformBuffer Uniform
52       %void = OpTypeVoid
53         %12 = OpTypeFunction %void
54    %float_0 = OpConstant %float 0
55    %v2float = OpTypeVector %float 2
56         %16 = OpConstantComposite %v2float %float_0 %float_0
57%_ptr_Function_v2float = OpTypePointer Function %v2float
58         %20 = OpTypeFunction %v4float %_ptr_Function_v2float
59       %uint = OpTypeInt 32 0
60     %v4uint = OpTypeVector %uint 4
61%_ptr_Function_v4uint = OpTypePointer Function %v4uint
62%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
63        %int = OpTypeInt 32 1
64      %int_0 = OpConstant %int 0
65  %float_100 = OpConstant %float 100
66      %int_1 = OpConstant %int 1
67   %uint_125 = OpConstant %uint 125
68    %uint_80 = OpConstant %uint 80
69   %uint_225 = OpConstant %uint 225
70         %62 = OpConstantComposite %v4uint %uint_125 %uint_80 %uint_80 %uint_225
71   %uint_100 = OpConstant %uint 100
72    %uint_75 = OpConstant %uint 75
73         %66 = OpConstantComposite %v4uint %uint_125 %uint_100 %uint_75 %uint_225
74       %bool = OpTypeBool
75      %false = OpConstantFalse %bool
76     %v2uint = OpTypeVector %uint 2
77         %77 = OpConstantComposite %v2uint %uint_80 %uint_80
78     %v2bool = OpTypeVector %bool 2
79     %v3uint = OpTypeVector %uint 3
80         %88 = OpConstantComposite %v3uint %uint_80 %uint_80 %uint_80
81     %v3bool = OpTypeVector %bool 3
82         %97 = OpConstantComposite %v4uint %uint_80 %uint_80 %uint_80 %uint_80
83     %v4bool = OpTypeVector %bool 4
84       %true = OpConstantTrue %bool
85        %108 = OpConstantComposite %v2uint %uint_125 %uint_80
86        %115 = OpConstantComposite %v3uint %uint_125 %uint_80 %uint_80
87        %158 = OpConstantComposite %v2uint %uint_125 %uint_100
88        %165 = OpConstantComposite %v3uint %uint_125 %uint_100 %uint_75
89%_ptr_Function_v4float = OpTypePointer Function %v4float
90      %int_2 = OpConstant %int 2
91%_entrypoint_v = OpFunction %void None %12
92         %13 = OpLabel
93         %17 = OpVariable %_ptr_Function_v2float Function
94               OpStore %17 %16
95         %19 = OpFunctionCall %v4float %main %17
96               OpStore %sk_FragColor %19
97               OpReturn
98               OpFunctionEnd
99       %main = OpFunction %v4float None %20
100         %21 = OpFunctionParameter %_ptr_Function_v2float
101         %22 = OpLabel
102 %uintValues = OpVariable %_ptr_Function_v4uint Function
103  %uintGreen = OpVariable %_ptr_Function_v4uint Function
104  %expectedA = OpVariable %_ptr_Function_v4uint Function
105  %expectedB = OpVariable %_ptr_Function_v4uint Function
106        %173 = OpVariable %_ptr_Function_v4float Function
107         %28 = OpAccessChain %_ptr_Uniform_v4float %7 %int_0
108         %32 = OpLoad %v4float %28
109         %27 = OpExtInst %v4float %1 FAbs %32
110         %34 = OpVectorTimesScalar %v4float %27 %float_100
111         %35 = OpCompositeExtract %float %34 0
112         %36 = OpConvertFToU %uint %35
113         %37 = OpCompositeExtract %float %34 1
114         %38 = OpConvertFToU %uint %37
115         %39 = OpCompositeExtract %float %34 2
116         %40 = OpConvertFToU %uint %39
117         %41 = OpCompositeExtract %float %34 3
118         %42 = OpConvertFToU %uint %41
119         %43 = OpCompositeConstruct %v4uint %36 %38 %40 %42
120               OpStore %uintValues %43
121         %45 = OpAccessChain %_ptr_Uniform_v4float %7 %int_1
122         %47 = OpLoad %v4float %45
123         %48 = OpVectorTimesScalar %v4float %47 %float_100
124         %49 = OpCompositeExtract %float %48 0
125         %50 = OpConvertFToU %uint %49
126         %51 = OpCompositeExtract %float %48 1
127         %52 = OpConvertFToU %uint %51
128         %53 = OpCompositeExtract %float %48 2
129         %54 = OpConvertFToU %uint %53
130         %55 = OpCompositeExtract %float %48 3
131         %56 = OpConvertFToU %uint %55
132         %57 = OpCompositeConstruct %v4uint %50 %52 %54 %56
133               OpStore %uintGreen %57
134               OpStore %expectedA %62
135               OpStore %expectedB %66
136         %70 = OpCompositeExtract %uint %43 0
137         %69 = OpExtInst %uint %1 UMax %70 %uint_80
138         %71 = OpIEqual %bool %69 %uint_125
139               OpSelectionMerge %73 None
140               OpBranchConditional %71 %72 %73
141         %72 = OpLabel
142         %75 = OpVectorShuffle %v2uint %43 %43 0 1
143         %74 = OpExtInst %v2uint %1 UMax %75 %77
144         %78 = OpVectorShuffle %v2uint %62 %62 0 1
145         %79 = OpIEqual %v2bool %74 %78
146         %81 = OpAll %bool %79
147               OpBranch %73
148         %73 = OpLabel
149         %82 = OpPhi %bool %false %22 %81 %72
150               OpSelectionMerge %84 None
151               OpBranchConditional %82 %83 %84
152         %83 = OpLabel
153         %86 = OpVectorShuffle %v3uint %43 %43 0 1 2
154         %85 = OpExtInst %v3uint %1 UMax %86 %88
155         %89 = OpVectorShuffle %v3uint %62 %62 0 1 2
156         %90 = OpIEqual %v3bool %85 %89
157         %92 = OpAll %bool %90
158               OpBranch %84
159         %84 = OpLabel
160         %93 = OpPhi %bool %false %73 %92 %83
161               OpSelectionMerge %95 None
162               OpBranchConditional %93 %94 %95
163         %94 = OpLabel
164         %96 = OpExtInst %v4uint %1 UMax %43 %97
165         %98 = OpIEqual %v4bool %96 %62
166        %100 = OpAll %bool %98
167               OpBranch %95
168         %95 = OpLabel
169        %101 = OpPhi %bool %false %84 %100 %94
170               OpSelectionMerge %103 None
171               OpBranchConditional %101 %102 %103
172        %102 = OpLabel
173               OpBranch %103
174        %103 = OpLabel
175        %105 = OpPhi %bool %false %95 %true %102
176               OpSelectionMerge %107 None
177               OpBranchConditional %105 %106 %107
178        %106 = OpLabel
179        %109 = OpVectorShuffle %v2uint %62 %62 0 1
180        %110 = OpIEqual %v2bool %108 %109
181        %111 = OpAll %bool %110
182               OpBranch %107
183        %107 = OpLabel
184        %112 = OpPhi %bool %false %103 %111 %106
185               OpSelectionMerge %114 None
186               OpBranchConditional %112 %113 %114
187        %113 = OpLabel
188        %116 = OpVectorShuffle %v3uint %62 %62 0 1 2
189        %117 = OpIEqual %v3bool %115 %116
190        %118 = OpAll %bool %117
191               OpBranch %114
192        %114 = OpLabel
193        %119 = OpPhi %bool %false %107 %118 %113
194               OpSelectionMerge %121 None
195               OpBranchConditional %119 %120 %121
196        %120 = OpLabel
197               OpBranch %121
198        %121 = OpLabel
199        %122 = OpPhi %bool %false %114 %true %120
200               OpSelectionMerge %124 None
201               OpBranchConditional %122 %123 %124
202        %123 = OpLabel
203        %126 = OpCompositeExtract %uint %57 0
204        %125 = OpExtInst %uint %1 UMax %70 %126
205        %127 = OpIEqual %bool %125 %uint_125
206               OpBranch %124
207        %124 = OpLabel
208        %128 = OpPhi %bool %false %121 %127 %123
209               OpSelectionMerge %130 None
210               OpBranchConditional %128 %129 %130
211        %129 = OpLabel
212        %132 = OpVectorShuffle %v2uint %43 %43 0 1
213        %133 = OpVectorShuffle %v2uint %57 %57 0 1
214        %131 = OpExtInst %v2uint %1 UMax %132 %133
215        %134 = OpVectorShuffle %v2uint %66 %66 0 1
216        %135 = OpIEqual %v2bool %131 %134
217        %136 = OpAll %bool %135
218               OpBranch %130
219        %130 = OpLabel
220        %137 = OpPhi %bool %false %124 %136 %129
221               OpSelectionMerge %139 None
222               OpBranchConditional %137 %138 %139
223        %138 = OpLabel
224        %141 = OpVectorShuffle %v3uint %43 %43 0 1 2
225        %142 = OpVectorShuffle %v3uint %57 %57 0 1 2
226        %140 = OpExtInst %v3uint %1 UMax %141 %142
227        %143 = OpVectorShuffle %v3uint %66 %66 0 1 2
228        %144 = OpIEqual %v3bool %140 %143
229        %145 = OpAll %bool %144
230               OpBranch %139
231        %139 = OpLabel
232        %146 = OpPhi %bool %false %130 %145 %138
233               OpSelectionMerge %148 None
234               OpBranchConditional %146 %147 %148
235        %147 = OpLabel
236        %149 = OpExtInst %v4uint %1 UMax %43 %57
237        %150 = OpIEqual %v4bool %149 %66
238        %151 = OpAll %bool %150
239               OpBranch %148
240        %148 = OpLabel
241        %152 = OpPhi %bool %false %139 %151 %147
242               OpSelectionMerge %154 None
243               OpBranchConditional %152 %153 %154
244        %153 = OpLabel
245               OpBranch %154
246        %154 = OpLabel
247        %155 = OpPhi %bool %false %148 %true %153
248               OpSelectionMerge %157 None
249               OpBranchConditional %155 %156 %157
250        %156 = OpLabel
251        %159 = OpVectorShuffle %v2uint %66 %66 0 1
252        %160 = OpIEqual %v2bool %158 %159
253        %161 = OpAll %bool %160
254               OpBranch %157
255        %157 = OpLabel
256        %162 = OpPhi %bool %false %154 %161 %156
257               OpSelectionMerge %164 None
258               OpBranchConditional %162 %163 %164
259        %163 = OpLabel
260        %166 = OpVectorShuffle %v3uint %66 %66 0 1 2
261        %167 = OpIEqual %v3bool %165 %166
262        %168 = OpAll %bool %167
263               OpBranch %164
264        %164 = OpLabel
265        %169 = OpPhi %bool %false %157 %168 %163
266               OpSelectionMerge %171 None
267               OpBranchConditional %169 %170 %171
268        %170 = OpLabel
269               OpBranch %171
270        %171 = OpLabel
271        %172 = OpPhi %bool %false %164 %true %170
272               OpSelectionMerge %177 None
273               OpBranchConditional %172 %175 %176
274        %175 = OpLabel
275        %178 = OpAccessChain %_ptr_Uniform_v4float %7 %int_1
276        %179 = OpLoad %v4float %178
277               OpStore %173 %179
278               OpBranch %177
279        %176 = OpLabel
280        %180 = OpAccessChain %_ptr_Uniform_v4float %7 %int_2
281        %182 = OpLoad %v4float %180
282               OpStore %173 %182
283               OpBranch %177
284        %177 = OpLabel
285        %183 = OpLoad %v4float %173
286               OpReturnValue %183
287               OpFunctionEnd
288