WebGL: Forbid GenerateMipmap on zero-size textures

This is a WebGL spec change:
https://github.com/KhronosGroup/WebGL/commit/bfbe124a7bb92eed34ea7cc18694167ed66b1030

Fixes conformance2/textures/misc/tex-mipmap-levels.html

Bug: chromium:898351
Change-Id: Ib20409e10bec598611be273577115a380a63b523
Reviewed-on: https://chromium-review.googlesource.com/c/1352385
Commit-Queue: James Darpinian <jdarpinian@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/libANGLE/validationES2.cpp b/src/libANGLE/validationES2.cpp
index 6cdf832..af3628a 100644
--- a/src/libANGLE/validationES2.cpp
+++ b/src/libANGLE/validationES2.cpp
@@ -6201,6 +6201,14 @@
         return false;
     }
 
+    if (context->getExtensions().webglCompatibility &&
+        (texture->getWidth(baseTarget, effectiveBaseLevel) == 0 ||
+         texture->getHeight(baseTarget, effectiveBaseLevel) == 0))
+    {
+        context->validationError(GL_INVALID_OPERATION, kGenerateMipmapZeroSize);
+        return false;
+    }
+
     return true;
 }