diff options
23 files changed, 251 insertions, 71 deletions
diff --git a/gpu/command_buffer/build_gles2_cmd_buffer.py b/gpu/command_buffer/build_gles2_cmd_buffer.py index c651a51..ac0f58bd 100755 --- a/gpu/command_buffer/build_gles2_cmd_buffer.py +++ b/gpu/command_buffer/build_gles2_cmd_buffer.py @@ -451,6 +451,7 @@ _ENUM_LISTS = { 'GL_ANY_SAMPLES_PASSED_EXT', 'GL_ANY_SAMPLES_PASSED_CONSERVATIVE_EXT', 'GL_COMMANDS_ISSUED_CHROMIUM', + 'GL_LATENCY_QUERY_CHROMIUM', ], }, 'RenderBufferParameter': { diff --git a/gpu/command_buffer/client/gles2_implementation_autogen.h b/gpu/command_buffer/client/gles2_implementation_autogen.h index 57835fb..b8d743c 100644 --- a/gpu/command_buffer/client/gles2_implementation_autogen.h +++ b/gpu/command_buffer/client/gles2_implementation_autogen.h @@ -498,17 +498,9 @@ virtual void ConsumeTextureCHROMIUM( virtual void BindUniformLocationCHROMIUM( GLuint program, GLint location, const char* name) OVERRIDE; -void BindTexImage2DCHROMIUM(GLenum target, GLint imageId) { - GPU_CLIENT_SINGLE_THREAD_CHECK(); - GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glBindTexImage2DCHROMIUM(" << GLES2Util::GetStringTextureBindTarget(target) << ", " << imageId << ")"); // NOLINT - helper_->BindTexImage2DCHROMIUM(target, imageId); -} - -void ReleaseTexImage2DCHROMIUM(GLenum target, GLint imageId) { - GPU_CLIENT_SINGLE_THREAD_CHECK(); - GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glReleaseTexImage2DCHROMIUM(" << GLES2Util::GetStringTextureBindTarget(target) << ", " << imageId << ")"); // NOLINT - helper_->ReleaseTexImage2DCHROMIUM(target, imageId); -} +virtual void BindTexImage2DCHROMIUM(GLenum target, GLint imageId) OVERRIDE; + +virtual void ReleaseTexImage2DCHROMIUM(GLenum target, GLint imageId) OVERRIDE; #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_AUTOGEN_H_ diff --git a/gpu/command_buffer/client/gles2_implementation_impl_autogen.h b/gpu/command_buffer/client/gles2_implementation_impl_autogen.h index 58ab468..2ffd65c 100644 --- a/gpu/command_buffer/client/gles2_implementation_impl_autogen.h +++ b/gpu/command_buffer/client/gles2_implementation_impl_autogen.h @@ -1500,5 +1500,19 @@ void GLES2Implementation::ConsumeTextureCHROMIUM( helper_->ConsumeTextureCHROMIUMImmediate(target, mailbox); } +void GLES2Implementation::BindTexImage2DCHROMIUM( + GLenum target, GLint imageId) { + GPU_CLIENT_SINGLE_THREAD_CHECK(); + GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glBindTexImage2DCHROMIUM(" << GLES2Util::GetStringTextureBindTarget(target) << ", " << imageId << ")"); // NOLINT + helper_->BindTexImage2DCHROMIUM(target, imageId); +} + +void GLES2Implementation::ReleaseTexImage2DCHROMIUM( + GLenum target, GLint imageId) { + GPU_CLIENT_SINGLE_THREAD_CHECK(); + GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glReleaseTexImage2DCHROMIUM(" << GLES2Util::GetStringTextureBindTarget(target) << ", " << imageId << ")"); // NOLINT + helper_->ReleaseTexImage2DCHROMIUM(target, imageId); +} + #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_IMPL_AUTOGEN_H_ diff --git a/gpu/command_buffer/client/gles2_interface_autogen.h b/gpu/command_buffer/client/gles2_interface_autogen.h index 4f38485..67837da 100644 --- a/gpu/command_buffer/client/gles2_interface_autogen.h +++ b/gpu/command_buffer/client/gles2_interface_autogen.h @@ -286,5 +286,7 @@ virtual void ProduceTextureCHROMIUM(GLenum target, const GLbyte* mailbox) = 0; virtual void ConsumeTextureCHROMIUM(GLenum target, const GLbyte* mailbox) = 0; virtual void BindUniformLocationCHROMIUM( GLuint program, GLint location, const char* name) = 0; +virtual void BindTexImage2DCHROMIUM(GLenum target, GLint imageId) = 0; +virtual void ReleaseTexImage2DCHROMIUM(GLenum target, GLint imageId) = 0; #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_INTERFACE_AUTOGEN_H_ diff --git a/gpu/command_buffer/client/gles2_interface_stub_autogen.h b/gpu/command_buffer/client/gles2_interface_stub_autogen.h index 02f75af..cabf287 100644 --- a/gpu/command_buffer/client/gles2_interface_stub_autogen.h +++ b/gpu/command_buffer/client/gles2_interface_stub_autogen.h @@ -318,5 +318,7 @@ virtual void ConsumeTextureCHROMIUM( GLenum target, const GLbyte* mailbox) OVERRIDE; virtual void BindUniformLocationCHROMIUM( GLuint program, GLint location, const char* name) OVERRIDE; +virtual void BindTexImage2DCHROMIUM(GLenum target, GLint imageId) OVERRIDE; +virtual void ReleaseTexImage2DCHROMIUM(GLenum target, GLint imageId) OVERRIDE; #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_INTERFACE_STUB_AUTOGEN_H_ diff --git a/gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h b/gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h index b69ce2f..fdb92c9 100644 --- a/gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h +++ b/gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h @@ -596,5 +596,11 @@ void GLES2InterfaceStub::ConsumeTextureCHROMIUM( void GLES2InterfaceStub::BindUniformLocationCHROMIUM( GLuint /* program */, GLint /* location */, const char* /* name */) { } +void GLES2InterfaceStub::BindTexImage2DCHROMIUM( + GLenum /* target */, GLint /* imageId */) { +} +void GLES2InterfaceStub::ReleaseTexImage2DCHROMIUM( + GLenum /* target */, GLint /* imageId */) { +} #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_INTERFACE_STUB_IMPL_AUTOGEN_H_ diff --git a/gpu/command_buffer/client/query_tracker.cc b/gpu/command_buffer/client/query_tracker.cc index 71017ff..a0c7b56 100644 --- a/gpu/command_buffer/client/query_tracker.cc +++ b/gpu/command_buffer/client/query_tracker.cc @@ -11,6 +11,7 @@ #include "../client/gles2_cmd_helper.h" #include "../client/gles2_implementation.h" #include "../client/mapped_memory.h" +#include "../common/time.h" namespace gpu { namespace gles2 { @@ -64,6 +65,7 @@ QueryTracker::Query::Query(GLuint id, GLenum target, submit_count_(0), token_(0), flushed_(false), + client_begin_time_us_(0), result_(0) { } @@ -76,6 +78,11 @@ void QueryTracker::Query::Begin(GLES2Implementation* gl) { case GL_GET_ERROR_QUERY_CHROMIUM: // To nothing on begin for error queries. break; + case GL_LATENCY_QUERY_CHROMIUM: + client_begin_time_us_ = MicrosecondsSinceOriginOfTime(); + // tell service about id, shared memory and count + gl->helper()->BeginQueryEXT(target(), id(), shm_id(), shm_offset()); + break; default: // tell service about id, shared memory and count gl->helper()->BeginQueryEXT(target(), id(), shm_id(), shm_offset()); @@ -114,7 +121,20 @@ bool QueryTracker::Query::CheckResultsAvailable( // Need a MemoryBarrier here so that sync->result read after // sync->process_count. gpu::MemoryBarrier(); - result_ = info_.sync->result; + switch (target()) { + case GL_COMMANDS_ISSUED_CHROMIUM: + result_ = std::min(info_.sync->result, + static_cast<uint64>(0xFFFFFFFFL)); + break; + case GL_LATENCY_QUERY_CHROMIUM: + GPU_DCHECK(info_.sync->result >= client_begin_time_us_); + result_ = std::min(info_.sync->result - client_begin_time_us_, + static_cast<uint64>(0xFFFFFFFFL)); + break; + default: + result_ = info_.sync->result; + break; + } state_ = kComplete; } else { if (!flushed_) { diff --git a/gpu/command_buffer/client/query_tracker.h b/gpu/command_buffer/client/query_tracker.h index e59419f..9df8d18 100644 --- a/gpu/command_buffer/client/query_tracker.h +++ b/gpu/command_buffer/client/query_tracker.h @@ -133,6 +133,7 @@ class GLES2_IMPL_EXPORT QueryTracker { uint32 submit_count_; int32 token_; bool flushed_; + uint64 client_begin_time_us_; // Only used for latency query target. uint32 result_; }; diff --git a/gpu/command_buffer/common/gles2_cmd_format.h b/gpu/command_buffer/common/gles2_cmd_format.h index 2a18d4a..93d7a6f 100644 --- a/gpu/command_buffer/common/gles2_cmd_format.h +++ b/gpu/command_buffer/common/gles2_cmd_format.h @@ -147,7 +147,7 @@ struct QuerySync { } uint32 process_count; - uint32 result; + uint64 result; }; COMPILE_ASSERT(sizeof(ProgramInput) == 20, ProgramInput_size_not_20); diff --git a/gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h b/gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h index f5023de..d15efd1 100644 --- a/gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h +++ b/gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h @@ -956,6 +956,7 @@ std::string GLES2Util::GetStringQueryTarget(uint32 value) { { GL_ANY_SAMPLES_PASSED_CONSERVATIVE_EXT, "GL_ANY_SAMPLES_PASSED_CONSERVATIVE_EXT" }, { GL_COMMANDS_ISSUED_CHROMIUM, "GL_COMMANDS_ISSUED_CHROMIUM" }, + { GL_LATENCY_QUERY_CHROMIUM, "GL_LATENCY_QUERY_CHROMIUM" }, }; return GLES2Util::GetQualifiedEnumString( string_table, arraysize(string_table), value); diff --git a/gpu/command_buffer/common/time.h b/gpu/command_buffer/common/time.h new file mode 100644 index 0000000..55403dd --- /dev/null +++ b/gpu/command_buffer/common/time.h @@ -0,0 +1,32 @@ +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef GPU_COMMAND_BUFFER_COMMON_TIME_H_ +#define GPU_COMMAND_BUFFER_COMMON_TIME_H_ + +#if !defined(__native_client__) + +#include "base/time.h" + +namespace gpu { + +inline uint64 MicrosecondsSinceOriginOfTime() { + return (base::TimeTicks::HighResNow() - base::TimeTicks()).InMicroseconds(); +} + +} // namespace gpu + +#else + +namespace gpu { + +inline uint64 MicrosecondsSinceOriginOfTime() { + return 0; +} + +} // namespace gpu + +#endif // __native_client__ + +#endif // GPU_COMMAND_BUFFER_COMMON_TIME_H_ diff --git a/gpu/command_buffer/service/feature_info.cc b/gpu/command_buffer/service/feature_info.cc index 14d421f..f06c920 100644 --- a/gpu/command_buffer/service/feature_info.cc +++ b/gpu/command_buffer/service/feature_info.cc @@ -221,6 +221,7 @@ void FeatureInfo::AddFeatures(const char* desired_features) { AddExtensionString("GL_ANGLE_translated_shader_source"); AddExtensionString("GL_CHROMIUM_bind_uniform_location"); AddExtensionString("GL_CHROMIUM_command_buffer_query"); + AddExtensionString("GL_CHROMIUM_command_buffer_latency_query"); AddExtensionString("GL_CHROMIUM_copy_texture"); AddExtensionString("GL_CHROMIUM_discard_framebuffer"); AddExtensionString("GL_CHROMIUM_get_error_query"); diff --git a/gpu/command_buffer/service/gl_utils.h b/gpu/command_buffer/service/gl_utils.h index 5baff01..a723031 100644 --- a/gpu/command_buffer/service/gl_utils.h +++ b/gpu/command_buffer/service/gl_utils.h @@ -89,6 +89,9 @@ /* GL_CHROMIUM_get_error_query */ #define GL_GET_ERROR_QUERY_CHROMIUM 0x84F3 +/* GL_CHROMIUM_command_buffer_latency_query */ +#define GL_LATENCY_QUERY_CHROMIUM 0x84F4 + // GL_OES_texure_3D #define GL_SAMPLER_3D_OES 0x8B5F diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc index 662c21c..3504c8c 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc @@ -8652,6 +8652,7 @@ error::Error GLES2DecoderImpl::HandleBeginQueryEXT( switch (target) { case GL_COMMANDS_ISSUED_CHROMIUM: + case GL_LATENCY_QUERY_CHROMIUM: break; default: if (!feature_info_->feature_flags().occlusion_query_boolean) { diff --git a/gpu/command_buffer/service/gles2_cmd_validation_implementation_autogen.h b/gpu/command_buffer/service/gles2_cmd_validation_implementation_autogen.h index ad51477..48eb54e 100644 --- a/gpu/command_buffer/service/gles2_cmd_validation_implementation_autogen.h +++ b/gpu/command_buffer/service/gles2_cmd_validation_implementation_autogen.h @@ -281,6 +281,7 @@ static GLenum valid_query_target_table[] = { GL_ANY_SAMPLES_PASSED_EXT, GL_ANY_SAMPLES_PASSED_CONSERVATIVE_EXT, GL_COMMANDS_ISSUED_CHROMIUM, + GL_LATENCY_QUERY_CHROMIUM, }; static GLenum valid_read_pixel_format_table[] = { diff --git a/gpu/command_buffer/service/query_manager.cc b/gpu/command_buffer/service/query_manager.cc index 0f94d46..45a3a56 100644 --- a/gpu/command_buffer/service/query_manager.cc +++ b/gpu/command_buffer/service/query_manager.cc @@ -102,8 +102,7 @@ bool CommandsIssuedQuery::Begin() { bool CommandsIssuedQuery::End(uint32 submit_count) { base::TimeDelta elapsed = base::TimeTicks::HighResNow() - begin_time_; MarkAsPending(submit_count); - return MarkAsCompleted( - std::min(elapsed.InMicroseconds(), static_cast<int64>(0xFFFFFFFFL))); + return MarkAsCompleted(elapsed.InMicroseconds()); } bool CommandsIssuedQuery::Process() { @@ -120,6 +119,49 @@ void CommandsIssuedQuery::Destroy(bool /* have_context */) { CommandsIssuedQuery::~CommandsIssuedQuery() { } +class CommandLatencyQuery : public QueryManager::Query { + public: + CommandLatencyQuery( + QueryManager* manager, GLenum target, int32 shm_id, uint32 shm_offset); + + virtual bool Begin() OVERRIDE; + virtual bool End(uint32 submit_count) OVERRIDE; + virtual bool Process() OVERRIDE; + virtual void Destroy(bool have_context) OVERRIDE; + + protected: + virtual ~CommandLatencyQuery(); +}; + +CommandLatencyQuery::CommandLatencyQuery( + QueryManager* manager, GLenum target, int32 shm_id, uint32 shm_offset) + : Query(manager, target, shm_id, shm_offset) { +} + +bool CommandLatencyQuery::Begin() { + return true; +} + +bool CommandLatencyQuery::End(uint32 submit_count) { + base::TimeDelta now = base::TimeTicks::HighResNow() - base::TimeTicks(); + MarkAsPending(submit_count); + return MarkAsCompleted(now.InMicroseconds()); +} + +bool CommandLatencyQuery::Process() { + NOTREACHED(); + return true; +} + +void CommandLatencyQuery::Destroy(bool /* have_context */) { + if (!IsDeleted()) { + MarkAsDeleted(); + } +} + +CommandLatencyQuery::~CommandLatencyQuery() { +} + class GetErrorQuery : public QueryManager::Query { public: GetErrorQuery( @@ -203,6 +245,9 @@ QueryManager::Query* QueryManager::CreateQuery( case GL_COMMANDS_ISSUED_CHROMIUM: query = new CommandsIssuedQuery(this, target, shm_id, shm_offset); break; + case GL_LATENCY_QUERY_CHROMIUM: + query = new CommandLatencyQuery(this, target, shm_id, shm_offset); + break; case GL_GET_ERROR_QUERY_CHROMIUM: query = new GetErrorQuery(this, target, shm_id, shm_offset); break; @@ -297,7 +342,7 @@ QueryManager::Query::~Query() { } } -bool QueryManager::Query::MarkAsCompleted(GLuint result) { +bool QueryManager::Query::MarkAsCompleted(uint64 result) { DCHECK(pending_); QuerySync* sync = manager_->decoder_->GetSharedMemoryAs<QuerySync*>( shm_id_, shm_offset_, sizeof(*sync)); diff --git a/gpu/command_buffer/service/query_manager.h b/gpu/command_buffer/service/query_manager.h index f6d3942..322c03d 100644 --- a/gpu/command_buffer/service/query_manager.h +++ b/gpu/command_buffer/service/query_manager.h @@ -81,7 +81,7 @@ class GPU_EXPORT QueryManager { } // Returns false if shared memory for sync is invalid. - bool MarkAsCompleted(GLuint result); + bool MarkAsCompleted(uint64 result); void MarkAsPending(uint32 submit_count) { DCHECK(!pending_); diff --git a/gpu/command_buffer/tests/gl_get_error_query_unittests.cc b/gpu/command_buffer/tests/gl_get_error_query_unittests.cc deleted file mode 100644 index a177044..0000000 --- a/gpu/command_buffer/tests/gl_get_error_query_unittests.cc +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include <GLES2/gl2.h> -#include <GLES2/gl2ext.h> - -#include "gpu/command_buffer/tests/gl_manager.h" -#include "gpu/command_buffer/tests/gl_test_utils.h" -#include "testing/gmock/include/gmock/gmock.h" -#include "testing/gtest/include/gtest/gtest.h" - -namespace gpu { - -class GetErrorQueryTest : public testing::Test { - protected: - virtual void SetUp() { - gl_.Initialize(gfx::Size(2, 2)); - } - - virtual void TearDown() { - gl_.Destroy(); - } - - GLManager gl_; -}; - -TEST_F(GetErrorQueryTest, Basic) { - EXPECT_TRUE(GLTestHelper::HasExtension("GL_CHROMIUM_get_error_query")); - - GLuint query = 0; - glGenQueriesEXT(1, &query); - - GLuint query_status = 0; - GLuint result = 0; - - glBeginQueryEXT(GL_GET_ERROR_QUERY_CHROMIUM, query); - glEnable(GL_TEXTURE_2D); // Generates an INVALID_ENUM error - glEndQueryEXT(GL_GET_ERROR_QUERY_CHROMIUM); - - glFinish(); - - query_status = 0; - result = 0; - glGetQueryObjectuivEXT(query, GL_QUERY_RESULT_AVAILABLE_EXT, &result); - EXPECT_TRUE(result); - glGetQueryObjectuivEXT(query, GL_QUERY_RESULT_EXT, &query_status); - EXPECT_EQ(static_cast<uint32>(GL_INVALID_ENUM), query_status); -} - -} // namespace gpu - - diff --git a/gpu/command_buffer/tests/gl_query_unittests.cc b/gpu/command_buffer/tests/gl_query_unittests.cc new file mode 100644 index 0000000..047ae60 --- /dev/null +++ b/gpu/command_buffer/tests/gl_query_unittests.cc @@ -0,0 +1,102 @@ +// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include <GLES2/gl2.h> +#include <GLES2/gl2ext.h> + +#include "base/threading/platform_thread.h" +#include "gpu/command_buffer/tests/gl_manager.h" +#include "gpu/command_buffer/tests/gl_test_utils.h" +#include "testing/gmock/include/gmock/gmock.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace gpu { + +class QueryTest : public testing::Test { + protected: + virtual void SetUp() { + gl_.Initialize(gfx::Size(2, 2)); + } + + virtual void TearDown() { + gl_.Destroy(); + } + + GLManager gl_; +}; + +TEST_F(QueryTest, GetErrorBasic) { + EXPECT_TRUE(GLTestHelper::HasExtension("GL_CHROMIUM_get_error_query")); + + GLuint query = 0; + glGenQueriesEXT(1, &query); + + GLuint query_status = 0; + GLuint result = 0; + + glBeginQueryEXT(GL_GET_ERROR_QUERY_CHROMIUM, query); + glEnable(GL_TEXTURE_2D); // Generates an INVALID_ENUM error + glEndQueryEXT(GL_GET_ERROR_QUERY_CHROMIUM); + + glFinish(); + + query_status = 0; + result = 0; + glGetQueryObjectuivEXT(query, GL_QUERY_RESULT_AVAILABLE_EXT, &result); + EXPECT_TRUE(result); + glGetQueryObjectuivEXT(query, GL_QUERY_RESULT_EXT, &query_status); + EXPECT_EQ(static_cast<uint32>(GL_INVALID_ENUM), query_status); +} + +TEST_F(QueryTest, LatencyQueryBasic) { + EXPECT_TRUE(GLTestHelper::HasExtension( + "GL_CHROMIUM_command_buffer_latency_query")); + + GLuint query = 0; + glGenQueriesEXT(1, &query); + + GLuint query_result = 0; + GLuint available = 0; + + // First test a query with a ~1ms "latency". + const unsigned int kExpectedLatencyMicroseconds = 2000; + const unsigned int kTimePrecisionMicroseconds = 1000; + + glBeginQueryEXT(GL_LATENCY_QUERY_CHROMIUM, query); + // Usually, we want to measure gpu-side latency, but we fake it by + // adding client side latency for our test because it's easier. + base::PlatformThread::Sleep( + base::TimeDelta::FromMicroseconds(kExpectedLatencyMicroseconds)); + glEndQueryEXT(GL_LATENCY_QUERY_CHROMIUM); + + glFinish(); + + query_result = 0; + available = 0; + glGetQueryObjectuivEXT(query, GL_QUERY_RESULT_AVAILABLE_EXT, &available); + EXPECT_TRUE(available); + glGetQueryObjectuivEXT(query, GL_QUERY_RESULT_EXT, &query_result); + EXPECT_GE(query_result, kExpectedLatencyMicroseconds + - kTimePrecisionMicroseconds); + EXPECT_LE(query_result, kExpectedLatencyMicroseconds + + kTimePrecisionMicroseconds); + + // Then test a query with the lowest latency possible. + glBeginQueryEXT(GL_LATENCY_QUERY_CHROMIUM, query); + glEndQueryEXT(GL_LATENCY_QUERY_CHROMIUM); + + glFinish(); + + query_result = 0; + available = 0; + glGetQueryObjectuivEXT(query, GL_QUERY_RESULT_AVAILABLE_EXT, &available); + EXPECT_TRUE(available); + glGetQueryObjectuivEXT(query, GL_QUERY_RESULT_EXT, &query_result); + + EXPECT_LE(query_result, kTimePrecisionMicroseconds); +} + +} // namespace gpu + + diff --git a/gpu/command_buffer_common.gypi b/gpu/command_buffer_common.gypi index 33578af..b8047b2 100644 --- a/gpu/command_buffer_common.gypi +++ b/gpu/command_buffer_common.gypi @@ -29,6 +29,7 @@ 'command_buffer/common/id_allocator.cc', 'command_buffer/common/id_allocator.h', 'command_buffer/common/thread_local.h', + 'command_buffer/common/time.h', 'command_buffer/common/types.h', ], } diff --git a/gpu/gpu.gyp b/gpu/gpu.gyp index ce3fdec..86baa0f 100644 --- a/gpu/gpu.gyp +++ b/gpu/gpu.gyp @@ -246,7 +246,7 @@ 'command_buffer/tests/gl_bind_uniform_location_unittest.cc', 'command_buffer/tests/gl_copy_texture_CHROMIUM_unittest.cc', 'command_buffer/tests/gl_depth_texture_unittest.cc', - 'command_buffer/tests/gl_get_error_query_unittests.cc', + 'command_buffer/tests/gl_query_unittests.cc', 'command_buffer/tests/gl_manager.cc', 'command_buffer/tests/gl_manager.h', 'command_buffer/tests/gl_pointcoord_unittest.cc', diff --git a/third_party/khronos/GLES2/gl2ext.h b/third_party/khronos/GLES2/gl2ext.h index a452f3f..b6390b6 100644 --- a/third_party/khronos/GLES2/gl2ext.h +++ b/third_party/khronos/GLES2/gl2ext.h @@ -2003,6 +2003,13 @@ typedef void (GL_APIENTRYP PFNGLCOPYTEXTURECHROMIUM) (GLenum target, GLenum sour #define GL_GET_ERROR_QUERY_CHROMIUM 0x84F3 #endif +/* GL_CHROMIUM_command_buffer_latency_query */ +#ifndef GL_CHROMIUM_command_buffer_latency_query +#define GL_CHROMIUM_command_buffer_latency_query 1 +// TODO: Get official numbers for these constants. +#define GL_LATENCY_QUERY_CHROMIUM 0x84F4 +#endif + /* GL_CHROMIUM_texture_mailbox */ #ifndef GL_CHROMIUM_texture_mailbox #define GL_CHROMIUM_texture_mailbox 1 diff --git a/third_party/khronos/README.chromium b/third_party/khronos/README.chromium index 4128e35..3cb6342 100644 --- a/third_party/khronos/README.chromium +++ b/third_party/khronos/README.chromium @@ -24,6 +24,7 @@ GLES2/gl2ext.h - Added ANGLE_instanced_arrays - Added GL_EXT_framebuffer_multisample - Added GL_CHROMIUM_command_buffer_query + - Added GL_CHROMIUM_command_buffer_latency_query - Added GL_CHROMIUM_copy_texture - Added GL_CHROMIUM_bind_uniform_location - Added GL_CHROMIUM_get_error_query |