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