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