| 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 9711aad60051632cd5b488da0e7a67afb1e9900a..0d93190a00dfe7647bb5f24afe87512a5d8c604a 100644
|
| --- a/gpu/command_buffer/service/in_process_command_buffer.cc
|
| +++ b/gpu/command_buffer/service/in_process_command_buffer.cc
|
| @@ -19,6 +19,7 @@
|
| #include "base/single_thread_task_runner.h"
|
| #include "base/thread_task_runner_handle.h"
|
| #include "gpu/command_buffer/client/gpu_memory_buffer_manager.h"
|
| +#include "gpu/command_buffer/common/gles2_cmd_format.h"
|
| #include "gpu/command_buffer/common/value_state.h"
|
| #include "gpu/command_buffer/service/command_buffer_service.h"
|
| #include "gpu/command_buffer/service/context_group.h"
|
| @@ -182,6 +183,8 @@ InProcessCommandBuffer::InProcessCommandBuffer(
|
| image_factory_(nullptr),
|
| last_put_offset_(-1),
|
| gpu_memory_buffer_manager_(nullptr),
|
| + next_fence_sync_release_(1),
|
| + flushed_fence_sync_release_(0),
|
| flush_event_(false, false),
|
| service_(GetInitialService(service)),
|
| gpu_thread_weak_ptr_factory_(this) {
|
| @@ -559,6 +562,8 @@ void InProcessCommandBuffer::Flush(int32 put_offset) {
|
| put_offset,
|
| order_num);
|
| QueueTask(task);
|
| +
|
| + flushed_fence_sync_release_ = next_fence_sync_release_ - 1;
|
| }
|
|
|
| void InProcessCommandBuffer::OrderingBarrier(int32 put_offset) {
|
| @@ -797,8 +802,14 @@ void InProcessCommandBuffer::RetireSyncPointOnGpuThread(uint32 sync_point) {
|
| base::AutoLock lock(command_buffer_lock_);
|
| make_current_success = MakeCurrent();
|
| }
|
| - if (make_current_success)
|
| - mailbox_manager->PushTextureUpdates(sync_point);
|
| + if (make_current_success) {
|
| + gles2::SyncToken sync_token = {
|
| + GetNamespaceID(),
|
| + GetCommandBufferID(),
|
| + sync_point
|
| + };
|
| + mailbox_manager->PushTextureUpdates(sync_token);
|
| + }
|
| }
|
| service_->sync_point_manager()->RetireSyncPoint(sync_point);
|
| }
|
| @@ -816,7 +827,12 @@ bool InProcessCommandBuffer::WaitSyncPointOnGpuThread(unsigned sync_point) {
|
| service_->sync_point_manager()->WaitSyncPoint(sync_point);
|
| gles2::MailboxManager* mailbox_manager =
|
| decoder_->GetContextGroup()->mailbox_manager();
|
| - mailbox_manager->PullTextureUpdates(sync_point);
|
| + gles2::SyncToken sync_token = {
|
| + GetNamespaceID(),
|
| + GetCommandBufferID(),
|
| + sync_point
|
| + };
|
| + mailbox_manager->PullTextureUpdates(sync_token);
|
| return true;
|
| }
|
|
|
| @@ -880,6 +896,18 @@ uint64_t InProcessCommandBuffer::GetCommandBufferID() const {
|
| return command_buffer_id_;
|
| }
|
|
|
| +uint32_t InProcessCommandBuffer::GenerateFenceSyncRelease() {
|
| + return next_fence_sync_release_++;
|
| +}
|
| +
|
| +bool InProcessCommandBuffer::IsFenceSyncRelease(uint32_t release) {
|
| + return release != 0 && release < next_fence_sync_release_;
|
| +}
|
| +
|
| +bool InProcessCommandBuffer::IsFenceSyncFlushed(uint32_t release) {
|
| + return release <= flushed_fence_sync_release_;
|
| +}
|
| +
|
| uint32 InProcessCommandBuffer::CreateStreamTextureOnGpuThread(
|
| uint32 client_texture_id) {
|
| #if defined(OS_ANDROID)
|
|
|