Struct vulkano::command_buffer::pool::UnsafeCommandPool[][src]

pub struct UnsafeCommandPool { /* fields omitted */ }

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

impl UnsafeCommandPool[src]

pub fn new(
    device: Arc<Device>,
    queue_family: QueueFamily<'_>,
    transient: bool,
    reset_cb: bool
) -> Result<UnsafeCommandPool, OomError>
[src]

Creates a new pool.

The command buffers created with this pool can only be executed on queues of the given family.

Setting transient to true is a hint to the implementation that the command buffers will be short-lived. Setting reset_cb to true means that command buffers can be reset individually.

Panic

  • Panics if the queue family doesn’t belong to the same physical device as device.

pub unsafe fn reset(&self, release_resources: bool) -> Result<(), OomError>[src]

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.

pub fn trim(&self) -> Result<(), CommandPoolTrimError>[src]

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 VK_KHR_maintenance1 extension was enabled at device creation. 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.

pub fn alloc_command_buffers(
    &self,
    secondary: bool,
    count: usize
) -> Result<UnsafeCommandPoolAllocIter, OomError>
[src]

Allocates count command buffers.

If secondary is true, allocates secondary command buffers. Otherwise, allocates primary command buffers.

pub unsafe fn free_command_buffers<I>(&self, command_buffers: I) where
    I: Iterator<Item = UnsafeCommandPoolAlloc>, 
[src]

Frees individual command buffers.

Safety

The command buffers must have been allocated from this pool. They must not be in use.

pub fn queue_family(&self) -> QueueFamily<'_>[src]

Returns the queue family on which command buffers of this pool can be executed.

Trait Implementations

impl Debug for UnsafeCommandPool[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl DeviceOwned for UnsafeCommandPool[src]

fn device(&self) -> &Arc<Device>[src]

Returns the device that owns Self.

impl Drop for UnsafeCommandPool[src]

fn drop(&mut self)[src]

Executes the destructor for this type. Read more

impl VulkanObject for UnsafeCommandPool[src]

type Object = CommandPool

The type of the object.

const TYPE: ObjectType[src]

The ObjectType of the internal Vulkan handle.

fn internal_object(&self) -> CommandPool[src]

Returns a reference to the object.

impl Send for UnsafeCommandPool[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> Content for T[src]

pub fn ref_from_ptr(*mut c_void, usize) -> Option<*mut T>[src]

Builds a pointer to this type from a raw pointer.

pub fn is_size_suitable(usize) -> bool[src]

Returns true if the size is suitable to store a type like this.

pub fn indiv_size() -> usize[src]

Returns the size of an individual element.

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.