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

Unified Diff: gpu/command_buffer/client/query_tracker.cc

Issue 228653004: Reduce the number of flushes while using glQueries. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixing review comnts. Created 6 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/query_tracker.h ('k') | no next file » | 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 5ac89e07e0f5ca472d767f99b86815ef2984be5f..2595e7a57a0f475a2ed29152857aa708938a5bc1 100644
--- a/gpu/command_buffer/client/query_tracker.cc
+++ b/gpu/command_buffer/client/query_tracker.cc
@@ -93,7 +93,7 @@ QueryTracker::Query::Query(GLuint id, GLenum target,
state_(kUninitialized),
submit_count_(0),
token_(0),
- flushed_(false),
+ flush_count_(0),
client_begin_time_us_(0),
result_(0) {
}
@@ -140,6 +140,7 @@ void QueryTracker::Query::End(GLES2Implementation* gl) {
}
}
}
+ flush_count_ = gl->helper()->flush_generation();
gl->helper()->EndQueryEXT(target(), submit_count());
MarkAsPending(gl->helper()->InsertToken());
}
@@ -168,12 +169,7 @@ bool QueryTracker::Query::CheckResultsAvailable(
}
state_ = kComplete;
} else {
- if (!flushed_) {
- // TODO(gman): We could reduce the number of flushes by having a
- // flush count, recording that count at the time we insert the
- // EndQuery command and then only flushing here if we've have not
- // passed that count yet.
- flushed_ = true;
+ if (!(helper->flush_generation()>flush_count_)) {
piman 2014/04/08 22:55:40 nit: spaces around '>'. Also, if (!(a>b)) can be w
piman 2014/04/08 22:55:40 Could we handle wraparound of the generation here?
rptr 2014/04/09 10:42:04 Done.
rptr 2014/04/09 10:42:04 nit: sorry for that, forgot to run cl format befor
helper->Flush();
} else {
// Insert no-ops so that eventually the GPU process will see more work.
« no previous file with comments | « gpu/command_buffer/client/query_tracker.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698