Disallow glBlitFramebuffer for multi-view framebuffers
According to the ANGLE_multiview spec, glBlitFramebuffer must
generate an INVALID_FRAMEBUFFER_OPERATION error if either the active read
framebuffer, or active draw framebuffer has a multi-view layout.
BUG=angleproject:2062
TEST=angle_end2end_tests
Change-Id: I885bdc970c9606cfad882f31759f5780c65d15e5
Reviewed-on: https://chromium-review.googlesource.com/590237
Commit-Queue: Martin Radev <mradev@nvidia.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
diff --git a/src/tests/gl_tests/FramebufferMultiviewTest.cpp b/src/tests/gl_tests/FramebufferMultiviewTest.cpp
index c605099..4d96d5a 100644
--- a/src/tests/gl_tests/FramebufferMultiviewTest.cpp
+++ b/src/tests/gl_tests/FramebufferMultiviewTest.cpp
@@ -423,4 +423,39 @@
}
}
+// Test that glBlitFramebuffer generates an invalid framebuffer operation when either the current
+// draw framebuffer, or current read framebuffer have multiview attachments.
+TEST_P(FramebufferMultiviewTest, InvalidBlit)
+{
+ if (!requestMultiviewExtension())
+ {
+ return;
+ }
+
+ mTexture2D = CreateTexture2D(GL_RGBA8, GL_RGBA, GL_UNSIGNED_BYTE);
+ ASSERT_GL_NO_ERROR();
+
+ const GLint viewportOffsets[2] = {0};
+ glFramebufferTextureMultiviewSideBySideANGLE(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, mTexture2D,
+ 0, 1, &viewportOffsets[0]);
+ ASSERT_GLENUM_EQ(GL_FRAMEBUFFER_COMPLETE, glCheckFramebufferStatus(GL_FRAMEBUFFER));
+ ASSERT_GL_NO_ERROR();
+
+ // Blit with the active read framebuffer having multiview attachments.
+ {
+ glBindFramebuffer(GL_READ_FRAMEBUFFER, mFramebuffer);
+ glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
+ glBlitFramebuffer(0, 0, 1, 1, 0, 0, 1, 1, GL_COLOR_BUFFER_BIT, GL_NEAREST);
+ EXPECT_GL_ERROR(GL_INVALID_FRAMEBUFFER_OPERATION);
+ }
+
+ // Blit with the active draw framebuffer having multiview attachments.
+ {
+ glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
+ glBindFramebuffer(GL_DRAW_FRAMEBUFFER, mFramebuffer);
+ glBlitFramebuffer(0, 0, 1, 1, 0, 0, 1, 1, GL_COLOR_BUFFER_BIT, GL_NEAREST);
+ EXPECT_GL_ERROR(GL_INVALID_FRAMEBUFFER_OPERATION);
+ }
+}
+
ANGLE_INSTANTIATE_TEST(FramebufferMultiviewTest, ES3_OPENGL());
\ No newline at end of file