Struct gfx_hal::pso::Specialization[][src]

pub struct Specialization<'a> {
    pub constants: Cow<'a, [SpecializationConstant]>,
    pub data: Cow<'a, [u8]>,
}

Information required for pipeline specialization.

Specialization allows for easy configuration of multiple similar pipelines. For example, there may be a boolean exposed to the shader that switches the specularity on/off, provided via a specialization constant.

That would produce separate PSO's for the "on" and "off" states but they share most of the internal stuff and are fast to produce. More importantly, they are fast to execute, since the driver can optimize out the branch on that other PSO creation.

Fields

constants: Cow<'a, [SpecializationConstant]>

Array of descriptors of specialization constants to override.

data: Cow<'a, [u8]>

Raw data of the specialization constants

Implementations

impl Specialization<'_>[src]

pub const EMPTY: Self[src]

Empty specialization instance.

Trait Implementations

impl<'a> Clone for Specialization<'a>[src]

impl<'a> Debug for Specialization<'a>[src]

impl Default for Specialization<'_>[src]

impl<T> From<T> for Specialization<'_> where
    T: SpecConstList, 
[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for Specialization<'a>[src]

impl<'a> Send for Specialization<'a>[src]

impl<'a> Sync for Specialization<'a>[src]

impl<'a> Unpin for Specialization<'a>[src]

impl<'a> UnwindSafe for Specialization<'a>[src]

Blanket Implementations

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

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

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

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

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.

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.