xref: /aosp_15_r20/external/skia/tests/sksl/shared/StructIndexStore.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 "colorGreen"
9               OpMemberName %_UniformBuffer 1 "colorRed"
10               OpName %_entrypoint_v "_entrypoint_v"
11               OpName %main "main"
12               OpName %InnerLUT "InnerLUT"
13               OpMemberName %InnerLUT 0 "values"
14               OpName %OuterLUT "OuterLUT"
15               OpMemberName %OuterLUT 0 "inner"
16               OpName %Root "Root"
17               OpMemberName %Root 0 "valueAtRoot"
18               OpMemberName %Root 1 "outer"
19               OpName %data "data"
20               OpName %values "values"
21               OpName %i "i"
22               OpName %j "j"
23               OpName %k "k"
24               OpName %ok "ok"
25               OpDecorate %sk_FragColor RelaxedPrecision
26               OpDecorate %sk_FragColor Location 0
27               OpDecorate %sk_FragColor Index 0
28               OpMemberDecorate %_UniformBuffer 0 Offset 0
29               OpMemberDecorate %_UniformBuffer 0 RelaxedPrecision
30               OpMemberDecorate %_UniformBuffer 1 Offset 16
31               OpMemberDecorate %_UniformBuffer 1 RelaxedPrecision
32               OpDecorate %_UniformBuffer Block
33               OpDecorate %7 Binding 0
34               OpDecorate %7 DescriptorSet 0
35               OpMemberDecorate %InnerLUT 0 Offset 0
36               OpDecorate %_arr_InnerLUT_int_3 ArrayStride 16
37               OpMemberDecorate %OuterLUT 0 Offset 0
38               OpMemberDecorate %OuterLUT 0 RelaxedPrecision
39               OpDecorate %_arr_OuterLUT_int_3 ArrayStride 48
40               OpMemberDecorate %Root 0 Offset 0
41               OpMemberDecorate %Root 1 Offset 16
42               OpMemberDecorate %Root 1 RelaxedPrecision
43               OpDecorate %196 RelaxedPrecision
44               OpDecorate %198 RelaxedPrecision
45               OpDecorate %199 RelaxedPrecision
46      %float = OpTypeFloat 32
47    %v4float = OpTypeVector %float 4
48%_ptr_Output_v4float = OpTypePointer Output %v4float
49%sk_FragColor = OpVariable %_ptr_Output_v4float Output
50%_UniformBuffer = OpTypeStruct %v4float %v4float
51%_ptr_Uniform__UniformBuffer = OpTypePointer Uniform %_UniformBuffer
52          %7 = OpVariable %_ptr_Uniform__UniformBuffer Uniform
53       %void = OpTypeVoid
54         %12 = OpTypeFunction %void
55    %float_0 = OpConstant %float 0
56    %v2float = OpTypeVector %float 2
57         %16 = OpConstantComposite %v2float %float_0 %float_0
58%_ptr_Function_v2float = OpTypePointer Function %v2float
59         %20 = OpTypeFunction %v4float %_ptr_Function_v2float
60        %int = OpTypeInt 32 1
61    %v3float = OpTypeVector %float 3
62   %InnerLUT = OpTypeStruct %v3float
63      %int_3 = OpConstant %int 3
64%_arr_InnerLUT_int_3 = OpTypeArray %InnerLUT %int_3
65   %OuterLUT = OpTypeStruct %_arr_InnerLUT_int_3
66%_arr_OuterLUT_int_3 = OpTypeArray %OuterLUT %int_3
67       %Root = OpTypeStruct %int %_arr_OuterLUT_int_3
68%_ptr_Function_Root = OpTypePointer Function %Root
69   %int_1234 = OpConstant %int 1234
70      %int_0 = OpConstant %int 0
71%_ptr_Function_int = OpTypePointer Function %int
72%_ptr_Function_v3float = OpTypePointer Function %v3float
73         %39 = OpConstantComposite %v3float %float_0 %float_0 %float_0
74       %bool = OpTypeBool
75    %float_1 = OpConstant %float 1
76   %float_10 = OpConstant %float 10
77  %float_100 = OpConstant %float 100
78         %61 = OpConstantComposite %v3float %float_1 %float_10 %float_100
79      %int_1 = OpConstant %int 1
80%_ptr_Function_float = OpTypePointer Function %float
81%_ptr_Function_bool = OpTypePointer Function %bool
82      %false = OpConstantFalse %bool
83     %v3bool = OpTypeVector %bool 3
84    %float_2 = OpConstant %float 2
85   %float_20 = OpConstant %float 20
86  %float_200 = OpConstant %float 200
87        %107 = OpConstantComposite %v3float %float_2 %float_20 %float_200
88      %int_2 = OpConstant %int 2
89    %float_3 = OpConstant %float 3
90   %float_30 = OpConstant %float 30
91  %float_300 = OpConstant %float 300
92        %119 = OpConstantComposite %v3float %float_3 %float_30 %float_300
93    %float_4 = OpConstant %float 4
94   %float_40 = OpConstant %float 40
95  %float_400 = OpConstant %float 400
96        %130 = OpConstantComposite %v3float %float_4 %float_40 %float_400
97    %float_5 = OpConstant %float 5
98   %float_50 = OpConstant %float 50
99  %float_500 = OpConstant %float 500
100        %141 = OpConstantComposite %v3float %float_5 %float_50 %float_500
101    %float_6 = OpConstant %float 6
102   %float_60 = OpConstant %float 60
103  %float_600 = OpConstant %float 600
104        %152 = OpConstantComposite %v3float %float_6 %float_60 %float_600
105    %float_7 = OpConstant %float 7
106   %float_70 = OpConstant %float 70
107  %float_700 = OpConstant %float 700
108        %163 = OpConstantComposite %v3float %float_7 %float_70 %float_700
109    %float_8 = OpConstant %float 8
110   %float_80 = OpConstant %float 80
111  %float_800 = OpConstant %float 800
112        %174 = OpConstantComposite %v3float %float_8 %float_80 %float_800
113    %float_9 = OpConstant %float 9
114   %float_90 = OpConstant %float 90
115  %float_900 = OpConstant %float 900
116        %185 = OpConstantComposite %v3float %float_9 %float_90 %float_900
117%_ptr_Function_v4float = OpTypePointer Function %v4float
118%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
119%_entrypoint_v = OpFunction %void None %12
120         %13 = OpLabel
121         %17 = OpVariable %_ptr_Function_v2float Function
122               OpStore %17 %16
123         %19 = OpFunctionCall %v4float %main %17
124               OpStore %sk_FragColor %19
125               OpReturn
126               OpFunctionEnd
127       %main = OpFunction %v4float None %20
128         %21 = OpFunctionParameter %_ptr_Function_v2float
129         %22 = OpLabel
130       %data = OpVariable %_ptr_Function_Root Function
131     %values = OpVariable %_ptr_Function_v3float Function
132          %i = OpVariable %_ptr_Function_int Function
133          %j = OpVariable %_ptr_Function_int Function
134          %k = OpVariable %_ptr_Function_int Function
135         %ok = OpVariable %_ptr_Function_bool Function
136        %189 = OpVariable %_ptr_Function_v4float Function
137         %35 = OpAccessChain %_ptr_Function_int %data %int_0
138               OpStore %35 %int_1234
139               OpStore %values %39
140               OpStore %i %int_0
141               OpBranch %41
142         %41 = OpLabel
143               OpLoopMerge %45 %44 None
144               OpBranch %42
145         %42 = OpLabel
146         %46 = OpLoad %int %i
147         %47 = OpSLessThan %bool %46 %int_3
148               OpBranchConditional %47 %43 %45
149         %43 = OpLabel
150               OpStore %j %int_0
151               OpBranch %50
152         %50 = OpLabel
153               OpLoopMerge %54 %53 None
154               OpBranch %51
155         %51 = OpLabel
156         %55 = OpLoad %int %j
157         %56 = OpSLessThan %bool %55 %int_3
158               OpBranchConditional %56 %52 %54
159         %52 = OpLabel
160         %57 = OpLoad %v3float %values
161         %62 = OpFAdd %v3float %57 %61
162               OpStore %values %62
163               OpStore %k %int_0
164               OpBranch %64
165         %64 = OpLabel
166               OpLoopMerge %68 %67 None
167               OpBranch %65
168         %65 = OpLabel
169         %69 = OpLoad %int %k
170         %70 = OpSLessThan %bool %69 %int_3
171               OpBranchConditional %70 %66 %68
172         %66 = OpLabel
173         %71 = OpLoad %v3float %values
174         %72 = OpLoad %int %k
175         %73 = OpVectorExtractDynamic %float %71 %72
176         %75 = OpLoad %int %i
177         %76 = OpLoad %int %j
178         %77 = OpLoad %int %k
179         %78 = OpAccessChain %_ptr_Function_float %data %int_1 %75 %int_0 %76 %int_0 %77
180               OpStore %78 %73
181               OpBranch %67
182         %67 = OpLabel
183         %80 = OpLoad %int %k
184         %81 = OpIAdd %int %80 %int_1
185               OpStore %k %81
186               OpBranch %64
187         %68 = OpLabel
188               OpBranch %53
189         %53 = OpLabel
190         %82 = OpLoad %int %j
191         %83 = OpIAdd %int %82 %int_1
192               OpStore %j %83
193               OpBranch %50
194         %54 = OpLabel
195               OpBranch %44
196         %44 = OpLabel
197         %84 = OpLoad %int %i
198         %85 = OpIAdd %int %84 %int_1
199               OpStore %i %85
200               OpBranch %41
201         %45 = OpLabel
202         %89 = OpAccessChain %_ptr_Function_int %data %int_0
203         %90 = OpLoad %int %89
204         %91 = OpIEqual %bool %90 %int_1234
205               OpSelectionMerge %93 None
206               OpBranchConditional %91 %92 %93
207         %92 = OpLabel
208         %94 = OpAccessChain %_ptr_Function_v3float %data %int_1 %int_0 %int_0 %int_0 %int_0
209         %95 = OpLoad %v3float %94
210         %96 = OpFOrdEqual %v3bool %95 %61
211         %98 = OpAll %bool %96
212               OpBranch %93
213         %93 = OpLabel
214         %99 = OpPhi %bool %false %45 %98 %92
215               OpSelectionMerge %101 None
216               OpBranchConditional %99 %100 %101
217        %100 = OpLabel
218        %102 = OpAccessChain %_ptr_Function_v3float %data %int_1 %int_0 %int_0 %int_1 %int_0
219        %103 = OpLoad %v3float %102
220        %108 = OpFOrdEqual %v3bool %103 %107
221        %109 = OpAll %bool %108
222               OpBranch %101
223        %101 = OpLabel
224        %110 = OpPhi %bool %false %93 %109 %100
225               OpSelectionMerge %112 None
226               OpBranchConditional %110 %111 %112
227        %111 = OpLabel
228        %114 = OpAccessChain %_ptr_Function_v3float %data %int_1 %int_0 %int_0 %int_2 %int_0
229        %115 = OpLoad %v3float %114
230        %120 = OpFOrdEqual %v3bool %115 %119
231        %121 = OpAll %bool %120
232               OpBranch %112
233        %112 = OpLabel
234        %122 = OpPhi %bool %false %101 %121 %111
235               OpSelectionMerge %124 None
236               OpBranchConditional %122 %123 %124
237        %123 = OpLabel
238        %125 = OpAccessChain %_ptr_Function_v3float %data %int_1 %int_1 %int_0 %int_0 %int_0
239        %126 = OpLoad %v3float %125
240        %131 = OpFOrdEqual %v3bool %126 %130
241        %132 = OpAll %bool %131
242               OpBranch %124
243        %124 = OpLabel
244        %133 = OpPhi %bool %false %112 %132 %123
245               OpSelectionMerge %135 None
246               OpBranchConditional %133 %134 %135
247        %134 = OpLabel
248        %136 = OpAccessChain %_ptr_Function_v3float %data %int_1 %int_1 %int_0 %int_1 %int_0
249        %137 = OpLoad %v3float %136
250        %142 = OpFOrdEqual %v3bool %137 %141
251        %143 = OpAll %bool %142
252               OpBranch %135
253        %135 = OpLabel
254        %144 = OpPhi %bool %false %124 %143 %134
255               OpSelectionMerge %146 None
256               OpBranchConditional %144 %145 %146
257        %145 = OpLabel
258        %147 = OpAccessChain %_ptr_Function_v3float %data %int_1 %int_1 %int_0 %int_2 %int_0
259        %148 = OpLoad %v3float %147
260        %153 = OpFOrdEqual %v3bool %148 %152
261        %154 = OpAll %bool %153
262               OpBranch %146
263        %146 = OpLabel
264        %155 = OpPhi %bool %false %135 %154 %145
265               OpSelectionMerge %157 None
266               OpBranchConditional %155 %156 %157
267        %156 = OpLabel
268        %158 = OpAccessChain %_ptr_Function_v3float %data %int_1 %int_2 %int_0 %int_0 %int_0
269        %159 = OpLoad %v3float %158
270        %164 = OpFOrdEqual %v3bool %159 %163
271        %165 = OpAll %bool %164
272               OpBranch %157
273        %157 = OpLabel
274        %166 = OpPhi %bool %false %146 %165 %156
275               OpSelectionMerge %168 None
276               OpBranchConditional %166 %167 %168
277        %167 = OpLabel
278        %169 = OpAccessChain %_ptr_Function_v3float %data %int_1 %int_2 %int_0 %int_1 %int_0
279        %170 = OpLoad %v3float %169
280        %175 = OpFOrdEqual %v3bool %170 %174
281        %176 = OpAll %bool %175
282               OpBranch %168
283        %168 = OpLabel
284        %177 = OpPhi %bool %false %157 %176 %167
285               OpSelectionMerge %179 None
286               OpBranchConditional %177 %178 %179
287        %178 = OpLabel
288        %180 = OpAccessChain %_ptr_Function_v3float %data %int_1 %int_2 %int_0 %int_2 %int_0
289        %181 = OpLoad %v3float %180
290        %186 = OpFOrdEqual %v3bool %181 %185
291        %187 = OpAll %bool %186
292               OpBranch %179
293        %179 = OpLabel
294        %188 = OpPhi %bool %false %168 %187 %178
295               OpStore %ok %188
296               OpSelectionMerge %193 None
297               OpBranchConditional %188 %191 %192
298        %191 = OpLabel
299        %194 = OpAccessChain %_ptr_Uniform_v4float %7 %int_0
300        %196 = OpLoad %v4float %194
301               OpStore %189 %196
302               OpBranch %193
303        %192 = OpLabel
304        %197 = OpAccessChain %_ptr_Uniform_v4float %7 %int_1
305        %198 = OpLoad %v4float %197
306               OpStore %189 %198
307               OpBranch %193
308        %193 = OpLabel
309        %199 = OpLoad %v4float %189
310               OpReturnValue %199
311               OpFunctionEnd
312