Fix shaders with invariant keyword.
We would trigger assertion failures in Debug mode, and fail to
parse and translate correctly in Release.
BUG=angle:711
Change-Id: Ibb7f33b288376617598578f48c7bbdbdec044279
Reviewed-on: https://chromium-review.googlesource.com/210822
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Nicolas Capens <capn@chromium.org>
diff --git a/src/compiler/translator/OutputGLSLBase.cpp b/src/compiler/translator/OutputGLSLBase.cpp
index 7839c04..09f7ad9 100644
--- a/src/compiler/translator/OutputGLSLBase.cpp
+++ b/src/compiler/translator/OutputGLSLBase.cpp
@@ -81,9 +81,11 @@
{
TInfoSinkBase &out = objSink();
TQualifier qualifier = type.getQualifier();
- // TODO(alokp): Validate qualifier for variable declarations.
- if (qualifier != EvqTemporary && qualifier != EvqGlobal)
+ if (qualifier != EvqTemporary && qualifier != EvqGlobal &&
+ type.getBasicType() != EbtInvariant)
+ {
out << type.getQualifierString() << " ";
+ }
// Declare the struct if we have not done so already.
if (type.getBasicType() == EbtStruct && !structDeclared(type.getStruct()))
{