VkClearAttachment(3)

# VkClearAttachment(3) Manual Page

## Name

VkClearAttachment - Structure specifying a clear attachment

## 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 if VK_IMAGE_ASPECT_COLOR_BIT is set in `aspectMask`, in which case it is an index into the bound color attachments.

- `clearValue` is the color or depth/stencil value to clear the attachment to, as described in Clear Values below.

## Description

Valid Usage

- VUID-VkClearAttachment-aspectMask-00019
  If `aspectMask` includes VK_IMAGE_ASPECT_COLOR_BIT, it must not include VK_IMAGE_ASPECT_DEPTH_BIT or VK_IMAGE_ASPECT_STENCIL_BIT

- VUID-VkClearAttachment-aspectMask-00020
  `aspectMask` must not include VK_IMAGE_ASPECT_METADATA_BIT

- VUID-VkClearAttachment-aspectMask-02246
  `aspectMask` must not include `VK_IMAGE_ASPECT_MEMORY_PLANE_i_BIT_EXT` for any index i

Valid Usage (Implicit)

- VUID-VkClearAttachment-aspectMask-parameter
  `aspectMask` must be a valid combination of VkImageAspectFlagBits values

- VUID-VkClearAttachment-aspectMask-requiredbitmask
  `aspectMask` must not be `0`

## See Also

VK_VERSION_1_0, VkClearValue, VkImageAspectFlags, vkCmdClearAttachments

## 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.

## Copyright

Copyright 2014-2026 The Khronos Group Inc.

SPDX-License-Identifier: CC-BY-4.0