| 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();
|
|
|