Struct gfx_hal::pso::Specialization
source · [−]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
sourceimpl Specialization<'_>
impl Specialization<'_>
Trait Implementations
sourceimpl<'a> Clone for Specialization<'a>
impl<'a> Clone for Specialization<'a>
sourcefn clone(&self) -> Specialization<'a>
fn clone(&self) -> Specialization<'a>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<'a> Debug for Specialization<'a>
impl<'a> Debug for Specialization<'a>
sourceimpl Default for Specialization<'_>
impl Default for Specialization<'_>
sourceimpl<T> From<T> for Specialization<'_> where
T: SpecConstList,
impl<T> From<T> for Specialization<'_> where
T: SpecConstList,
Auto Trait Implementations
impl<'a> RefUnwindSafe for Specialization<'a>
impl<'a> Send for Specialization<'a>
impl<'a> Sync for Specialization<'a>
impl<'a> Unpin for Specialization<'a>
impl<'a> UnwindSafe for Specialization<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more