vkCmdSetColorWriteMaskEXT(3)

# vkCmdSetColorWriteMaskEXT(3) Manual Page

## Name

vkCmdSetColorWriteMaskEXT - Specify the color write masks for each attachment dynamically for a command buffer

Loading… please wait.

## C Specification

To dynamically set the color write masks, call:

    // Provided by VK_EXT_extended_dynamic_state3
    void vkCmdSetColorWriteMaskEXT(
        VkCommandBuffer                             commandBuffer,
        uint32_t                                    firstAttachment,
        uint32_t                                    attachmentCount,
        const VkColorComponentFlags*                pColorWriteMasks);

## Parameters

- `commandBuffer` is the command buffer into which the command will be recorded.

- `firstAttachment` the first color attachment the color write masks apply to.

- `attachmentCount` the number of VkColorComponentFlags values in the `pColorWriteMasks` array.

- `pColorWriteMasks` an array of VkColorComponentFlags values that specify the color write masks of the corresponding attachments.

## Description

This command sets the color write masks of the specified attachments for subsequent drawing commands when the graphics pipeline is created with `VK_DYNAMIC_STATE_COLOR_WRITE_MASK_EXT` set in VkPipelineDynamicStateCreateInfo::`pDynamicStates`. Otherwise, this state is specified by the VkPipelineColorBlendAttachmentState::`colorWriteMask` values used to create the currently active pipeline.

Valid Usage

- VUID-vkCmdSetColorWriteMaskEXT-extendedDynamicState3ColorWriteMask-07364
  The `extendedDynamicState3ColorWriteMask` feature must be enabled

Valid Usage (Implicit)

- VUID-vkCmdSetColorWriteMaskEXT-commandBuffer-parameter
  `commandBuffer` must be a valid VkCommandBuffer handle

- VUID-vkCmdSetColorWriteMaskEXT-pColorWriteMasks-parameter
  `pColorWriteMasks` must be a valid pointer to an array of `attachmentCount` valid combinations of VkColorComponentFlagBits values

- VUID-vkCmdSetColorWriteMaskEXT-commandBuffer-recording
  `commandBuffer` must be in the recording state

- VUID-vkCmdSetColorWriteMaskEXT-commandBuffer-cmdpool
  The `VkCommandPool` that `commandBuffer` was allocated from must support graphics operations

- VUID-vkCmdSetColorWriteMaskEXT-videocoding
  This command must only be called outside of a video coding scope

- VUID-vkCmdSetColorWriteMaskEXT-attachmentCount-arraylength
  `attachmentCount` must be greater than `0`

Host Synchronization

- Host access to `commandBuffer` must be externally synchronized

- Host access to the `VkCommandPool` that `commandBuffer` was allocated from must be externally synchronized

Command Properties

Command Buffer Levels | Render Pass Scope | Video Coding Scope | Supported Queue Types | Command Type
--- | --- | --- | --- | ---
Primary Secondary | Both | Outside | Graphics | State

## See Also

VK_EXT_extended_dynamic_state3, VkColorComponentFlags, VkCommandBuffer

## 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 2014-2022 The Khronos Group Inc.

SPDX-License-Identifier: CC-BY-4.0