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

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

Empty specialization instance.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.