C Specification
The VkClearAttachment
structure is defined as:
// Provided by VK_VERSION_1_0
typedef struct VkClearAttachment {
VkImageAspectFlags aspectMask;
uint32_t colorAttachment;
VkClearValue clearValue;
} VkClearAttachment;
Members
-
aspectMask
is a mask selecting the color, depth and/or stencil aspects of the attachment to be cleared. -
colorAttachment
is only meaningful ifVK_IMAGE_ASPECT_COLOR_BIT
is set inaspectMask
, in which case it is an index to thepColorAttachments
array in the VkSubpassDescription structure of the current subpass which selects the color attachment to clear. -
clearValue
is the color or depth/stencil value to clear the attachment to, as described in Clear Values below.
Description
No memory barriers are needed between vkCmdClearAttachments
and
preceding or subsequent draw or attachment clear commands in the same
subpass.
The vkCmdClearAttachments
command is not affected by the bound
pipeline state.
Attachments can also be cleared at the beginning of a render pass instance
by setting loadOp
(or stencilLoadOp
) of
VkAttachmentDescription to VK_ATTACHMENT_LOAD_OP_CLEAR
, as
described for vkCreateRenderPass.
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.