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

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

Issue 10883036: Make glGetQueryObjectuivEXT return true for GL_QUERY_RESULT_AVAILABLE_EXT (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 | Annotate | Revision Log
« no previous file with comments | « gpu/command_buffer/client/gles2_implementation.cc ('k') | no next file » | 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 <GLES2/gl2.h> 5 #include <GLES2/gl2.h>
6 #include <GLES2/gl2ext.h> 6 #include <GLES2/gl2ext.h>
7 7
8 #include "../client/query_tracker.h" 8 #include "../client/query_tracker.h"
9 9
10 #include "../client/atomicops.h" 10 #include "../client/atomicops.h"
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 } 102 }
103 } 103 }
104 } 104 }
105 gl->helper()->EndQueryEXT(target(), submit_count()); 105 gl->helper()->EndQueryEXT(target(), submit_count());
106 MarkAsPending(gl->helper()->InsertToken()); 106 MarkAsPending(gl->helper()->InsertToken());
107 } 107 }
108 108
109 bool QueryTracker::Query::CheckResultsAvailable( 109 bool QueryTracker::Query::CheckResultsAvailable(
110 CommandBufferHelper* helper) { 110 CommandBufferHelper* helper) {
111 if (Pending()) { 111 if (Pending()) {
112 if (info_.sync->process_count == submit_count_) { 112 if (info_.sync->process_count == submit_count_ ||
113 helper->IsContextLost()) {
113 // Need a MemoryBarrier here so that sync->result read after 114 // Need a MemoryBarrier here so that sync->result read after
114 // sync->process_count. 115 // sync->process_count.
115 gpu::MemoryBarrier(); 116 gpu::MemoryBarrier();
116 result_ = info_.sync->result; 117 result_ = info_.sync->result;
117 state_ = kComplete; 118 state_ = kComplete;
118 } else { 119 } else {
119 if (!flushed_) { 120 if (!flushed_) {
120 // TODO(gman): We could reduce the number of flushes by having a 121 // TODO(gman): We could reduce the number of flushes by having a
121 // flush count, recording that count at the time we insert the 122 // flush count, recording that count at the time we insert the
122 // EndQuery command and then only flushing here if we've have not 123 // EndQuery command and then only flushing here if we've have not
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 Query* query = it->second; 172 Query* query = it->second;
172 GPU_DCHECK(context_lost || !query->Pending()); 173 GPU_DCHECK(context_lost || !query->Pending());
173 query_sync_manager_.Free(query->info_); 174 query_sync_manager_.Free(query->info_);
174 queries_.erase(it); 175 queries_.erase(it);
175 delete query; 176 delete query;
176 } 177 }
177 } 178 }
178 179
179 } // namespace gles2 180 } // namespace gles2
180 } // namespace gpu 181 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/client/gles2_implementation.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698