Trait vulkano::command_buffer::pool::CommandPool
[−]
[src]
pub unsafe trait CommandPool { type Iter: Iterator<Item=AllocatedCommandBuffer>; type Lock; type Finished: CommandPoolFinished; fn alloc(&self, secondary: bool, count: u32) -> Result<Self::Iter, OomError>; unsafe fn free<I>(&self, secondary: bool, command_buffers: I) where I: Iterator<Item=AllocatedCommandBuffer>; fn finish(self) -> Self::Finished; fn lock(&self) -> Self::Lock; fn can_reset_invidual_command_buffers(&self) -> bool; fn device(&self) -> &Arc<Device>; fn queue_family(&self) -> QueueFamily; }
Types that manage the memory of command buffers.
Associated Types
type Iter: Iterator<Item=AllocatedCommandBuffer>
See alloc()
.
type Lock
See lock()
.
type Finished: CommandPoolFinished
See finish()
.
Required Methods
fn alloc(&self, secondary: bool, count: u32) -> Result<Self::Iter, OomError>
Allocates command buffers from this pool.
unsafe fn free<I>(&self, secondary: bool, command_buffers: I) where I: Iterator<Item=AllocatedCommandBuffer>
Frees command buffers from this pool.
Safety
- The command buffers must have been allocated from this pool.
secondary
must have the same value as what was passed toalloc
.
fn finish(self) -> Self::Finished
Once a command buffer has finished being built, it should call this method in order to
produce a Finished
object.
The Finished
object must hold the pool alive.
The point of this object is to change the Send/Sync strategy after a command buffer has finished being built compared to before.
fn lock(&self) -> Self::Lock
Before any command buffer allocated from this pool can be modified, the pool itself must be locked by calling this method.
All the operations are atomic at the thread level, so the point of this lock is to prevent the pool from being accessed from multiple threads in parallel.
fn can_reset_invidual_command_buffers(&self) -> bool
Returns true if command buffers can be reset individually. In other words, if the pool
was created with reset_cb
set to true.
fn device(&self) -> &Arc<Device>
Returns the device used to create this pool.
fn queue_family(&self) -> QueueFamily
Returns the queue family that this pool targets.
Implementors
impl CommandPool for Arc<StandardCommandPool>