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: bool
Controls 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: BlendFactor
Selects which blend factor is used to determine the source factors.
dst_color_blend_factor: BlendFactor
Selects which blend factor is used to determine the destination factors.
color_blend_op: BlendOp
Selects which blend operation is used to calculate the RGB values to write to the color attachment.
src_alpha_blend_factor: BlendFactor
Selects which blend factor is used to determine the source factor.
dst_alpha_blend_factor: BlendFactor
Selects which blend factor is used to determine the destination factor.
alpha_blend_op: BlendOp
Selects which blend operation is used to calculate the alpha values to write to the color attachment.
color_write_mask: ColorComponentFlags
A 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§
source§impl PartialEq for BlendMode
impl PartialEq for BlendMode
impl Copy for BlendMode
impl Eq for BlendMode
impl StructuralPartialEq for BlendMode
Auto Trait Implementations§
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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
.§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
.§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.§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.