Struct gfx_hal::pool::CommandPool
source · pub struct CommandPool<B: Backend, C> { /* private fields */ }
Expand description
Strong-typed command pool.
This a safer wrapper around RawCommandPool
which ensures that only one
command buffer is recorded at the same time from the current queue.
Command buffers are stored internally and can only be obtained via a strong-typed
CommandBuffer
wrapper for encoding.
Implementations
sourceimpl<B: Backend, C> CommandPool<B, C>
impl<B: Backend, C> CommandPool<B, C>
sourcepub unsafe fn new(raw: B::CommandPool) -> Self
pub unsafe fn new(raw: B::CommandPool) -> Self
Create typed command pool from raw.
Safety
<C as Capability>::supported_by(queue_type)
must return true
for queue_type
being the type of queues from family this raw
pool is associated with.
sourcepub unsafe fn reset(&mut self)
pub unsafe fn reset(&mut self)
Reset the command pool and the corresponding command buffers.
Synchronization: You may not free the pool if a command buffer is still in use (pool memory still in use)
sourcepub fn acquire_command_buffer<S: Shot>(&mut self) -> CommandBuffer<B, C, S>
pub fn acquire_command_buffer<S: Shot>(&mut self) -> CommandBuffer<B, C, S>
Get a primary command buffer for recording.
You can only record to one command buffer per pool at the same time. If more command buffers are requested than allocated, new buffers will be reserved. The command buffer will be returned in ‘recording’ state.
sourcepub fn acquire_secondary_command_buffer<S: Shot>(
&mut self
) -> SecondaryCommandBuffer<B, C, S>
pub fn acquire_secondary_command_buffer<S: Shot>(
&mut self
) -> SecondaryCommandBuffer<B, C, S>
Get a secondary command buffer for recording.
You can only record to one command buffer per pool at the same time. If more command buffers are requested than allocated, new buffers will be reserved. The command buffer will be returned in ‘recording’ state.
sourcepub unsafe fn free<S: Shot, I>(&mut self, cmd_buffers: I)where
I: IntoIterator<Item = CommandBuffer<B, C, S>>,
pub unsafe fn free<S: Shot, I>(&mut self, cmd_buffers: I)where
I: IntoIterator<Item = CommandBuffer<B, C, S>>,
Free the given iterator of command buffers from the pool.
sourcepub fn into_raw(self) -> B::CommandPool
pub fn into_raw(self) -> B::CommandPool
Downgrade a typed command pool to untyped one, free up the allocated command buffers.
sourceimpl<B: Backend, C: Supports<Graphics>> CommandPool<B, C>
impl<B: Backend, C: Supports<Graphics>> CommandPool<B, C>
sourcepub fn acquire_subpass_command_buffer<'a, S: Shot>(
&mut self
) -> SubpassCommandBuffer<B, S>
pub fn acquire_subpass_command_buffer<'a, S: Shot>(
&mut self
) -> SubpassCommandBuffer<B, S>
Get a subpass command buffer for recording.
You can only record to one command buffer per pool at the same time. If more command buffers are requested than allocated, new buffers will be reserved. The command buffer will be returned in ‘recording’ state.