xref: /aosp_15_r20/external/skia/tests/sksl/shared/MatrixToVectorCast.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 %ok "ok"
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 ColMajor
23               OpMemberDecorate %_UniformBuffer 2 MatrixStride 16
24               OpMemberDecorate %_UniformBuffer 2 RelaxedPrecision
25               OpDecorate %_UniformBuffer Block
26               OpDecorate %7 Binding 0
27               OpDecorate %7 DescriptorSet 0
28               OpDecorate %35 RelaxedPrecision
29               OpDecorate %36 RelaxedPrecision
30               OpDecorate %37 RelaxedPrecision
31               OpDecorate %38 RelaxedPrecision
32               OpDecorate %39 RelaxedPrecision
33               OpDecorate %40 RelaxedPrecision
34               OpDecorate %53 RelaxedPrecision
35               OpDecorate %54 RelaxedPrecision
36               OpDecorate %55 RelaxedPrecision
37               OpDecorate %56 RelaxedPrecision
38               OpDecorate %57 RelaxedPrecision
39               OpDecorate %58 RelaxedPrecision
40               OpDecorate %65 RelaxedPrecision
41               OpDecorate %66 RelaxedPrecision
42               OpDecorate %67 RelaxedPrecision
43               OpDecorate %68 RelaxedPrecision
44               OpDecorate %69 RelaxedPrecision
45               OpDecorate %70 RelaxedPrecision
46               OpDecorate %87 RelaxedPrecision
47               OpDecorate %88 RelaxedPrecision
48               OpDecorate %89 RelaxedPrecision
49               OpDecorate %90 RelaxedPrecision
50               OpDecorate %91 RelaxedPrecision
51               OpDecorate %92 RelaxedPrecision
52               OpDecorate %110 RelaxedPrecision
53               OpDecorate %112 RelaxedPrecision
54               OpDecorate %113 RelaxedPrecision
55      %float = OpTypeFloat 32
56    %v4float = OpTypeVector %float 4
57%_ptr_Output_v4float = OpTypePointer Output %v4float
58%sk_FragColor = OpVariable %_ptr_Output_v4float Output
59    %v2float = OpTypeVector %float 2
60%mat2v2float = OpTypeMatrix %v2float 2
61%_UniformBuffer = OpTypeStruct %v4float %v4float %mat2v2float
62%_ptr_Uniform__UniformBuffer = OpTypePointer Uniform %_UniformBuffer
63          %7 = OpVariable %_ptr_Uniform__UniformBuffer Uniform
64       %void = OpTypeVoid
65         %14 = OpTypeFunction %void
66    %float_0 = OpConstant %float 0
67         %17 = OpConstantComposite %v2float %float_0 %float_0
68%_ptr_Function_v2float = OpTypePointer Function %v2float
69         %21 = OpTypeFunction %v4float %_ptr_Function_v2float
70       %bool = OpTypeBool
71%_ptr_Function_bool = OpTypePointer Function %bool
72       %true = OpConstantTrue %bool
73      %false = OpConstantFalse %bool
74%_ptr_Uniform_mat2v2float = OpTypePointer Uniform %mat2v2float
75        %int = OpTypeInt 32 1
76      %int_2 = OpConstant %int 2
77    %float_1 = OpConstant %float 1
78    %float_2 = OpConstant %float 2
79    %float_3 = OpConstant %float 3
80    %float_4 = OpConstant %float 4
81         %45 = OpConstantComposite %v4float %float_1 %float_2 %float_3 %float_4
82     %v4bool = OpTypeVector %bool 4
83      %v4int = OpTypeVector %int 4
84      %int_1 = OpConstant %int 1
85      %int_3 = OpConstant %int 3
86      %int_4 = OpConstant %int 4
87         %80 = OpConstantComposite %v4int %int_1 %int_2 %int_3 %int_4
88         %98 = OpConstantComposite %v4bool %true %true %true %true
89%_ptr_Function_v4float = OpTypePointer Function %v4float
90%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
91      %int_0 = OpConstant %int 0
92%_entrypoint_v = OpFunction %void None %14
93         %15 = OpLabel
94         %18 = OpVariable %_ptr_Function_v2float Function
95               OpStore %18 %17
96         %20 = OpFunctionCall %v4float %main %18
97               OpStore %sk_FragColor %20
98               OpReturn
99               OpFunctionEnd
100       %main = OpFunction %v4float None %21
101         %22 = OpFunctionParameter %_ptr_Function_v2float
102         %23 = OpLabel
103         %ok = OpVariable %_ptr_Function_bool Function
104        %102 = OpVariable %_ptr_Function_v4float Function
105               OpStore %ok %true
106               OpSelectionMerge %30 None
107               OpBranchConditional %true %29 %30
108         %29 = OpLabel
109         %31 = OpAccessChain %_ptr_Uniform_mat2v2float %7 %int_2
110         %35 = OpLoad %mat2v2float %31
111         %36 = OpCompositeExtract %float %35 0 0
112         %37 = OpCompositeExtract %float %35 0 1
113         %38 = OpCompositeExtract %float %35 1 0
114         %39 = OpCompositeExtract %float %35 1 1
115         %40 = OpCompositeConstruct %v4float %36 %37 %38 %39
116         %46 = OpFOrdEqual %v4bool %40 %45
117         %48 = OpAll %bool %46
118               OpBranch %30
119         %30 = OpLabel
120         %49 = OpPhi %bool %false %23 %48 %29
121               OpStore %ok %49
122               OpSelectionMerge %51 None
123               OpBranchConditional %49 %50 %51
124         %50 = OpLabel
125         %52 = OpAccessChain %_ptr_Uniform_mat2v2float %7 %int_2
126         %53 = OpLoad %mat2v2float %52
127         %54 = OpCompositeExtract %float %53 0 0
128         %55 = OpCompositeExtract %float %53 0 1
129         %56 = OpCompositeExtract %float %53 1 0
130         %57 = OpCompositeExtract %float %53 1 1
131         %58 = OpCompositeConstruct %v4float %54 %55 %56 %57
132         %59 = OpFOrdEqual %v4bool %58 %45
133         %60 = OpAll %bool %59
134               OpBranch %51
135         %51 = OpLabel
136         %61 = OpPhi %bool %false %30 %60 %50
137               OpStore %ok %61
138               OpSelectionMerge %63 None
139               OpBranchConditional %61 %62 %63
140         %62 = OpLabel
141         %64 = OpAccessChain %_ptr_Uniform_mat2v2float %7 %int_2
142         %65 = OpLoad %mat2v2float %64
143         %66 = OpCompositeExtract %float %65 0 0
144         %67 = OpCompositeExtract %float %65 0 1
145         %68 = OpCompositeExtract %float %65 1 0
146         %69 = OpCompositeExtract %float %65 1 1
147         %70 = OpCompositeConstruct %v4float %66 %67 %68 %69
148         %71 = OpConvertFToS %int %66
149         %72 = OpConvertFToS %int %67
150         %73 = OpConvertFToS %int %68
151         %74 = OpConvertFToS %int %69
152         %76 = OpCompositeConstruct %v4int %71 %72 %73 %74
153         %81 = OpIEqual %v4bool %76 %80
154         %82 = OpAll %bool %81
155               OpBranch %63
156         %63 = OpLabel
157         %83 = OpPhi %bool %false %51 %82 %62
158               OpStore %ok %83
159               OpSelectionMerge %85 None
160               OpBranchConditional %83 %84 %85
161         %84 = OpLabel
162         %86 = OpAccessChain %_ptr_Uniform_mat2v2float %7 %int_2
163         %87 = OpLoad %mat2v2float %86
164         %88 = OpCompositeExtract %float %87 0 0
165         %89 = OpCompositeExtract %float %87 0 1
166         %90 = OpCompositeExtract %float %87 1 0
167         %91 = OpCompositeExtract %float %87 1 1
168         %92 = OpCompositeConstruct %v4float %88 %89 %90 %91
169         %93 = OpFUnordNotEqual %bool %88 %float_0
170         %94 = OpFUnordNotEqual %bool %89 %float_0
171         %95 = OpFUnordNotEqual %bool %90 %float_0
172         %96 = OpFUnordNotEqual %bool %91 %float_0
173         %97 = OpCompositeConstruct %v4bool %93 %94 %95 %96
174         %99 = OpLogicalEqual %v4bool %97 %98
175        %100 = OpAll %bool %99
176               OpBranch %85
177         %85 = OpLabel
178        %101 = OpPhi %bool %false %63 %100 %84
179               OpStore %ok %101
180               OpSelectionMerge %106 None
181               OpBranchConditional %101 %104 %105
182        %104 = OpLabel
183        %107 = OpAccessChain %_ptr_Uniform_v4float %7 %int_0
184        %110 = OpLoad %v4float %107
185               OpStore %102 %110
186               OpBranch %106
187        %105 = OpLabel
188        %111 = OpAccessChain %_ptr_Uniform_v4float %7 %int_1
189        %112 = OpLoad %v4float %111
190               OpStore %102 %112
191               OpBranch %106
192        %106 = OpLabel
193        %113 = OpLoad %v4float %102
194               OpReturnValue %113
195               OpFunctionEnd
196