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.