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

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

Issue 2956005: Adds MapBufferSubData and MapTexSubImage2D.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 5 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
« no previous file with comments | « gpu/command_buffer/client/cmd_buffer_helper.h ('k') | gpu/command_buffer/client/fenced_allocator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/client/fenced_allocator.h
===================================================================
--- gpu/command_buffer/client/fenced_allocator.h (revision 52147)
+++ gpu/command_buffer/client/fenced_allocator.h (working copy)
@@ -65,8 +65,11 @@
// Parameters:
// offset: the offset of the memory block to free.
// token: the token value to wait for before re-using the memory.
- void FreePendingToken(Offset offset, unsigned int token);
+ void FreePendingToken(Offset offset, int32 token);
+ // Frees any blocks pending a token for which the token has been read.
+ void FreeUnused();
+
// Gets the size of the largest free block that is available without waiting.
unsigned int GetLargestFreeSize();
@@ -92,7 +95,7 @@
State state;
Offset offset;
unsigned int size;
- unsigned int token; // token to wait for in the FREE_PENDING_TOKEN case.
+ int32 token; // token to wait for in the FREE_PENDING_TOKEN case.
};
// Comparison functor for memory block sorting.
@@ -106,7 +109,7 @@
typedef std::vector<Block> Container;
typedef unsigned int BlockIndex;
- static const unsigned int kUnusedToken = 0;
+ static const int32 kUnusedToken = 0;
// Gets the index of a memory block, given its offset.
BlockIndex GetBlockByOffset(Offset offset);
@@ -189,11 +192,16 @@
// Parameters:
// pointer: the pointer to the memory block to free.
// token: the token value to wait for before re-using the memory.
- void FreePendingToken(void *pointer, unsigned int token) {
+ void FreePendingToken(void *pointer, int32 token) {
DCHECK(pointer);
allocator_.FreePendingToken(GetOffset(pointer), token);
}
+ // Frees any blocks pending a token for which the token has been read.
+ void FreeUnused() {
+ allocator_.FreeUnused();
+ }
+
// Gets a pointer to a memory block given the base memory and the offset.
// It translates FencedAllocator::kInvalidOffset to NULL.
void *GetPointer(FencedAllocator::Offset offset) {
« no previous file with comments | « gpu/command_buffer/client/cmd_buffer_helper.h ('k') | gpu/command_buffer/client/fenced_allocator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698