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

Unified 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, 8 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/client/query_tracker.cc
diff --git a/gpu/command_buffer/client/query_tracker.cc b/gpu/command_buffer/client/query_tracker.cc
index bf71645d289c256fcd19c38b0e3955dbe35ea3f6..4e241d6446ae17e7ce4816d177230075d354f9be 100644
--- a/gpu/command_buffer/client/query_tracker.cc
+++ b/gpu/command_buffer/client/query_tracker.cc
@@ -175,9 +175,17 @@ void QueryTracker::Query::QueryCounter(GLES2Implementation* gl) {
bool QueryTracker::Query::CheckResultsAvailable(
CommandBufferHelper* helper) {
if (Pending()) {
- if (base::subtle::Acquire_Load(&info_.sync->process_count) ==
- submit_count_ ||
- helper->IsContextLost()) {
+ bool processed_all =
+ base::subtle::Acquire_Load(&info_.sync->process_count) == submit_count_;
+ // We check lost on the command buffer itself here instead of checking the
+ // GLES2Implementation because the GLES2Implementation will not hear about
+ // the loss until we exit out of this call stack (to avoid re-entrancy), and
+ // we need be able to enter kComplete state on context loss.
+ // TODO(danakj): If GLES2Implementation can handle being notified of loss
+ // re-entrantly (without calling its clients re-entrantly), then we could
+ // call GLES2Implementation::GetGraphicsResetStatusKHR() here and remove
+ // this method from CommandBufferHelper.
+ if (processed_all || helper->IsContextLost()) {
switch (target()) {
case GL_COMMANDS_ISSUED_CHROMIUM:
result_ = info_.sync->result;
« 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