Struct vulkano::pipeline::graphics::color_blend::ColorBlendState
source · [−]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
sourceimpl ColorBlendState
impl ColorBlendState
sourcepub fn new(num: u32) -> Self
pub fn new(num: u32) -> Self
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.
sourcepub fn logic_op(self, logic_op: LogicOp) -> Self
pub fn logic_op(self, logic_op: LogicOp) -> Self
Enables logical operations with the given logical operation.
sourcepub fn logic_op_dynamic(self) -> Self
pub fn logic_op_dynamic(self) -> Self
Enables logical operations with a dynamic logical operation.
sourcepub fn blend(self, blend: AttachmentBlend) -> Self
pub fn blend(self, blend: AttachmentBlend) -> Self
Enables blending for all attachments, with the given parameters.
sourcepub fn blend_alpha(self) -> Self
pub fn blend_alpha(self) -> Self
Enables blending for all attachments, with alpha blending.
sourcepub fn blend_additive(self) -> Self
pub fn blend_additive(self) -> Self
Enables blending for all attachments, with additive blending.
sourcepub fn color_write_mask(self, color_write_mask: ColorComponents) -> Self
pub fn color_write_mask(self, color_write_mask: ColorComponents) -> Self
Sets the color write mask for all attachments.
sourcepub fn blend_constants(self, constants: [f32; 4]) -> Self
pub fn blend_constants(self, constants: [f32; 4]) -> Self
Sets the blend constants.
sourcepub fn blend_constants_dynamic(self) -> Self
pub fn blend_constants_dynamic(self) -> Self
Sets the blend constants as dynamic.
Trait Implementations
sourceimpl Clone for ColorBlendState
impl Clone for ColorBlendState
sourcefn clone(&self) -> ColorBlendState
fn clone(&self) -> ColorBlendState
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more