class UniformBlockAllocator
Defined at line 18 of file ../../src/ui/lib/escher/renderer/uniform_block_allocator.h
Similar to BlockAllocator, except that it returns suballocations from within
fixed-size GPU uniform buffers. A UniformBufferPool is used to obtain the
buffers that are allocated from.
Public Methods
void UniformBlockAllocator (impl::UniformBufferPoolWeakPtr pool)
The pool must be guaranteed to outlive the allocator.
Defined at line 13 of file ../../src/ui/lib/escher/renderer/uniform_block_allocator.cc
UniformAllocation Allocate (size_t size, size_t alignment)
Defined at line 18 of file ../../src/ui/lib/escher/renderer/uniform_block_allocator.cc
void Reset ()
Invalidates all previously-allocated pointers, and frees memory for reuse.
The freed buffers are immediately released back to the UniformBufferPool.
Defined at line 34 of file ../../src/ui/lib/escher/renderer/uniform_block_allocator.cc
std::vector<BufferPtr> TakeBuffers ()
Allows the caller to manage the valid lifetime of the suballocation
buffers, which will be returned to the UniformBufferPool when their
ref-count reaches zero. For example, if the returned buffers are
immediately freed then the behavior is effectively identical to Reset().
NOTE: the caller is responsible for returning the buffers to the pool
before the pool is destroyed (this is enforced by ResourceManager DCHECKs).
The caller must therefore know something about the lifetime of the pool (or
at least the lifetime of this allocator, since the pool is required to
outlive this allocator).
Defined at line 46 of file ../../src/ui/lib/escher/renderer/uniform_block_allocator.cc