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 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 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.
    • 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.
    • 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;
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.

        The struct member offsets.
    • Constructor Detail

      • VkClearAttachment

        public VkClearAttachment​(java.nio.ByteBuffer container)
        Creates a VkClearAttachment instance at the current position of the specified ByteBuffer container. Changes to the buffer's content will be visible to the struct instance and vice versa.

        The created instance holds a strong reference to the container object.