1// Copyright 2015-2023 The Khronos Group Inc.
2//
3// SPDX-License-Identifier: CC-BY-4.0
4
5[[clears]]
6= Clear Commands
7
8
9[[clears-outside]]
10== Clearing Images Outside A Render Pass Instance
11
12[open,refpage='vkCmdClearColorImage',desc='Clear regions of a color image',type='protos']
13--
14To clear one or more subranges of a color image, call:
15
16include::{generated}/api/protos/vkCmdClearColorImage.adoc[]
17
18.Valid Usage
19****
20  * [[VUID-vkCmdClearColorImage-image-00003]]
21    If pname:image is non-sparse then it must: be bound completely and
22    contiguously to a single sname:VkDeviceMemory object
23  * [[VUID-vkCmdClearColorImage-imageLayout-00004]]
24    pname:imageLayout must: specify the layout of the image subresource
25    ranges of pname:image specified in pname:pRanges at the time this
26    command is executed on a sname:VkDevice
27  * [[VUID-vkCmdClearColorImage-imageLayout-00005]]
28    pname:imageLayout must: be ename:VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL or
29    ename:VK_IMAGE_LAYOUT_GENERAL
30ifdef::VK_KHR_shared_presentable_image[]
31    , or ename:VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR
32endif::VK_KHR_shared_presentable_image[]
33  * [[VUID-vkCmdClearColorImage-pColor-04961]]
34    pname:pColor must: be a valid pointer to a slink:VkClearColorValue union
35****
36