Struct vulkano::buffer::cpu_pool::CpuBufferPool [] [src]

pub struct CpuBufferPool<T: ?Sized, A = Arc<StdMemoryPool>> where
    A: MemoryPool
{ /* fields omitted */ }

Buffer from which "sub-buffers" of fixed size can be individually allocated.

This buffer is especially suitable when you want to upload or download some data at each frame.

BufferUsage

A CpuBufferPool is a bit similar to a Vec. You start by creating an empty pool, then you grab elements from the pool and use them, and if the pool is full it will automatically grow in size.

But contrary to a Vec, elements automatically free themselves when they are dropped (ie. usually when they are no longer in use by the GPU).

Arc-like

The CpuBufferPool struct internally contains an Arc. You can clone the CpuBufferPool for a cheap cost, and all the clones will share the same underlying buffer.

Methods

impl<T> CpuBufferPool<T>
[src]

Builds a CpuBufferPool meant for simple uploads.

Shortcut for a pool that can only be used as transfer sources and with exclusive queue family accesses.

impl<T> CpuBufferPool<[T]>
[src]

impl<T: ?Sized> CpuBufferPool<T>
[src]

Returns the current capacity of the pool.

impl<T, A> CpuBufferPool<T, A> where
    A: MemoryPool
[src]

Sets the capacity to capacity, or does nothing if the capacity is already higher.

Since this can involve a memory allocation, an OomError can happen.

Grants access to a new subbuffer and puts data in it.

If no subbuffer is available (because they are still in use by the GPU), a new buffer will automatically be allocated.

Note: You can think of it like a Vec. If you insert an element and the Vec is not large enough, a new chunk of memory is automatically allocated.

Grants access to a new subbuffer and puts data in it.

Returns None if no subbuffer is available.

A CpuBufferPool is always empty the first time you use it, so you shouldn't use try_next the first time you use it.

Trait Implementations

impl<T: ?Sized, A> Clone for CpuBufferPool<T, A> where
    A: MemoryPool + Clone
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<T: ?Sized, A> DeviceOwned for CpuBufferPool<T, A> where
    A: MemoryPool
[src]

Returns the device that owns Self.