Fix context virtualization for timer queries
In the current implementation of query virtualization, queries are
paused/resumed during draw calls. Timer queries however are affected by
every OpenGL call, so virtualization and context switches for timer
queries must happen every time there is a context switch. Thus the logic
for context-switching queries was moved to a new function in the GL state
manager that is called everytime a makeCurrent call on the context is
made. Since queries may be made after a context is made current, the state
manager needs to keep track of any new queries that are started in a
context, so an additional delegate function was added to the state manager
that is called every time a glBeginQuery() call is made that adds the
query object to a set. All the queries in that set are paused when a
context switch is made and the queries in the new context are then loaded
and resumed.
BUG=angleproject:1307
Change-Id: I4e596d83739274cb2e14152a39e86e0e51b0f95c
Reviewed-on: https://chromium-review.googlesource.com/325811
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Ian Ewell <ewell@google.com>
diff --git a/src/tests/test_utils/ANGLETest.cpp b/src/tests/test_utils/ANGLETest.cpp
index d1a3c32..74969f9 100644
--- a/src/tests/test_utils/ANGLETest.cpp
+++ b/src/tests/test_utils/ANGLETest.cpp
@@ -463,6 +463,15 @@
return isD3D9() || isD3D11_FL93();
}
+bool ANGLETest::isOSX() const
+{
+#ifdef __APPLE__
+ return true;
+#else
+ return false;
+#endif
+}
+
EGLint ANGLETest::getPlatformRenderer() const
{
assert(mEGLWindow);