pub trait CommandPool<B>:
Debug
+ Any
+ Send
+ Syncwhere
B: Backend,{
// Required methods
unsafe fn reset(&mut self, release_resources: bool);
unsafe fn free<I>(&mut self, buffers: I)
where I: IntoIterator<Item = <B as Backend>::CommandBuffer>;
// Provided methods
unsafe fn allocate_one(
&mut self,
level: Level,
) -> <B as Backend>::CommandBuffer { ... }
unsafe fn allocate_vec(
&mut self,
num: usize,
level: Level,
) -> SmallVec<[<B as Backend>::CommandBuffer; 1]> { ... }
}Expand description
The allocated command buffers are associated with the creating command queue.
Required Methods§
Sourceunsafe fn reset(&mut self, release_resources: bool)
unsafe fn reset(&mut self, release_resources: bool)
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)
Provided Methods§
Sourceunsafe fn allocate_one(&mut self, level: Level) -> <B as Backend>::CommandBuffer
unsafe fn allocate_one(&mut self, level: Level) -> <B as Backend>::CommandBuffer
Allocate a single command buffers from the pool.
Sourceunsafe fn allocate_vec(
&mut self,
num: usize,
level: Level,
) -> SmallVec<[<B as Backend>::CommandBuffer; 1]>
unsafe fn allocate_vec( &mut self, num: usize, level: Level, ) -> SmallVec<[<B as Backend>::CommandBuffer; 1]>
Allocate new command buffers from the pool.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.