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

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

Issue 116863003: gpu: Reuse transfer buffers more aggresively (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: [WIP] gpu: Reuse transfer buffers more aggresively 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/buffer_tracker.h
diff --git a/gpu/command_buffer/client/buffer_tracker.h b/gpu/command_buffer/client/buffer_tracker.h
index 3e50364317d234bc9d7ed336c81de4fdbc26d5a4..b60562c7949bbf8ad66326388f346aa5b73f14c7 100644
--- a/gpu/command_buffer/client/buffer_tracker.h
+++ b/gpu/command_buffer/client/buffer_tracker.h
@@ -35,7 +35,9 @@ class GLES2_IMPL_EXPORT BufferTracker {
shm_offset_(shm_offset),
address_(address),
mapped_(false),
- transfer_ready_token_(0) {
+ transfer_ready_token_(0),
+ last_usage_token_(0),
+ async_query_id_(0) {
}
GLenum id() const {
@@ -74,6 +76,30 @@ class GLES2_IMPL_EXPORT BufferTracker {
return transfer_ready_token_;
}
+ void set_used(bool used) {
piman 2014/01/11 02:02:32 What does used mean exactly?
jadahl 2014/01/11 11:35:29 It's mean to be used for keeping track if a buffer
+ used_ = used;
+ }
+
+ bool used() const {
+ return used_;
+ }
+
+ void set_last_usage_token(int token) {
+ last_usage_token_ = token;
+ }
+
+ int last_usage_token() const {
+ return last_usage_token_;
+ }
+
+ void set_async_query_id(GLuint async_query_id) {
+ async_query_id_ = async_query_id;
+ }
+
+ GLuint async_query_id() const {
+ return async_query_id_;
+ }
+
private:
friend class BufferTracker;
friend class BufferTrackerTest;
@@ -83,8 +109,11 @@ class GLES2_IMPL_EXPORT BufferTracker {
int32 shm_id_;
uint32 shm_offset_;
void* address_;
- bool mapped_;
+ bool mapped_ : 1;
+ bool used_ : 1;
int32 transfer_ready_token_;
+ int32 last_usage_token_;
+ GLuint async_query_id_;
};
BufferTracker(MappedMemoryManager* manager);
@@ -96,7 +125,9 @@ class GLES2_IMPL_EXPORT BufferTracker {
// Frees the block of memory associated with buffer, pending the passage
// of a token.
- void FreePendingToken(Buffer*, int32 token);
+ void FreePendingToken(Buffer* buffer, int32 token);
+ void FreePendingSerial(Buffer* buffer, uint32 serial);
+ void Free(Buffer* buffer);
private:
typedef base::hash_map<GLuint, Buffer*> BufferMap;

Powered by Google App Engine
This is Rietveld 408576698