diff options
author | jbauman@chromium.org <jbauman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-06 22:33:09 +0000 |
---|---|---|
committer | jbauman@chromium.org <jbauman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-06 22:33:09 +0000 |
commit | f5f910d56e257b47f1632919f4e7b96779a7dc9e (patch) | |
tree | 4f879bbf835faa40f8bf3a84e8eac22a6e1977aa /gpu | |
parent | fa1c17e4e5036fe1abf4c378f476d52348e96c62 (diff) | |
download | chromium_src-f5f910d56e257b47f1632919f4e7b96779a7dc9e.zip chromium_src-f5f910d56e257b47f1632919f4e7b96779a7dc9e.tar.gz chromium_src-f5f910d56e257b47f1632919f4e7b96779a7dc9e.tar.bz2 |
Deschedule command buffer while polling fences
Use the normal deschedule path when waiting for fences, and use a separate callback to poll for the fences to complete (not the normal rescheduled command buffer message). This lets us run commands on other command buffers while waiting for this command buffer to finish.
BUG=112349
Review URL: http://codereview.chromium.org/9553012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@125234 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu')
-rw-r--r-- | gpu/command_buffer/service/gpu_scheduler.cc | 5 | ||||
-rw-r--r-- | gpu/command_buffer/service/gpu_scheduler.h | 8 |
2 files changed, 8 insertions, 5 deletions
diff --git a/gpu/command_buffer/service/gpu_scheduler.cc b/gpu/command_buffer/service/gpu_scheduler.cc index 7df1b16..fc9593d4 100644 --- a/gpu/command_buffer/service/gpu_scheduler.cc +++ b/gpu/command_buffer/service/gpu_scheduler.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// 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. @@ -191,6 +191,7 @@ void GpuScheduler::SetCommandProcessedCallback( void GpuScheduler::DeferToFence(base::Closure task) { unschedule_fences_.push(make_linked_ptr( new UnscheduleFence(gfx::GLFence::Create(), task))); + SetScheduled(false); } bool GpuScheduler::PollUnscheduleFences() { @@ -202,6 +203,7 @@ bool GpuScheduler::PollUnscheduleFences() { if (unschedule_fences_.front()->fence->HasCompleted()) { unschedule_fences_.front()->task.Run(); unschedule_fences_.pop(); + SetScheduled(true); } else { return false; } @@ -212,6 +214,7 @@ bool GpuScheduler::PollUnscheduleFences() { while (!unschedule_fences_.empty()) { unschedule_fences_.front()->task.Run(); unschedule_fences_.pop(); + SetScheduled(true); } } diff --git a/gpu/command_buffer/service/gpu_scheduler.h b/gpu/command_buffer/service/gpu_scheduler.h index a03ffdf..2ae048b 100644 --- a/gpu/command_buffer/service/gpu_scheduler.h +++ b/gpu/command_buffer/service/gpu_scheduler.h @@ -67,15 +67,15 @@ class GPU_EXPORT GpuScheduler void DeferToFence(base::Closure task); + // Polls the fences, invoking callbacks that were waiting to be triggered + // by them and returns whether all fences were complete. + bool PollUnscheduleFences(); + CommandParser* parser() const { return parser_.get(); } private: - // Polls the fences, invoking callbacks that were waiting to be triggered - // by them and returns whether all fences were complete. - bool PollUnscheduleFences(); - // Artificially reschedule if the scheduler is still unscheduled after a // timeout. void RescheduleTimeOut(); |