Remove the clientVersion parameter from the format utils.

clientVersion was only useful for intitial validation of formats and not
required for queries.  Only use the client version and caps structure to
validate if a format is available and then trust that it is supported past
the validation layer.

Fixed some inconsistancies between tables such as missing formats or
incorrect load functions in the ES3 tables.

BUG=angle:659

Change-Id: I8d33c902156ee6fb41efe937d93b0586191726e5
Reviewed-on: https://chromium-review.googlesource.com/201167
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
diff --git a/src/libGLESv2/validationES3.cpp b/src/libGLESv2/validationES3.cpp
index e865fba..27c226d 100644
--- a/src/libGLESv2/validationES3.cpp
+++ b/src/libGLESv2/validationES3.cpp
@@ -170,7 +170,6 @@
 
     // Validate texture formats
     GLenum actualInternalFormat = isSubImage ? textureInternalFormat : internalformat;
-    int clientVersion = context->getClientVersion();
     if (isCompressed)
     {
         if (!ValidCompressedImageSize(context, actualInternalFormat, width, height))
@@ -178,7 +177,7 @@
             return gl::error(GL_INVALID_OPERATION, false);
         }
 
-        if (!gl::IsFormatCompressed(actualInternalFormat, clientVersion))
+        if (!gl::IsFormatCompressed(actualInternalFormat))
         {
             return gl::error(GL_INVALID_ENUM, false);
         }
@@ -193,13 +192,13 @@
         // Note: dEQP 2013.4 expects an INVALID_VALUE error for TexImage3D with an invalid
         // internal format. (dEQP-GLES3.functional.negative_api.texture.teximage3d)
         if (!gl::IsValidInternalFormat(actualInternalFormat, context->getCaps().extensions, context->getClientVersion()) ||
-            !gl::IsValidFormat(format, context->getClientVersion()) ||
-            !gl::IsValidType(type, context->getClientVersion()))
+            !gl::IsValidFormat(format, context->getCaps().extensions, context->getClientVersion()) ||
+            !gl::IsValidType(type, context->getCaps().extensions, context->getClientVersion()))
         {
             return gl::error(GL_INVALID_ENUM, false);
         }
 
-        if (!gl::IsValidFormatCombination(actualInternalFormat, format, type, clientVersion))
+        if (!gl::IsValidFormatCombination(actualInternalFormat, format, type, context->getCaps().extensions, context->getClientVersion()))
         {
             return gl::error(GL_INVALID_OPERATION, false);
         }
@@ -261,11 +260,10 @@
         size_t widthSize = static_cast<size_t>(width);
         size_t heightSize = static_cast<size_t>(height);
         size_t depthSize = static_cast<size_t>(depth);
-        GLenum sizedFormat = gl::IsSizedInternalFormat(actualInternalFormat, clientVersion) ?
-                             actualInternalFormat :
-                             gl::GetSizedInternalFormat(actualInternalFormat, type, clientVersion);
+        GLenum sizedFormat = gl::IsSizedInternalFormat(actualInternalFormat) ? actualInternalFormat
+                                                                             : gl::GetSizedInternalFormat(actualInternalFormat, type);
 
-        size_t pixelBytes = static_cast<size_t>(gl::GetPixelBytes(sizedFormat, clientVersion));
+        size_t pixelBytes = static_cast<size_t>(gl::GetPixelBytes(sizedFormat));
 
         if (!rx::IsUnsignedMultiplicationSafe(widthSize, heightSize) ||
             !rx::IsUnsignedMultiplicationSafe(widthSize * heightSize, depthSize) ||
@@ -443,7 +441,7 @@
         return gl::error(GL_INVALID_ENUM, false);
     }
 
-    if (!gl::IsSizedInternalFormat(internalformat, context->getClientVersion()))
+    if (!gl::IsSizedInternalFormat(internalformat))
     {
         return gl::error(GL_INVALID_ENUM, false);
     }
@@ -638,7 +636,7 @@
             }
             break;
           case GL_FLOAT:
-            if (gl::GetComponentType(internalFormat, 3) != GL_FLOAT)
+            if (gl::GetComponentType(internalFormat) != GL_FLOAT)
             {
                 return false;
             }
@@ -651,13 +649,13 @@
         switch (type)
         {
           case GL_INT:
-            if (gl::GetComponentType(internalFormat, 3) != GL_INT)
+            if (gl::GetComponentType(internalFormat) != GL_INT)
             {
                 return false;
             }
             break;
           case GL_UNSIGNED_INT:
-            if (gl::GetComponentType(internalFormat, 3) != GL_UNSIGNED_INT)
+            if (gl::GetComponentType(internalFormat) != GL_UNSIGNED_INT)
             {
                 return false;
             }