summaryrefslogtreecommitdiffstats
path: root/gfx/angle/checkout/src/compiler/translator/VariablePacker.h
diff options
context:
space:
mode:
Diffstat (limited to 'gfx/angle/checkout/src/compiler/translator/VariablePacker.h')
-rw-r--r--gfx/angle/checkout/src/compiler/translator/VariablePacker.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/gfx/angle/checkout/src/compiler/translator/VariablePacker.h b/gfx/angle/checkout/src/compiler/translator/VariablePacker.h
new file mode 100644
index 0000000000..8cf621f168
--- /dev/null
+++ b/gfx/angle/checkout/src/compiler/translator/VariablePacker.h
@@ -0,0 +1,32 @@
+//
+// Copyright 2002 The ANGLE Project Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+// Check whether variables fit within packing limits according to the packing rules from the GLSL ES
+// 1.00.17 spec, Appendix A, section 7.
+
+#ifndef COMPILER_TRANSLATOR_VARIABLEPACKER_H_
+#define COMPILER_TRANSLATOR_VARIABLEPACKER_H_
+
+#include <vector>
+
+#include <GLSLANG/ShaderLang.h>
+
+namespace sh
+{
+
+// Gets how many components in a row a data type takes.
+int GetTypePackingComponentsPerRow(sh::GLenum type);
+
+// Gets how many rows a data type takes.
+int GetTypePackingRows(sh::GLenum type);
+
+// Returns true if the passed in variables pack in maxVectors.
+// T should be ShaderVariable or one of the subclasses of ShaderVariable.
+bool CheckVariablesInPackingLimits(unsigned int maxVectors,
+ const std::vector<ShaderVariable> &variables);
+
+} // namespace sh
+
+#endif // COMPILER_TRANSLATOR_VARIABLEPACKER_H_