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..2d413cb43847903da9a26ed0cdb3718bdd252919 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), |
+ last_flush_(0), |
client_begin_time_us_(0), |
result_(0) { |
} |
@@ -140,6 +140,7 @@ void QueryTracker::Query::End(GLES2Implementation* gl) { |
} |
} |
} |
+ last_flush_ = gl->helper()->flush_generation(); |
gl->helper()->EndQueryEXT(target(), submit_count()); |
MarkAsPending(gl->helper()->InsertToken()); |
} |
@@ -168,13 +169,10 @@ 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; |
+ uint32 flush_generation = helper->flush_generation(); |
+ if (!(flush_generation>last_flush_)) { |
helper->Flush(); |
+ last_flush_ = helper->flush_generation(); |
Zhenyao Mo
2014/04/08 21:13:56
My apology for not catching this earlier, but this
rptr
2014/04/08 22:44:16
Done.
Problem was updating flush_count_ here. we s
|
} else { |
// Insert no-ops so that eventually the GPU process will see more work. |
helper->Noop(1); |