Don't use the mip level to validate the 2D texture depth parameter.

BUG=angleproject:1149

Change-Id: I5dd45c99b373d480814c9fbdbe0abd419a270c89
Reviewed-on: https://chromium-review.googlesource.com/297052
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
diff --git a/src/libANGLE/validationES3.cpp b/src/libANGLE/validationES3.cpp
index 20b033c..021ec22 100644
--- a/src/libANGLE/validationES3.cpp
+++ b/src/libANGLE/validationES3.cpp
@@ -363,7 +363,7 @@
       case GL_TEXTURE_2D_ARRAY:
         if (static_cast<GLuint>(width) > (caps.max2DTextureSize >> level) ||
             static_cast<GLuint>(height) > (caps.max2DTextureSize >> level) ||
-            static_cast<GLuint>(depth) > (caps.maxArrayTextureLayers >> level))
+            static_cast<GLuint>(depth) > caps.maxArrayTextureLayers)
         {
             context->recordError(Error(GL_INVALID_VALUE));
             return false;
@@ -866,7 +866,13 @@
         return false;
     }
 
-    if (levels > gl::log2(std::max(std::max(width, height), depth)) + 1)
+    GLsizei maxDim = std::max(width, height);
+    if (target != GL_TEXTURE_2D_ARRAY)
+    {
+        maxDim = std::max(maxDim, depth);
+    }
+
+    if (levels > gl::log2(maxDim) + 1)
     {
         context->recordError(Error(GL_INVALID_OPERATION));
         return false;
diff --git a/src/tests/deqp_support/deqp_gles3_test_expectations.txt b/src/tests/deqp_support/deqp_gles3_test_expectations.txt
index a1798b5..c5ee657 100644
--- a/src/tests/deqp_support/deqp_gles3_test_expectations.txt
+++ b/src/tests/deqp_support/deqp_gles3_test_expectations.txt
@@ -299,12 +299,6 @@
 1094 WIN : dEQP-GLES3.functional.shaders.constant_expressions.complex_types.array_length_fragment = FAIL
 1094 WIN : dEQP-GLES3.functional.shaders.constant_expressions.complex_types.array_vertex = FAIL
 1094 WIN : dEQP-GLES3.functional.shaders.constant_expressions.complex_types.array_fragment = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.filtering.2d_array.sizes.128x32x64_nearest = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.filtering.2d_array.sizes.128x32x64_linear = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.filtering.2d_array.sizes.128x32x64_nearest_mipmap_nearest = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.filtering.2d_array.sizes.128x32x64_linear_mipmap_nearest = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.filtering.2d_array.sizes.128x32x64_nearest_mipmap_linear = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.filtering.2d_array.sizes.128x32x64_linear_mipmap_linear = FAIL
 1095 WIN : dEQP-GLES3.functional.texture.mipmap.2d.projected.nearest_nearest_clamp = FAIL
 1095 WIN : dEQP-GLES3.functional.texture.mipmap.2d.projected.nearest_nearest_repeat = FAIL
 1095 WIN : dEQP-GLES3.functional.texture.mipmap.2d.projected.nearest_nearest_mirror = FAIL
@@ -369,7 +363,6 @@
 1095 WIN : dEQP-GLES3.functional.texture.specification.teximage2d_depth.depth32f_stencil8 = FAIL
 1095 WIN : dEQP-GLES3.functional.texture.specification.teximage2d_depth_pbo.depth_component32f = FAIL
 1095 WIN : dEQP-GLES3.functional.texture.specification.teximage2d_depth_pbo.depth_component24 = FAIL
-1095 WIN : dEQP-GLES3.functional.texture.specification.teximage3d_depth_pbo.depth_component16_2d_array = FAIL
 1095 WIN : dEQP-GLES3.functional.texture.specification.teximage2d_depth_pbo.depth32f_stencil8 = FAIL
 1095 WIN : dEQP-GLES3.functional.texture.specification.basic_texsubimage2d.rgba32i_cube = FAIL
 1095 WIN : dEQP-GLES3.functional.texture.specification.basic_texsubimage2d.rgba32ui_cube = FAIL