Pack VertexAttribType enum.

This improves performance slightly in vertex array format checks.
Instead of needing to switch on GLenum values we can use packed arrays
and tables to determine the values we need.

Does not significantly affect performance but will enable future work.

Bug: angleproject:3074
Change-Id: I6f4821a463e9b41fe3f8c8967eb3ed4c1d6b84be
Reviewed-on: https://chromium-review.googlesource.com/c/1393903
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
diff --git a/src/libANGLE/validationES1.cpp b/src/libANGLE/validationES1.cpp
index 1d59579..4102302 100644
--- a/src/libANGLE/validationES1.cpp
+++ b/src/libANGLE/validationES1.cpp
@@ -72,7 +72,7 @@
 bool ValidateBuiltinVertexAttributeCommon(Context *context,
                                           ClientVertexArrayType arrayType,
                                           GLint size,
-                                          GLenum type,
+                                          VertexAttribType type,
                                           GLsizei stride,
                                           const void *pointer)
 {
@@ -125,14 +125,14 @@
 
     switch (type)
     {
-        case GL_BYTE:
+        case VertexAttribType::Byte:
             if (arrayType == ClientVertexArrayType::PointSize)
             {
                 context->validationError(GL_INVALID_ENUM, kInvalidVertexPointerType);
                 return false;
             }
             break;
-        case GL_SHORT:
+        case VertexAttribType::Short:
             if (arrayType == ClientVertexArrayType::PointSize ||
                 arrayType == ClientVertexArrayType::Color)
             {
@@ -140,8 +140,8 @@
                 return false;
             }
             break;
-        case GL_FIXED:
-        case GL_FLOAT:
+        case VertexAttribType::Fixed:
+        case VertexAttribType::Float:
             break;
         default:
             context->validationError(GL_INVALID_ENUM, kInvalidVertexPointerType);
@@ -695,7 +695,7 @@
 
 bool ValidateColorPointer(Context *context,
                           GLint size,
-                          GLenum type,
+                          VertexAttribType type,
                           GLsizei stride,
                           const void *pointer)
 {
@@ -1075,7 +1075,10 @@
     return true;
 }
 
-bool ValidateNormalPointer(Context *context, GLenum type, GLsizei stride, const void *pointer)
+bool ValidateNormalPointer(Context *context,
+                           VertexAttribType type,
+                           GLsizei stride,
+                           const void *pointer)
 {
     return ValidateBuiltinVertexAttributeCommon(context, ClientVertexArrayType::Normal, 3, type,
                                                 stride, pointer);
@@ -1239,7 +1242,7 @@
 
 bool ValidateTexCoordPointer(Context *context,
                              GLint size,
-                             GLenum type,
+                             VertexAttribType type,
                              GLsizei stride,
                              const void *pointer)
 {
@@ -1342,7 +1345,7 @@
 
 bool ValidateVertexPointer(Context *context,
                            GLint size,
-                           GLenum type,
+                           VertexAttribType type,
                            GLsizei stride,
                            const void *pointer)
 {
@@ -1441,7 +1444,10 @@
     return true;
 }
 
-bool ValidatePointSizePointerOES(Context *context, GLenum type, GLsizei stride, const void *pointer)
+bool ValidatePointSizePointerOES(Context *context,
+                                 VertexAttribType type,
+                                 GLsizei stride,
+                                 const void *pointer)
 {
     return ValidateBuiltinVertexAttributeCommon(context, ClientVertexArrayType::PointSize, 1, type,
                                                 stride, pointer);