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