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

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

Issue 116863003: gpu: Reuse transfer buffers more aggresively (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: [WIP] Review comments follow-up Created 6 years, 11 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
Index: gpu/command_buffer/client/query_tracker.h
diff --git a/gpu/command_buffer/client/query_tracker.h b/gpu/command_buffer/client/query_tracker.h
index 9e7f501768b74a5bbfa4dccfb2bee6e153622dfa..ebb7856ad1cf5cd8fae2773a2897288784773ea6 100644
--- a/gpu/command_buffer/client/query_tracker.h
+++ b/gpu/command_buffer/client/query_tracker.h
@@ -102,6 +102,14 @@ class GLES2_IMPL_EXPORT QueryTracker {
return info_.shm_offset;
}
+ uint32 serial() const {
+ return serial_;
+ }
+
+ void set_serial(uint32 serial) {
+ serial_ = serial;
+ }
+
void MarkAsActive() {
state_ = kActive;
++submit_count_;
@@ -133,6 +141,10 @@ class GLES2_IMPL_EXPORT QueryTracker {
uint32 GetResult() const;
+ bool IsInternal() const {
+ return serial_ != 0;
+ }
+
void Begin(GLES2Implementation* gl);
void End(GLES2Implementation* gl);
@@ -147,6 +159,7 @@ class GLES2_IMPL_EXPORT QueryTracker {
uint32 submit_count_;
int32 token_;
bool flushed_;
+ uint32 serial_; // Only used for internal queries, 0 means not internal.
uint64 client_begin_time_us_; // Only used for latency query target.
uint32 result_;
};
@@ -155,12 +168,15 @@ class GLES2_IMPL_EXPORT QueryTracker {
~QueryTracker();
Query* CreateQuery(GLuint id, GLenum target);
+ Query* CreateInternalQuery(GLuint id, GLenum target);
Query* GetQuery(GLuint id);
void RemoveQuery(GLuint id);
void Shrink();
void FreeCompletedQueries();
private:
+ uint32 NextSerial();
+
typedef base::hash_map<GLuint, Query*> QueryMap;
typedef std::list<Query*> QueryList;
@@ -168,6 +184,8 @@ class GLES2_IMPL_EXPORT QueryTracker {
QueryList removed_queries_;
QuerySyncManager query_sync_manager_;
+ uint32 next_serial_;
+
DISALLOW_COPY_AND_ASSIGN(QueryTracker);
};

Powered by Google App Engine
This is Rietveld 408576698