Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(220)

Unified Diff: gpu/command_buffer/tests/gl_query_unittests.cc

Issue 106623008: gpu: Support parallel active queries in command buffer (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 6 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/tests/gl_query_unittests.cc
diff --git a/gpu/command_buffer/tests/gl_query_unittests.cc b/gpu/command_buffer/tests/gl_query_unittests.cc
index 4d1700d847c673a7b9ff55866d895b8fda36dd29..b2dcc6b831c617699935f6eae3e3bebadf32a6c5 100644
--- a/gpu/command_buffer/tests/gl_query_unittests.cc
+++ b/gpu/command_buffer/tests/gl_query_unittests.cc
@@ -27,6 +27,50 @@ class QueryTest : public testing::Test {
GLManager gl_;
};
+TEST_F(QueryTest, MultipleQueries) {
+ EXPECT_TRUE(GLTestHelper::HasExtension("GL_CHROMIUM_get_error_query"));
+ EXPECT_TRUE(GLTestHelper::HasExtension(
+ "GL_CHROMIUM_command_buffer_latency_query"));
+
+ GLuint error_query = 0;
+ GLuint latency_query = 0;
+ glGenQueriesEXT(1, &error_query);
+ glGenQueriesEXT(1, &latency_query);
+
+ GLuint query_status;
+ GLuint available;
+
+ // Begin two queries of different types
+ glBeginQueryEXT(GL_LATENCY_QUERY_CHROMIUM, latency_query);
+ glBeginQueryEXT(GL_GET_ERROR_QUERY_CHROMIUM, error_query);
+
+ glEnable(GL_TEXTURE_2D); // Generates an INVALID_ENUM error
+
+ // End the two queries
+ glEndQueryEXT(GL_LATENCY_QUERY_CHROMIUM);
+ glEndQueryEXT(GL_GET_ERROR_QUERY_CHROMIUM);
+
+ glFinish();
+
+ // Check that we got result on both queries.
+
+ available = 0;
+ glGetQueryObjectuivEXT(latency_query,
+ GL_QUERY_RESULT_AVAILABLE_EXT,
+ &available);
+ EXPECT_TRUE(available);
+ // TODO(jadahl): Check latency result whenever latency test is enabled
reveman 2014/01/02 15:38:12 Would it be better to use a GL_COMMANDS_ISSUED_CHR
+
+ query_status = 0;
+ available = 0;
+ glGetQueryObjectuivEXT(error_query,
+ GL_QUERY_RESULT_AVAILABLE_EXT,
+ &available);
+ EXPECT_TRUE(available);
+ glGetQueryObjectuivEXT(error_query, GL_QUERY_RESULT_EXT, &query_status);
+ EXPECT_EQ(static_cast<uint32>(GL_INVALID_ENUM), query_status);
+}
+
TEST_F(QueryTest, GetErrorBasic) {
EXPECT_TRUE(GLTestHelper::HasExtension("GL_CHROMIUM_get_error_query"));
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698