VKBLENDFACTOR(3)

NAME
VkBlendFactor - framebuffer blending factors

C SPECIFICATION

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;

DESCRIPTION

The semantics of each enum value is described in the table below:

Table 1. Blend Factors
VkBlendFactor | RGB Blend Factors ([ $S_r,S_g,S_b$ ]) or ([ $D_r,D_g,D_b$ ]) | Alpha Blend Factor ([ $S_a$ ] or [ $D_a$ ])
VK_BLEND_FACTOR_ZERO | [ $(0,0,0)$ ] | [ $0$ ]
VK_BLEND_FACTOR_ONE | [ $(1,1,1)$ ] | [ $1$ ]
VK_BLEND_FACTOR_SRC_COLOR | [ $(R_{s0},G_{s0},B_{s0})$ ] | [ $A_{s0}$ ]
VK_BLEND_FACTOR_ONE_MINUS_SRC_COLOR | [ $(1-R_{s0},1-G_{s0},1-B_{s0})$ ] | [ $1-A_{s0}$ ]
VK_BLEND_FACTOR_DST_COLOR | [ $(R_d,G_d,B_d)$ ] | [ $A_d$ ]
VK_BLEND_FACTOR_ONE_MINUS_DST_COLOR | [ $(1-R_d,1-G_d,1-B_d)$ ] | [ $1-A_d$ ]
VK_BLEND_FACTOR_SRC_ALPHA | [ $(A_{s0},A_{s0},A_{s0})$ ] | [ $A_{s0}$ ]
VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA | [ $(1-A_{s0},1-A_{s0},1-A_{s0})$ ] | [ $1-A_{s0}$ ]
VK_BLEND_FACTOR_DST_ALPHA | [ $(A_d,A_d,A_d)$ ] | [ $A_d$ ]
VK_BLEND_FACTOR_ONE_MINUS_DST_ALPHA | [ $(1-A_d,1-A_d,1-A_d)$ ] | [ $1-A_d$ ]
VK_BLEND_FACTOR_CONSTANT_COLOR | [ $(R_c,G_c,B_c)$ ] | [ $A_c$ ]
VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR | [ $(1-R_c,1-G_c,1-B_c)$ ] | [ $1-A_c$ ]
VK_BLEND_FACTOR_CONSTANT_ALPHA | [ $(A_c,A_c,A_c)$ ] | [ $A_c$ ]
VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA | [ $(1-A_c,1-A_c,1-A_c)$ ] | [ $1-A_c$ ]
VK_BLEND_FACTOR_SRC_ALPHA_SATURATE | [ $(f,f,f); f=n(A_{s0},1-A_d)$ ] | [ $1$ ]
VK_BLEND_FACTOR_SRC1_COLOR | [ $(R_{s1},G_{s1},B_{s1})$ ] | [ $A_{s1}$ ]
VK_BLEND_FACTOR_ONE_MINUS_SRC1_COLOR | [ $(1-R_{s1},1-G_{s1},1-B_{s1})$ ] | [ $1-A_{s1}$ ]
VK_BLEND_FACTOR_SRC1_ALPHA | [ $(A_{s1},A_{s1},A_{s1})$ ] | [ $A_{s1}$ ]
VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA | [ $(1-A_{s1},1-A_{s1},1-A_{s1})$ ] | [ $1-A_{s1}$ ]

In this table, the following conventions are used:

    • [ $R_{s0},G_{s0},B_{s0}$ ] and [ $A_{s0}$ ] represent the first source color R, G, B, and A components, respectively, for the fragment output location corresponding to the color attachment being blended.

    • [ $R_{s1},G_{s1},B_{s1}$ ] and [ $A_{s1}$ ] 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.

    • [ $R_d,G_d,B_d$ ] and [ $A_d$ ] 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.

    • [ $R_c,G_c,B_c$ ] and [ $A_c$ ] represent the blend constant R, G, B, and A components, respectively.

SEE ALSO

VkPipelineColorBlendAttachmentState

DOCUMENT NOTES

For more information, see the Vulkan Specification at URL

https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#VkBlendFactor

This page is extracted from the Vulkan Specification. Fixes and changes should be made to the Specification,not directly.

COPYRIGHT

Copyright (c) 2014-2016 Khronos Group. This work is licensed under a Creative Commons Attribution 4.0 International License.

AUTHOR

Khronos Group
    Author.