Disallow glReadPixels with multi-view read framebuffers

According to the ANGLE_multiview spec, glReadPixels must generate an
INVALID_FRAMEBUFFER_OPERATION error if the active read framebuffer has
a multi-view layout.

BUG=angleproject:2062
TEST=angle_end2end_tests

Change-Id: Ia5311ff7a62c5ff732491eb80befd32de57b9d44
Reviewed-on: https://chromium-review.googlesource.com/591368
Commit-Queue: Martin Radev <mradev@nvidia.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
diff --git a/src/libANGLE/validationES.cpp b/src/libANGLE/validationES.cpp
index 7e4fe4e..c3b7d4c 100644
--- a/src/libANGLE/validationES.cpp
+++ b/src/libANGLE/validationES.cpp
@@ -5456,6 +5456,16 @@
         return false;
     }
 
+    // ANGLE_multiview, Revision 1:
+    // ReadPixels generates an INVALID_FRAMEBUFFER_OPERATION error if the multi-view layout of the
+    // current read framebuffer is not NONE.
+    if (readBuffer->getMultiviewLayout() != GL_NONE)
+    {
+        context->handleError(InvalidFramebufferOperation()
+                             << "Attempting to read from a multi-view framebuffer.");
+        return false;
+    }
+
     if (context->getExtensions().webglCompatibility)
     {
         // The ES 2.0 spec states that the format must be "among those defined in table 3.4,