| 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..2f4a67fc604a1acf9a988cbe64a42de6abeac95e 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;
|
| @@ -276,6 +275,7 @@ void CommandBufferProxyImpl::Flush(int32_t put_offset) {
|
| std::make_pair(fence_sync_release, flush_id));
|
| }
|
| }
|
| + CleanupFlushedReleases(highest_verified_flush_id);
|
| }
|
|
|
| if (put_offset_changed)
|
| @@ -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);
|
| @@ -309,6 +308,7 @@ void CommandBufferProxyImpl::OrderingBarrier(int32_t put_offset) {
|
| std::make_pair(fence_sync_release, flush_id));
|
| }
|
| }
|
| + CleanupFlushedReleases(highest_verified_flush_id);
|
| }
|
|
|
| if (put_offset_changed)
|
| @@ -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());
|
|
|