pub trait CommandPool<B: Backend>:
Debug
+ Any
+ Send
+ Sync {
// Required methods
unsafe fn reset(&mut self, release_resources: bool);
unsafe fn free<I>(&mut self, buffers: I)
where I: Iterator<Item = B::CommandBuffer>;
// Provided methods
unsafe fn allocate_one(&mut self, level: Level) -> B::CommandBuffer { ... }
unsafe fn allocate<E>(&mut self, num: usize, level: Level, list: &mut E)
where E: Extend<B::CommandBuffer> { ... }
}
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.
§Arguments
release_resources
- iftrue
, this command pool will recycle all the resources it own and give them back to the system.
§Synchronization
You may not free the pool if a command buffer allocated from it is still in use (pool memory still in use).
Sourceunsafe fn free<I>(&mut self, buffers: I)where
I: Iterator<Item = B::CommandBuffer>,
unsafe fn free<I>(&mut self, buffers: I)where
I: Iterator<Item = B::CommandBuffer>,
Free command buffers allocated from this pool.
Provided Methods§
Sourceunsafe fn allocate_one(&mut self, level: Level) -> B::CommandBuffer
unsafe fn allocate_one(&mut self, level: Level) -> B::CommandBuffer
Allocate a single command buffer from the pool.
§Arguments
level
- whether this command buffer is primary or secondary.
Sourceunsafe fn allocate<E>(&mut self, num: usize, level: Level, list: &mut E)where
E: Extend<B::CommandBuffer>,
unsafe fn allocate<E>(&mut self, num: usize, level: Level, list: &mut E)where
E: Extend<B::CommandBuffer>,
Allocate new command buffers from the pool.
§Arguments
num
- how many buffers to returnlevel
- whether to allocate primary or secondary command buffers.list
- an extendable list of command buffers into which to allocate.
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.