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

Side by Side Diff: gpu/command_buffer/client/query_tracker.cc

Issue 1916303003: Report lost context from GLES2Implementation based on share group state. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: lost-share-group: disconnect-channel Created 4 years, 7 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 | « gpu/command_buffer/client/gpu_control_client.h ('k') | gpu/command_buffer/client/share_group.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/command_buffer/client/query_tracker.h" 5 #include "gpu/command_buffer/client/query_tracker.h"
6 6
7 #include <GLES2/gl2.h> 7 #include <GLES2/gl2.h>
8 #include <GLES2/gl2ext.h> 8 #include <GLES2/gl2ext.h>
9 #include <GLES2/gl2extchromium.h> 9 #include <GLES2/gl2extchromium.h>
10 10
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 MarkAsActive(); 168 MarkAsActive();
169 flush_count_ = gl->helper()->flush_generation(); 169 flush_count_ = gl->helper()->flush_generation();
170 gl->helper()->QueryCounterEXT(id(), target(), shm_id(), shm_offset(), 170 gl->helper()->QueryCounterEXT(id(), target(), shm_id(), shm_offset(),
171 submit_count()); 171 submit_count());
172 MarkAsPending(gl->helper()->InsertToken()); 172 MarkAsPending(gl->helper()->InsertToken());
173 } 173 }
174 174
175 bool QueryTracker::Query::CheckResultsAvailable( 175 bool QueryTracker::Query::CheckResultsAvailable(
176 CommandBufferHelper* helper) { 176 CommandBufferHelper* helper) {
177 if (Pending()) { 177 if (Pending()) {
178 if (base::subtle::Acquire_Load(&info_.sync->process_count) == 178 bool processed_all =
179 submit_count_ || 179 base::subtle::Acquire_Load(&info_.sync->process_count) == submit_count_;
180 helper->IsContextLost()) { 180 // We check lost on the command buffer itself here instead of checking the
181 // GLES2Implementation because the GLES2Implementation will not hear about
182 // the loss until we exit out of this call stack (to avoid re-entrancy), and
183 // we need be able to enter kComplete state on context loss.
184 // TODO(danakj): If GLES2Implementation can handle being notified of loss
185 // re-entrantly (without calling its clients re-entrantly), then we could
186 // call GLES2Implementation::GetGraphicsResetStatusKHR() here and remove
187 // this method from CommandBufferHelper.
188 if (processed_all || helper->IsContextLost()) {
181 switch (target()) { 189 switch (target()) {
182 case GL_COMMANDS_ISSUED_CHROMIUM: 190 case GL_COMMANDS_ISSUED_CHROMIUM:
183 result_ = info_.sync->result; 191 result_ = info_.sync->result;
184 break; 192 break;
185 case GL_LATENCY_QUERY_CHROMIUM: 193 case GL_LATENCY_QUERY_CHROMIUM:
186 // Disabled DCHECK because of http://crbug.com/419236. 194 // Disabled DCHECK because of http://crbug.com/419236.
187 //DCHECK(info_.sync->result >= client_begin_time_us_); 195 //DCHECK(info_.sync->result >= client_begin_time_us_);
188 result_ = info_.sync->result - client_begin_time_us_; 196 result_ = info_.sync->result - client_begin_time_us_;
189 break; 197 break;
190 case GL_ASYNC_PIXEL_PACK_COMPLETED_CHROMIUM: 198 case GL_ASYNC_PIXEL_PACK_COMPLETED_CHROMIUM:
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 if (local_disjoint_count_ != disjoint_count) { 393 if (local_disjoint_count_ != disjoint_count) {
386 local_disjoint_count_ = disjoint_count; 394 local_disjoint_count_ = disjoint_count;
387 return true; 395 return true;
388 } 396 }
389 } 397 }
390 return false; 398 return false;
391 } 399 }
392 400
393 } // namespace gles2 401 } // namespace gles2
394 } // namespace gpu 402 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/client/gpu_control_client.h ('k') | gpu/command_buffer/client/share_group.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698