VkPipelineColorBlendAttachmentState(3)

# VkPipelineColorBlendAttachmentState(3) Manual Page

## Name

VkPipelineColorBlendAttachmentState - Structure specifying a pipeline color blend attachment state

Loading... please wait.

## C Specification

The `VkPipelineColorBlendAttachmentState` structure is defined as:

    typedef struct VkPipelineColorBlendAttachmentState {
        VkBool32                 blendEnable;
        VkBlendFactor            srcColorBlendFactor;
        VkBlendFactor            dstColorBlendFactor;
        VkBlendOp                colorBlendOp;
        VkBlendFactor            srcAlphaBlendFactor;
        VkBlendFactor            dstAlphaBlendFactor;
        VkBlendOp                alphaBlendOp;
        VkColorComponentFlags    colorWriteMask;
    } VkPipelineColorBlendAttachmentState;

## Members

- `blendEnable` controls whether blending is enabled for the corresponding color attachment. If blending is not enabled, the source fragment’s color for that attachment is passed through unmodified.

- `srcColorBlendFactor` selects which blend factor is used to determine the source factors (Sr,Sg,Sb).

- `dstColorBlendFactor` selects which blend factor is used to determine the destination factors (Dr,Dg,Db).

- `colorBlendOp` selects which blend operation is used to calculate the RGB values to write to the color attachment.

- `srcAlphaBlendFactor` selects which blend factor is used to determine the source factor Sa.

- `dstAlphaBlendFactor` selects which blend factor is used to determine the destination factor Da.

- `alphaBlendOp` selects which blend operation is use to calculate the alpha values to write to the color attachment.

- `colorWriteMask` is a bitmask of VkColorComponentFlagBits specifying which of the R, G, B, and/or A components are enabled for writing, as described for the Color Write Mask.

## Description

Valid Usage

- If the dual source blending feature is not enabled, `srcColorBlendFactor` must not be `VK_BLEND_FACTOR_SRC1_COLOR`, `VK_BLEND_FACTOR_ONE_MINUS_SRC1_COLOR`, `VK_BLEND_FACTOR_SRC1_ALPHA`, or `VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA`

- If the dual source blending feature is not enabled, `dstColorBlendFactor` must not be `VK_BLEND_FACTOR_SRC1_COLOR`, `VK_BLEND_FACTOR_ONE_MINUS_SRC1_COLOR`, `VK_BLEND_FACTOR_SRC1_ALPHA`, or `VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA`

- If the dual source blending feature is not enabled, `srcAlphaBlendFactor` must not be `VK_BLEND_FACTOR_SRC1_COLOR`, `VK_BLEND_FACTOR_ONE_MINUS_SRC1_COLOR`, `VK_BLEND_FACTOR_SRC1_ALPHA`, or `VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA`

- If the dual source blending feature is not enabled, `dstAlphaBlendFactor` must not be `VK_BLEND_FACTOR_SRC1_COLOR`, `VK_BLEND_FACTOR_ONE_MINUS_SRC1_COLOR`, `VK_BLEND_FACTOR_SRC1_ALPHA`, or `VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA`

- If either of `colorBlendOp` or `alphaBlendOp` is an advanced blend operation, then `colorBlendOp` must equal `alphaBlendOp`

- If VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT::`advancedBlendIndependentBlend` is `VK_FALSE` and `colorBlendOp` is an advanced blend operation, then `colorBlendOp` must be the same for all attachments

- If VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT::`advancedBlendIndependentBlend` is `VK_FALSE` and `alphaBlendOp` is an advanced blend operation, then `alphaBlendOp` must be the same for all attachments

- If VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT::`advancedBlendAllOperations` is `VK_FALSE`, then `colorBlendOp` must not be `VK_BLEND_OP_ZERO_EXT`, `VK_BLEND_OP_SRC_EXT`, `VK_BLEND_OP_DST_EXT`, `VK_BLEND_OP_SRC_OVER_EXT`, `VK_BLEND_OP_DST_OVER_EXT`, `VK_BLEND_OP_SRC_IN_EXT`, `VK_BLEND_OP_DST_IN_EXT`, `VK_BLEND_OP_SRC_OUT_EXT`, `VK_BLEND_OP_DST_OUT_EXT`, `VK_BLEND_OP_SRC_ATOP_EXT`, `VK_BLEND_OP_DST_ATOP_EXT`, `VK_BLEND_OP_XOR_EXT`, `VK_BLEND_OP_INVERT_EXT`, `VK_BLEND_OP_INVERT_RGB_EXT`, `VK_BLEND_OP_LINEARDODGE_EXT`, `VK_BLEND_OP_LINEARBURN_EXT`, `VK_BLEND_OP_VIVIDLIGHT_EXT`, `VK_BLEND_OP_LINEARLIGHT_EXT`, `VK_BLEND_OP_PINLIGHT_EXT`, `VK_BLEND_OP_HARDMIX_EXT`, `VK_BLEND_OP_PLUS_EXT`, `VK_BLEND_OP_PLUS_CLAMPED_EXT`, `VK_BLEND_OP_PLUS_CLAMPED_ALPHA_EXT`, `VK_BLEND_OP_PLUS_DARKER_EXT`, `VK_BLEND_OP_MINUS_EXT`, `VK_BLEND_OP_MINUS_CLAMPED_EXT`, `VK_BLEND_OP_CONTRAST_EXT`, `VK_BLEND_OP_INVERT_OVG_EXT`, `VK_BLEND_OP_RED_EXT`, `VK_BLEND_OP_GREEN_EXT`, or `VK_BLEND_OP_BLUE_EXT`

- If `colorBlendOp` or `alphaBlendOp` is an advanced blend operation, then VkSubpassDescription::`colorAttachmentCount` of the subpass this pipeline is compiled against must be less than or equal to VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT::advancedBlendMaxColorAttachments

Valid Usage (Implicit)

- `srcColorBlendFactor` must be a valid VkBlendFactor value

- `dstColorBlendFactor` must be a valid VkBlendFactor value

- `colorBlendOp` must be a valid VkBlendOp value

- `srcAlphaBlendFactor` must be a valid VkBlendFactor value

- `dstAlphaBlendFactor` must be a valid VkBlendFactor value

- `alphaBlendOp` must be a valid VkBlendOp value

- `colorWriteMask` must be a valid combination of VkColorComponentFlagBits values

## See Also

VkBlendFactor, VkBlendOp, `VkBool32`, VkColorComponentFlags, VkPipelineColorBlendStateCreateInfo

## Document Notes

For more information, see the Vulkan Specification

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

## Copyright

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