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

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

Issue 1131913004: More compact representation of the GL Query cache (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Smaller patch still. Created 5 years, 7 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 72e29e71c421b007b0a9405c6fad615c551dc6e3..a894f81901338ee656c2358d1abba67a1a4bb856 100644
--- a/gpu/command_buffer/client/query_tracker.h
+++ b/gpu/command_buffer/client/query_tracker.h
@@ -9,6 +9,7 @@
#include <deque>
#include <list>
+#include <vector>
#include "base/atomicops.h"
#include "base/containers/hash_tables.h"
@@ -30,12 +31,13 @@ class GLES2_IMPL_EXPORT QuerySyncManager {
static const size_t kSyncsPerBucket = 4096;
struct Bucket {
- explicit Bucket(QuerySync* sync_mem)
- : syncs(sync_mem),
- used_query_count(0) {
- }
+ Bucket(QuerySync* sync_mem, int32 shm_id, unsigned int shm_offset);
+ ~Bucket();
QuerySync* syncs;
unsigned used_query_count;
reveman 2015/05/11 17:13:07 is |used_query_count| still needed?
Daniel Bratell 2015/05/12 16:16:40 It can be replaced by |kSyncsPerBucket - bucket->f
reveman 2015/05/12 16:45:05 I generally prefer unnecessary state when possible
+ int32 shm_id;
+ unsigned int base_shm_offset;
reveman 2015/05/11 17:13:08 nit: uint32 base_shm_offset to be consistent with
Daniel Bratell 2015/05/12 16:16:40 Done.
+ std::vector<unsigned short> free_queries;
reveman 2015/05/11 17:13:08 can we just use vector<size_t> here instead? that'
jbauman 2015/05/11 19:12:53 Could you add a COMPILE_ASSERT that kSyncsPerBucke
Daniel Bratell 2015/05/12 16:16:40 This is the main source of memory usage in the cac
Daniel Bratell 2015/05/12 16:16:40 Done.
reveman 2015/05/12 16:45:05 Acknowledged. Btw, have you considered using std:
};
struct QueryInfo {
QueryInfo(Bucket* bucket, int32 id, uint32 offset, QuerySync* sync_mem)
@@ -68,7 +70,6 @@ class GLES2_IMPL_EXPORT QuerySyncManager {
private:
MappedMemoryManager* mapped_memory_;
std::deque<Bucket*> buckets_;
- std::deque<QueryInfo> free_queries_;
DISALLOW_COPY_AND_ASSIGN(QuerySyncManager);
};
« no previous file with comments | « no previous file | gpu/command_buffer/client/query_tracker.cc » ('j') | gpu/command_buffer/client/query_tracker.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698