GLES1: glClientActiveTexture
+ adds query for GL_MAX_TEXTURE_UNITS
BUG=angleproject:2306
Change-Id: Ie89fa6a067551170856bf0f7e6d7b4452b3da132
Reviewed-on: https://chromium-review.googlesource.com/984894
Commit-Queue: Lingfeng Yang <lfy@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/libANGLE/validationES1.cpp b/src/libANGLE/validationES1.cpp
index 60a34be..52f50ff 100644
--- a/src/libANGLE/validationES1.cpp
+++ b/src/libANGLE/validationES1.cpp
@@ -72,7 +72,14 @@
bool ValidateClientActiveTexture(Context *context, GLenum texture)
{
- UNIMPLEMENTED();
+ ANGLE_VALIDATE_IS_GLES1(context);
+ if (texture < GL_TEXTURE0 ||
+ texture > GL_TEXTURE0 + context->getCaps().maxMultitextureUnits - 1)
+ {
+ ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidMultitextureUnit);
+ return false;
+ }
+
return true;
}