pub struct CommandPool<B: Backend, C = QueueType, R = NoIndividualReset> { /* private fields */ }
Expand description
Simple pool wrapper.
Doesn’t provide any guarantees.
Wraps raw buffers into CommandCommand buffer
.
Implementations§
Source§impl<B, C, R> CommandPool<B, C, R>where
B: Backend,
impl<B, C, R> CommandPool<B, C, R>where
B: Backend,
Sourcepub fn assert_family_owner(&self, family: &Family<B, C>)
pub fn assert_family_owner(&self, family: &Family<B, C>)
Assert specified family is owner.
Sourcepub fn assert_device_owner(&self, device: &Device<B>)
pub fn assert_device_owner(&self, device: &Device<B>)
Assert specified device is owner.
Sourcepub fn assert_instance_owner(&self, instance: &Instance<B>)
pub fn assert_instance_owner(&self, instance: &Instance<B>)
Assert specified instance is owner.
Source§impl<B, C, R> CommandPool<B, C, R>
impl<B, C, R> CommandPool<B, C, R>
Sourcepub unsafe fn create(
family: FamilyId,
capability: C,
device: &Device<B>,
) -> Result<Self, OutOfMemory>where
R: Reset,
C: Capability,
pub unsafe fn create(
family: FamilyId,
capability: C,
device: &Device<B>,
) -> Result<Self, OutOfMemory>where
R: Reset,
C: Capability,
Create command pool associated with the family. Command buffers created from the pool could be submitted to the queues of the family.
§Safety
Family must belong to specified device. Family must have specified capability.
Sourcepub unsafe fn from_raw(
raw: B::CommandPool,
capability: C,
reset: R,
family: FamilyId,
) -> Self
pub unsafe fn from_raw( raw: B::CommandPool, capability: C, reset: R, family: FamilyId, ) -> Self
Wrap raw command pool.
§Safety
raw
must be valid command pool handle.- The command pool must be created for specified
family
index. capability
must be subset of capabilites of thefamily
the pool was created for.- if
reset
isIndividualReset
the pool must be created with individual command buffer reset flag set.
Sourcepub fn allocate_buffers<L>(
&mut self,
count: usize,
) -> Vec<CommandBuffer<B, C, InitialState, L, R>>where
L: Level,
C: Capability,
pub fn allocate_buffers<L>(
&mut self,
count: usize,
) -> Vec<CommandBuffer<B, C, InitialState, L, R>>where
L: Level,
C: Capability,
Allocate new command buffers.
Sourcepub unsafe fn free_buffers(
&mut self,
buffers: impl IntoIterator<Item = CommandBuffer<B, C, impl Resettable, impl Level, R>>,
)
pub unsafe fn free_buffers( &mut self, buffers: impl IntoIterator<Item = CommandBuffer<B, C, impl Resettable, impl Level, R>>, )
Free buffers. Buffers must be in droppable state. TODO: Validate buffers were allocated from this pool.
Sourcepub unsafe fn reset(&mut self)
pub unsafe fn reset(&mut self)
Reset all buffers of this pool.
§Safety
All buffers allocated from this pool must be marked reset.
See CommandBuffer::mark_reset
(struct.Command buffer.html#method.mark_reset)
Sourcepub fn with_queue_type(self) -> CommandPool<B, QueueType, R>where
C: Capability,
pub fn with_queue_type(self) -> CommandPool<B, QueueType, R>where
C: Capability,
Convert capability level
Sourcepub fn with_capability<U>(self) -> Result<CommandPool<B, U, R>, Self>where
C: Supports<U>,
pub fn with_capability<U>(self) -> Result<CommandPool<B, U, R>, Self>where
C: Supports<U>,
Convert capability level