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.