Context virtualization for D3D11 queries
Queries in D3D11 are now virtualized such that they work as expected with
multiple contexts. Timer queries now only time the operations that their
context is responsible for and the operations of other contexts are
ignored.
BUG=angleproject:657
Change-Id: I667de594bdb5831d126d5801c0e692ded4c88bf4
Reviewed-on: https://chromium-review.googlesource.com/327150
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Ian Ewell <ewell@google.com>
diff --git a/src/tests/gl_tests/TimerQueriesTest.cpp b/src/tests/gl_tests/TimerQueriesTest.cpp
index 70d9cfd..79c0ac9 100644
--- a/src/tests/gl_tests/TimerQueriesTest.cpp
+++ b/src/tests/gl_tests/TimerQueriesTest.cpp
@@ -308,14 +308,10 @@
return;
}
- // D3D multicontext isn't implemented yet
- if (GetParam() == ES3_D3D11() || GetParam() == ES2_D3D11())
- {
- std::cout
- << "Test skipped because the D3D backends cannot support simultaneous timer queries yet"
- << std::endl;
- return;
- }
+ // Without a glClear, the first draw call on GL takes a huge amount of time when run after the
+ // D3D test on certain NVIDIA drivers
+ glDepthMask(GL_TRUE);
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
EGLint contextAttributes[] = {
EGL_CONTEXT_MAJOR_VERSION_KHR,
@@ -415,15 +411,6 @@
// Go back to the first context, end its query, and get the result
eglMakeCurrent(display, surface, surface, contexts[0].context);
glEndQueryEXT(GL_TIME_ELAPSED_EXT);
- int timeout = 20000;
- GLuint ready = GL_FALSE;
- while (ready == GL_FALSE && timeout > 0)
- {
- angle::Sleep(0);
- glGetQueryObjectuivEXT(contexts[0].query, GL_QUERY_RESULT_AVAILABLE_EXT, &ready);
- timeout--;
- }
- ASSERT_LT(0, timeout) << "Query result available timed out" << std::endl;
GLuint64 result1 = 0;
GLuint64 result2 = 0;
@@ -432,17 +419,8 @@
glDeleteProgram(contexts[0].program);
ASSERT_GL_NO_ERROR();
- // Get the 2nd contexts results
+ // Get the 2nd context's results
eglMakeCurrent(display, surface, surface, contexts[1].context);
- timeout = 20000;
- ready = GL_FALSE;
- while (ready == GL_FALSE && timeout > 0)
- {
- angle::Sleep(0);
- glGetQueryObjectuivEXT(contexts[1].query, GL_QUERY_RESULT_AVAILABLE_EXT, &ready);
- timeout--;
- }
- ASSERT_LT(0, timeout) << "Query result available timed out" << std::endl;
glGetQueryObjectui64vEXT(contexts[1].query, GL_QUERY_RESULT_EXT, &result2);
glDeleteQueriesEXT(1, &contexts[1].query);
glDeleteProgram(contexts[1].program);