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/OutputHLSL.cpp b/src/compiler/translator/OutputHLSL.cpp
index ed082c9..93994ba 100644
--- a/src/compiler/translator/OutputHLSL.cpp
+++ b/src/compiler/translator/OutputHLSL.cpp
@@ -1937,6 +1937,12 @@
}
else if (variable && IsVaryingOut(variable->getQualifier()))
{
+ // Skip translation of invariant declarations
+ if (variable->getBasicType() == EbtInvariant)
+ {
+ return false;
+ }
+
for (TIntermSequence::iterator sit = sequence->begin(); sit != sequence->end(); sit++)
{
TIntermSymbol *symbol = (*sit)->getAsSymbolNode();