pub struct BlendMode {
pub blend_enable: bool,
pub src_color_blend_factor: BlendFactor,
pub dst_color_blend_factor: BlendFactor,
pub color_blend_op: BlendOp,
pub src_alpha_blend_factor: BlendFactor,
pub dst_alpha_blend_factor: BlendFactor,
pub alpha_blend_op: BlendOp,
pub color_write_mask: ColorComponentFlags,
}Expand description
Specifies color blend state used when rasterization is enabled for any color attachments accessed during rendering.
Fields§
§blend_enable: boolControls whether blending is enabled for the corresponding color attachment.
If blending is not enabled, the source fragment’s color for that attachment is passed through unmodified.
src_color_blend_factor: BlendFactorSelects which blend factor is used to determine the source factors.
dst_color_blend_factor: BlendFactorSelects which blend factor is used to determine the destination factors.
color_blend_op: BlendOpSelects which blend operation is used to calculate the RGB values to write to the color attachment.
src_alpha_blend_factor: BlendFactorSelects which blend factor is used to determine the source factor.
dst_alpha_blend_factor: BlendFactorSelects which blend factor is used to determine the destination factor.
alpha_blend_op: BlendOpSelects which blend operation is used to calculate the alpha values to write to the color attachment.
color_write_mask: ColorComponentFlagsA bitmask of specifying which of the R, G, B, and/or A components are enabled for writing, as described for the Color Write Mask.
Implementations§
Source§impl BlendMode
impl BlendMode
Sourcepub const REPLACE: Self
pub const REPLACE: Self
A commonly used blend mode for replacing color attachment values with new ones.
Sourcepub const ALPHA: Self
pub const ALPHA: Self
A commonly used blend mode for blending color attachment values based on the alpha channel.
Sourcepub const PRE_MULTIPLIED_ALPHA: Self
pub const PRE_MULTIPLIED_ALPHA: Self
A commonly used blend mode for blending color attachment values based on the alpha channel, where the color components have been pre-multiplied with the alpha component value.
Sourcepub fn new() -> BlendModeBuilder
pub fn new() -> BlendModeBuilder
Specifies a default blend mode which is not enabled.
Trait Implementations§
impl Copy for BlendMode
impl Eq for BlendMode
impl StructuralPartialEq for BlendMode
Auto Trait Implementations§
impl Freeze for BlendMode
impl RefUnwindSafe for BlendMode
impl Send for BlendMode
impl Sync for BlendMode
impl Unpin for BlendMode
impl UnwindSafe for BlendMode
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.