Chromium Code Reviews| Index: gpu/ipc/client/command_buffer_proxy_impl.cc |
| diff --git a/gpu/ipc/client/command_buffer_proxy_impl.cc b/gpu/ipc/client/command_buffer_proxy_impl.cc |
| index 395dcddc18eb5425b6ee37362d6e7e1906ce4bb8..e4614ad417a03585712278b3574a5817d7a83ea1 100644 |
| --- a/gpu/ipc/client/command_buffer_proxy_impl.cc |
| +++ b/gpu/ipc/client/command_buffer_proxy_impl.cc |
| @@ -266,7 +266,6 @@ void CommandBufferProxyImpl::Flush(int32_t put_offset) { |
| const uint32_t flush_id = channel_->OrderingBarrier( |
| route_id_, stream_id_, put_offset, ++flush_count_, latency_info_, |
| put_offset_changed, true, &highest_verified_flush_id); |
| - UpdateVerifiedReleases(highest_verified_flush_id); |
| if (put_offset_changed) { |
| DCHECK(flush_id); |
| const uint64_t fence_sync_release = next_fence_sync_release_ - 1; |
| @@ -275,6 +274,7 @@ void CommandBufferProxyImpl::Flush(int32_t put_offset) { |
| flushed_release_flush_id_.push( |
| std::make_pair(fence_sync_release, flush_id)); |
| } |
| + CleanupFlushedReleases(highest_verified_flush_id); |
|
piman
2016/09/07 23:49:10
nit: any reason to only do that when put_offset_ch
|
| } |
| } |
| @@ -298,7 +298,6 @@ void CommandBufferProxyImpl::OrderingBarrier(int32_t put_offset) { |
| const uint32_t flush_id = channel_->OrderingBarrier( |
| route_id_, stream_id_, put_offset, ++flush_count_, latency_info_, |
| put_offset_changed, false, &highest_verified_flush_id); |
| - UpdateVerifiedReleases(highest_verified_flush_id); |
| if (put_offset_changed) { |
| DCHECK(flush_id); |
| @@ -308,6 +307,7 @@ void CommandBufferProxyImpl::OrderingBarrier(int32_t put_offset) { |
| flushed_release_flush_id_.push( |
| std::make_pair(fence_sync_release, flush_id)); |
| } |
| + CleanupFlushedReleases(highest_verified_flush_id); |
| } |
| } |
| @@ -746,6 +746,18 @@ void CommandBufferProxyImpl::UpdateVerifiedReleases(uint32_t verified_flush) { |
| } |
| } |
| +void CommandBufferProxyImpl::CleanupFlushedReleases( |
| + uint32_t highest_verified_flush_id) { |
| + DCHECK(channel_); |
| + static const uint32_t kMaxUnverifiedFlushes = 1000; |
| + if (flushed_release_flush_id_.size() > kMaxUnverifiedFlushes) { |
| + // Prevent list of unverified flushes from growing indefinitely. |
| + highest_verified_flush_id = |
| + channel_->ValidateFlushIDReachedServer(stream_id_, false); |
| + } |
| + UpdateVerifiedReleases(highest_verified_flush_id); |
| +} |
| + |
| gpu::CommandBufferSharedState* CommandBufferProxyImpl::shared_state() const { |
| return reinterpret_cast<gpu::CommandBufferSharedState*>( |
| shared_state_shm_->memory()); |