Disallow indirect draw calls for multi-view framebuffers
According to the ANGLE_multiview spec indirect draw calls
must generate an INVALID_OPERATION error if the number of
views in the active draw framebuffer is greater than 1.
The patch addresses this by extending the indirect draw call
validation.
BUG=angleproject:2062
TEST=angle_end2end_tests
Change-Id: Ic30ef9a0eabba454aeea6176df1be8bd2ccd9783
Reviewed-on: https://chromium-review.googlesource.com/583027
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Martin Radev <mradev@nvidia.com>
diff --git a/src/libANGLE/validationES31.cpp b/src/libANGLE/validationES31.cpp
index 4856d85..d367250 100644
--- a/src/libANGLE/validationES31.cpp
+++ b/src/libANGLE/validationES31.cpp
@@ -172,6 +172,19 @@
return false;
}
+ // ANGLE_multiview spec, revision 1:
+ // An INVALID_OPERATION is generated by DrawArraysIndirect and DrawElementsIndirect if the
+ // number of views in the draw framebuffer is greater than 1.
+ const Framebuffer *drawFramebuffer = context->getGLState().getDrawFramebuffer();
+ ASSERT(drawFramebuffer != nullptr);
+ if (drawFramebuffer->getNumViews() > 1)
+ {
+ context->handleError(
+ InvalidOperation()
+ << "The number of views in the active draw framebuffer is greater than 1.");
+ return false;
+ }
+
return true;
}