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

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: Created 7 years 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 | « no previous file | 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
diff --git a/gpu/command_buffer/client/fenced_allocator.h b/gpu/command_buffer/client/fenced_allocator.h
index bb5c55170ab25e2766a4804c762a51ee00e8c2f3..f2d39879dab5b165ee02c397720a84287e52c6c1 100644
--- a/gpu/command_buffer/client/fenced_allocator.h
+++ b/gpu/command_buffer/client/fenced_allocator.h
@@ -35,6 +35,7 @@ class GPU_EXPORT FencedAllocator {
// Creates a FencedAllocator. Note that the size of the buffer is passed, but
// not its base address: everything is handled as offsets into the buffer.
FencedAllocator(unsigned int size,
+ bool aggressive_reuse,
epennerAtGoogle 2013/12/18 19:21:15 Rather than a separate allocator, do you think it
CommandBufferHelper *helper);
~FencedAllocator();
@@ -87,6 +88,8 @@ class GPU_EXPORT FencedAllocator {
size_t bytes_in_use() const { return bytes_in_use_; }
private:
+ Offset AggressiveAlloc(unsigned int size);
+
// Status of a block of memory, for book-keeping.
enum State {
IN_USE,
@@ -137,6 +140,7 @@ class GPU_EXPORT FencedAllocator {
CommandBufferHelper *helper_;
Container blocks_;
+ bool aggressive_reuse_;
size_t bytes_in_use_;
DISALLOW_IMPLICIT_CONSTRUCTORS(FencedAllocator);
@@ -147,9 +151,10 @@ class GPU_EXPORT FencedAllocator {
class FencedAllocatorWrapper {
public:
FencedAllocatorWrapper(unsigned int size,
+ bool aggressive_reuse,
CommandBufferHelper* helper,
void* base)
- : allocator_(size, helper),
+ : allocator_(size, aggressive_reuse, helper),
base_(base) { }
// Allocates a block of memory. If the buffer is out of directly available
« no previous file with comments | « no previous file | gpu/command_buffer/client/fenced_allocator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698