diff options
author | piman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-27 01:29:51 +0000 |
---|---|---|
committer | piman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-27 01:29:51 +0000 |
commit | 840a7e465bf6de0c40e1240b8fff7ef121f1f964 (patch) | |
tree | 58a110e62cc4f41e0f3b5c420580306360c1513f /content | |
parent | 7c97f8cec3686136ad08b583d1596f25c713e3ce (diff) | |
download | chromium_src-840a7e465bf6de0c40e1240b8fff7ef121f1f964.zip chromium_src-840a7e465bf6de0c40e1240b8fff7ef121f1f964.tar.gz chromium_src-840a7e465bf6de0c40e1240b8fff7ef121f1f964.tar.bz2 |
Make WaitSyncPoint go through command buffers.
BUG=178305
Review URL: https://chromiumcodereview.appspot.com/12330129
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@184820 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
6 files changed, 12 insertions, 29 deletions
diff --git a/content/common/gpu/client/command_buffer_proxy_impl.cc b/content/common/gpu/client/command_buffer_proxy_impl.cc index addf767..49cb0a3 100644 --- a/content/common/gpu/client/command_buffer_proxy_impl.cc +++ b/content/common/gpu/client/command_buffer_proxy_impl.cc @@ -398,10 +398,6 @@ uint32 CommandBufferProxyImpl::InsertSyncPoint() { return sync_point; } -void CommandBufferProxyImpl::WaitSyncPoint(uint32 sync_point) { - Send(new GpuCommandBufferMsg_WaitSyncPoint(route_id_, sync_point)); -} - bool CommandBufferProxyImpl::SignalSyncPoint(uint32 sync_point, const base::Closure& callback) { if (last_state_.error != gpu::error::kNoError) { diff --git a/content/common/gpu/client/command_buffer_proxy_impl.h b/content/common/gpu/client/command_buffer_proxy_impl.h index 82221b9..3d75a3f 100644 --- a/content/common/gpu/client/command_buffer_proxy_impl.h +++ b/content/common/gpu/client/command_buffer_proxy_impl.h @@ -97,11 +97,6 @@ class CommandBufferProxyImpl // global and can be used for cross-channel synchronization. uint32 InsertSyncPoint(); - // Makes this command buffer wait on a sync point. This command buffer will be - // unscheduled until the command buffer that inserted that sync point reaches - // it, or gets destroyed. - void WaitSyncPoint(uint32); - // Makes this command buffer invoke a task when a sync point is reached, or // the command buffer that inserted that sync point is destroyed. bool SignalSyncPoint(uint32 sync_point, diff --git a/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc b/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc index 574ee10..ba010d5 100644 --- a/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc +++ b/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc @@ -424,12 +424,6 @@ unsigned int WebGraphicsContext3DCommandBufferImpl::insertSyncPoint() { return command_buffer_->InsertSyncPoint(); } -void WebGraphicsContext3DCommandBufferImpl::waitSyncPoint( - unsigned int sync_point) { - real_gl_->helper()->CommandBufferHelper::Flush(); - command_buffer_->WaitSyncPoint(sync_point); -} - bool WebGraphicsContext3DCommandBufferImpl::SetParent( WebGraphicsContext3DCommandBufferImpl* new_parent) { if (parent_ == new_parent) @@ -1617,6 +1611,8 @@ DELEGATE_TO_GL_3(bindUniformLocationCHROMIUM, BindUniformLocationCHROMIUM, DELEGATE_TO_GL(shallowFlushCHROMIUM,ShallowFlushCHROMIUM); +DELEGATE_TO_GL_1(waitSyncPoint, WaitSyncPointCHROMIUM, GLuint) + void WebGraphicsContext3DCommandBufferImpl::genMailboxCHROMIUM( WGC3Dbyte* name) { std::vector<std::string> names(1); diff --git a/content/common/gpu/gpu_command_buffer_stub.cc b/content/common/gpu/gpu_command_buffer_stub.cc index c0cf215..550c174 100644 --- a/content/common/gpu/gpu_command_buffer_stub.cc +++ b/content/common/gpu/gpu_command_buffer_stub.cc @@ -161,8 +161,7 @@ bool GpuCommandBufferStub::OnMessageReceived(const IPC::Message& message) { // Echo, RetireSyncPoint, or WaitSyncPoint). if (decoder_.get() && message.type() != GpuCommandBufferMsg_Echo::ID && - message.type() != GpuCommandBufferMsg_RetireSyncPoint::ID && - message.type() != GpuCommandBufferMsg_WaitSyncPoint::ID) { + message.type() != GpuCommandBufferMsg_RetireSyncPoint::ID) { if (!MakeCurrent()) return false; } @@ -201,8 +200,6 @@ bool GpuCommandBufferStub::OnMessageReceived(const IPC::Message& message) { OnEnsureBackbuffer) IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_RetireSyncPoint, OnRetireSyncPoint) - IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_WaitSyncPoint, - OnWaitSyncPoint) IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_SignalSyncPoint, OnSignalSyncPoint) IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_SendClientManagedMemoryStats, @@ -225,8 +222,7 @@ bool GpuCommandBufferStub::Send(IPC::Message* message) { } bool GpuCommandBufferStub::IsScheduled() { - return sync_point_wait_count_ == 0 && - (!scheduler_.get() || scheduler_->IsScheduled()); + return (!scheduler_.get() || scheduler_->IsScheduled()); } bool GpuCommandBufferStub::HasMoreWork() { @@ -478,6 +474,9 @@ void GpuCommandBufferStub::OnInitialize( decoder_->SetMsgCallback( base::Bind(&GpuCommandBufferStub::SendConsoleMessage, base::Unretained(this))); + decoder_->SetWaitSyncPointCallback( + base::Bind(&GpuCommandBufferStub::OnWaitSyncPoint, + base::Unretained(this))); command_buffer_->SetPutOffsetChangeCallback( base::Bind(&GpuCommandBufferStub::PutChanged, base::Unretained(this))); @@ -758,17 +757,19 @@ void GpuCommandBufferStub::OnRetireSyncPoint(uint32 sync_point) { manager->sync_point_manager()->RetireSyncPoint(sync_point); } -void GpuCommandBufferStub::OnWaitSyncPoint(uint32 sync_point) { +bool GpuCommandBufferStub::OnWaitSyncPoint(uint32 sync_point) { if (sync_point_wait_count_ == 0) { TRACE_EVENT_ASYNC_BEGIN1("gpu", "WaitSyncPoint", this, "GpuCommandBufferStub", this); } + scheduler_->SetScheduled(false); ++sync_point_wait_count_; GpuChannelManager* manager = channel_->gpu_channel_manager(); manager->sync_point_manager()->AddSyncPointCallback( sync_point, base::Bind(&GpuCommandBufferStub::OnSyncPointRetired, this->AsWeakPtr())); + return scheduler_->IsScheduled(); } void GpuCommandBufferStub::OnSyncPointRetired() { @@ -777,7 +778,7 @@ void GpuCommandBufferStub::OnSyncPointRetired() { TRACE_EVENT_ASYNC_END1("gpu", "WaitSyncPoint", this, "GpuCommandBufferStub", this); } - OnReschedule(); + scheduler_->SetScheduled(true); } void GpuCommandBufferStub::OnSignalSyncPoint(uint32 sync_point, uint32 id) { diff --git a/content/common/gpu/gpu_command_buffer_stub.h b/content/common/gpu/gpu_command_buffer_stub.h index 5e58f75..a30626a 100644 --- a/content/common/gpu/gpu_command_buffer_stub.h +++ b/content/common/gpu/gpu_command_buffer_stub.h @@ -171,7 +171,7 @@ class GpuCommandBufferStub void OnEnsureBackbuffer(); void OnRetireSyncPoint(uint32 sync_point); - void OnWaitSyncPoint(uint32 sync_point); + bool OnWaitSyncPoint(uint32 sync_point); void OnSyncPointRetired(); void OnSignalSyncPoint(uint32 sync_point, uint32 id); void OnSignalSyncPointAck(uint32 id); diff --git a/content/common/gpu/gpu_messages.h b/content/common/gpu/gpu_messages.h index 997ee95..687340c 100644 --- a/content/common/gpu/gpu_messages.h +++ b/content/common/gpu/gpu_messages.h @@ -582,11 +582,6 @@ IPC_SYNC_MESSAGE_ROUTED0_1(GpuCommandBufferMsg_InsertSyncPoint, IPC_MESSAGE_ROUTED1(GpuCommandBufferMsg_RetireSyncPoint, uint32 /* sync_point */) -// Makes this command buffer wait on a sync point. Command buffer message -// execution will be delayed until the sync point has been reached. -IPC_MESSAGE_ROUTED1(GpuCommandBufferMsg_WaitSyncPoint, - uint32 /* sync_point */) - // Makes this command buffer signal when a sync point is reached, by sending // back a GpuCommandBufferMsg_SignalSyncPointAck message with the same // signal_id. |