Fix attachment validation bug

Passing COLOR_ATTACHMENTm, where m is greater or equal to
MAX_COLOR_ATTACHMENTS, to a FramebufferTexture* function should
generate an INVALID_OPERATION instead of an INVALID_VALUE error.

BUG=angleproject:2106
TEST=angle_end2end_tests

Change-Id: I99045defcbe5eb2afefac1b45062ee4245f50dd3
Reviewed-on: https://chromium-review.googlesource.com/569966
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
diff --git a/src/libANGLE/validationES.cpp b/src/libANGLE/validationES.cpp
index afcc372..8a32be2 100644
--- a/src/libANGLE/validationES.cpp
+++ b/src/libANGLE/validationES.cpp
@@ -1446,7 +1446,9 @@
 
         if (colorAttachment >= context->getCaps().maxColorAttachments)
         {
-            context->handleError(InvalidValue());
+            context->handleError(
+                InvalidOperation()
+                << "attachment index cannot be greater or equal to MAX_COLOR_ATTACHMENTS.");
             return false;
         }
     }