Enum
VkBlendFactor
Framebuffer blending factors
The source and destination color and alpha blending factors are selected from the enum:
typedef enum VkBlendFactor {
VK_BLEND_FACTOR_ZERO = 0,
VK_BLEND_FACTOR_ONE = 1,
VK_BLEND_FACTOR_SRC_COLOR = 2,
VK_BLEND_FACTOR_ONE_MINUS_SRC_COLOR = 3,
VK_BLEND_FACTOR_DST_COLOR = 4,
VK_BLEND_FACTOR_ONE_MINUS_DST_COLOR = 5,
VK_BLEND_FACTOR_SRC_ALPHA = 6,
VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA = 7,
VK_BLEND_FACTOR_DST_ALPHA = 8,
VK_BLEND_FACTOR_ONE_MINUS_DST_ALPHA = 9,
VK_BLEND_FACTOR_CONSTANT_COLOR = 10,
VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR = 11,
VK_BLEND_FACTOR_CONSTANT_ALPHA = 12,
VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA = 13,
VK_BLEND_FACTOR_SRC_ALPHA_SATURATE = 14,
VK_BLEND_FACTOR_SRC1_COLOR = 15,
VK_BLEND_FACTOR_ONE_MINUS_SRC1_COLOR = 16,
VK_BLEND_FACTOR_SRC1_ALPHA = 17,
VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA = 18,
} VkBlendFactor;
pub struct BlendFactor(u32);
impl BlendFactor {
pub const ZERO: Self = 0;
pub const ONE: Self = 1;
pub const SRC_COLOR: Self = 2;
pub const ONE_MINUS_SRC_COLOR: Self = 3;
pub const DST_COLOR: Self = 4;
pub const ONE_MINUS_DST_COLOR: Self = 5;
pub const SRC_ALPHA: Self = 6;
pub const ONE_MINUS_SRC_ALPHA: Self = 7;
pub const DST_ALPHA: Self = 8;
pub const ONE_MINUS_DST_ALPHA: Self = 9;
pub const CONSTANT_COLOR: Self = 10;
pub const ONE_MINUS_CONSTANT_COLOR: Self = 11;
pub const CONSTANT_ALPHA: Self = 12;
pub const ONE_MINUS_CONSTANT_ALPHA: Self = 13;
pub const SRC_ALPHA_SATURATE: Self = 14;
pub const SRC1_COLOR: Self = 15;
pub const ONE_MINUS_SRC1_COLOR: Self = 16;
pub const SRC1_ALPHA: Self = 17;
pub const ONE_MINUS_SRC1_ALPHA: Self = 18;
}
The semantics of the enum values are described in the table below:
| VkBlendFactor | RGB Blend Factors(Sr,Sg,Sb)or(Dr,Dg,Db) | Alpha Blend Factor (SaorDa) |
|---|---|---|
VK_BLEND_FACTOR_ZERO | (0,0,0) | 0 |
VK_BLEND_FACTOR_ONE | (1,1,1) | 1 |
VK_BLEND_FACTOR_SRC_COLOR | (Rs0,Gs0,Bs0) | As0 |
VK_BLEND_FACTOR_ONE_MINUS_SRC_COLOR | (1-Rs0,1-Gs0,1-Bs0) | 1-As0 |
VK_BLEND_FACTOR_DST_COLOR | (Rd,Gd,Bd) | Ad |
VK_BLEND_FACTOR_ONE_MINUS_DST_COLOR | (1-Rd,1-Gd,1-Bd) | 1-Ad |
VK_BLEND_FACTOR_SRC_ALPHA | (As0,As0,As0) | As0 |
VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA | (1-As0,1-As0,1-As0) | 1-As0 |
VK_BLEND_FACTOR_DST_ALPHA | (Ad,Ad,Ad) | Ad |
VK_BLEND_FACTOR_ONE_MINUS_DST_ALPHA | (1-Ad,1-Ad,1-Ad) | 1-Ad |
VK_BLEND_FACTOR_CONSTANT_COLOR | (Rc,Gc,Bc) | Ac |
VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR | (1-Rc,1-Gc,1-Bc) | 1-Ac |
VK_BLEND_FACTOR_CONSTANT_ALPHA | (Ac,Ac,Ac) | Ac |
VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA | (1-Ac,1-Ac,1-Ac) | 1-Ac |
VK_BLEND_FACTOR_SRC_ALPHA_SATURATE | (f,f,f);f = min(As0,1-Ad) | 1 |
VK_BLEND_FACTOR_SRC1_COLOR | (Rs1,Gs1,Bs1) | As1 |
VK_BLEND_FACTOR_ONE_MINUS_SRC1_COLOR | (1-Rs1,1-Gs1,1-Bs1) | 1-As1 |
VK_BLEND_FACTOR_SRC1_ALPHA | (As1,As1,As1) | As1 |
VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA | (1-As1,1-As1,1-As1) | 1-As1 |
In this table, the following conventions are used:
- Rs0,Gs0,Bs0 and As0 represent the first source color R, G, B, and A components, respectively, for the fragment output location corresponding to the color attachment being blended.
- Rs1,Gs1,Bs1 and As1 represent the second source color R, G, B, and A components, respectively, used in dual source blending modes, for the fragment output location corresponding to the color attachment being blended.
- Rd,Gd,Bd and Ad represent the R, G, B, and A components of the destination color. That is, the color currently in the corresponding color attachment for this fragment/sample.
- Rc,Gc,Bc and Ac represent the blend constant R, G, B, and A components, respectively.
Parent
VK_VERSION_1_0Type
Enum