VKCMDCLEARATTACHMENT(3)

NAME
vkCmdClearAttachments - Clear regions within currently bound framebuffer attachments.

C SPECIFICATION

To clear one or more regions of color and depth/stencil attachments inside a render pass instance, call:

    void vkCmdClearAttachments(
        VkCommandBuffer                             commandBuffer,
        uint32_t                                    attachmentCount,
        const VkClearAttachment*                    pAttachments,
        uint32_t                                    rectCount,
        const VkClearRect*                          pRects);

PARAMETERS

    • commandBuffer is the command buffer into which the command will be recorded.

    • attachmentCount is the number of entries in the pAttachments array.

    • pAttachments is a pointer to an array of VkClearAttachment structures defining the attachments to clear and the clear values to use.

    • rectCount is the number of entries in the pRects array.

    • pRects points to an array of VkClearRect structures defining regions within each selected attachment to clear.

DESCRIPTION

vkCmdClearAttachments can clear multiple regions of each attachment used in the current subpass of a render pass instance. This command must be called only inside a render pass instance, and implicitly selects the images to clear based on the current framebuffer attachments and the command parameters.

VALID USAGE

    • commandBuffer must be a valid VkCommandBuffer handle

    • pAttachments must be a pointer to an array of attachmentCount valid VkClearAttachment structures

    • pRects must be a pointer to an array of rectCount VkClearRect structures

    • commandBuffer must be in the recording state

    • The VkCommandPool that commandBuffer was allocated from must support graphics operations

    • This command must only be called inside of a render pass instance

    • attachmentCount must be greater than 0

    • rectCount must be greater than 0

    • If the aspectMask member of any given element of pAttachments contains VK_IMAGE_ASPECT_COLOR_BIT, the colorAttachment member of those elements must refer to a valid color attachment in the current subpass

    • The rectangular region specified by a given element of pRects must be contained within the render area of the current render pass instance

    • The layers specified by a given element of pRects must be contained within every attachment that pAttachments refers to

HOST SYNCHRONIZATION

    • Host access to commandBuffer must be externally synchronized

COMMAND PROPERTIES
Command Buffer Levels | Render Pass Scope | Supported Queue Types
Primary Secondary | Inside | GRAPHICS

SEE ALSO

VkClearAttachment, VkClearRect, VkCommandBuffer

DOCUMENT NOTES

For more information, see the Vulkan Specification at URL

https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#vkCmdClearAttachments

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

COPYRIGHT

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

AUTHOR

Khronos Group
    Author.