From 63294bc251336f3e59240642676a5e758a8c2192 Mon Sep 17 00:00:00 2001 From: reveman Date: Mon, 17 Nov 2014 21:06:25 -0800 Subject: cc: Add UMA stats for texture copy latency. Records the time between the issue of a texture copy operation and detecting that it has completed as measured by the GPU process. This data is useful to determine potential driver problems related to fences. Consistent high latency (200ms and above) for copy operations is a strong indication of a misbehaving fence extension. The data can also be used to determine the amount of staging resources to use for optimal performance. BUG=431845 Review URL: https://codereview.chromium.org/733053005 Cr-Commit-Position: refs/heads/master@{#304562} --- gpu/command_buffer/tests/gl_query_unittest.cc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'gpu/command_buffer/tests') diff --git a/gpu/command_buffer/tests/gl_query_unittest.cc b/gpu/command_buffer/tests/gl_query_unittest.cc index 0104430..5ea7e8d 100644 --- a/gpu/command_buffer/tests/gl_query_unittest.cc +++ b/gpu/command_buffer/tests/gl_query_unittest.cc @@ -63,7 +63,7 @@ TEST_F(QueryTest, MultipleQueries) { glGetQueryObjectuivEXT(commands_issue_query, GL_QUERY_RESULT_EXT, &result); // Sanity check - the resulting delta is shorter than the time it took to // run this test. - EXPECT_LT(result, base::TimeDelta(after - before).InMicroseconds()); + EXPECT_LE(result, base::TimeDelta(after - before).InMicroseconds()); result = 0; available = 0; @@ -152,6 +152,8 @@ TEST_F(QueryTest, CommandsCompleted) { return; } + base::TimeTicks before = base::TimeTicks::HighResNow(); + GLuint query; glGenQueriesEXT(1, &query); glBeginQueryEXT(GL_COMMANDS_COMPLETED_CHROMIUM, query); @@ -161,7 +163,12 @@ TEST_F(QueryTest, CommandsCompleted) { glFlush(); GLuint result = 0; glGetQueryObjectuivEXT(query, GL_QUERY_RESULT_EXT, &result); - EXPECT_EQ(0u, result); + + base::TimeTicks after = base::TimeTicks::HighResNow(); + // Sanity check - the resulting delta is shorter than the time it took to + // run this test. + EXPECT_LE(result, base::TimeDelta(after - before).InMicroseconds()); + glDeleteQueriesEXT(1, &query); GLTestHelper::CheckGLError("no errors", __LINE__); } -- cgit v1.1