Fix Clear validation assert for default FBOs
The validation was iterating over maxDrawBuffers attachments when
default framebuffers only have one attachment. Use the framebuffer's
drawBufferCount instead.
Also adds a regression test in the form of a WebGLComptibility test for
glClearBuffer with the default framebuffer.
BUG=angleproject:2091
Change-Id: I07ee524db1fcb8a99dab4043248c0885100fd216
diff --git a/src/libANGLE/validationES2.cpp b/src/libANGLE/validationES2.cpp
index 9907e2a..a526aab 100644
--- a/src/libANGLE/validationES2.cpp
+++ b/src/libANGLE/validationES2.cpp
@@ -2302,7 +2302,7 @@
constexpr GLenum validComponentTypes[] = {GL_FLOAT, GL_UNSIGNED_NORMALIZED,
GL_SIGNED_NORMALIZED};
- for (GLuint drawBufferIdx = 0; drawBufferIdx < context->getCaps().maxDrawBuffers;
+ for (GLuint drawBufferIdx = 0; drawBufferIdx < fbo->getDrawbufferStateCount();
drawBufferIdx++)
{
if (!ValidateWebGLFramebufferAttachmentClearType(