Enum rafx_api::RafxDescriptorSetArray[][src]

pub enum RafxDescriptorSetArray {
    Empty(RafxDescriptorSetArrayEmpty),
}
Expand description

An array of descriptor sets. These are expected to be pooled and reused.

Managing descriptor sets can be challenging and there are many strategies that may be used. So a RafxDescriptorSetArray is intended to be allocated in blocks and pooled. This allows downstream code to provide more fine-grained allocation strategies appropriate to their needs.

Higher level crates in rafx-framework provide ref-counted descriptor sets and pooling.

Once a RafxDescriptorSetArray is allocated, depending on the backend, it may remain allocated for the duration of the API object, even if the descriptor set array is dropped. So rather than drop them, pool and reuse them.

Descriptor sets are like pointers to GPU memory. A command buffer can bind a descriptor set, meaning that other command may access resources that the descriptor set references.

Once a command buffer using a descriptor set has been submitted, it must not be modified until the command buffer is finished executing. Fine-grained synchronization primitives allow this restriction to be loosened.

Using an incorrectly configured descriptor set can result in undefined behavior. In practice, this can include GPU hangs, driver crashes, and kernel panics.

Variants

Empty(RafxDescriptorSetArrayEmpty)

Implementations

impl RafxDescriptorSetArray[src]

pub fn handle(&self, index: u32) -> Option<RafxDescriptorSetHandle>[src]

Create a lightweight, opaque pointer to a particular set in the array. This pointer can only be used for binding the given set in a command buffer.

pub fn root_signature(&self) -> &RafxRootSignature[src]

Get the root signature that this descriptor set is created from

pub fn update_descriptor_set(
    &mut self,
    params: &[RafxDescriptorUpdate<'_>]
) -> RafxResult<()>
[src]

Update one or more descriptor sets with new values. This is the same as calling queue_descriptor_set_update, followed by flush_descriptor_set_updates

pub fn queue_descriptor_set_update(
    &mut self,
    update: &RafxDescriptorUpdate<'_>
) -> RafxResult<()>
[src]

Update a CPU-only copy of the descriptor set, but does not apply the write to the descriptor set until flush_descriptor_set_updates() is called.

The main reason for allowing queueing/flushing in separate calls is to help calling code avoid borrow-checking difficulties.

pub fn flush_descriptor_set_updates(&mut self) -> RafxResult<()>[src]

Flush all queued descriptor set writes

pub fn empty_descriptor_set_array(&self) -> Option<&RafxDescriptorSetArrayEmpty>[src]

Get the underlying metal API object. This provides access to any internally created metal objects.

Trait Implementations

impl Debug for RafxDescriptorSetArray[src]

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

Formats the value using the given formatter. Read more

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> Downcast for T where
    T: Any

pub fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait. Read more

pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read more

pub fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s. Read more

pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s. Read more

impl<T> DowncastSync for T where
    T: Any + Send + Sync

pub fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + 'static + Sync + Send>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait. Read more

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.

impl<T> Resource for T where
    T: Downcast + Send + Sync
[src]