Clean up direct access of ShaderVariable::arraySize
This change is pure refactoring. It's intended to help with adding
support for arrays of arrays.
BUG=angleproject:2125
TEST=angle_unittests
Change-Id: I82881a98c3c476fd6666a551ce6be255ae0de4cf
Reviewed-on: https://chromium-review.googlesource.com/733127
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
diff --git a/src/compiler/translator/ShaderVars.cpp b/src/compiler/translator/ShaderVars.cpp
index 7a6e181..d51ca5b 100644
--- a/src/compiler/translator/ShaderVars.cpp
+++ b/src/compiler/translator/ShaderVars.cpp
@@ -34,9 +34,15 @@
{
}
+ShaderVariable::ShaderVariable(GLenum typeIn)
+ : type(typeIn), precision(0), arraySize(0), staticUse(false)
+{
+}
+
ShaderVariable::ShaderVariable(GLenum typeIn, unsigned int arraySizeIn)
: type(typeIn), precision(0), arraySize(arraySizeIn), staticUse(false)
{
+ ASSERT(arraySizeIn != 0);
}
ShaderVariable::~ShaderVariable()