To clear one or more regions of color and depth/stencil attachments inside a render pass instance, call:
// Provided by VK_VERSION_1_0
const VkClearAttachment* pAttachments,
const VkClearRect* pRects);
commandBufferis the command buffer into which the command will be recorded.
attachmentCountis the number of entries in the
pAttachmentsis a pointer to an array of VkClearAttachment structures defining the attachments to clear and the clear values to use.
rectCountis the number of entries in the
pRectsis a pointer to an array of VkClearRect structures defining regions within each selected attachment to clear.
Unlike other clear commands, vkCmdClearAttachments is not a
It performs its operations in rasterization order.
For color attachments, the operations are executed as color attachment
writes, by the
For depth/stencil attachments, the operations are executed as
depth writes and stencil writes by
vkCmdClearAttachments is not affected by the bound pipeline state.
It is generally preferable to clear attachments by using the
If any attachment’s
aspectMask to be cleared is not backed by an image
view, the clear has no effect on that aspect.
If an attachment being cleared refers to an image view created with an
aspectMask equal to one of
is considered to be
VK_IMAGE_ASPECT_COLOR_BIT for purposes of this
command, and must be cleared with the
aspect as specified by image view creation.
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.