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