xref: /aosp_15_r20/external/angle/src/compiler/translator/VariablePacker.h (revision 8975f5c5ed3d1c378011245431ada316dfb6f244)
1*8975f5c5SAndroid Build Coastguard Worker //
2*8975f5c5SAndroid Build Coastguard Worker // Copyright 2002 The ANGLE Project Authors. All rights reserved.
3*8975f5c5SAndroid Build Coastguard Worker // Use of this source code is governed by a BSD-style license that can be
4*8975f5c5SAndroid Build Coastguard Worker // found in the LICENSE file.
5*8975f5c5SAndroid Build Coastguard Worker //
6*8975f5c5SAndroid Build Coastguard Worker // Check whether variables fit within packing limits according to the packing rules from the GLSL ES
7*8975f5c5SAndroid Build Coastguard Worker // 1.00.17 spec, Appendix A, section 7.
8*8975f5c5SAndroid Build Coastguard Worker 
9*8975f5c5SAndroid Build Coastguard Worker #ifndef COMPILER_TRANSLATOR_VARIABLEPACKER_H_
10*8975f5c5SAndroid Build Coastguard Worker #define COMPILER_TRANSLATOR_VARIABLEPACKER_H_
11*8975f5c5SAndroid Build Coastguard Worker 
12*8975f5c5SAndroid Build Coastguard Worker #include <vector>
13*8975f5c5SAndroid Build Coastguard Worker 
14*8975f5c5SAndroid Build Coastguard Worker #include <GLSLANG/ShaderLang.h>
15*8975f5c5SAndroid Build Coastguard Worker 
16*8975f5c5SAndroid Build Coastguard Worker namespace sh
17*8975f5c5SAndroid Build Coastguard Worker {
18*8975f5c5SAndroid Build Coastguard Worker 
19*8975f5c5SAndroid Build Coastguard Worker // Gets how many components in a row a data type takes.
20*8975f5c5SAndroid Build Coastguard Worker int GetTypePackingComponentsPerRow(sh::GLenum type);
21*8975f5c5SAndroid Build Coastguard Worker 
22*8975f5c5SAndroid Build Coastguard Worker // Gets how many rows a data type takes.
23*8975f5c5SAndroid Build Coastguard Worker int GetTypePackingRows(sh::GLenum type);
24*8975f5c5SAndroid Build Coastguard Worker 
25*8975f5c5SAndroid Build Coastguard Worker // Returns true if the passed in variables pack in maxVectors.
26*8975f5c5SAndroid Build Coastguard Worker // T should be ShaderVariable or one of the subclasses of ShaderVariable.
27*8975f5c5SAndroid Build Coastguard Worker bool CheckVariablesInPackingLimits(unsigned int maxVectors,
28*8975f5c5SAndroid Build Coastguard Worker                                    const std::vector<ShaderVariable> &variables);
29*8975f5c5SAndroid Build Coastguard Worker 
30*8975f5c5SAndroid Build Coastguard Worker }  // namespace sh
31*8975f5c5SAndroid Build Coastguard Worker 
32*8975f5c5SAndroid Build Coastguard Worker #endif  // COMPILER_TRANSLATOR_VARIABLEPACKER_H_
33