rendy_command

Struct CommandPool

Source
pub struct CommandPool<B: Backend, C = QueueType, R = NoIndividualReset> { /* private fields */ }
Expand description

Simple pool wrapper. Doesn’t provide any guarantees. Wraps raw buffers into CommandCommand buffer.

Implementations§

Source§

impl<B, C, R> CommandPool<B, C, R>
where B: Backend,

Source

pub fn family_id(&self) -> FamilyId

Get owner id.

Source

pub fn assert_family_owner(&self, family: &Family<B, C>)

Assert specified family is owner.

Source

pub fn assert_device_owner(&self, device: &Device<B>)

Assert specified device is owner.

Source

pub fn assert_instance_owner(&self, instance: &Instance<B>)

Assert specified instance is owner.

Source§

impl<B, C, R> CommandPool<B, C, R>
where B: Backend, R: Reset,

Source

pub unsafe fn create( family: FamilyId, capability: C, device: &Device<B>, ) -> Result<Self, OutOfMemory>
where R: Reset, C: Capability,

Create command pool associated with the family. Command buffers created from the pool could be submitted to the queues of the family.

§Safety

Family must belong to specified device. Family must have specified capability.

Source

pub unsafe fn from_raw( raw: B::CommandPool, capability: C, reset: R, family: FamilyId, ) -> Self

Wrap raw command pool.

§Safety
  • raw must be valid command pool handle.
  • The command pool must be created for specified family index.
  • capability must be subset of capabilites of the family the pool was created for.
  • if reset is IndividualReset the pool must be created with individual command buffer reset flag set.
Source

pub fn allocate_buffers<L>( &mut self, count: usize, ) -> Vec<CommandBuffer<B, C, InitialState, L, R>>
where L: Level, C: Capability,

Allocate new command buffers.

Source

pub unsafe fn free_buffers( &mut self, buffers: impl IntoIterator<Item = CommandBuffer<B, C, impl Resettable, impl Level, R>>, )

Free buffers. Buffers must be in droppable state. TODO: Validate buffers were allocated from this pool.

Source

pub unsafe fn reset(&mut self)

Reset all buffers of this pool.

§Safety

All buffers allocated from this pool must be marked reset. See CommandBuffer::mark_reset(struct.Command buffer.html#method.mark_reset)

Source

pub unsafe fn dispose(self, device: &Device<B>)

Dispose of command pool.

§Safety

All buffers allocated from this pool must be freed.

Source

pub fn with_queue_type(self) -> CommandPool<B, QueueType, R>
where C: Capability,

Convert capability level

Source

pub fn with_capability<U>(self) -> Result<CommandPool<B, U, R>, Self>
where C: Supports<U>,

Convert capability level

Trait Implementations§

Source§

impl<B: Debug + Backend, C: Debug, R: Debug> Debug for CommandPool<B, C, R>
where B::CommandPool: Debug,

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<B, C, R> Freeze for CommandPool<B, C, R>
where <B as Backend>::CommandPool: Freeze, C: Freeze, R: Freeze,

§

impl<B, C, R> RefUnwindSafe for CommandPool<B, C, R>

§

impl<B, C, R> Send for CommandPool<B, C, R>
where C: Send, R: Send,

§

impl<B, C, R> Sync for CommandPool<B, C, R>
where C: Sync, R: Sync,

§

impl<B, C, R> Unpin for CommandPool<B, C, R>
where <B as Backend>::CommandPool: Unpin, C: Unpin, R: Unpin,

§

impl<B, C, R> UnwindSafe for CommandPool<B, C, R>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.