Add support for ES31 context creation

The dEQP test for context creation passes.

SH_WEBGL3_SPEC has been added, but it should be considered whether we
should keep it, remove it or rename it. It was added so that there is
a webgl mapping to es 310 shaders. Check Compiler.cpp. The bison file
has been modified so that some tokens from es3 can be also used in
es31 as well.

A separate macro ES3_1_ONLY is added so that some tokens are limited
only for es 310 shaders.

BUG=angleproject:1442
TEST=angle_unittests

Change-Id: I2e5ca227c96046c30dc796ab934f3fda9c533eba
Reviewed-on: https://chromium-review.googlesource.com/360300
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
diff --git a/src/libANGLE/ContextState.cpp b/src/libANGLE/ContextState.cpp
index a824be5..707afda 100644
--- a/src/libANGLE/ContextState.cpp
+++ b/src/libANGLE/ContextState.cpp
@@ -15,15 +15,16 @@
 {
 
 ContextState::ContextState(uintptr_t contextIn,
-                           GLint clientVersionIn,
+                           GLint clientMajorVersionIn,
+                           GLint clientMinorVersionIn,
                            State *stateIn,
                            const Caps &capsIn,
                            const TextureCapsMap &textureCapsIn,
                            const Extensions &extensionsIn,
                            const ResourceManager *resourceManagerIn,
                            const Limitations &limitationsIn)
-    : mContext(contextIn),
-      mClientVersion(clientVersionIn),
+    : mGLVersion(clientMajorVersionIn, clientMinorVersionIn),
+      mContext(contextIn),
       mState(stateIn),
       mCaps(capsIn),
       mTextureCaps(textureCapsIn),
@@ -42,7 +43,8 @@
     return mTextureCaps.get(internalFormat);
 }
 
-ValidationContext::ValidationContext(GLint clientVersion,
+ValidationContext::ValidationContext(GLint clientMajorVersion,
+                                     GLint clientMinorVersion,
                                      State *state,
                                      const Caps &caps,
                                      const TextureCapsMap &textureCaps,
@@ -51,7 +53,8 @@
                                      const Limitations &limitations,
                                      bool skipValidation)
     : mState(reinterpret_cast<uintptr_t>(this),
-             clientVersion,
+             clientMajorVersion,
+             clientMinorVersion,
              state,
              caps,
              textureCaps,
@@ -330,7 +333,7 @@
         case GL_PACK_ROW_LENGTH:
         case GL_PACK_SKIP_ROWS:
         case GL_PACK_SKIP_PIXELS:
-            if ((getClientVersion() < 3) && !getExtensions().packSubimage)
+            if ((getClientMajorVersion() < 3) && !getExtensions().packSubimage)
             {
                 return false;
             }
@@ -340,7 +343,7 @@
         case GL_UNPACK_ROW_LENGTH:
         case GL_UNPACK_SKIP_ROWS:
         case GL_UNPACK_SKIP_PIXELS:
-            if ((getClientVersion() < 3) && !getExtensions().unpackSubimage)
+            if ((getClientMajorVersion() < 3) && !getExtensions().unpackSubimage)
             {
                 return false;
             }
@@ -348,7 +351,7 @@
             *numParams = 1;
             return true;
         case GL_VERTEX_ARRAY_BINDING:
-            if ((getClientVersion() < 3) && !getExtensions().vertexArrayObject)
+            if ((getClientMajorVersion() < 3) && !getExtensions().vertexArrayObject)
             {
                 return false;
             }
@@ -357,7 +360,7 @@
             return true;
         case GL_PIXEL_PACK_BUFFER_BINDING:
         case GL_PIXEL_UNPACK_BUFFER_BINDING:
-            if ((getClientVersion() < 3) && !getExtensions().pixelBufferObject)
+            if ((getClientMajorVersion() < 3) && !getExtensions().pixelBufferObject)
             {
                 return false;
             }
@@ -366,7 +369,7 @@
             return true;
     }
 
-    if (getClientVersion() < 3)
+    if (getClientMajorVersion() < 3)
     {
         return false;
     }
@@ -449,7 +452,7 @@
                                                      GLenum *type,
                                                      unsigned int *numParams)
 {
-    if (getClientVersion() < 3)
+    if (getClientMajorVersion() < 3)
     {
         return false;
     }