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

Side by Side Diff: gpu/ipc/client/command_buffer_proxy_impl.cc

Issue 2241253003: Clear old verified flush IDs when doing OrderingBarrier. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2785
Patch Set: Created 4 years, 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | gpu/ipc/client/gpu_channel_host.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "gpu/ipc/client/command_buffer_proxy_impl.h" 5 #include "gpu/ipc/client/command_buffer_proxy_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 return; 255 return;
256 256
257 TRACE_EVENT1("gpu", "CommandBufferProxyImpl::Flush", "put_offset", 257 TRACE_EVENT1("gpu", "CommandBufferProxyImpl::Flush", "put_offset",
258 put_offset); 258 put_offset);
259 259
260 bool put_offset_changed = last_put_offset_ != put_offset; 260 bool put_offset_changed = last_put_offset_ != put_offset;
261 last_put_offset_ = put_offset; 261 last_put_offset_ = put_offset;
262 last_barrier_put_offset_ = put_offset; 262 last_barrier_put_offset_ = put_offset;
263 263
264 if (channel_) { 264 if (channel_) {
265 uint32_t highest_verified_flush_id;
265 const uint32_t flush_id = channel_->OrderingBarrier( 266 const uint32_t flush_id = channel_->OrderingBarrier(
266 route_id_, stream_id_, put_offset, ++flush_count_, latency_info_, 267 route_id_, stream_id_, put_offset, ++flush_count_, latency_info_,
267 put_offset_changed, true); 268 put_offset_changed, true, &highest_verified_flush_id);
269 UpdateVerifiedReleases(highest_verified_flush_id);
268 if (put_offset_changed) { 270 if (put_offset_changed) {
269 DCHECK(flush_id); 271 DCHECK(flush_id);
270 const uint64_t fence_sync_release = next_fence_sync_release_ - 1; 272 const uint64_t fence_sync_release = next_fence_sync_release_ - 1;
271 if (fence_sync_release > flushed_fence_sync_release_) { 273 if (fence_sync_release > flushed_fence_sync_release_) {
272 flushed_fence_sync_release_ = fence_sync_release; 274 flushed_fence_sync_release_ = fence_sync_release;
273 flushed_release_flush_id_.push( 275 flushed_release_flush_id_.push(
274 std::make_pair(fence_sync_release, flush_id)); 276 std::make_pair(fence_sync_release, flush_id));
275 } 277 }
276 } 278 }
277 } 279 }
278 280
279 if (put_offset_changed) 281 if (put_offset_changed)
280 latency_info_.clear(); 282 latency_info_.clear();
281 } 283 }
282 284
283 void CommandBufferProxyImpl::OrderingBarrier(int32_t put_offset) { 285 void CommandBufferProxyImpl::OrderingBarrier(int32_t put_offset) {
284 CheckLock(); 286 CheckLock();
285 if (last_state_.error != gpu::error::kNoError) 287 if (last_state_.error != gpu::error::kNoError)
286 return; 288 return;
287 289
288 TRACE_EVENT1("gpu", "CommandBufferProxyImpl::OrderingBarrier", "put_offset", 290 TRACE_EVENT1("gpu", "CommandBufferProxyImpl::OrderingBarrier", "put_offset",
289 put_offset); 291 put_offset);
290 292
291 bool put_offset_changed = last_barrier_put_offset_ != put_offset; 293 bool put_offset_changed = last_barrier_put_offset_ != put_offset;
292 last_barrier_put_offset_ = put_offset; 294 last_barrier_put_offset_ = put_offset;
293 295
294 if (channel_) { 296 if (channel_) {
297 uint32_t highest_verified_flush_id;
295 const uint32_t flush_id = channel_->OrderingBarrier( 298 const uint32_t flush_id = channel_->OrderingBarrier(
296 route_id_, stream_id_, put_offset, ++flush_count_, latency_info_, 299 route_id_, stream_id_, put_offset, ++flush_count_, latency_info_,
297 put_offset_changed, false); 300 put_offset_changed, false, &highest_verified_flush_id);
301 UpdateVerifiedReleases(highest_verified_flush_id);
302
298 if (put_offset_changed) { 303 if (put_offset_changed) {
299 DCHECK(flush_id); 304 DCHECK(flush_id);
300 const uint64_t fence_sync_release = next_fence_sync_release_ - 1; 305 const uint64_t fence_sync_release = next_fence_sync_release_ - 1;
301 if (fence_sync_release > flushed_fence_sync_release_) { 306 if (fence_sync_release > flushed_fence_sync_release_) {
302 flushed_fence_sync_release_ = fence_sync_release; 307 flushed_fence_sync_release_ = fence_sync_release;
303 flushed_release_flush_id_.push( 308 flushed_release_flush_id_.push(
304 std::make_pair(fence_sync_release, flush_id)); 309 std::make_pair(fence_sync_release, flush_id));
305 } 310 }
306 } 311 }
307 } 312 }
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after
873 gpu_control_client_->OnGpuControlLostContext(); 878 gpu_control_client_->OnGpuControlLostContext();
874 } 879 }
875 880
876 CommandBufferProxyImpl::ImageInfo::ImageInfo() {} 881 CommandBufferProxyImpl::ImageInfo::ImageInfo() {}
877 CommandBufferProxyImpl::ImageInfo::~ImageInfo() {} 882 CommandBufferProxyImpl::ImageInfo::~ImageInfo() {}
878 CommandBufferProxyImpl::ImageInfo::ImageInfo(ImageInfo&& other) = default; 883 CommandBufferProxyImpl::ImageInfo::ImageInfo(ImageInfo&& other) = default;
879 CommandBufferProxyImpl::ImageInfo& CommandBufferProxyImpl::ImageInfo::operator=( 884 CommandBufferProxyImpl::ImageInfo& CommandBufferProxyImpl::ImageInfo::operator=(
880 ImageInfo&& other) = default; 885 ImageInfo&& other) = default;
881 886
882 } // namespace gpu 887 } // namespace gpu
OLDNEW
« no previous file with comments | « no previous file | gpu/ipc/client/gpu_channel_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698