logo
#[repr(i32)]
pub enum BlendFactor {
Show 19 variants Zero, One, SrcColor, OneMinusSrcColor, DstColor, OneMinusDstColor, SrcAlpha, OneMinusSrcAlpha, DstAlpha, OneMinusDstAlpha, ConstantColor, OneMinusConstantColor, ConstantAlpha, OneMinusConstantAlpha, SrcAlphaSaturate, Src1Color, OneMinusSrc1Color, Src1Alpha, OneMinusSrc1Alpha,
}
Expand description

The operation that takes source (output from the fragment shader), destination (value currently in the framebuffer attachment) and blend_constant input values, and produces new inputs to be fed to BlendOp.

Some operations take source1 as an input, representing the second source value. The dual_src_blend feature must be enabled on the device when these are used.

Variants

Zero

Always 0.

One

Always 1.

SrcColor

source component-wise.

OneMinusSrcColor

1 - source component-wise.

DstColor

destination component-wise.

OneMinusDstColor

1 - destination component-wise.

SrcAlpha

source.a for all components.

OneMinusSrcAlpha

1 - source.a for all components.

DstAlpha

destination.a for all components.

OneMinusDstAlpha

1 - destination.a for all components.

ConstantColor

blend_constants component-wise.

OneMinusConstantColor

1 - blend_constants component-wise.

ConstantAlpha

blend_constants.a for all components.

OneMinusConstantAlpha

1 - blend_constants.a for all components.

SrcAlphaSaturate

For the alpha component, always 1. For the color components, min(source.a, 1 - destination.a) for all components.

Src1Color

source1 component-wise.

OneMinusSrc1Color

1 - source1 component-wise.

Src1Alpha

source1.a for all components.

OneMinusSrc1Alpha

1 - source1.a for all components.

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

Performs the conversion.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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.