Commit 94c91a95 by Olli Etuaho Committed by Commit Bot

Don't allow multiview clear during timer query

This brings the ANGLE_multiview spec in line with WEBGL_multiview. This also fixes the test so that the timer query extension is requested when it is being tested. BUG=angleproject:2062 TEST=angle_end2end_tests Change-Id: Ibd5c117a5ae2642d26137d9ad44420d6601ba762 Reviewed-on: https://chromium-review.googlesource.com/1143283Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
parent ba365939
...@@ -524,9 +524,9 @@ Additions to the AGL/EGL/GLX/WGL Specifications ...@@ -524,9 +524,9 @@ Additions to the AGL/EGL/GLX/WGL Specifications
Interactions with EXT_disjoint_timer_query Interactions with EXT_disjoint_timer_query
An INVALID_OPERATION error is generated by any Draw* command, if there An INVALID_OPERATION error is generated by any Draw* command and the Clear
is an active query object for target TIME_ELAPSED_EXT and the number command if there is an active query object for target TIME_ELAPSED_EXT and
of views in the draw framebuffer is greater than 1. the number of views in the draw framebuffer is greater than 1.
Errors Errors
......
...@@ -2554,6 +2554,7 @@ bool ValidateBlitFramebufferANGLE(Context *context, ...@@ -2554,6 +2554,7 @@ bool ValidateBlitFramebufferANGLE(Context *context,
bool ValidateClear(Context *context, GLbitfield mask) bool ValidateClear(Context *context, GLbitfield mask)
{ {
Framebuffer *fbo = context->getGLState().getDrawFramebuffer(); Framebuffer *fbo = context->getGLState().getDrawFramebuffer();
const Extensions &extensions = context->getExtensions();
if (!ValidateFramebufferComplete(context, fbo)) if (!ValidateFramebufferComplete(context, fbo))
{ {
...@@ -2566,7 +2567,7 @@ bool ValidateClear(Context *context, GLbitfield mask) ...@@ -2566,7 +2567,7 @@ bool ValidateClear(Context *context, GLbitfield mask)
return false; return false;
} }
if (context->getExtensions().webglCompatibility && (mask & GL_COLOR_BUFFER_BIT) != 0) if (extensions.webglCompatibility && (mask & GL_COLOR_BUFFER_BIT) != 0)
{ {
constexpr GLenum validComponentTypes[] = {GL_FLOAT, GL_UNSIGNED_NORMALIZED, constexpr GLenum validComponentTypes[] = {GL_FLOAT, GL_UNSIGNED_NORMALIZED,
GL_SIGNED_NORMALIZED}; GL_SIGNED_NORMALIZED};
...@@ -2582,6 +2583,20 @@ bool ValidateClear(Context *context, GLbitfield mask) ...@@ -2582,6 +2583,20 @@ bool ValidateClear(Context *context, GLbitfield mask)
} }
} }
if (extensions.multiview && extensions.disjointTimerQuery)
{
const State &state = context->getGLState();
Framebuffer *framebuffer = state.getDrawFramebuffer();
if (framebuffer->getNumViews() > 1 && state.isQueryActive(QueryType::TimeElapsed))
{
context->handleError(InvalidOperation() << "There is an active query for target "
"GL_TIME_ELAPSED_EXT when the number of "
"views in the active draw framebuffer is "
"greater than 1.");
return false;
}
}
return true; return true;
} }
......
...@@ -764,6 +764,11 @@ TEST_P(MultiviewDrawValidationTest, ActiveTimeElapsedQuery) ...@@ -764,6 +764,11 @@ TEST_P(MultiviewDrawValidationTest, ActiveTimeElapsedQuery)
{ {
ANGLE_SKIP_TEST_IF(!requestMultiviewExtension()); ANGLE_SKIP_TEST_IF(!requestMultiviewExtension());
if (extensionRequestable("GL_EXT_disjoint_timer_query"))
{
glRequestExtensionANGLE("GL_EXT_disjoint_timer_query");
}
ANGLE_SKIP_TEST_IF(!extensionEnabled("GL_EXT_disjoint_timer_query")); ANGLE_SKIP_TEST_IF(!extensionEnabled("GL_EXT_disjoint_timer_query"));
const GLint viewportOffsets[4] = {0, 0, 2, 0}; const GLint viewportOffsets[4] = {0, 0, 2, 0};
...@@ -787,6 +792,8 @@ TEST_P(MultiviewDrawValidationTest, ActiveTimeElapsedQuery) ...@@ -787,6 +792,8 @@ TEST_P(MultiviewDrawValidationTest, ActiveTimeElapsedQuery)
{ {
glFramebufferTextureMultiviewSideBySideANGLE(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, mTex2d, glFramebufferTextureMultiviewSideBySideANGLE(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, mTex2d,
0, 2, &viewportOffsets[0]); 0, 2, &viewportOffsets[0]);
glClear(GL_COLOR_BUFFER_BIT);
EXPECT_GL_ERROR(GL_INVALID_OPERATION);
glDrawArrays(GL_TRIANGLES, 0, 3); glDrawArrays(GL_TRIANGLES, 0, 3);
EXPECT_GL_ERROR(GL_INVALID_OPERATION); EXPECT_GL_ERROR(GL_INVALID_OPERATION);
} }
...@@ -795,6 +802,8 @@ TEST_P(MultiviewDrawValidationTest, ActiveTimeElapsedQuery) ...@@ -795,6 +802,8 @@ TEST_P(MultiviewDrawValidationTest, ActiveTimeElapsedQuery)
{ {
glFramebufferTextureMultiviewSideBySideANGLE(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, mTex2d, glFramebufferTextureMultiviewSideBySideANGLE(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, mTex2d,
0, 1, &viewportOffsets[0]); 0, 1, &viewportOffsets[0]);
glClear(GL_COLOR_BUFFER_BIT);
EXPECT_GL_NO_ERROR();
glDrawArrays(GL_TRIANGLES, 0, 3); glDrawArrays(GL_TRIANGLES, 0, 3);
EXPECT_GL_NO_ERROR(); EXPECT_GL_NO_ERROR();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment