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