Class VkClearAttachment

  • All Implemented Interfaces:
    java.lang.AutoCloseable, NativeResource, Pointer

    public class VkClearAttachment
    extends Struct
    implements NativeResource
    Structure specifying a clear attachment.

    No memory barriers are needed between CmdClearAttachments and preceding or subsequent draw or attachment clear commands in the same subpass.

    The CmdClearAttachments 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 ATTACHMENT_LOAD_OP_CLEAR, as described for CreateRenderPass.

    Valid Usage
    Valid Usage (Implicit)
    • aspectMask must be a valid combination of VkImageAspectFlagBits values
    • aspectMask must not be 0
    See Also

    VkClearValue, CmdClearAttachments

    Member documentation

    • aspectMask – a mask selecting the color, depth and/or stencil aspects of the attachment to be cleared. aspectMask can include IMAGE_ASPECT_COLOR_BIT for color attachments, IMAGE_ASPECT_DEPTH_BIT for depth/stencil attachments with a depth component, and IMAGE_ASPECT_STENCIL_BIT for depth/stencil attachments with a stencil component. If the subpass’s depth/stencil attachment is ATTACHMENT_UNUSED, then the clear has no effect.
    • colorAttachment – only meaningful if IMAGE_ASPECT_COLOR_BIT is set in aspectMask, in which case it is an index to the pColorAttachments array in the VkSubpassDescription structure of the current subpass which selects the color attachment to clear. If colorAttachment is ATTACHMENT_UNUSED then the clear has no effect.
    • clearValue – the color or depth/stencil value to clear the attachment to, as described in Clear Values below.


     struct VkClearAttachment {
         VkImageAspectFlags aspectMask;
         uint32_t colorAttachment;
         VkClearValue clearValue;