Add missing errors specified by OES_EGL_image_external
Previously the code just silently ignored some filtering parameters
for external textures, when in fact trying to set them should result
in an error according to the extension specs.
BUG=angleproject:1332
Change-Id: I3a691b60561638c562bc1a9780a4dcb88ac43012
Reviewed-on: https://chromium-review.googlesource.com/341441
Reviewed-by: Ian Ewell <ewell@google.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
diff --git a/src/libANGLE/validationES.cpp b/src/libANGLE/validationES.cpp
index eeafe45..a41bfa7 100644
--- a/src/libANGLE/validationES.cpp
+++ b/src/libANGLE/validationES.cpp
@@ -872,7 +872,14 @@
return true;
case GL_REPEAT:
case GL_MIRRORED_REPEAT:
- return (target != GL_TEXTURE_EXTERNAL_OES);
+ if (target == GL_TEXTURE_EXTERNAL_OES)
+ {
+ // OES_EGL_image_external specifies this error.
+ context->recordError(Error(
+ GL_INVALID_ENUM, "external textures only support CLAMP_TO_EDGE wrap mode"));
+ return false;
+ }
+ return true;
default:
context->recordError(Error(GL_INVALID_ENUM));
return false;
@@ -888,7 +895,15 @@
case GL_LINEAR_MIPMAP_NEAREST:
case GL_NEAREST_MIPMAP_LINEAR:
case GL_LINEAR_MIPMAP_LINEAR:
- return (target != GL_TEXTURE_EXTERNAL_OES);
+ if (target == GL_TEXTURE_EXTERNAL_OES)
+ {
+ // OES_EGL_image_external specifies this error.
+ context->recordError(
+ Error(GL_INVALID_ENUM,
+ "external textures only support NEAREST and LINEAR filtering"));
+ return false;
+ }
+ return true;
default:
context->recordError(Error(GL_INVALID_ENUM));
return false;