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§
Source§impl Specialization<'_>
impl Specialization<'_>
Trait Implementations§
Source§impl<'a> Clone for Specialization<'a>
impl<'a> Clone for Specialization<'a>
Source§fn clone(&self) -> Specialization<'a>
fn clone(&self) -> Specialization<'a>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<'a> Debug for Specialization<'a>
impl<'a> Debug for Specialization<'a>
Source§impl Default for Specialization<'_>
impl Default for Specialization<'_>
Auto Trait Implementations§
impl<'a> Freeze for Specialization<'a>
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§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more