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
Interactions with EXT_disjoint_timer_query
An INVALID_OPERATION error is generated by any Draw* command, if there
is an active query object for target TIME_ELAPSED_EXT and the number
of views in the draw framebuffer is greater than 1.
An INVALID_OPERATION error is generated by any Draw* command and the Clear
command if there is an active query object for target TIME_ELAPSED_EXT and
the number of views in the draw framebuffer is greater than 1.
Errors
......
......@@ -2554,6 +2554,7 @@ bool ValidateBlitFramebufferANGLE(Context *context,
bool ValidateClear(Context *context, GLbitfield mask)
{
Framebuffer *fbo = context->getGLState().getDrawFramebuffer();
const Extensions &extensions = context->getExtensions();
if (!ValidateFramebufferComplete(context, fbo))
{
......@@ -2566,7 +2567,7 @@ bool ValidateClear(Context *context, GLbitfield mask)
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,
GL_SIGNED_NORMALIZED};
......@@ -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;
}
......
......@@ -764,6 +764,11 @@ TEST_P(MultiviewDrawValidationTest, ActiveTimeElapsedQuery)
{
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"));
const GLint viewportOffsets[4] = {0, 0, 2, 0};
......@@ -787,6 +792,8 @@ TEST_P(MultiviewDrawValidationTest, ActiveTimeElapsedQuery)
{
glFramebufferTextureMultiviewSideBySideANGLE(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, mTex2d,
0, 2, &viewportOffsets[0]);
glClear(GL_COLOR_BUFFER_BIT);
EXPECT_GL_ERROR(GL_INVALID_OPERATION);
glDrawArrays(GL_TRIANGLES, 0, 3);
EXPECT_GL_ERROR(GL_INVALID_OPERATION);
}
......@@ -795,6 +802,8 @@ TEST_P(MultiviewDrawValidationTest, ActiveTimeElapsedQuery)
{
glFramebufferTextureMultiviewSideBySideANGLE(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, mTex2d,
0, 1, &viewportOffsets[0]);
glClear(GL_COLOR_BUFFER_BIT);
EXPECT_GL_NO_ERROR();
glDrawArrays(GL_TRIANGLES, 0, 3);
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