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

Unified Diff: gpu/command_buffer/service/in_process_command_buffer.cc

Issue 1339203002: Added global order numbers to in process command buffers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: minor changes Created 5 years, 3 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
Index: gpu/command_buffer/service/in_process_command_buffer.cc
diff --git a/gpu/command_buffer/service/in_process_command_buffer.cc b/gpu/command_buffer/service/in_process_command_buffer.cc
index 01ac9711b1428bb1ed9433b9776efe88d2fd079a..19e361619cdfcd4e3ae69ce08a6afa7f8cf78607 100644
--- a/gpu/command_buffer/service/in_process_command_buffer.cc
+++ b/gpu/command_buffer/service/in_process_command_buffer.cc
@@ -344,6 +344,11 @@ bool InProcessCommandBuffer::InitializeOnGpuThread(
return false;
}
+ sync_point_client_state_ = SyncPointClientState::Create();
+ sync_point_client_ = service_->sync_point_manager()->CreateSyncPointClient(
+ sync_point_client_state_,
+ GetNamespaceID(), GetCommandBufferID());
+
if (service_->UseVirtualizedGLContexts() ||
decoder_->GetContextGroup()
->feature_info()
@@ -439,6 +444,8 @@ bool InProcessCommandBuffer::DestroyOnGpuThread() {
}
context_ = NULL;
surface_ = NULL;
+ sync_point_client_ = NULL;
+ sync_point_client_state_ = NULL;
gl_share_group_ = NULL;
#if defined(OS_ANDROID)
stream_texture_manager_.reset();
@@ -481,10 +488,13 @@ int32 InProcessCommandBuffer::GetLastToken() {
return last_state_.token;
}
-void InProcessCommandBuffer::FlushOnGpuThread(int32 put_offset) {
+void InProcessCommandBuffer::FlushOnGpuThread(int32 put_offset,
+ uint32_t order_num) {
CheckSequencedThread();
ScopedEvent handle_flush(&flush_event_);
base::AutoLock lock(command_buffer_lock_);
+
+ sync_point_client_state_->BeginProcessingOrderNumber(order_num);
command_buffer_->Flush(put_offset);
{
// Update state before signaling the flush event.
@@ -494,6 +504,13 @@ void InProcessCommandBuffer::FlushOnGpuThread(int32 put_offset) {
DCHECK((!error::IsError(state_after_last_flush_.error) && !context_lost_) ||
(error::IsError(state_after_last_flush_.error) && context_lost_));
+ // Currently the in process command buffer does not support being descheduled,
+ // if it does we would need to back off on calling the finish processing
+ // order number function until the message is rescheduled and finished
+ // processing. This DCHECK is to enforce this.
+ DCHECK(context_lost_ || put_offset == state_after_last_flush_.get_offset);
+ sync_point_client_state_->FinishProcessingOrderNumber(order_num);
+
// If we've processed all pending commands but still have pending queries,
// pump idle work until the query is passed.
if (put_offset == state_after_last_flush_.get_offset &&
@@ -534,10 +551,14 @@ void InProcessCommandBuffer::Flush(int32 put_offset) {
if (last_put_offset_ == put_offset)
return;
+ SyncPointManager* sync_manager = service_->sync_point_manager();
+ const uint32_t order_num =
+ sync_point_client_state_->GenerateUnprocessedOrderNumber(sync_manager);
last_put_offset_ = put_offset;
base::Closure task = base::Bind(&InProcessCommandBuffer::FlushOnGpuThread,
gpu_thread_weak_ptr_,
- put_offset);
+ put_offset,
+ order_num);
QueueTask(task);
}
« no previous file with comments | « gpu/command_buffer/service/in_process_command_buffer.h ('k') | gpu/command_buffer/service/sync_point_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698