vkCmdSetColorWriteMaskEXT
To dynamically set the color write masks, call:
void vkCmdSetColorWriteMaskEXT(
VkCommandBuffer commandBuffer,
uint32_t firstAttachment,
uint32_t attachmentCount,
const VkColorComponentFlags* pColorWriteMasks);
commandBufferis the command buffer into which the command will be recorded.firstAttachmentthe first color attachment the color write masks apply to.attachmentCountthe number of VkColorComponentFlags values in thepColorWriteMasksarray.pColorWriteMasksan array of VkColorComponentFlags values that specify the color write masks of the corresponding attachments.
This command sets the color write masks of the specified attachments for
subsequent drawing commands
when drawing using shader objects, or
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.
Formats with bits that are shared between components specified by
VkColorComponentFlagBits, such as
VK_FORMAT_E5B9G9R9_UFLOAT_PACK32, cannot have their channels
individually masked by this functionality; either all components that share
bits have to be enabled, or none of them.
Valid Usage
VUID-vkCmdSetColorWriteMaskEXT-None-09423
At least one of the following must be true:
- The
extendedDynamicState3ColorWriteMaskfeature is enabled - The
shaderObjectfeature is 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
commandBuffermust be externally synchronized - Host access to the
VkCommandPoolthatcommandBufferwas allocated from must be externally synchronized ::