Struct vulkano::command_buffer::pool::UnsafeCommandPool
source · [−]pub struct UnsafeCommandPool { /* private fields */ }
Expand description
Low-level implementation of a command pool.
A command pool is always tied to a specific queue family. Command buffers allocated from a pool can only be executed on the corresponding queue family.
This struct doesn’t implement the Sync
trait because Vulkan command pools are not thread
safe. In other words, you can only use a pool from one thread at a time.
Implementations
sourceimpl UnsafeCommandPool
impl UnsafeCommandPool
sourcepub fn new(
device: Arc<Device>,
create_info: UnsafeCommandPoolCreateInfo
) -> Result<UnsafeCommandPool, UnsafeCommandPoolCreationError>
pub fn new(
device: Arc<Device>,
create_info: UnsafeCommandPoolCreateInfo
) -> Result<UnsafeCommandPool, UnsafeCommandPoolCreationError>
Creates a new UnsafeCommandPool
.
sourcepub unsafe fn reset(&self, release_resources: bool) -> Result<(), OomError>
pub unsafe fn reset(&self, release_resources: bool) -> Result<(), OomError>
Resets the pool, which resets all the command buffers that were allocated from it.
If release_resources
is true, it is a hint to the implementation that it should free all
the memory internally allocated for this pool.
Safety
- The command buffers allocated from this pool jump to the initial state.
sourcepub fn allocate_command_buffers(
&self,
allocate_info: CommandBufferAllocateInfo
) -> Result<impl ExactSizeIterator<Item = UnsafeCommandPoolAlloc>, OomError>
pub fn allocate_command_buffers(
&self,
allocate_info: CommandBufferAllocateInfo
) -> Result<impl ExactSizeIterator<Item = UnsafeCommandPoolAlloc>, OomError>
Allocates command buffers.
sourcepub unsafe fn free_command_buffers<I>(&self, command_buffers: I) where
I: IntoIterator<Item = UnsafeCommandPoolAlloc>,
pub unsafe fn free_command_buffers<I>(&self, command_buffers: I) where
I: IntoIterator<Item = UnsafeCommandPoolAlloc>,
Frees individual command buffers.
Safety
- The
command_buffers
must have been allocated from this pool. - The
command_buffers
must not be in the pending state.
sourcepub fn trim(&self) -> Result<(), CommandPoolTrimError>
pub fn trim(&self) -> Result<(), CommandPoolTrimError>
Trims a command pool, which recycles unused internal memory from the command pool back to the system.
Command buffers allocated from the pool are not affected by trimming.
This function is supported only if the
khr_maintenance1
extension is
enabled on the device. Otherwise an error is returned.
Since this operation is purely an optimization it is legitimate to call this function and
simply ignore any possible error.
sourcepub fn queue_family(&self) -> QueueFamily<'_>
pub fn queue_family(&self) -> QueueFamily<'_>
Returns the queue family on which command buffers of this pool can be executed.
Trait Implementations
sourceimpl Debug for UnsafeCommandPool
impl Debug for UnsafeCommandPool
sourceimpl DeviceOwned for UnsafeCommandPool
impl DeviceOwned for UnsafeCommandPool
sourceimpl Drop for UnsafeCommandPool
impl Drop for UnsafeCommandPool
sourceimpl Hash for UnsafeCommandPool
impl Hash for UnsafeCommandPool
sourceimpl VulkanObject for UnsafeCommandPool
impl VulkanObject for UnsafeCommandPool
type Object = CommandPool
type Object = CommandPool
The type of the object.
sourcefn internal_object(&self) -> CommandPool
fn internal_object(&self) -> CommandPool
Returns a reference to the object.
impl Eq for UnsafeCommandPool
impl Send for UnsafeCommandPool
Auto Trait Implementations
impl RefUnwindSafe for UnsafeCommandPool
impl !Sync for UnsafeCommandPool
impl Unpin for UnsafeCommandPool
impl UnwindSafe for UnsafeCommandPool
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more