logo
pub struct ColorBlendState {
    pub logic_op: Option<StateMode<LogicOp>>,
    pub attachments: Vec<ColorBlendAttachmentState>,
    pub blend_constants: StateMode<[f32; 4]>,
}
Expand description

Describes how the color output of the fragment shader is written to the attachment. See the documentation of the blend module for more info.

Fields

logic_op: Option<StateMode<LogicOp>>

Sets the logical operation to perform between the incoming fragment color and the existing fragment in the framebuffer attachment.

If set to Some, the logic_op feature must be enabled on the device. If set to Some(Dynamic), then the extended_dynamic_state2_logic_op feature must also be enabled on the device.

attachments: Vec<ColorBlendAttachmentState>

Sets the blend and output state for each color attachment. The number of elements must match the number of color attachments in the framebuffer.

If there are multiple elements, and the blend and color_write_mask members of each element differ, then the independent_blend feature must be enabled on the device.

blend_constants: StateMode<[f32; 4]>

The constant color to use for some of the BlendFactor variants.

Implementations

Creates a ColorBlendState with logical operations disabled, blend constants set to zero, and num attachment entries that have blending disabled, and color write and all color components enabled.

Enables logical operations with the given logical operation.

Enables logical operations with a dynamic logical operation.

Enables blending for all attachments, with the given parameters.

Enables blending for all attachments, with alpha blending.

Enables blending for all attachments, with additive blending.

Sets the color write mask for all attachments.

Sets the blend constants.

Sets the blend constants as dynamic.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more

Returns [ColorBlendState::new(1)].

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.