commit | 83b2f0e8a2e09ae469fe1afd05842ee5dcfb38c2 | [log] [tgz] |
---|---|---|
author | James Darpinian <jdarpinian@chromium.org> | Tue Nov 27 15:56:01 2018 -0800 |
committer | Commit Bot <commit-bot@chromium.org> | Wed Nov 28 02:20:28 2018 +0000 |
tree | 68ff6067fb98b6d0fd12af5226f5ff14a464c36b | |
parent | 3b7c9d099b0da0e70ebe9a0d73cfa644ee1c4901 [diff] [blame] |
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; }