Add support for parsing ESSL3 invariant qualifiers

The parser recognizes ESSL3 invariant variable declaration syntax and
marks the variables as invariant.

In ESSL3, invariant out variables can be linked to non-invariant
in variables, so linking checks should now be different depending on
shading language version. A shading language version dependent varying
matching check is added to the translator API to facilitate this.

Tested by deqp/data/gles3/shaders/qualification_order.html after patching
Chrome to use the new linking check API.

A previous revision of this change that broke API compatibility was
reverted since it broke Chromium FYI bots. This revision keeps deprecated
API functionality around for now so that changes can be rolled
step-by-step to Chromium without breakage.

TEST=WebGL 2 conformance tests, angle_unittests
BUG=angleproject:987

Change-Id: Iecb64e3afd23e267ba999bc17f44390affcdfc13
Reviewed-on: https://chromium-review.googlesource.com/269940
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
diff --git a/src/compiler/translator/ShaderVars.cpp b/src/compiler/translator/ShaderVars.cpp
index 590655f..a3fe633 100644
--- a/src/compiler/translator/ShaderVars.cpp
+++ b/src/compiler/translator/ShaderVars.cpp
@@ -305,9 +305,14 @@
 
 bool Varying::isSameVaryingAtLinkTime(const Varying &other) const
 {
+    return isSameVaryingAtLinkTime(other, 100);
+}
+
+bool Varying::isSameVaryingAtLinkTime(const Varying &other, int shaderVersion) const
+{
     return (ShaderVariable::isSameVariableAtLinkTime(other, false) &&
             interpolation == other.interpolation &&
-            isInvariant == other.isInvariant);
+            (shaderVersion >= 300 || isInvariant == other.isInvariant));
 }
 
 InterfaceBlock::InterfaceBlock()