Invariant keyword support
Added support for the invariant keyword in the parser.
Also made sure all in/out types were handled properly
in OutputASM.cpp.
Change-Id: I40f0bc9caf5bccc691aa60dfaa90bed5d1d7d238
Reviewed-on: https://swiftshader-review.googlesource.com/3663
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
diff --git a/src/OpenGL/compiler/ParseHelper.cpp b/src/OpenGL/compiler/ParseHelper.cpp
index f27486e..2fa4512 100644
--- a/src/OpenGL/compiler/ParseHelper.cpp
+++ b/src/OpenGL/compiler/ParseHelper.cpp
@@ -1053,6 +1053,24 @@
return false;
}
+void TParseContext::es3InvariantErrorCheck(const TQualifier qualifier, const TSourceLoc &invariantLocation)
+{
+ switch(qualifier)
+ {
+ case EvqVaryingOut:
+ case EvqSmoothOut:
+ case EvqFlatOut:
+ case EvqCentroidOut:
+ case EvqVertexOut:
+ case EvqFragmentOut:
+ break;
+ default:
+ error(invariantLocation, "Only out variables can be invariant.", "invariant");
+ recover();
+ break;
+ }
+}
+
bool TParseContext::supportsExtension(const char* extension)
{
const TExtensionBehavior& extbehavior = extensionBehavior();