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

source

pub fn with_attachment_states( count: u32, attachment_state: ColorBlendAttachmentState ) -> Self

Returns a default ColorBlendState with count duplicates of attachment_state.

source

pub fn new(num: u32) -> Self

👎Deprecated since 0.34.0

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.

source

pub fn logic_op(self, logic_op: LogicOp) -> Self

👎Deprecated since 0.34.0

Enables logical operations with the given logical operation.

source

pub fn blend(self, blend: AttachmentBlend) -> Self

👎Deprecated since 0.34.0

Enables blending for all attachments, with the given parameters.

source

pub fn blend_alpha(self) -> Self

👎Deprecated since 0.34.0

Enables blending for all attachments, with alpha blending.

source

pub fn blend_additive(self) -> Self

👎Deprecated since 0.34.0

Enables blending for all attachments, with additive blending.

source

pub fn color_write_mask(self, color_write_mask: ColorComponents) -> Self

👎Deprecated since 0.34.0

Sets the color write mask for all attachments.

source

pub fn blend_constants(self, constants: [f32; 4]) -> Self

👎Deprecated since 0.34.0

Sets the blend constants.

Trait Implementations§

source§

impl Clone for ColorBlendState

source§

fn clone(&self) -> ColorBlendState

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ColorBlendState

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for ColorBlendState

source§

fn default() -> Self

Returns [ColorBlendState::new(1)].

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.