Struct vulkano::pipeline::graphics::color_blend::ColorBlendState
source · pub struct ColorBlendState {
pub flags: ColorBlendStateFlags,
pub logic_op: Option<LogicOp>,
pub attachments: Vec<ColorBlendAttachmentState>,
pub blend_constants: [f32; 4],
pub _ne: NonExhaustive,
}
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§
§flags: ColorBlendStateFlags
Additional properties of the color blend state.
The default value is empty.
logic_op: Option<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.
The default value is None
.
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 subpass.
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.
The default value is empty, which must be overridden if the subpass has color attachments.
blend_constants: [f32; 4]
The constant color to use for some of the BlendFactor
variants.
The default value is [0.0; 4]
.
_ne: NonExhaustive
Implementations§
source§impl ColorBlendState
impl ColorBlendState
sourcepub fn with_attachment_states(
count: u32,
attachment_state: ColorBlendAttachmentState
) -> Self
pub fn with_attachment_states( count: u32, attachment_state: ColorBlendAttachmentState ) -> Self
Returns a default ColorBlendState
with count
duplicates of attachment_state
.
sourcepub fn new(num: u32) -> Self
👎Deprecated since 0.34.0
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
👎Deprecated since 0.34.0
pub fn logic_op(self, logic_op: LogicOp) -> Self
Enables logical operations with the given logical operation.
sourcepub fn blend(self, blend: AttachmentBlend) -> Self
👎Deprecated since 0.34.0
pub fn blend(self, blend: AttachmentBlend) -> Self
Enables blending for all attachments, with the given parameters.
sourcepub fn blend_alpha(self) -> Self
👎Deprecated since 0.34.0
pub fn blend_alpha(self) -> Self
Enables blending for all attachments, with alpha blending.
sourcepub fn blend_additive(self) -> Self
👎Deprecated since 0.34.0
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
👎Deprecated since 0.34.0
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
👎Deprecated since 0.34.0
pub fn blend_constants(self, constants: [f32; 4]) -> Self
Sets the blend constants.
Trait Implementations§
source§impl Clone for ColorBlendState
impl Clone for ColorBlendState
source§fn clone(&self) -> ColorBlendState
fn clone(&self) -> ColorBlendState
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more