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

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

Issue 116863003: gpu: Reuse transfer buffers more aggresively (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: [WIP] Introduced internal SetAsyncToken command buffer command 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/fenced_allocator.h
diff --git a/gpu/command_buffer/client/fenced_allocator.h b/gpu/command_buffer/client/fenced_allocator.h
index bb5c55170ab25e2766a4804c762a51ee00e8c2f3..c65bfcacc617388fd83555401c77681a96db9c03 100644
--- a/gpu/command_buffer/client/fenced_allocator.h
+++ b/gpu/command_buffer/client/fenced_allocator.h
@@ -65,6 +65,8 @@ class GPU_EXPORT FencedAllocator {
// token: the token value to wait for before re-using the memory.
void FreePendingToken(Offset offset, int32 token);
+ void FreePendingAsyncToken(Offset offset, uint32 token);
+
// Frees any blocks pending a token for which the token has been read.
void FreeUnused();
@@ -91,7 +93,8 @@ class GPU_EXPORT FencedAllocator {
enum State {
IN_USE,
FREE,
- FREE_PENDING_TOKEN
+ FREE_PENDING_TOKEN,
+ FREE_PENDING_ASYNC_TOKEN
};
// Book-keeping sturcture that describes a block of memory.
@@ -100,6 +103,7 @@ class GPU_EXPORT FencedAllocator {
Offset offset;
unsigned int size;
int32 token; // token to wait for in the FREE_PENDING_TOKEN case.
+ uint32 async_token;
};
// Comparison functor for memory block sorting.
@@ -114,6 +118,7 @@ class GPU_EXPORT FencedAllocator {
typedef unsigned int BlockIndex;
static const int32 kUnusedToken = 0;
+ static const uint32 kUnusedAsyncToken = 0;
// Gets the index of a memory block, given its offset.
BlockIndex GetBlockByOffset(Offset offset);
@@ -202,6 +207,11 @@ class FencedAllocatorWrapper {
allocator_.FreePendingToken(GetOffset(pointer), token);
}
+ void FreePendingAsyncToken(void *pointer, uint32 async_token) {
+ DCHECK(pointer);
+ allocator_.FreePendingAsyncToken(GetOffset(pointer), async_token);
+ }
+
// Frees any blocks pending a token for which the token has been read.
void FreeUnused() {
allocator_.FreeUnused();

Powered by Google App Engine
This is Rietveld 408576698