Struct rafx::framework::DynCommandPool
source · pub struct DynCommandPool { /* private fields */ }
Expand description
A helper that can be allocated as needed to create very short-lived command buffers. The object may not be persisted across frames. Instead, allocated a new one every frame. They are pooled, allocation is cheap and thread-safe.
This is designed for fire-and-forget command buffers. A DynCommandPool borrows a command pool that is not in use and not in flight, allocates out of it, resets itself after the appropriate number of frames pass, and returns itself to the pool for future reuse. See allocate_dyn_pool for more details
Implementations§
source§impl DynCommandPool
impl DynCommandPool
sourcepub fn allocate_dyn_command_buffer(
&mut self,
command_buffer_def: &RafxCommandBufferDef
) -> Result<DynCommandBuffer, RafxError>
pub fn allocate_dyn_command_buffer( &mut self, command_buffer_def: &RafxCommandBufferDef ) -> Result<DynCommandBuffer, RafxError>
Allocate a command buffer and call begin() on it
sourcepub fn pool(&mut self) -> &mut RafxCommandPool
pub fn pool(&mut self) -> &mut RafxCommandPool
Get the underlying pool within the allocator. The pool will be destroyed after MAX_FRAMES_IN_FLIGHT pass, and all command buffers created with it must follow the same restrictions as a command buffer created via begin_command_buffer/end_command_buffer. It’s recommended to use begin_writing/end_writing as it is less error prone.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for DynCommandPool
impl Send for DynCommandPool
impl Sync for DynCommandPool
impl Unpin for DynCommandPool
impl UnwindSafe for DynCommandPool
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.