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