1e5c31af7Sopenharmony_ci// Copyright 2015-2021 The Khronos Group, Inc.
2e5c31af7Sopenharmony_ci//
3e5c31af7Sopenharmony_ci// SPDX-License-Identifier: CC-BY-4.0
4e5c31af7Sopenharmony_ci
5e5c31af7Sopenharmony_ci[[resources]]
6e5c31af7Sopenharmony_ci= Resource Creation
7e5c31af7Sopenharmony_ci
8e5c31af7Sopenharmony_ciVulkan supports two primary resource types: _buffers_ and _images_.
9e5c31af7Sopenharmony_ciResources are views of memory with associated formatting and dimensionality.
10e5c31af7Sopenharmony_ciBuffers are essentially unformatted arrays of bytes whereas images contain
11e5c31af7Sopenharmony_ciformat information, can: be multidimensional and may: have associated
12e5c31af7Sopenharmony_cimetadata.
13e5c31af7Sopenharmony_ci
14e5c31af7Sopenharmony_ci
15e5c31af7Sopenharmony_ci[[resources-buffers]]
16e5c31af7Sopenharmony_ci== Buffers
17e5c31af7Sopenharmony_ci
18e5c31af7Sopenharmony_ci[open,refpage='VkBuffer',desc='Opaque handle to a buffer object',type='handles']
19e5c31af7Sopenharmony_ci--
20e5c31af7Sopenharmony_ciBuffers represent linear arrays of data which are used for various purposes
21e5c31af7Sopenharmony_ciby binding them to a graphics or compute pipeline via descriptor sets or via
22e5c31af7Sopenharmony_cicertain commands, or by directly specifying them as parameters to certain
23e5c31af7Sopenharmony_cicommands.
24e5c31af7Sopenharmony_ci
25e5c31af7Sopenharmony_ciBuffers are represented by sname:VkBuffer handles:
26e5c31af7Sopenharmony_ci
27e5c31af7Sopenharmony_ciinclude::{generated}/api/handles/VkBuffer.txt[]
28e5c31af7Sopenharmony_ci--
29e5c31af7Sopenharmony_ci
30e5c31af7Sopenharmony_ci[open,refpage='vkCreateBuffer',desc='Create a new buffer object',type='protos']
31e5c31af7Sopenharmony_ci--
32e5c31af7Sopenharmony_ciTo create buffers, call:
33e5c31af7Sopenharmony_ci
34e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCreateBuffer.txt[]
35e5c31af7Sopenharmony_ci
36e5c31af7Sopenharmony_ci  * pname:device is the logical device that creates the buffer object.
37e5c31af7Sopenharmony_ci  * pname:pCreateInfo is a pointer to a slink:VkBufferCreateInfo structure
38e5c31af7Sopenharmony_ci    containing parameters affecting creation of the buffer.
39e5c31af7Sopenharmony_ci  * pname:pAllocator controls host memory allocation as described in the
40e5c31af7Sopenharmony_ci    <<memory-allocation, Memory Allocation>> chapter.
41e5c31af7Sopenharmony_ci  * pname:pBuffer is a pointer to a slink:VkBuffer handle in which the
42e5c31af7Sopenharmony_ci    resulting buffer object is returned.
43e5c31af7Sopenharmony_ci
44e5c31af7Sopenharmony_ci.Valid Usage
45e5c31af7Sopenharmony_ci****
46e5c31af7Sopenharmony_ci  * [[VUID-vkCreateBuffer-flags-00911]]
47e5c31af7Sopenharmony_ci    If the pname:flags member of pname:pCreateInfo includes
48e5c31af7Sopenharmony_ci    ename:VK_BUFFER_CREATE_SPARSE_BINDING_BIT, creating this sname:VkBuffer
49e5c31af7Sopenharmony_ci    must: not cause the total required sparse memory for all currently valid
50e5c31af7Sopenharmony_ci    sparse resources on the device to exceed
51e5c31af7Sopenharmony_ci    sname:VkPhysicalDeviceLimits::pname:sparseAddressSpaceSize
52e5c31af7Sopenharmony_ciifdef::VK_FUCHSIA_buffer_collection[]
53e5c31af7Sopenharmony_ci  * [[VUID-vkCreateBuffer-pNext-06387]]
54e5c31af7Sopenharmony_ci    If using the slink:VkBuffer for an import operation from a
55e5c31af7Sopenharmony_ci    slink:VkBufferCollectionFUCHSIA where a
56e5c31af7Sopenharmony_ci    slink:VkBufferCollectionBufferCreateInfoFUCHSIA has been chained to
57e5c31af7Sopenharmony_ci    pname:pNext, pname:pCreateInfo must: match the
58e5c31af7Sopenharmony_ci    slink:VkBufferConstraintsInfoFUCHSIA::pname:createInfo used when setting
59e5c31af7Sopenharmony_ci    the constraints on the buffer collection with
60e5c31af7Sopenharmony_ci    flink:vkSetBufferCollectionBufferConstraintsFUCHSIA
61e5c31af7Sopenharmony_ciendif::VK_FUCHSIA_buffer_collection[]
62e5c31af7Sopenharmony_ci****
63e5c31af7Sopenharmony_ci
64e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCreateBuffer.txt[]
65e5c31af7Sopenharmony_ci--
66e5c31af7Sopenharmony_ci
67e5c31af7Sopenharmony_ci[open,refpage='VkBufferCreateInfo',desc='Structure specifying the parameters of a newly created buffer object',type='structs']
68e5c31af7Sopenharmony_ci--
69e5c31af7Sopenharmony_ciThe sname:VkBufferCreateInfo structure is defined as:
70e5c31af7Sopenharmony_ci
71e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkBufferCreateInfo.txt[]
72e5c31af7Sopenharmony_ci
73e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure.
74e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
75e5c31af7Sopenharmony_ci    structure.
76e5c31af7Sopenharmony_ci  * pname:flags is a bitmask of elink:VkBufferCreateFlagBits specifying
77e5c31af7Sopenharmony_ci    additional parameters of the buffer.
78e5c31af7Sopenharmony_ci  * pname:size is the size in bytes of the buffer to be created.
79e5c31af7Sopenharmony_ci  * pname:usage is a bitmask of elink:VkBufferUsageFlagBits specifying
80e5c31af7Sopenharmony_ci    allowed usages of the buffer.
81e5c31af7Sopenharmony_ci  * pname:sharingMode is a elink:VkSharingMode value specifying the sharing
82e5c31af7Sopenharmony_ci    mode of the buffer when it will be accessed by multiple queue families.
83e5c31af7Sopenharmony_ci  * pname:queueFamilyIndexCount is the number of entries in the
84e5c31af7Sopenharmony_ci    pname:pQueueFamilyIndices array.
85e5c31af7Sopenharmony_ci  * pname:pQueueFamilyIndices is a pointer to an array of queue families
86e5c31af7Sopenharmony_ci    that will access this buffer.
87e5c31af7Sopenharmony_ci    It is ignored if pname:sharingMode is not
88e5c31af7Sopenharmony_ci    ename:VK_SHARING_MODE_CONCURRENT.
89e5c31af7Sopenharmony_ci
90e5c31af7Sopenharmony_ci.Valid Usage
91e5c31af7Sopenharmony_ci****
92e5c31af7Sopenharmony_ci  * [[VUID-VkBufferCreateInfo-size-00912]]
93e5c31af7Sopenharmony_ci    pname:size must: be greater than `0`
94e5c31af7Sopenharmony_ci  * [[VUID-VkBufferCreateInfo-sharingMode-00913]]
95e5c31af7Sopenharmony_ci    If pname:sharingMode is ename:VK_SHARING_MODE_CONCURRENT,
96e5c31af7Sopenharmony_ci    pname:pQueueFamilyIndices must: be a valid pointer to an array of
97e5c31af7Sopenharmony_ci    pname:queueFamilyIndexCount code:uint32_t values
98e5c31af7Sopenharmony_ci  * [[VUID-VkBufferCreateInfo-sharingMode-00914]]
99e5c31af7Sopenharmony_ci    If pname:sharingMode is ename:VK_SHARING_MODE_CONCURRENT,
100e5c31af7Sopenharmony_ci    pname:queueFamilyIndexCount must: be greater than `1`
101e5c31af7Sopenharmony_ciifndef::VK_VERSION_1_1,VK_KHR_get_physical_device_properties2[]
102e5c31af7Sopenharmony_ci  * [[VUID-VkBufferCreateInfo-sharingMode-01391]]
103e5c31af7Sopenharmony_ci    If pname:sharingMode is ename:VK_SHARING_MODE_CONCURRENT, each element
104e5c31af7Sopenharmony_ci    of pname:pQueueFamilyIndices must: be unique and must: be less than
105e5c31af7Sopenharmony_ci    pname:pQueueFamilyPropertyCount returned by
106e5c31af7Sopenharmony_ci    flink:vkGetPhysicalDeviceQueueFamilyProperties for the
107e5c31af7Sopenharmony_ci    pname:physicalDevice that was used to create pname:device
108e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_get_physical_device_properties2[]
109e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_get_physical_device_properties2[]
110e5c31af7Sopenharmony_ci  * [[VUID-VkBufferCreateInfo-sharingMode-01419]]
111e5c31af7Sopenharmony_ci    If pname:sharingMode is ename:VK_SHARING_MODE_CONCURRENT, each element
112e5c31af7Sopenharmony_ci    of pname:pQueueFamilyIndices must: be unique and must: be less than
113e5c31af7Sopenharmony_ci    pname:pQueueFamilyPropertyCount returned by either
114e5c31af7Sopenharmony_ci    flink:vkGetPhysicalDeviceQueueFamilyProperties or
115e5c31af7Sopenharmony_ci    flink:vkGetPhysicalDeviceQueueFamilyProperties2 for the
116e5c31af7Sopenharmony_ci    pname:physicalDevice that was used to create pname:device
117e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_get_physical_device_properties2[]
118e5c31af7Sopenharmony_ci  * [[VUID-VkBufferCreateInfo-flags-00915]]
119e5c31af7Sopenharmony_ci    If the <<features-sparseBinding,sparse bindings>> feature is not
120e5c31af7Sopenharmony_ci    enabled, pname:flags must: not contain
121e5c31af7Sopenharmony_ci    ename:VK_BUFFER_CREATE_SPARSE_BINDING_BIT
122e5c31af7Sopenharmony_ci  * [[VUID-VkBufferCreateInfo-flags-00916]]
123e5c31af7Sopenharmony_ci    If the <<features-sparseResidencyBuffer,sparse buffer residency>>
124e5c31af7Sopenharmony_ci    feature is not enabled, pname:flags must: not contain
125e5c31af7Sopenharmony_ci    ename:VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT
126e5c31af7Sopenharmony_ci  * [[VUID-VkBufferCreateInfo-flags-00917]]
127e5c31af7Sopenharmony_ci    If the <<features-sparseResidencyAliased,sparse aliased residency>>
128e5c31af7Sopenharmony_ci    feature is not enabled, pname:flags must: not contain
129e5c31af7Sopenharmony_ci    ename:VK_BUFFER_CREATE_SPARSE_ALIASED_BIT
130e5c31af7Sopenharmony_ci  * [[VUID-VkBufferCreateInfo-flags-00918]]
131e5c31af7Sopenharmony_ci    If pname:flags contains ename:VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT or
132e5c31af7Sopenharmony_ci    ename:VK_BUFFER_CREATE_SPARSE_ALIASED_BIT, it must: also contain
133e5c31af7Sopenharmony_ci    ename:VK_BUFFER_CREATE_SPARSE_BINDING_BIT
134e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_external_memory[]
135e5c31af7Sopenharmony_ci  * [[VUID-VkBufferCreateInfo-pNext-00920]]
136e5c31af7Sopenharmony_ci    If the pname:pNext chain includes a
137e5c31af7Sopenharmony_ci    slink:VkExternalMemoryBufferCreateInfo structure, its pname:handleTypes
138e5c31af7Sopenharmony_ci    member must: only contain bits that are also in
139e5c31af7Sopenharmony_ci    slink:VkExternalBufferProperties::pname:externalMemoryProperties.compatibleHandleTypes,
140e5c31af7Sopenharmony_ci    as returned by flink:vkGetPhysicalDeviceExternalBufferProperties with
141e5c31af7Sopenharmony_ci    pname:pExternalBufferInfo->handleType equal to any one of the handle
142e5c31af7Sopenharmony_ci    types specified in
143e5c31af7Sopenharmony_ci    slink:VkExternalMemoryBufferCreateInfo::pname:handleTypes
144e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_external_memory[]
145e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1[]
146e5c31af7Sopenharmony_ci  * [[VUID-VkBufferCreateInfo-flags-01887]]
147e5c31af7Sopenharmony_ci    If the protected memory feature is not enabled, pname:flags must: not
148e5c31af7Sopenharmony_ci    contain ename:VK_BUFFER_CREATE_PROTECTED_BIT
149e5c31af7Sopenharmony_ci  * [[VUID-VkBufferCreateInfo-None-01888]]
150e5c31af7Sopenharmony_ci    If any of the bits ename:VK_BUFFER_CREATE_SPARSE_BINDING_BIT,
151e5c31af7Sopenharmony_ci    ename:VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT, or
152e5c31af7Sopenharmony_ci    ename:VK_BUFFER_CREATE_SPARSE_ALIASED_BIT are set,
153e5c31af7Sopenharmony_ci    ename:VK_BUFFER_CREATE_PROTECTED_BIT must: not also be set
154e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1[]
155e5c31af7Sopenharmony_ciifdef::VK_NV_dedicated_allocation[]
156e5c31af7Sopenharmony_ci  * [[VUID-VkBufferCreateInfo-pNext-01571]]
157e5c31af7Sopenharmony_ci    If the pname:pNext chain includes a
158e5c31af7Sopenharmony_ci    slink:VkDedicatedAllocationBufferCreateInfoNV structure, and the
159e5c31af7Sopenharmony_ci    pname:dedicatedAllocation member of the chained structure is
160e5c31af7Sopenharmony_ci    ename:VK_TRUE, then pname:flags must: not include
161e5c31af7Sopenharmony_ci    ename:VK_BUFFER_CREATE_SPARSE_BINDING_BIT,
162e5c31af7Sopenharmony_ci    ename:VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT, or
163e5c31af7Sopenharmony_ci    ename:VK_BUFFER_CREATE_SPARSE_ALIASED_BIT
164e5c31af7Sopenharmony_ciendif::VK_NV_dedicated_allocation[]
165e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_EXT_buffer_device_address,VK_KHR_buffer_device_address[]
166e5c31af7Sopenharmony_ciifdef::VK_EXT_buffer_device_address[]
167e5c31af7Sopenharmony_ci  * [[VUID-VkBufferCreateInfo-deviceAddress-02604]]
168e5c31af7Sopenharmony_ci    If slink:VkBufferDeviceAddressCreateInfoEXT::pname:deviceAddress is not
169e5c31af7Sopenharmony_ci    zero, pname:flags must: include
170e5c31af7Sopenharmony_ci    ename:VK_BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT
171e5c31af7Sopenharmony_ciendif::VK_EXT_buffer_device_address[]
172e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_KHR_buffer_device_address[]
173e5c31af7Sopenharmony_ci  * [[VUID-VkBufferCreateInfo-opaqueCaptureAddress-03337]]
174e5c31af7Sopenharmony_ci    If
175e5c31af7Sopenharmony_ci    slink:VkBufferOpaqueCaptureAddressCreateInfo::pname:opaqueCaptureAddress
176e5c31af7Sopenharmony_ci    is not zero, pname:flags must: include
177e5c31af7Sopenharmony_ci    ename:VK_BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT
178e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_KHR_buffer_device_address[]
179e5c31af7Sopenharmony_ci  * [[VUID-VkBufferCreateInfo-flags-03338]]
180e5c31af7Sopenharmony_ci    If pname:flags includes
181e5c31af7Sopenharmony_ci    ename:VK_BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT, the
182e5c31af7Sopenharmony_ci    <<features-bufferDeviceAddressCaptureReplay,bufferDeviceAddressCaptureReplay>>
183e5c31af7Sopenharmony_ci    or
184e5c31af7Sopenharmony_ci    <<features-bufferDeviceAddressCaptureReplayEXT,sname:VkPhysicalDeviceBufferDeviceAddressFeaturesEXT::pname:bufferDeviceAddressCaptureReplay>>
185e5c31af7Sopenharmony_ci    feature must: be enabled
186e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_EXT_buffer_device_address,VK_KHR_buffer_device_address[]
187e5c31af7Sopenharmony_ciifdef::VK_KHR_video_decode_queue[]
188e5c31af7Sopenharmony_ci  * [[VUID-VkBufferCreateInfo-usage-04813]]
189e5c31af7Sopenharmony_ci    If pname:usage includes ename:VK_BUFFER_USAGE_VIDEO_DECODE_SRC_BIT_KHR,
190e5c31af7Sopenharmony_ci    ename:VK_BUFFER_USAGE_VIDEO_DECODE_DST_BIT_KHR, then the pname:pNext
191e5c31af7Sopenharmony_ci    chain must: include a valid slink:VkVideoProfilesKHR structure which
192e5c31af7Sopenharmony_ci    includes at least one slink:VkVideoProfileKHR with a decode
193e5c31af7Sopenharmony_ci    codec-operation
194e5c31af7Sopenharmony_ciendif::VK_KHR_video_decode_queue[]
195e5c31af7Sopenharmony_ciifdef::VK_KHR_video_encode_queue[]
196e5c31af7Sopenharmony_ci  * [[VUID-VkBufferCreateInfo-usage-04814]]
197e5c31af7Sopenharmony_ci    If pname:usage includes ename:VK_BUFFER_USAGE_VIDEO_ENCODE_SRC_BIT_KHR,
198e5c31af7Sopenharmony_ci    ename:VK_BUFFER_USAGE_VIDEO_ENCODE_DST_BIT_KHR, then the pname:pNext
199e5c31af7Sopenharmony_ci    chain must: include a valid slink:VkVideoProfilesKHR structure which
200e5c31af7Sopenharmony_ci    includes at least one slink:VkVideoProfileKHR with a encode
201e5c31af7Sopenharmony_ci    codec-operation
202e5c31af7Sopenharmony_ciendif::VK_KHR_video_encode_queue[]
203e5c31af7Sopenharmony_ciifdef::VK_KHR_maintenance4[]
204e5c31af7Sopenharmony_ci  * [[VUID-VkBufferCreateInfo-size-06409]]
205e5c31af7Sopenharmony_ci    pname:size must: be less than or equal to
206e5c31af7Sopenharmony_ci    slink:VkPhysicalDeviceMaintenance4PropertiesKHR::pname:maxBufferSize
207e5c31af7Sopenharmony_ciendif::VK_KHR_maintenance4[]
208e5c31af7Sopenharmony_ci****
209e5c31af7Sopenharmony_ci
210e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkBufferCreateInfo.txt[]
211e5c31af7Sopenharmony_ci--
212e5c31af7Sopenharmony_ci
213e5c31af7Sopenharmony_ci[open,refpage='VkBufferUsageFlagBits',desc='Bitmask specifying allowed usage of a buffer',type='enums']
214e5c31af7Sopenharmony_ci--
215e5c31af7Sopenharmony_ciBits which can: be set in slink:VkBufferCreateInfo::pname:usage, specifying
216e5c31af7Sopenharmony_ciusage behavior of a buffer, are:
217e5c31af7Sopenharmony_ci
218e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkBufferUsageFlagBits.txt[]
219e5c31af7Sopenharmony_ci
220e5c31af7Sopenharmony_ci  * ename:VK_BUFFER_USAGE_TRANSFER_SRC_BIT specifies that the buffer can: be
221e5c31af7Sopenharmony_ci    used as the source of a _transfer command_ (see the definition of
222e5c31af7Sopenharmony_ci    <<synchronization-pipeline-stages-transfer,
223e5c31af7Sopenharmony_ci    ename:VK_PIPELINE_STAGE_TRANSFER_BIT>>).
224e5c31af7Sopenharmony_ci  * ename:VK_BUFFER_USAGE_TRANSFER_DST_BIT specifies that the buffer can: be
225e5c31af7Sopenharmony_ci    used as the destination of a transfer command.
226e5c31af7Sopenharmony_ci  * ename:VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT specifies that the buffer
227e5c31af7Sopenharmony_ci    can: be used to create a sname:VkBufferView suitable for occupying a
228e5c31af7Sopenharmony_ci    sname:VkDescriptorSet slot of type
229e5c31af7Sopenharmony_ci    ename:VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER.
230e5c31af7Sopenharmony_ci  * ename:VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT specifies that the buffer
231e5c31af7Sopenharmony_ci    can: be used to create a sname:VkBufferView suitable for occupying a
232e5c31af7Sopenharmony_ci    sname:VkDescriptorSet slot of type
233e5c31af7Sopenharmony_ci    ename:VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER.
234e5c31af7Sopenharmony_ci  * ename:VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT specifies that the buffer can:
235e5c31af7Sopenharmony_ci    be used in a sname:VkDescriptorBufferInfo suitable for occupying a
236e5c31af7Sopenharmony_ci    sname:VkDescriptorSet slot either of type
237e5c31af7Sopenharmony_ci    ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER or
238e5c31af7Sopenharmony_ci    ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC.
239e5c31af7Sopenharmony_ci  * ename:VK_BUFFER_USAGE_STORAGE_BUFFER_BIT specifies that the buffer can:
240e5c31af7Sopenharmony_ci    be used in a sname:VkDescriptorBufferInfo suitable for occupying a
241e5c31af7Sopenharmony_ci    sname:VkDescriptorSet slot either of type
242e5c31af7Sopenharmony_ci    ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER or
243e5c31af7Sopenharmony_ci    ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC.
244e5c31af7Sopenharmony_ci  * ename:VK_BUFFER_USAGE_INDEX_BUFFER_BIT specifies that the buffer is
245e5c31af7Sopenharmony_ci    suitable for passing as the pname:buffer parameter to
246e5c31af7Sopenharmony_ci    flink:vkCmdBindIndexBuffer.
247e5c31af7Sopenharmony_ci  * ename:VK_BUFFER_USAGE_VERTEX_BUFFER_BIT specifies that the buffer is
248e5c31af7Sopenharmony_ci    suitable for passing as an element of the pname:pBuffers array to
249e5c31af7Sopenharmony_ci    flink:vkCmdBindVertexBuffers.
250e5c31af7Sopenharmony_ci  * ename:VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT specifies that the buffer is
251e5c31af7Sopenharmony_ci    suitable for passing as the pname:buffer parameter to
252e5c31af7Sopenharmony_ci    flink:vkCmdDrawIndirect, flink:vkCmdDrawIndexedIndirect,
253e5c31af7Sopenharmony_ciifdef::VK_NV_mesh_shader[]
254e5c31af7Sopenharmony_ci    flink:vkCmdDrawMeshTasksIndirectNV,
255e5c31af7Sopenharmony_ci    flink:vkCmdDrawMeshTasksIndirectCountNV,
256e5c31af7Sopenharmony_ciendif::VK_NV_mesh_shader[]
257e5c31af7Sopenharmony_ci    or flink:vkCmdDispatchIndirect.
258e5c31af7Sopenharmony_ciifdef::VK_NV_device_generated_commands[]
259e5c31af7Sopenharmony_ci    It is also suitable for passing as the pname:buffer member of
260e5c31af7Sopenharmony_ci    sname:VkIndirectCommandsStreamNV, or pname:sequencesCountBuffer or
261e5c31af7Sopenharmony_ci    pname:sequencesIndexBuffer or pname:preprocessedBuffer member of
262e5c31af7Sopenharmony_ci    sname:VkGeneratedCommandsInfoNV
263e5c31af7Sopenharmony_ciendif::VK_NV_device_generated_commands[]
264e5c31af7Sopenharmony_ciifdef::VK_EXT_conditional_rendering[]
265e5c31af7Sopenharmony_ci  * ename:VK_BUFFER_USAGE_CONDITIONAL_RENDERING_BIT_EXT specifies that the
266e5c31af7Sopenharmony_ci    buffer is suitable for passing as the pname:buffer parameter to
267e5c31af7Sopenharmony_ci    flink:vkCmdBeginConditionalRenderingEXT.
268e5c31af7Sopenharmony_ciendif::VK_EXT_conditional_rendering[]
269e5c31af7Sopenharmony_ciifdef::VK_EXT_transform_feedback[]
270e5c31af7Sopenharmony_ci  * ename:VK_BUFFER_USAGE_TRANSFORM_FEEDBACK_BUFFER_BIT_EXT specifies that
271e5c31af7Sopenharmony_ci    the buffer is suitable for using for binding as a transform feedback
272e5c31af7Sopenharmony_ci    buffer with flink:vkCmdBindTransformFeedbackBuffersEXT.
273e5c31af7Sopenharmony_ci  * ename:VK_BUFFER_USAGE_TRANSFORM_FEEDBACK_COUNTER_BUFFER_BIT_EXT
274e5c31af7Sopenharmony_ci    specifies that the buffer is suitable for using as a counter buffer with
275e5c31af7Sopenharmony_ci    flink:vkCmdBeginTransformFeedbackEXT and
276e5c31af7Sopenharmony_ci    flink:vkCmdEndTransformFeedbackEXT.
277e5c31af7Sopenharmony_ciendif::VK_EXT_transform_feedback[]
278e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing[]
279e5c31af7Sopenharmony_ci  * ename:VK_BUFFER_USAGE_RAY_TRACING_BIT_NV specifies that the buffer is
280e5c31af7Sopenharmony_ci    suitable for use in flink:vkCmdTraceRaysNV.
281e5c31af7Sopenharmony_ciendif::VK_NV_ray_tracing[]
282e5c31af7Sopenharmony_ciifdef::VK_KHR_ray_tracing_pipeline[]
283e5c31af7Sopenharmony_ci  * ename:VK_BUFFER_USAGE_SHADER_BINDING_TABLE_BIT_KHR specifies that the
284e5c31af7Sopenharmony_ci    buffer is suitable for use as a <<shader-binding-table,Shader Binding
285e5c31af7Sopenharmony_ci    Table>>.
286e5c31af7Sopenharmony_ciendif::VK_KHR_ray_tracing_pipeline[]
287e5c31af7Sopenharmony_ciifdef::VK_KHR_acceleration_structure[]
288e5c31af7Sopenharmony_ci  * ename:VK_BUFFER_USAGE_ACCELERATION_STRUCTURE_BUILD_INPUT_READ_ONLY_BIT_KHR
289e5c31af7Sopenharmony_ci    specifies that the buffer is suitable for use as a read-only input to an
290e5c31af7Sopenharmony_ci    <<acceleration-structure-building,acceleration structure build>>.
291e5c31af7Sopenharmony_ci  * ename:VK_BUFFER_USAGE_ACCELERATION_STRUCTURE_STORAGE_BIT_KHR specifies
292e5c31af7Sopenharmony_ci    that the buffer is suitable for storage space for a
293e5c31af7Sopenharmony_ci    slink:VkAccelerationStructureKHR.
294e5c31af7Sopenharmony_ciendif::VK_KHR_acceleration_structure[]
295e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_EXT_buffer_device_address,VK_KHR_buffer_device_address[]
296e5c31af7Sopenharmony_ci  * ename:VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT specifies that the
297e5c31af7Sopenharmony_ci    buffer can: be used to retrieve a buffer device address via
298e5c31af7Sopenharmony_ci    flink:vkGetBufferDeviceAddress and use that address to access the
299e5c31af7Sopenharmony_ci    buffer's memory from a shader.
300e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_EXT_buffer_device_address,VK_KHR_buffer_device_address[]
301e5c31af7Sopenharmony_ciifdef::VK_KHR_video_decode_queue[]
302e5c31af7Sopenharmony_ci  * ename:VK_BUFFER_USAGE_VIDEO_DECODE_SRC_BIT_KHR specifies that the buffer
303e5c31af7Sopenharmony_ci    can: be used as the source bitstream buffer in a
304e5c31af7Sopenharmony_ci    <<video-decode-operations, video decode operation>>.
305e5c31af7Sopenharmony_ci  * ename:VK_BUFFER_USAGE_VIDEO_DECODE_DST_BIT_KHR specifies that the buffer
306e5c31af7Sopenharmony_ci    can: be used as the destination status buffer in a
307e5c31af7Sopenharmony_ci    <<video-decode-operations, video decode operation>>.
308e5c31af7Sopenharmony_ciendif::VK_KHR_video_decode_queue[]
309e5c31af7Sopenharmony_ciifdef::VK_KHR_video_encode_queue[]
310e5c31af7Sopenharmony_ci  * ename:VK_BUFFER_USAGE_VIDEO_ENCODE_DST_BIT_KHR specifies that the buffer
311e5c31af7Sopenharmony_ci    can: be used as the destination bitstream buffer in a
312e5c31af7Sopenharmony_ci    <<video-encode-operations, video encode operation>>.
313e5c31af7Sopenharmony_ci  * ename:VK_BUFFER_USAGE_VIDEO_ENCODE_DST_BIT_KHR specifies that the buffer
314e5c31af7Sopenharmony_ci    can: be used as the destination status buffer in a
315e5c31af7Sopenharmony_ci    <<video-encode-operations, video encode operation>>.
316e5c31af7Sopenharmony_ciendif::VK_KHR_video_encode_queue[]
317e5c31af7Sopenharmony_ci--
318e5c31af7Sopenharmony_ci
319e5c31af7Sopenharmony_ci[open,refpage='VkBufferUsageFlags',desc='Bitmask of VkBufferUsageFlagBits',type='flags']
320e5c31af7Sopenharmony_ci--
321e5c31af7Sopenharmony_ciinclude::{generated}/api/flags/VkBufferUsageFlags.txt[]
322e5c31af7Sopenharmony_ci
323e5c31af7Sopenharmony_citname:VkBufferUsageFlags is a bitmask type for setting a mask of zero or
324e5c31af7Sopenharmony_cimore elink:VkBufferUsageFlagBits.
325e5c31af7Sopenharmony_ci--
326e5c31af7Sopenharmony_ci
327e5c31af7Sopenharmony_ci[open,refpage='VkBufferCreateFlagBits',desc='Bitmask specifying additional parameters of a buffer',type='enums']
328e5c31af7Sopenharmony_ci--
329e5c31af7Sopenharmony_ciBits which can: be set in slink:VkBufferCreateInfo::pname:flags, specifying
330e5c31af7Sopenharmony_ciadditional parameters of a buffer, are:
331e5c31af7Sopenharmony_ci
332e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkBufferCreateFlagBits.txt[]
333e5c31af7Sopenharmony_ci
334e5c31af7Sopenharmony_ci  * ename:VK_BUFFER_CREATE_SPARSE_BINDING_BIT specifies that the buffer will
335e5c31af7Sopenharmony_ci    be backed using sparse memory binding.
336e5c31af7Sopenharmony_ci  * ename:VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT specifies that the buffer
337e5c31af7Sopenharmony_ci    can: be partially backed using sparse memory binding.
338e5c31af7Sopenharmony_ci    Buffers created with this flag must: also be created with the
339e5c31af7Sopenharmony_ci    ename:VK_BUFFER_CREATE_SPARSE_BINDING_BIT flag.
340e5c31af7Sopenharmony_ci  * ename:VK_BUFFER_CREATE_SPARSE_ALIASED_BIT specifies that the buffer will
341e5c31af7Sopenharmony_ci    be backed using sparse memory binding with memory ranges that might also
342e5c31af7Sopenharmony_ci    simultaneously be backing another buffer (or another portion of the same
343e5c31af7Sopenharmony_ci    buffer).
344e5c31af7Sopenharmony_ci    Buffers created with this flag must: also be created with the
345e5c31af7Sopenharmony_ci    ename:VK_BUFFER_CREATE_SPARSE_BINDING_BIT flag.
346e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1[]
347e5c31af7Sopenharmony_ci  * ename:VK_BUFFER_CREATE_PROTECTED_BIT specifies that the buffer is a
348e5c31af7Sopenharmony_ci    protected buffer.
349e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1[]
350e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_EXT_buffer_device_address,VK_KHR_buffer_device_address[]
351e5c31af7Sopenharmony_ci  * ename:VK_BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT specifies that
352e5c31af7Sopenharmony_ci    the buffer's address can: be saved and reused on a subsequent run (e.g.
353e5c31af7Sopenharmony_ci    for trace capture and replay), see
354e5c31af7Sopenharmony_ci    slink:VkBufferOpaqueCaptureAddressCreateInfo for more detail.
355e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_EXT_buffer_device_address,VK_KHR_buffer_device_address[]
356e5c31af7Sopenharmony_ci
357e5c31af7Sopenharmony_ciSee <<sparsememory-sparseresourcefeatures,Sparse Resource Features>> and
358e5c31af7Sopenharmony_ci<<features,Physical Device Features>> for details of the sparse memory
359e5c31af7Sopenharmony_cifeatures supported on a device.
360e5c31af7Sopenharmony_ci--
361e5c31af7Sopenharmony_ci
362e5c31af7Sopenharmony_ci[open,refpage='VkBufferCreateFlags',desc='Bitmask of VkBufferCreateFlagBits',type='flags']
363e5c31af7Sopenharmony_ci--
364e5c31af7Sopenharmony_ciinclude::{generated}/api/flags/VkBufferCreateFlags.txt[]
365e5c31af7Sopenharmony_ci
366e5c31af7Sopenharmony_citname:VkBufferCreateFlags is a bitmask type for setting a mask of zero or
367e5c31af7Sopenharmony_cimore elink:VkBufferCreateFlagBits.
368e5c31af7Sopenharmony_ci--
369e5c31af7Sopenharmony_ci
370e5c31af7Sopenharmony_ciifdef::VK_NV_dedicated_allocation[]
371e5c31af7Sopenharmony_ci[open,refpage='VkDedicatedAllocationBufferCreateInfoNV',desc='Specify that a buffer is bound to a dedicated memory resource',type='structs']
372e5c31af7Sopenharmony_ci--
373e5c31af7Sopenharmony_ciIf the pname:pNext chain includes a
374e5c31af7Sopenharmony_cisname:VkDedicatedAllocationBufferCreateInfoNV structure, then that structure
375e5c31af7Sopenharmony_ciincludes an enable controlling whether the buffer will have a dedicated
376e5c31af7Sopenharmony_cimemory allocation bound to it.
377e5c31af7Sopenharmony_ci
378e5c31af7Sopenharmony_ciThe sname:VkDedicatedAllocationBufferCreateInfoNV structure is defined as:
379e5c31af7Sopenharmony_ci
380e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkDedicatedAllocationBufferCreateInfoNV.txt[]
381e5c31af7Sopenharmony_ci
382e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure.
383e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
384e5c31af7Sopenharmony_ci    structure.
385e5c31af7Sopenharmony_ci  * pname:dedicatedAllocation specifies whether the buffer will have a
386e5c31af7Sopenharmony_ci    dedicated allocation bound to it.
387e5c31af7Sopenharmony_ci
388e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkDedicatedAllocationBufferCreateInfoNV.txt[]
389e5c31af7Sopenharmony_ci--
390e5c31af7Sopenharmony_ciendif::VK_NV_dedicated_allocation[]
391e5c31af7Sopenharmony_ci
392e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_external_memory[]
393e5c31af7Sopenharmony_ci[open,refpage='VkExternalMemoryBufferCreateInfo',desc='Specify that a buffer may be backed by external memory',type='structs']
394e5c31af7Sopenharmony_ci--
395e5c31af7Sopenharmony_ciTo define a set of external memory handle types that may: be used as backing
396e5c31af7Sopenharmony_cistore for a buffer, add a slink:VkExternalMemoryBufferCreateInfo structure
397e5c31af7Sopenharmony_cito the pname:pNext chain of the slink:VkBufferCreateInfo structure.
398e5c31af7Sopenharmony_ciThe sname:VkExternalMemoryBufferCreateInfo structure is defined as:
399e5c31af7Sopenharmony_ci
400e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkExternalMemoryBufferCreateInfo.txt[]
401e5c31af7Sopenharmony_ci
402e5c31af7Sopenharmony_ciifdef::VK_KHR_external_memory[]
403e5c31af7Sopenharmony_cior the equivalent
404e5c31af7Sopenharmony_ci
405e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkExternalMemoryBufferCreateInfoKHR.txt[]
406e5c31af7Sopenharmony_ciendif::VK_KHR_external_memory[]
407e5c31af7Sopenharmony_ci
408e5c31af7Sopenharmony_ci[NOTE]
409e5c31af7Sopenharmony_ci.Note
410e5c31af7Sopenharmony_ci====
411e5c31af7Sopenharmony_ciA sname:VkExternalMemoryBufferCreateInfo structure with a non-zero
412e5c31af7Sopenharmony_cipname:handleTypes field must be included in the creation parameters for a
413e5c31af7Sopenharmony_cibuffer that will be bound to memory that is either exported or imported.
414e5c31af7Sopenharmony_ci====
415e5c31af7Sopenharmony_ci
416e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure.
417e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
418e5c31af7Sopenharmony_ci    structure.
419e5c31af7Sopenharmony_ci  * pname:handleTypes is zero, or a bitmask of
420e5c31af7Sopenharmony_ci    elink:VkExternalMemoryHandleTypeFlagBits specifying one or more external
421e5c31af7Sopenharmony_ci    memory handle types.
422e5c31af7Sopenharmony_ci
423e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkExternalMemoryBufferCreateInfo.txt[]
424e5c31af7Sopenharmony_ci--
425e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_external_memory[]
426e5c31af7Sopenharmony_ci
427e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_KHR_buffer_device_address[]
428e5c31af7Sopenharmony_ci[open,refpage='VkBufferOpaqueCaptureAddressCreateInfo',desc='Request a specific address for a buffer',type='structs',alias='VkBufferOpaqueCaptureAddressCreateInfoKHR']
429e5c31af7Sopenharmony_ci--
430e5c31af7Sopenharmony_ciTo request a specific device address for a buffer, add a
431e5c31af7Sopenharmony_cislink:VkBufferOpaqueCaptureAddressCreateInfo structure to the pname:pNext
432e5c31af7Sopenharmony_cichain of the slink:VkBufferCreateInfo structure.
433e5c31af7Sopenharmony_ciThe sname:VkBufferOpaqueCaptureAddressCreateInfo structure is defined as:
434e5c31af7Sopenharmony_ci
435e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkBufferOpaqueCaptureAddressCreateInfo.txt[]
436e5c31af7Sopenharmony_ci
437e5c31af7Sopenharmony_ciifdef::VK_KHR_buffer_device_address[]
438e5c31af7Sopenharmony_cior the equivalent
439e5c31af7Sopenharmony_ci
440e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkBufferOpaqueCaptureAddressCreateInfoKHR.txt[]
441e5c31af7Sopenharmony_ciendif::VK_KHR_buffer_device_address[]
442e5c31af7Sopenharmony_ci
443e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure.
444e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
445e5c31af7Sopenharmony_ci    structure.
446e5c31af7Sopenharmony_ci  * pname:opaqueCaptureAddress is the opaque capture address requested for
447e5c31af7Sopenharmony_ci    the buffer.
448e5c31af7Sopenharmony_ci
449e5c31af7Sopenharmony_ciIf pname:opaqueCaptureAddress is zero, no specific address is requested.
450e5c31af7Sopenharmony_ci
451e5c31af7Sopenharmony_ciIf pname:opaqueCaptureAddress is not zero, then it should: be an address
452e5c31af7Sopenharmony_ciretrieved from flink:vkGetBufferOpaqueCaptureAddress for an identically
453e5c31af7Sopenharmony_cicreated buffer on the same implementation.
454e5c31af7Sopenharmony_ci
455e5c31af7Sopenharmony_ciIf this structure is not present, it is as if pname:opaqueCaptureAddress is
456e5c31af7Sopenharmony_cizero.
457e5c31af7Sopenharmony_ci
458e5c31af7Sopenharmony_ciApps should: avoid creating buffers with app-provided addresses and
459e5c31af7Sopenharmony_ciimplementation-provided addresses in the same process, to reduce the
460e5c31af7Sopenharmony_cilikelihood of ename:VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS errors.
461e5c31af7Sopenharmony_ci
462e5c31af7Sopenharmony_ci[NOTE]
463e5c31af7Sopenharmony_ci.Note
464e5c31af7Sopenharmony_ci====
465e5c31af7Sopenharmony_ciThe expected usage for this is that a trace capture/replay tool will add the
466e5c31af7Sopenharmony_ciename:VK_BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT flag to all buffers
467e5c31af7Sopenharmony_cithat use ename:VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT, and during capture
468e5c31af7Sopenharmony_ciwill save the queried opaque device addresses in the trace.
469e5c31af7Sopenharmony_ciDuring replay, the buffers will be created specifying the original address
470e5c31af7Sopenharmony_ciso any address values stored in the trace data will remain valid.
471e5c31af7Sopenharmony_ci
472e5c31af7Sopenharmony_ciImplementations are expected to separate such buffers in the GPU address
473e5c31af7Sopenharmony_cispace so normal allocations will avoid using these addresses.
474e5c31af7Sopenharmony_ciApps/tools should avoid mixing app-provided and implementation-provided
475e5c31af7Sopenharmony_ciaddresses for buffers created with
476e5c31af7Sopenharmony_ciename:VK_BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT, to avoid address
477e5c31af7Sopenharmony_cispace allocation conflicts.
478e5c31af7Sopenharmony_ci====
479e5c31af7Sopenharmony_ci
480e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkBufferOpaqueCaptureAddressCreateInfo.txt[]
481e5c31af7Sopenharmony_ci--
482e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_KHR_buffer_device_address[]
483e5c31af7Sopenharmony_ci
484e5c31af7Sopenharmony_ciifdef::VK_EXT_buffer_device_address[]
485e5c31af7Sopenharmony_ci[open,refpage='VkBufferDeviceAddressCreateInfoEXT',desc='Request a specific address for a buffer',type='structs']
486e5c31af7Sopenharmony_ci--
487e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_KHR_buffer_device_address[]
488e5c31af7Sopenharmony_ciAlternatively, to
489e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_KHR_buffer_device_address[]
490e5c31af7Sopenharmony_ciifndef::VK_VERSION_1_2,VK_KHR_buffer_device_address[]
491e5c31af7Sopenharmony_ciTo
492e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_KHR_buffer_device_address[]
493e5c31af7Sopenharmony_cirequest a specific device address for a buffer, add a
494e5c31af7Sopenharmony_cislink:VkBufferDeviceAddressCreateInfoEXT structure to the pname:pNext chain
495e5c31af7Sopenharmony_ciof the slink:VkBufferCreateInfo structure.
496e5c31af7Sopenharmony_ciThe sname:VkBufferDeviceAddressCreateInfoEXT structure is defined as:
497e5c31af7Sopenharmony_ci
498e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkBufferDeviceAddressCreateInfoEXT.txt[]
499e5c31af7Sopenharmony_ci
500e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure.
501e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
502e5c31af7Sopenharmony_ci    structure.
503e5c31af7Sopenharmony_ci  * pname:deviceAddress is the device address requested for the buffer.
504e5c31af7Sopenharmony_ci
505e5c31af7Sopenharmony_ciIf pname:deviceAddress is zero, no specific address is requested.
506e5c31af7Sopenharmony_ci
507e5c31af7Sopenharmony_ciIf pname:deviceAddress is not zero, then it must: be an address retrieved
508e5c31af7Sopenharmony_cifrom an identically created buffer on the same implementation.
509e5c31af7Sopenharmony_ciThe buffer must: also be bound to an identically created
510e5c31af7Sopenharmony_cisname:VkDeviceMemory object.
511e5c31af7Sopenharmony_ci
512e5c31af7Sopenharmony_ciIf this structure is not present, it is as if pname:deviceAddress is zero.
513e5c31af7Sopenharmony_ci
514e5c31af7Sopenharmony_ciApps should: avoid creating buffers with app-provided addresses and
515e5c31af7Sopenharmony_ciimplementation-provided addresses in the same process, to reduce the
516e5c31af7Sopenharmony_cilikelihood of ename:VK_ERROR_INVALID_DEVICE_ADDRESS_EXT errors.
517e5c31af7Sopenharmony_ci
518e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkBufferDeviceAddressCreateInfoEXT.txt[]
519e5c31af7Sopenharmony_ci--
520e5c31af7Sopenharmony_ciendif::VK_EXT_buffer_device_address[]
521e5c31af7Sopenharmony_ci
522e5c31af7Sopenharmony_ci
523e5c31af7Sopenharmony_ciifdef::VK_FUCHSIA_buffer_collection[]
524e5c31af7Sopenharmony_ci[open,refpage='VkBufferCollectionBufferCreateInfoFUCHSIA',desc='Create a VkBufferCollectionFUCHSIA-compatible VkBuffer',type='structs']
525e5c31af7Sopenharmony_ci--
526e5c31af7Sopenharmony_ciThe sname:VkBufferCollectionBufferCreateInfoFUCHSIA structure is defined as:
527e5c31af7Sopenharmony_ci
528e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkBufferCollectionBufferCreateInfoFUCHSIA.txt[]
529e5c31af7Sopenharmony_ci
530e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure
531e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
532e5c31af7Sopenharmony_ci    structure
533e5c31af7Sopenharmony_ci  * pname:collection is the slink:VkBufferCollectionFUCHSIA handle
534e5c31af7Sopenharmony_ci  * pname:index is the index of the buffer in the buffer collection from
535e5c31af7Sopenharmony_ci    which the memory will be imported
536e5c31af7Sopenharmony_ci
537e5c31af7Sopenharmony_ci.Valid Usage
538e5c31af7Sopenharmony_ci****
539e5c31af7Sopenharmony_ci  * [[VUID-VkBufferCollectionBufferCreateInfoFUCHSIA-index-06388]]
540e5c31af7Sopenharmony_ci    pname:index must: be less than
541e5c31af7Sopenharmony_ci    slink:VkBufferCollectionPropertiesFUCHSIA::pname:bufferCount
542e5c31af7Sopenharmony_ci****
543e5c31af7Sopenharmony_ci
544e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkBufferCollectionBufferCreateInfoFUCHSIA.txt[]
545e5c31af7Sopenharmony_ci--
546e5c31af7Sopenharmony_ciendif::VK_FUCHSIA_buffer_collection[]
547e5c31af7Sopenharmony_ci
548e5c31af7Sopenharmony_ci[open,refpage='vkDestroyBuffer',desc='Destroy a buffer object',type='protos']
549e5c31af7Sopenharmony_ci--
550e5c31af7Sopenharmony_ciTo destroy a buffer, call:
551e5c31af7Sopenharmony_ci
552e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkDestroyBuffer.txt[]
553e5c31af7Sopenharmony_ci
554e5c31af7Sopenharmony_ci  * pname:device is the logical device that destroys the buffer.
555e5c31af7Sopenharmony_ci  * pname:buffer is the buffer to destroy.
556e5c31af7Sopenharmony_ci  * pname:pAllocator controls host memory allocation as described in the
557e5c31af7Sopenharmony_ci    <<memory-allocation, Memory Allocation>> chapter.
558e5c31af7Sopenharmony_ci
559e5c31af7Sopenharmony_ci.Valid Usage
560e5c31af7Sopenharmony_ci****
561e5c31af7Sopenharmony_ci  * [[VUID-vkDestroyBuffer-buffer-00922]]
562e5c31af7Sopenharmony_ci    All submitted commands that refer to pname:buffer, either directly or
563e5c31af7Sopenharmony_ci    via a sname:VkBufferView, must: have completed execution
564e5c31af7Sopenharmony_ci  * [[VUID-vkDestroyBuffer-buffer-00923]]
565e5c31af7Sopenharmony_ci    If sname:VkAllocationCallbacks were provided when pname:buffer was
566e5c31af7Sopenharmony_ci    created, a compatible set of callbacks must: be provided here
567e5c31af7Sopenharmony_ci  * [[VUID-vkDestroyBuffer-buffer-00924]]
568e5c31af7Sopenharmony_ci    If no sname:VkAllocationCallbacks were provided when pname:buffer was
569e5c31af7Sopenharmony_ci    created, pname:pAllocator must: be `NULL`
570e5c31af7Sopenharmony_ci****
571e5c31af7Sopenharmony_ci
572e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkDestroyBuffer.txt[]
573e5c31af7Sopenharmony_ci--
574e5c31af7Sopenharmony_ci
575e5c31af7Sopenharmony_ci
576e5c31af7Sopenharmony_ci[[resources-buffer-views]]
577e5c31af7Sopenharmony_ci== Buffer Views
578e5c31af7Sopenharmony_ci
579e5c31af7Sopenharmony_ci[open,refpage='VkBufferView',desc='Opaque handle to a buffer view object',type='handles']
580e5c31af7Sopenharmony_ci--
581e5c31af7Sopenharmony_ciA _buffer view_ represents a contiguous range of a buffer and a specific
582e5c31af7Sopenharmony_ciformat to be used to interpret the data.
583e5c31af7Sopenharmony_ciBuffer views are used to enable shaders to access buffer contents
584e5c31af7Sopenharmony_ciinterpreted as formatted data.
585e5c31af7Sopenharmony_ciIn order to create a valid buffer view, the buffer must: have been created
586e5c31af7Sopenharmony_ciwith at least one of the following usage flags:
587e5c31af7Sopenharmony_ci
588e5c31af7Sopenharmony_ci  * ename:VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT
589e5c31af7Sopenharmony_ci  * ename:VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT
590e5c31af7Sopenharmony_ci
591e5c31af7Sopenharmony_ciBuffer views are represented by sname:VkBufferView handles:
592e5c31af7Sopenharmony_ci
593e5c31af7Sopenharmony_ciinclude::{generated}/api/handles/VkBufferView.txt[]
594e5c31af7Sopenharmony_ci--
595e5c31af7Sopenharmony_ci
596e5c31af7Sopenharmony_ci[open,refpage='vkCreateBufferView',desc='Create a new buffer view object',type='protos']
597e5c31af7Sopenharmony_ci--
598e5c31af7Sopenharmony_ciTo create a buffer view, call:
599e5c31af7Sopenharmony_ci
600e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCreateBufferView.txt[]
601e5c31af7Sopenharmony_ci
602e5c31af7Sopenharmony_ci  * pname:device is the logical device that creates the buffer view.
603e5c31af7Sopenharmony_ci  * pname:pCreateInfo is a pointer to a slink:VkBufferViewCreateInfo
604e5c31af7Sopenharmony_ci    structure containing parameters to be used to create the buffer view.
605e5c31af7Sopenharmony_ci  * pname:pAllocator controls host memory allocation as described in the
606e5c31af7Sopenharmony_ci    <<memory-allocation, Memory Allocation>> chapter.
607e5c31af7Sopenharmony_ci  * pname:pView is a pointer to a slink:VkBufferView handle in which the
608e5c31af7Sopenharmony_ci    resulting buffer view object is returned.
609e5c31af7Sopenharmony_ci
610e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCreateBufferView.txt[]
611e5c31af7Sopenharmony_ci--
612e5c31af7Sopenharmony_ci
613e5c31af7Sopenharmony_ci[open,refpage='VkBufferViewCreateInfo',desc='Structure specifying parameters of a newly created buffer view',type='structs']
614e5c31af7Sopenharmony_ci--
615e5c31af7Sopenharmony_ciThe sname:VkBufferViewCreateInfo structure is defined as:
616e5c31af7Sopenharmony_ci
617e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkBufferViewCreateInfo.txt[]
618e5c31af7Sopenharmony_ci
619e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure.
620e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
621e5c31af7Sopenharmony_ci    structure.
622e5c31af7Sopenharmony_ci  * pname:flags is reserved for future use.
623e5c31af7Sopenharmony_ci  * pname:buffer is a slink:VkBuffer on which the view will be created.
624e5c31af7Sopenharmony_ci  * pname:format is a elink:VkFormat describing the format of the data
625e5c31af7Sopenharmony_ci    elements in the buffer.
626e5c31af7Sopenharmony_ci  * pname:offset is an offset in bytes from the base address of the buffer.
627e5c31af7Sopenharmony_ci    Accesses to the buffer view from shaders use addressing that is relative
628e5c31af7Sopenharmony_ci    to this starting offset.
629e5c31af7Sopenharmony_ci  * pname:range is a size in bytes of the buffer view.
630e5c31af7Sopenharmony_ci    If pname:range is equal to ename:VK_WHOLE_SIZE, the range from
631e5c31af7Sopenharmony_ci    pname:offset to the end of the buffer is used.
632e5c31af7Sopenharmony_ci    If ename:VK_WHOLE_SIZE is used and the remaining size of the buffer is
633e5c31af7Sopenharmony_ci    not a multiple of the <<texel-block-size, texel block size>> of
634e5c31af7Sopenharmony_ci    pname:format, the nearest smaller multiple is used.
635e5c31af7Sopenharmony_ci
636e5c31af7Sopenharmony_ci.Valid Usage
637e5c31af7Sopenharmony_ci****
638e5c31af7Sopenharmony_ci  * [[VUID-VkBufferViewCreateInfo-offset-00925]]
639e5c31af7Sopenharmony_ci    pname:offset must: be less than the size of pname:buffer
640e5c31af7Sopenharmony_ciifndef::VK_EXT_texel_buffer_alignment[]
641e5c31af7Sopenharmony_ci  * [[VUID-VkBufferViewCreateInfo-offset-00926]]
642e5c31af7Sopenharmony_ci    pname:offset must: be a multiple of
643e5c31af7Sopenharmony_ci    sname:VkPhysicalDeviceLimits::pname:minTexelBufferOffsetAlignment
644e5c31af7Sopenharmony_ciendif::VK_EXT_texel_buffer_alignment[]
645e5c31af7Sopenharmony_ci  * [[VUID-VkBufferViewCreateInfo-range-00928]]
646e5c31af7Sopenharmony_ci    If pname:range is not equal to ename:VK_WHOLE_SIZE, pname:range must: be
647e5c31af7Sopenharmony_ci    greater than `0`
648e5c31af7Sopenharmony_ci  * [[VUID-VkBufferViewCreateInfo-range-00929]]
649e5c31af7Sopenharmony_ci    If pname:range is not equal to ename:VK_WHOLE_SIZE, pname:range must: be
650e5c31af7Sopenharmony_ci    an integer multiple of the texel block size of pname:format
651e5c31af7Sopenharmony_ci  * [[VUID-VkBufferViewCreateInfo-range-00930]]
652e5c31af7Sopenharmony_ci    If pname:range is not equal to ename:VK_WHOLE_SIZE, the number of texel
653e5c31af7Sopenharmony_ci    buffer elements given by [eq]#({lfloor}pname:range / (texel block
654e5c31af7Sopenharmony_ci    size){rfloor} {times} (texels per block))# where texel block size and
655e5c31af7Sopenharmony_ci    texels per block are as defined in the <<formats-compatibility,
656e5c31af7Sopenharmony_ci    Compatible Formats>> table for pname:format, must: be less than or equal
657e5c31af7Sopenharmony_ci    to sname:VkPhysicalDeviceLimits::pname:maxTexelBufferElements
658e5c31af7Sopenharmony_ci  * [[VUID-VkBufferViewCreateInfo-offset-00931]]
659e5c31af7Sopenharmony_ci    If pname:range is not equal to ename:VK_WHOLE_SIZE, the sum of
660e5c31af7Sopenharmony_ci    pname:offset and pname:range must: be less than or equal to the size of
661e5c31af7Sopenharmony_ci    pname:buffer
662e5c31af7Sopenharmony_ci  * [[VUID-VkBufferViewCreateInfo-range-04059]]
663e5c31af7Sopenharmony_ci    If pname:range is equal to ename:VK_WHOLE_SIZE, the number of texel
664e5c31af7Sopenharmony_ci    buffer elements given by [eq]#({lfloor}(size - pname:offset) / (texel
665e5c31af7Sopenharmony_ci    block size){rfloor} {times} (texels per block))# where size is the size
666e5c31af7Sopenharmony_ci    of pname:buffer, and texel block size and texels per block are as
667e5c31af7Sopenharmony_ci    defined in the <<formats-compatibility, Compatible Formats>> table for
668e5c31af7Sopenharmony_ci    pname:format, must: be less than or equal to
669e5c31af7Sopenharmony_ci    sname:VkPhysicalDeviceLimits::pname:maxTexelBufferElements
670e5c31af7Sopenharmony_ci  * [[VUID-VkBufferViewCreateInfo-buffer-00932]]
671e5c31af7Sopenharmony_ci    pname:buffer must: have been created with a pname:usage value containing
672e5c31af7Sopenharmony_ci    at least one of ename:VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT or
673e5c31af7Sopenharmony_ci    ename:VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT
674e5c31af7Sopenharmony_ci  * [[VUID-VkBufferViewCreateInfo-buffer-00933]]
675e5c31af7Sopenharmony_ci    If pname:buffer was created with pname:usage containing
676e5c31af7Sopenharmony_ci    ename:VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT, pname:format must: be
677e5c31af7Sopenharmony_ci    supported for uniform texel buffers, as specified by the
678e5c31af7Sopenharmony_ci    ename:VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT flag in
679e5c31af7Sopenharmony_ci    sname:VkFormatProperties::pname:bufferFeatures returned by
680e5c31af7Sopenharmony_ci    flink:vkGetPhysicalDeviceFormatProperties
681e5c31af7Sopenharmony_ci  * [[VUID-VkBufferViewCreateInfo-buffer-00934]]
682e5c31af7Sopenharmony_ci    If pname:buffer was created with pname:usage containing
683e5c31af7Sopenharmony_ci    ename:VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT, pname:format must: be
684e5c31af7Sopenharmony_ci    supported for storage texel buffers, as specified by the
685e5c31af7Sopenharmony_ci    ename:VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT flag in
686e5c31af7Sopenharmony_ci    sname:VkFormatProperties::pname:bufferFeatures returned by
687e5c31af7Sopenharmony_ci    flink:vkGetPhysicalDeviceFormatProperties
688e5c31af7Sopenharmony_ci  * [[VUID-VkBufferViewCreateInfo-buffer-00935]]
689e5c31af7Sopenharmony_ci    If pname:buffer is non-sparse then it must: be bound completely and
690e5c31af7Sopenharmony_ci    contiguously to a single sname:VkDeviceMemory object
691e5c31af7Sopenharmony_ciifdef::VK_EXT_texel_buffer_alignment[]
692e5c31af7Sopenharmony_ci  * [[VUID-VkBufferViewCreateInfo-offset-02749]]
693e5c31af7Sopenharmony_ci    If the <<features-texelBufferAlignment,texelBufferAlignment>> feature is
694e5c31af7Sopenharmony_ci    not enabled, pname:offset must: be a multiple of
695e5c31af7Sopenharmony_ci    sname:VkPhysicalDeviceLimits::pname:minTexelBufferOffsetAlignment
696e5c31af7Sopenharmony_ci  * [[VUID-VkBufferViewCreateInfo-buffer-02750]]
697e5c31af7Sopenharmony_ci    If the <<features-texelBufferAlignment,texelBufferAlignment>> feature is
698e5c31af7Sopenharmony_ci    enabled and if pname:buffer was created with pname:usage containing
699e5c31af7Sopenharmony_ci    ename:VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT, pname:offset must: be a
700e5c31af7Sopenharmony_ci    multiple of the lesser of
701e5c31af7Sopenharmony_ci    slink:VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT::pname:storageTexelBufferOffsetAlignmentBytes
702e5c31af7Sopenharmony_ci    or, if
703e5c31af7Sopenharmony_ci    slink:VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT::pname:storageTexelBufferOffsetSingleTexelAlignment
704e5c31af7Sopenharmony_ci    is ename:VK_TRUE, the size of a texel of the requested pname:format.
705e5c31af7Sopenharmony_ci    If the size of a texel is a multiple of three bytes, then the size of a
706e5c31af7Sopenharmony_ci    single component of pname:format is used instead
707e5c31af7Sopenharmony_ci  * [[VUID-VkBufferViewCreateInfo-buffer-02751]]
708e5c31af7Sopenharmony_ci    If the <<features-texelBufferAlignment,texelBufferAlignment>> feature is
709e5c31af7Sopenharmony_ci    enabled and if pname:buffer was created with pname:usage containing
710e5c31af7Sopenharmony_ci    ename:VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT, pname:offset must: be a
711e5c31af7Sopenharmony_ci    multiple of the lesser of
712e5c31af7Sopenharmony_ci    slink:VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT::pname:uniformTexelBufferOffsetAlignmentBytes
713e5c31af7Sopenharmony_ci    or, if
714e5c31af7Sopenharmony_ci    slink:VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT::pname:uniformTexelBufferOffsetSingleTexelAlignment
715e5c31af7Sopenharmony_ci    is ename:VK_TRUE, the size of a texel of the requested pname:format.
716e5c31af7Sopenharmony_ci    If the size of a texel is a multiple of three bytes, then the size of a
717e5c31af7Sopenharmony_ci    single component of pname:format is used instead
718e5c31af7Sopenharmony_ciendif::VK_EXT_texel_buffer_alignment[]
719e5c31af7Sopenharmony_ci****
720e5c31af7Sopenharmony_ci
721e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkBufferViewCreateInfo.txt[]
722e5c31af7Sopenharmony_ci--
723e5c31af7Sopenharmony_ci
724e5c31af7Sopenharmony_ci[open,refpage='VkBufferViewCreateFlags',desc='Reserved for future use',type='flags']
725e5c31af7Sopenharmony_ci--
726e5c31af7Sopenharmony_ciinclude::{generated}/api/flags/VkBufferViewCreateFlags.txt[]
727e5c31af7Sopenharmony_ci
728e5c31af7Sopenharmony_citname:VkBufferViewCreateFlags is a bitmask type for setting a mask, but is
729e5c31af7Sopenharmony_cicurrently reserved for future use.
730e5c31af7Sopenharmony_ci--
731e5c31af7Sopenharmony_ci
732e5c31af7Sopenharmony_ci[open,refpage='vkDestroyBufferView',desc='Destroy a buffer view object',type='protos']
733e5c31af7Sopenharmony_ci--
734e5c31af7Sopenharmony_ciTo destroy a buffer view, call:
735e5c31af7Sopenharmony_ci
736e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkDestroyBufferView.txt[]
737e5c31af7Sopenharmony_ci
738e5c31af7Sopenharmony_ci  * pname:device is the logical device that destroys the buffer view.
739e5c31af7Sopenharmony_ci  * pname:bufferView is the buffer view to destroy.
740e5c31af7Sopenharmony_ci  * pname:pAllocator controls host memory allocation as described in the
741e5c31af7Sopenharmony_ci    <<memory-allocation, Memory Allocation>> chapter.
742e5c31af7Sopenharmony_ci
743e5c31af7Sopenharmony_ci.Valid Usage
744e5c31af7Sopenharmony_ci****
745e5c31af7Sopenharmony_ci  * [[VUID-vkDestroyBufferView-bufferView-00936]]
746e5c31af7Sopenharmony_ci    All submitted commands that refer to pname:bufferView must: have
747e5c31af7Sopenharmony_ci    completed execution
748e5c31af7Sopenharmony_ci  * [[VUID-vkDestroyBufferView-bufferView-00937]]
749e5c31af7Sopenharmony_ci    If sname:VkAllocationCallbacks were provided when pname:bufferView was
750e5c31af7Sopenharmony_ci    created, a compatible set of callbacks must: be provided here
751e5c31af7Sopenharmony_ci  * [[VUID-vkDestroyBufferView-bufferView-00938]]
752e5c31af7Sopenharmony_ci    If no sname:VkAllocationCallbacks were provided when pname:bufferView
753e5c31af7Sopenharmony_ci    was created, pname:pAllocator must: be `NULL`
754e5c31af7Sopenharmony_ci****
755e5c31af7Sopenharmony_ci
756e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkDestroyBufferView.txt[]
757e5c31af7Sopenharmony_ci--
758e5c31af7Sopenharmony_ci
759e5c31af7Sopenharmony_ci
760e5c31af7Sopenharmony_ci[[resources-images]]
761e5c31af7Sopenharmony_ci== Images
762e5c31af7Sopenharmony_ci
763e5c31af7Sopenharmony_ci[open,refpage='VkImage',desc='Opaque handle to an image object',type='handles']
764e5c31af7Sopenharmony_ci--
765e5c31af7Sopenharmony_ciImages represent multidimensional - up to 3 - arrays of data which can: be
766e5c31af7Sopenharmony_ciused for various purposes (e.g. attachments, textures), by binding them to a
767e5c31af7Sopenharmony_cigraphics or compute pipeline via descriptor sets, or by directly specifying
768e5c31af7Sopenharmony_cithem as parameters to certain commands.
769e5c31af7Sopenharmony_ci
770e5c31af7Sopenharmony_ciImages are represented by sname:VkImage handles:
771e5c31af7Sopenharmony_ci
772e5c31af7Sopenharmony_ciinclude::{generated}/api/handles/VkImage.txt[]
773e5c31af7Sopenharmony_ci--
774e5c31af7Sopenharmony_ci
775e5c31af7Sopenharmony_ci[open,refpage='vkCreateImage',desc='Create a new image object',type='protos']
776e5c31af7Sopenharmony_ci--
777e5c31af7Sopenharmony_ciTo create images, call:
778e5c31af7Sopenharmony_ci
779e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCreateImage.txt[]
780e5c31af7Sopenharmony_ci
781e5c31af7Sopenharmony_ci  * pname:device is the logical device that creates the image.
782e5c31af7Sopenharmony_ci  * pname:pCreateInfo is a pointer to a slink:VkImageCreateInfo structure
783e5c31af7Sopenharmony_ci    containing parameters to be used to create the image.
784e5c31af7Sopenharmony_ci  * pname:pAllocator controls host memory allocation as described in the
785e5c31af7Sopenharmony_ci    <<memory-allocation, Memory Allocation>> chapter.
786e5c31af7Sopenharmony_ci  * pname:pImage is a pointer to a slink:VkImage handle in which the
787e5c31af7Sopenharmony_ci    resulting image object is returned.
788e5c31af7Sopenharmony_ci
789e5c31af7Sopenharmony_ci.Valid Usage
790e5c31af7Sopenharmony_ci****
791e5c31af7Sopenharmony_ci  * [[VUID-vkCreateImage-flags-00939]]
792e5c31af7Sopenharmony_ci    If the pname:flags member of pname:pCreateInfo includes
793e5c31af7Sopenharmony_ci    ename:VK_IMAGE_CREATE_SPARSE_BINDING_BIT, creating this sname:VkImage
794e5c31af7Sopenharmony_ci    must: not cause the total required sparse memory for all currently valid
795e5c31af7Sopenharmony_ci    sparse resources on the device to exceed
796e5c31af7Sopenharmony_ci    sname:VkPhysicalDeviceLimits::pname:sparseAddressSpaceSize
797e5c31af7Sopenharmony_ciifdef::VK_FUCHSIA_buffer_collection[]
798e5c31af7Sopenharmony_ci  * [[VUID-vkCreateImage-pNext-06389]]
799e5c31af7Sopenharmony_ci    If a slink:VkBufferCollectionImageCreateInfoFUCHSIA has been chained to
800e5c31af7Sopenharmony_ci    pname:pNext, pname:pCreateInfo must: match the
801e5c31af7Sopenharmony_ci    <<sysmem-chosen-create-infos,Sysmem chosen sname:VkImageCreateInfo>>
802e5c31af7Sopenharmony_ci    excepting members slink:VkImageCreateInfo::pname:extent and
803e5c31af7Sopenharmony_ci    slink:VkImageCreateInfo::pname:usage in the match criteria
804e5c31af7Sopenharmony_ciendif::VK_FUCHSIA_buffer_collection[]
805e5c31af7Sopenharmony_ci****
806e5c31af7Sopenharmony_ci
807e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCreateImage.txt[]
808e5c31af7Sopenharmony_ci--
809e5c31af7Sopenharmony_ci
810e5c31af7Sopenharmony_ci[open,refpage='VkImageCreateInfo',desc='Structure specifying the parameters of a newly created image object',type='structs']
811e5c31af7Sopenharmony_ci--
812e5c31af7Sopenharmony_ciThe sname:VkImageCreateInfo structure is defined as:
813e5c31af7Sopenharmony_ci
814e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkImageCreateInfo.txt[]
815e5c31af7Sopenharmony_ci
816e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure.
817e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
818e5c31af7Sopenharmony_ci    structure.
819e5c31af7Sopenharmony_ci  * pname:flags is a bitmask of elink:VkImageCreateFlagBits describing
820e5c31af7Sopenharmony_ci    additional parameters of the image.
821e5c31af7Sopenharmony_ci  * pname:imageType is a elink:VkImageType value specifying the basic
822e5c31af7Sopenharmony_ci    dimensionality of the image.
823e5c31af7Sopenharmony_ci    Layers in array textures do not count as a dimension for the purposes of
824e5c31af7Sopenharmony_ci    the image type.
825e5c31af7Sopenharmony_ci  * pname:format is a elink:VkFormat describing the format and type of the
826e5c31af7Sopenharmony_ci    texel blocks that will be contained in the image.
827e5c31af7Sopenharmony_ci  * pname:extent is a slink:VkExtent3D describing the number of data
828e5c31af7Sopenharmony_ci    elements in each dimension of the base level.
829e5c31af7Sopenharmony_ci  * pname:mipLevels describes the number of levels of detail available for
830e5c31af7Sopenharmony_ci    minified sampling of the image.
831e5c31af7Sopenharmony_ci  * pname:arrayLayers is the number of layers in the image.
832e5c31af7Sopenharmony_ci  * pname:samples is a elink:VkSampleCountFlagBits value specifying the
833e5c31af7Sopenharmony_ci    number of <<primsrast-multisampling,samples per texel>>.
834e5c31af7Sopenharmony_ci  * pname:tiling is a elink:VkImageTiling value specifying the tiling
835e5c31af7Sopenharmony_ci    arrangement of the texel blocks in memory.
836e5c31af7Sopenharmony_ci  * pname:usage is a bitmask of elink:VkImageUsageFlagBits describing the
837e5c31af7Sopenharmony_ci    intended usage of the image.
838e5c31af7Sopenharmony_ci  * pname:sharingMode is a elink:VkSharingMode value specifying the sharing
839e5c31af7Sopenharmony_ci    mode of the image when it will be accessed by multiple queue families.
840e5c31af7Sopenharmony_ci  * pname:queueFamilyIndexCount is the number of entries in the
841e5c31af7Sopenharmony_ci    pname:pQueueFamilyIndices array.
842e5c31af7Sopenharmony_ci  * pname:pQueueFamilyIndices is a pointer to an array of queue families
843e5c31af7Sopenharmony_ci    that will access this image.
844e5c31af7Sopenharmony_ci    It is ignored if pname:sharingMode is not
845e5c31af7Sopenharmony_ci    ename:VK_SHARING_MODE_CONCURRENT.
846e5c31af7Sopenharmony_ci  * pname:initialLayout is a elink:VkImageLayout value specifying the
847e5c31af7Sopenharmony_ci    initial elink:VkImageLayout of all image subresources of the image.
848e5c31af7Sopenharmony_ci    See <<resources-image-layouts,Image Layouts>>.
849e5c31af7Sopenharmony_ci
850e5c31af7Sopenharmony_ciImages created with pname:tiling equal to ename:VK_IMAGE_TILING_LINEAR have
851e5c31af7Sopenharmony_cifurther restrictions on their limits and capabilities compared to images
852e5c31af7Sopenharmony_cicreated with pname:tiling equal to ename:VK_IMAGE_TILING_OPTIMAL.
853e5c31af7Sopenharmony_ciCreation of images with tiling ename:VK_IMAGE_TILING_LINEAR may: not be
854e5c31af7Sopenharmony_cisupported unless other parameters meet all of the constraints:
855e5c31af7Sopenharmony_ci
856e5c31af7Sopenharmony_ci  * pname:imageType is ename:VK_IMAGE_TYPE_2D
857e5c31af7Sopenharmony_ci  * pname:format is not a depth/stencil format
858e5c31af7Sopenharmony_ci  * pname:mipLevels is 1
859e5c31af7Sopenharmony_ci  * pname:arrayLayers is 1
860e5c31af7Sopenharmony_ci  * pname:samples is ename:VK_SAMPLE_COUNT_1_BIT
861e5c31af7Sopenharmony_ci  * pname:usage only includes ename:VK_IMAGE_USAGE_TRANSFER_SRC_BIT and/or
862e5c31af7Sopenharmony_ci    ename:VK_IMAGE_USAGE_TRANSFER_DST_BIT
863e5c31af7Sopenharmony_ci
864e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
865e5c31af7Sopenharmony_ciImages created with one of the <<formats-requiring-sampler-ycbcr-conversion,
866e5c31af7Sopenharmony_ciformats that require a sampler Y'C~B~C~R~ conversion>>, have further
867e5c31af7Sopenharmony_cirestrictions on their limits and capabilities compared to images created
868e5c31af7Sopenharmony_ciwith other formats.
869e5c31af7Sopenharmony_ciCreation of images with a format requiring
870e5c31af7Sopenharmony_ci<<formats-requiring-sampler-ycbcr-conversion, {YCbCr} conversion>> may: not
871e5c31af7Sopenharmony_cibe supported unless other parameters meet all of the constraints:
872e5c31af7Sopenharmony_ci
873e5c31af7Sopenharmony_ci  * pname:imageType is ename:VK_IMAGE_TYPE_2D
874e5c31af7Sopenharmony_ci  * pname:mipLevels is 1
875e5c31af7Sopenharmony_ci  * pname:arrayLayers is 1
876e5c31af7Sopenharmony_ci  * pname:samples is ename:VK_SAMPLE_COUNT_1_BIT
877e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
878e5c31af7Sopenharmony_ci
879e5c31af7Sopenharmony_ciImplementations may: support additional limits and capabilities beyond those
880e5c31af7Sopenharmony_cilisted above.
881e5c31af7Sopenharmony_ci
882e5c31af7Sopenharmony_ciTo determine the set of valid pname:usage bits for a given format, call
883e5c31af7Sopenharmony_ciflink:vkGetPhysicalDeviceFormatProperties.
884e5c31af7Sopenharmony_ci
885e5c31af7Sopenharmony_ciIf the size of the resultant image would exceed pname:maxResourceSize, then
886e5c31af7Sopenharmony_ciflink:vkCreateImage must: fail and return
887e5c31af7Sopenharmony_ciename:VK_ERROR_OUT_OF_DEVICE_MEMORY.
888e5c31af7Sopenharmony_ciThis failure may: occur even when all image creation parameters satisfy
889e5c31af7Sopenharmony_citheir valid usage requirements.
890e5c31af7Sopenharmony_ci
891e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_maintenance2[]
892e5c31af7Sopenharmony_ci[NOTE]
893e5c31af7Sopenharmony_ci.Note
894e5c31af7Sopenharmony_ci====
895e5c31af7Sopenharmony_ciFor images created without ename:VK_IMAGE_CREATE_EXTENDED_USAGE_BIT a
896e5c31af7Sopenharmony_cipname:usage bit is valid if it is supported for the format the image is
897e5c31af7Sopenharmony_cicreated with.
898e5c31af7Sopenharmony_ci
899e5c31af7Sopenharmony_ciFor images created with ename:VK_IMAGE_CREATE_EXTENDED_USAGE_BIT a
900e5c31af7Sopenharmony_cipname:usage bit is valid if it is supported for at least one of the formats
901e5c31af7Sopenharmony_cia sname:VkImageView created from the image can: have (see
902e5c31af7Sopenharmony_ci<<resources-image-views,Image Views>> for more detail).
903e5c31af7Sopenharmony_ci====
904e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_maintenance2[]
905e5c31af7Sopenharmony_ci
906e5c31af7Sopenharmony_ci[[resources-image-creation-limits]]
907e5c31af7Sopenharmony_ci.Image Creation Limits
908e5c31af7Sopenharmony_ci****
909e5c31af7Sopenharmony_ciValid values for some image creation parameters are limited by a numerical
910e5c31af7Sopenharmony_ciupper bound or by inclusion in a bitset.
911e5c31af7Sopenharmony_ciFor example, slink:VkImageCreateInfo::pname:arrayLayers is limited by
912e5c31af7Sopenharmony_cipname:imageCreateMaxArrayLayers, defined below; and
913e5c31af7Sopenharmony_cislink:VkImageCreateInfo::pname:samples is limited by
914e5c31af7Sopenharmony_cipname:imageCreateSampleCounts, also defined below.
915e5c31af7Sopenharmony_ci
916e5c31af7Sopenharmony_ciSeveral limiting values are defined below, as well as assisting values from
917e5c31af7Sopenharmony_ciwhich the limiting values are derived.
918e5c31af7Sopenharmony_ciThe limiting values are referenced by the relevant valid usage statements of
919e5c31af7Sopenharmony_cislink:VkImageCreateInfo.
920e5c31af7Sopenharmony_ci
921e5c31af7Sopenharmony_ciifdef::VK_EXT_image_drm_format_modifier[]
922e5c31af7Sopenharmony_ci  * Let `uint64_t imageCreateDrmFormatModifiers[]` be the set of
923e5c31af7Sopenharmony_ci    <<glossary-drm-format-modifier,Linux DRM format modifiers>> that the
924e5c31af7Sopenharmony_ci    resultant image may: have.
925e5c31af7Sopenharmony_ci  ** If pname:tiling is not ename:VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT,
926e5c31af7Sopenharmony_ci     then pname:imageCreateDrmFormatModifiers is empty.
927e5c31af7Sopenharmony_ci  ** If slink:VkImageCreateInfo::pname:pNext contains
928e5c31af7Sopenharmony_ci     slink:VkImageDrmFormatModifierExplicitCreateInfoEXT, then
929e5c31af7Sopenharmony_ci     pname:imageCreateDrmFormatModifiers contains exactly one modifier,
930e5c31af7Sopenharmony_ci     slink:VkImageDrmFormatModifierExplicitCreateInfoEXT::pname:drmFormatModifier.
931e5c31af7Sopenharmony_ci  ** If slink:VkImageCreateInfo::pname:pNext contains
932e5c31af7Sopenharmony_ci     slink:VkImageDrmFormatModifierListCreateInfoEXT, then
933e5c31af7Sopenharmony_ci     pname:imageCreateDrmFormatModifiers contains the entire array
934e5c31af7Sopenharmony_ci     slink:VkImageDrmFormatModifierListCreateInfoEXT::pname:pDrmFormatModifiers.
935e5c31af7Sopenharmony_ciendif::VK_EXT_image_drm_format_modifier[]
936e5c31af7Sopenharmony_ci
937e5c31af7Sopenharmony_ci  * Let `VkBool32 imageCreateMaybeLinear` indicate if the resultant image
938e5c31af7Sopenharmony_ci    may be <<glossary-linear-resource,linear>>.
939e5c31af7Sopenharmony_ciifndef::VK_EXT_image_drm_format_modifier[]
940e5c31af7Sopenharmony_ci    (The definition below is trivial because certain extensions are disabled
941e5c31af7Sopenharmony_ci    in this build of the specification).
942e5c31af7Sopenharmony_ciendif::VK_EXT_image_drm_format_modifier[]
943e5c31af7Sopenharmony_ci  ** If pname:tiling is ename:VK_IMAGE_TILING_LINEAR, then
944e5c31af7Sopenharmony_ci     pname:imageCreateMaybeLinear is ename:VK_TRUE.
945e5c31af7Sopenharmony_ci  ** If pname:tiling is ename:VK_IMAGE_TILING_OPTIMAL, then
946e5c31af7Sopenharmony_ci     pname:imageCreateMaybeLinear is ename:VK_FALSE.
947e5c31af7Sopenharmony_ciifdef::VK_EXT_image_drm_format_modifier[]
948e5c31af7Sopenharmony_ci  ** If pname:tiling is ename:VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT, then
949e5c31af7Sopenharmony_ci     pname:imageCreateMaybeLinear is ename:VK_TRUE if and only if
950e5c31af7Sopenharmony_ci     pname:imageCreateDrmFormatModifiers contains
951e5c31af7Sopenharmony_ci     etext:DRM_FORMAT_MOD_LINEAR.
952e5c31af7Sopenharmony_ciendif::VK_EXT_image_drm_format_modifier[]
953e5c31af7Sopenharmony_ci
954e5c31af7Sopenharmony_ci  * Let `VkFormatFeatureFlags imageCreateFormatFeatures` be the set of valid
955e5c31af7Sopenharmony_ci    _format features_ available during image creation.
956e5c31af7Sopenharmony_ci  ** If pname:tiling is ename:VK_IMAGE_TILING_LINEAR, then
957e5c31af7Sopenharmony_ci     pname:imageCreateFormatFeatures is the value of
958e5c31af7Sopenharmony_ci     slink:VkFormatProperties::pname:linearTilingFeatures found by calling
959e5c31af7Sopenharmony_ci     flink:vkGetPhysicalDeviceFormatProperties with parameter pname:format
960e5c31af7Sopenharmony_ci     equal to slink:VkImageCreateInfo::pname:format.
961e5c31af7Sopenharmony_ci  ** If pname:tiling is ename:VK_IMAGE_TILING_OPTIMAL,
962e5c31af7Sopenharmony_ciifdef::VK_ANDROID_external_memory_android_hardware_buffer[]
963e5c31af7Sopenharmony_ci     and if the pname:pNext chain includes no slink:VkExternalFormatANDROID
964e5c31af7Sopenharmony_ci     structure with non-zero pname:externalFormat,
965e5c31af7Sopenharmony_ciendif::VK_ANDROID_external_memory_android_hardware_buffer[]
966e5c31af7Sopenharmony_ci     then pname:imageCreateFormatFeatures is the value of
967e5c31af7Sopenharmony_ci     slink:VkFormatProperties::pname:optimalTilingFeatures found by calling
968e5c31af7Sopenharmony_ci     flink:vkGetPhysicalDeviceFormatProperties with parameter pname:format
969e5c31af7Sopenharmony_ci     equal to slink:VkImageCreateInfo::pname:format.
970e5c31af7Sopenharmony_ciifdef::VK_ANDROID_external_memory_android_hardware_buffer[]
971e5c31af7Sopenharmony_ci  ** If pname:tiling is ename:VK_IMAGE_TILING_OPTIMAL, and if the
972e5c31af7Sopenharmony_ci     pname:pNext chain includes a slink:VkExternalFormatANDROID structure
973e5c31af7Sopenharmony_ci     with non-zero pname:externalFormat, then
974e5c31af7Sopenharmony_ci     pname:imageCreateFormatFeatures is the value of
975e5c31af7Sopenharmony_ci     slink:VkAndroidHardwareBufferFormatPropertiesANDROID::pname:formatFeatures
976e5c31af7Sopenharmony_ci     obtained by flink:vkGetAndroidHardwareBufferPropertiesANDROID with a
977e5c31af7Sopenharmony_ci     matching pname:externalFormat value.
978e5c31af7Sopenharmony_ciendif::VK_ANDROID_external_memory_android_hardware_buffer[]
979e5c31af7Sopenharmony_ciifdef::VK_FUCHSIA_buffer_collection[]
980e5c31af7Sopenharmony_ci  ** If the pname:pNext chain includes a
981e5c31af7Sopenharmony_ci     slink:VkBufferCollectionImageCreateInfoFUCHSIA structure, then
982e5c31af7Sopenharmony_ci     pname:imageCreateFormatFeatures is the value of
983e5c31af7Sopenharmony_ci     slink:VkBufferCollectionPropertiesFUCHSIA::pname:formatFeatures found
984e5c31af7Sopenharmony_ci     by calling flink:vkGetBufferCollectionPropertiesFUCHSIA with a
985e5c31af7Sopenharmony_ci     parameter pname:collection equal to
986e5c31af7Sopenharmony_ci     slink:VkBufferCollectionImageCreateInfoFUCHSIA::pname:collection
987e5c31af7Sopenharmony_ciendif::VK_FUCHSIA_buffer_collection[]
988e5c31af7Sopenharmony_ciifdef::VK_EXT_image_drm_format_modifier[]
989e5c31af7Sopenharmony_ci  ** If pname:tiling is ename:VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT, then
990e5c31af7Sopenharmony_ci     the value of pname:imageCreateFormatFeatures is found by calling
991e5c31af7Sopenharmony_ci     flink:vkGetPhysicalDeviceFormatProperties2 with
992e5c31af7Sopenharmony_ci     slink:VkImageFormatProperties::pname:format equal to
993e5c31af7Sopenharmony_ci     slink:VkImageCreateInfo::pname:format and with
994e5c31af7Sopenharmony_ci     slink:VkDrmFormatModifierPropertiesListEXT chained into
995e5c31af7Sopenharmony_ci     slink:VkImageFormatProperties2; by collecting all members of the
996e5c31af7Sopenharmony_ci     returned array
997e5c31af7Sopenharmony_ci     slink:VkDrmFormatModifierPropertiesListEXT::pname:pDrmFormatModifierProperties
998e5c31af7Sopenharmony_ci     whose pname:drmFormatModifier belongs to
999e5c31af7Sopenharmony_ci     pname:imageCreateDrmFormatModifiers; and by taking the bitwise
1000e5c31af7Sopenharmony_ci     intersection, over the collected array members, of
1001e5c31af7Sopenharmony_ci     pname:drmFormatModifierTilingFeatures.
1002e5c31af7Sopenharmony_ci     (The resultant pname:imageCreateFormatFeatures may: be empty).
1003e5c31af7Sopenharmony_ciendif::VK_EXT_image_drm_format_modifier[]
1004e5c31af7Sopenharmony_ci
1005e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_external_memory[]
1006e5c31af7Sopenharmony_ci  * Let `VkImageFormatProperties2 imageCreateImageFormatPropertiesList[]` be
1007e5c31af7Sopenharmony_ciifdef::VK_ANDROID_external_memory_android_hardware_buffer[]
1008e5c31af7Sopenharmony_ci    defined as follows.
1009e5c31af7Sopenharmony_ci  ** If slink:VkImageCreateInfo::pname:pNext contains no
1010e5c31af7Sopenharmony_ci     slink:VkExternalFormatANDROID structure with non-zero
1011e5c31af7Sopenharmony_ci     pname:externalFormat, then pname:imageCreateImageFormatPropertiesList
1012e5c31af7Sopenharmony_ci     is
1013e5c31af7Sopenharmony_ciendif::VK_ANDROID_external_memory_android_hardware_buffer[]
1014e5c31af7Sopenharmony_ci     the list of structures obtained by calling
1015e5c31af7Sopenharmony_ci     flink:vkGetPhysicalDeviceImageFormatProperties2, possibly multiple
1016e5c31af7Sopenharmony_ci     times, as follows:
1017e5c31af7Sopenharmony_ci  *** The parameters slink:VkPhysicalDeviceImageFormatInfo2::pname:format,
1018e5c31af7Sopenharmony_ci      pname:imageType, pname:tiling, pname:usage, and pname:flags must: be
1019e5c31af7Sopenharmony_ci      equal to those in slink:VkImageCreateInfo.
1020e5c31af7Sopenharmony_ci  *** If slink:VkImageCreateInfo::pname:pNext contains a
1021e5c31af7Sopenharmony_ci      slink:VkExternalMemoryImageCreateInfo structure whose
1022e5c31af7Sopenharmony_ci      pname:handleTypes is not `0`, then
1023e5c31af7Sopenharmony_ci      slink:VkPhysicalDeviceImageFormatInfo2::pname:pNext must: contain a
1024e5c31af7Sopenharmony_ci      slink:VkPhysicalDeviceExternalImageFormatInfo structure whose
1025e5c31af7Sopenharmony_ci      pname:handleType is not `0`; and
1026e5c31af7Sopenharmony_ci      flink:vkGetPhysicalDeviceImageFormatProperties2 must: be called for
1027e5c31af7Sopenharmony_ci      each handle type in
1028e5c31af7Sopenharmony_ci      slink:VkExternalMemoryImageCreateInfo::pname:handleTypes, successively
1029e5c31af7Sopenharmony_ci      setting
1030e5c31af7Sopenharmony_ci      slink:VkPhysicalDeviceExternalImageFormatInfo::pname:handleType on
1031e5c31af7Sopenharmony_ci      each call.
1032e5c31af7Sopenharmony_ci  *** If slink:VkImageCreateInfo::pname:pNext contains no
1033e5c31af7Sopenharmony_ci      slink:VkExternalMemoryImageCreateInfo structure, or contains a
1034e5c31af7Sopenharmony_ci      structure whose pname:handleTypes is `0`, then
1035e5c31af7Sopenharmony_ci      slink:VkPhysicalDeviceImageFormatInfo2::pname:pNext must: either
1036e5c31af7Sopenharmony_ci      contain no slink:VkPhysicalDeviceExternalImageFormatInfo structure, or
1037e5c31af7Sopenharmony_ci      contain a structure whose pname:handleType is `0`.
1038e5c31af7Sopenharmony_ciifdef::VK_EXT_image_drm_format_modifier[]
1039e5c31af7Sopenharmony_ci  *** If pname:tiling is ename:VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT, then
1040e5c31af7Sopenharmony_ci      slink:VkPhysicalDeviceImageFormatInfo2::pname:pNext must: contain a
1041e5c31af7Sopenharmony_ci      slink:VkPhysicalDeviceImageDrmFormatModifierInfoEXT structure where
1042e5c31af7Sopenharmony_ci      pname:sharingMode is equal to
1043e5c31af7Sopenharmony_ci      slink:VkImageCreateInfo::pname:sharingMode; and, if pname:sharingMode
1044e5c31af7Sopenharmony_ci      is ename:VK_SHARING_MODE_CONCURRENT, then pname:queueFamilyIndexCount
1045e5c31af7Sopenharmony_ci      and pname:pQueueFamilyIndices must: be equal to those in
1046e5c31af7Sopenharmony_ci      slink:VkImageCreateInfo; and, if pname:flags contains
1047e5c31af7Sopenharmony_ci      ename:VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT, then the
1048e5c31af7Sopenharmony_ci      slink:VkImageFormatListCreateInfo structure included in the
1049e5c31af7Sopenharmony_ci      pname:pNext chain of slink:VkPhysicalDeviceImageFormatInfo2 must: be
1050e5c31af7Sopenharmony_ci      equivalent to the one included in the pname:pNext chain of
1051e5c31af7Sopenharmony_ci      slink:VkImageCreateInfo; and
1052e5c31af7Sopenharmony_ci      flink:vkGetPhysicalDeviceImageFormatProperties2 must: be called for
1053e5c31af7Sopenharmony_ci      each modifier in pname:imageCreateDrmFormatModifiers, successively
1054e5c31af7Sopenharmony_ci      setting
1055e5c31af7Sopenharmony_ci      slink:VkPhysicalDeviceImageDrmFormatModifierInfoEXT::pname:drmFormatModifier
1056e5c31af7Sopenharmony_ci      on each call.
1057e5c31af7Sopenharmony_ci  *** If pname:tiling is not ename:VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT,
1058e5c31af7Sopenharmony_ci      then slink:VkPhysicalDeviceImageFormatInfo2::pname:pNext must: contain
1059e5c31af7Sopenharmony_ci      no slink:VkPhysicalDeviceImageDrmFormatModifierInfoEXT structure.
1060e5c31af7Sopenharmony_ciendif::VK_EXT_image_drm_format_modifier[]
1061e5c31af7Sopenharmony_ci  *** If any call to flink:vkGetPhysicalDeviceImageFormatProperties2 returns
1062e5c31af7Sopenharmony_ci      an error, then pname:imageCreateImageFormatPropertiesList is defined
1063e5c31af7Sopenharmony_ci      to be the empty list.
1064e5c31af7Sopenharmony_ciifdef::VK_ANDROID_external_memory_android_hardware_buffer[]
1065e5c31af7Sopenharmony_ci  ** If slink:VkImageCreateInfo::pname:pNext contains a
1066e5c31af7Sopenharmony_ci     slink:VkExternalFormatANDROID structure with non-zero
1067e5c31af7Sopenharmony_ci     pname:externalFormat, then pname:imageCreateImageFormatPropertiesList
1068e5c31af7Sopenharmony_ci     contains a single element where:
1069e5c31af7Sopenharmony_ci  *** sname:VkImageFormatProperties::pname:maxMipLevels is
1070e5c31af7Sopenharmony_ci      [eq]#{lfloor}log~2~(max(pname:extent.width, pname:extent.height,
1071e5c31af7Sopenharmony_ci      pname:extent.depth)){rfloor} {plus} 1#.
1072e5c31af7Sopenharmony_ci  *** sname:VkImageFormatProperties::pname:maxArrayLayers is
1073e5c31af7Sopenharmony_ci      slink:VkPhysicalDeviceLimits::pname:maxImageArrayLayers.
1074e5c31af7Sopenharmony_ci  *** Each component of sname:VkImageFormatProperties::pname:maxExtent is
1075e5c31af7Sopenharmony_ci      slink:VkPhysicalDeviceLimits::pname:maxImageDimension2D.
1076e5c31af7Sopenharmony_ci  *** sname:VkImageFormatProperties::pname:sampleCounts contains exactly
1077e5c31af7Sopenharmony_ci      ename:VK_SAMPLE_COUNT_1_BIT.
1078e5c31af7Sopenharmony_ciendif::VK_ANDROID_external_memory_android_hardware_buffer[]
1079e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_external_memory[]
1080e5c31af7Sopenharmony_ci
1081e5c31af7Sopenharmony_ci  * Let `uint32_t imageCreateMaxMipLevels` be
1082e5c31af7Sopenharmony_ciifndef::VK_VERSION_1_1,VK_KHR_external_memory[]
1083e5c31af7Sopenharmony_ci    the value of slink:VkImageFormatProperties::pname:maxMipLevels found by
1084e5c31af7Sopenharmony_ci    calling flink:vkGetPhysicalDeviceImageFormatProperties with parameters
1085e5c31af7Sopenharmony_ci    pname:format, pname:imageType, pname:tiling, pname:usage, and
1086e5c31af7Sopenharmony_ci    pname:flags equal to those in slink:VkImageCreateInfo.
1087e5c31af7Sopenharmony_ci    If flink:vkGetPhysicalDeviceFormatProperties returns an error, then the
1088e5c31af7Sopenharmony_ci    value of pname:imageCreateMaxMipLevels is undefined:.
1089e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_external_memory[]
1090e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_external_memory[]
1091e5c31af7Sopenharmony_ci    the minimum value of slink:VkImageFormatProperties::pname:maxMipLevels
1092e5c31af7Sopenharmony_ci    in pname:imageCreateImageFormatPropertiesList.
1093e5c31af7Sopenharmony_ci    The value is undefined: if pname:imageCreateImageFormatPropertiesList is
1094e5c31af7Sopenharmony_ci    empty.
1095e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_external_memory[]
1096e5c31af7Sopenharmony_ci
1097e5c31af7Sopenharmony_ci  * Let `uint32_t imageCreateMaxArrayLayers` be
1098e5c31af7Sopenharmony_ciifndef::VK_VERSION_1_1,VK_KHR_external_memory[]
1099e5c31af7Sopenharmony_ci    defined analogously to pname:imageCreateMaxMipLevels.
1100e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_external_memory[]
1101e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_external_memory[]
1102e5c31af7Sopenharmony_ci    the minimum value of slink:VkImageFormatProperties::pname:maxArrayLayers
1103e5c31af7Sopenharmony_ci    in pname:imageCreateImageFormatPropertiesList.
1104e5c31af7Sopenharmony_ci    The value is undefined: if pname:imageCreateImageFormatPropertiesList is
1105e5c31af7Sopenharmony_ci    empty.
1106e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_external_memory[]
1107e5c31af7Sopenharmony_ci
1108e5c31af7Sopenharmony_ci  * Let `VkExtent3D imageCreateMaxExtent` be
1109e5c31af7Sopenharmony_ciifndef::VK_VERSION_1_1,VK_KHR_external_memory[]
1110e5c31af7Sopenharmony_ci    defined analogously to pname:imageCreateMaxMipLevels.
1111e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_external_memory[]
1112e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_external_memory[]
1113e5c31af7Sopenharmony_ci    the component-wise minimum over all
1114e5c31af7Sopenharmony_ci    slink:VkImageFormatProperties::pname:maxExtent values in
1115e5c31af7Sopenharmony_ci    pname:imageCreateImageFormatPropertiesList.
1116e5c31af7Sopenharmony_ci    The value is undefined: if pname:imageCreateImageFormatPropertiesList is
1117e5c31af7Sopenharmony_ci    empty.
1118e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_external_memory[]
1119e5c31af7Sopenharmony_ci
1120e5c31af7Sopenharmony_ci  * Let `VkSampleCountFlags imageCreateSampleCounts` be
1121e5c31af7Sopenharmony_ciifndef::VK_VERSION_1_1,VK_KHR_external_memory[]
1122e5c31af7Sopenharmony_ci    defined analogously to pname:imageCreateMaxMipLevels.
1123e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_external_memory[]
1124e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_external_memory[]
1125e5c31af7Sopenharmony_ci    the intersection of each
1126e5c31af7Sopenharmony_ci    slink:VkImageFormatProperties::pname:sampleCounts in
1127e5c31af7Sopenharmony_ci    pname:imageCreateImageFormatPropertiesList.
1128e5c31af7Sopenharmony_ci    The value is undefined: if pname:imageCreateImageFormatPropertiesList is
1129e5c31af7Sopenharmony_ci    empty.
1130e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_external_memory[]
1131e5c31af7Sopenharmony_ci****
1132e5c31af7Sopenharmony_ci
1133e5c31af7Sopenharmony_ci.Valid Usage
1134e5c31af7Sopenharmony_ci****
1135e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-imageCreateMaxMipLevels-02251]]
1136e5c31af7Sopenharmony_ci    Each of the following values (as described in
1137e5c31af7Sopenharmony_ci    <<resources-image-creation-limits,Image Creation Limits>>) must: not be
1138e5c31af7Sopenharmony_ci    undefined: : pname:imageCreateMaxMipLevels,
1139e5c31af7Sopenharmony_ci    pname:imageCreateMaxArrayLayers, pname:imageCreateMaxExtent, and
1140e5c31af7Sopenharmony_ci    pname:imageCreateSampleCounts
1141e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-sharingMode-00941]]
1142e5c31af7Sopenharmony_ci    If pname:sharingMode is ename:VK_SHARING_MODE_CONCURRENT,
1143e5c31af7Sopenharmony_ci    pname:pQueueFamilyIndices must: be a valid pointer to an array of
1144e5c31af7Sopenharmony_ci    pname:queueFamilyIndexCount code:uint32_t values
1145e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-sharingMode-00942]]
1146e5c31af7Sopenharmony_ci    If pname:sharingMode is ename:VK_SHARING_MODE_CONCURRENT,
1147e5c31af7Sopenharmony_ci    pname:queueFamilyIndexCount must: be greater than `1`
1148e5c31af7Sopenharmony_ciifndef::VK_VERSION_1_1,VK_KHR_get_physical_device_properties2[]
1149e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-sharingMode-01392]]
1150e5c31af7Sopenharmony_ci    If pname:sharingMode is ename:VK_SHARING_MODE_CONCURRENT, each element
1151e5c31af7Sopenharmony_ci    of pname:pQueueFamilyIndices must: be unique and must: be less than
1152e5c31af7Sopenharmony_ci    pname:pQueueFamilyPropertyCount returned by
1153e5c31af7Sopenharmony_ci    flink:vkGetPhysicalDeviceQueueFamilyProperties for the
1154e5c31af7Sopenharmony_ci    pname:physicalDevice that was used to create pname:device
1155e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_get_physical_device_properties2[]
1156e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_get_physical_device_properties2[]
1157e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-sharingMode-01420]]
1158e5c31af7Sopenharmony_ci    If pname:sharingMode is ename:VK_SHARING_MODE_CONCURRENT, each element
1159e5c31af7Sopenharmony_ci    of pname:pQueueFamilyIndices must: be unique and must: be less than
1160e5c31af7Sopenharmony_ci    pname:pQueueFamilyPropertyCount returned by either
1161e5c31af7Sopenharmony_ci    flink:vkGetPhysicalDeviceQueueFamilyProperties or
1162e5c31af7Sopenharmony_ci    flink:vkGetPhysicalDeviceQueueFamilyProperties2 for the
1163e5c31af7Sopenharmony_ci    pname:physicalDevice that was used to create pname:device
1164e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_get_physical_device_properties2[]
1165e5c31af7Sopenharmony_ciifndef::VK_ANDROID_external_memory_android_hardware_buffer[]
1166e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-format-00943]]
1167e5c31af7Sopenharmony_ci    pname:format must: not be ename:VK_FORMAT_UNDEFINED
1168e5c31af7Sopenharmony_ciendif::VK_ANDROID_external_memory_android_hardware_buffer[]
1169e5c31af7Sopenharmony_ciifdef::VK_ANDROID_external_memory_android_hardware_buffer[]
1170e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-pNext-01974]]
1171e5c31af7Sopenharmony_ci    If the pname:pNext chain includes a slink:VkExternalFormatANDROID
1172e5c31af7Sopenharmony_ci    structure, and its pname:externalFormat member is non-zero the
1173e5c31af7Sopenharmony_ci    pname:format must: be ename:VK_FORMAT_UNDEFINED
1174e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-pNext-01975]]
1175e5c31af7Sopenharmony_ci    If the pname:pNext chain does not include a
1176e5c31af7Sopenharmony_ci    slink:VkExternalFormatANDROID structure, or does and its
1177e5c31af7Sopenharmony_ci    pname:externalFormat member is `0`, the pname:format must: not be
1178e5c31af7Sopenharmony_ci    ename:VK_FORMAT_UNDEFINED
1179e5c31af7Sopenharmony_ciendif::VK_ANDROID_external_memory_android_hardware_buffer[]
1180e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-extent-00944]]
1181e5c31af7Sopenharmony_ci    pname:extent.width must: be greater than `0`
1182e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-extent-00945]]
1183e5c31af7Sopenharmony_ci    pname:extent.height must: be greater than `0`
1184e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-extent-00946]]
1185e5c31af7Sopenharmony_ci    pname:extent.depth must: be greater than `0`
1186e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-mipLevels-00947]]
1187e5c31af7Sopenharmony_ci    pname:mipLevels must: be greater than `0`
1188e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-arrayLayers-00948]]
1189e5c31af7Sopenharmony_ci    pname:arrayLayers must: be greater than `0`
1190e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-flags-00949]]
1191e5c31af7Sopenharmony_ci    If pname:flags contains ename:VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT,
1192e5c31af7Sopenharmony_ci    pname:imageType must: be ename:VK_IMAGE_TYPE_2D
1193e5c31af7Sopenharmony_ciifdef::VK_EXT_fragment_density_map[]
1194e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-flags-02557]]
1195e5c31af7Sopenharmony_ci    If pname:flags contains
1196e5c31af7Sopenharmony_ci    ename:VK_IMAGE_USAGE_FRAGMENT_DENSITY_MAP_BIT_EXT, pname:imageType must:
1197e5c31af7Sopenharmony_ci    be ename:VK_IMAGE_TYPE_2D
1198e5c31af7Sopenharmony_ciendif::VK_EXT_fragment_density_map[]
1199e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_maintenance1[]
1200e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-flags-00950]]
1201e5c31af7Sopenharmony_ci    If pname:flags contains ename:VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT,
1202e5c31af7Sopenharmony_ci    pname:imageType must: be ename:VK_IMAGE_TYPE_3D
1203e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_maintenance1[]
1204e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-extent-02252]]
1205e5c31af7Sopenharmony_ci    pname:extent.width must: be less than or equal to
1206e5c31af7Sopenharmony_ci    pname:imageCreateMaxExtent.width (as defined in
1207e5c31af7Sopenharmony_ci    <<resources-image-creation-limits,Image Creation Limits>>)
1208e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-extent-02253]]
1209e5c31af7Sopenharmony_ci    pname:extent.height must: be less than or equal to
1210e5c31af7Sopenharmony_ci    pname:imageCreateMaxExtent.height (as defined in
1211e5c31af7Sopenharmony_ci    <<resources-image-creation-limits,Image Creation Limits>>)
1212e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-extent-02254]]
1213e5c31af7Sopenharmony_ci    pname:extent.depth must: be less than or equal to
1214e5c31af7Sopenharmony_ci    pname:imageCreateMaxExtent.depth (as defined in
1215e5c31af7Sopenharmony_ci    <<resources-image-creation-limits,Image Creation Limits>>)
1216e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-imageType-00954]]
1217e5c31af7Sopenharmony_ci    If pname:imageType is ename:VK_IMAGE_TYPE_2D and pname:flags contains
1218e5c31af7Sopenharmony_ci    ename:VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT, pname:extent.width and
1219e5c31af7Sopenharmony_ci    pname:extent.height must: be equal and pname:arrayLayers must: be
1220e5c31af7Sopenharmony_ci    greater than or equal to 6
1221e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-imageType-00956]]
1222e5c31af7Sopenharmony_ci    If pname:imageType is ename:VK_IMAGE_TYPE_1D, both pname:extent.height
1223e5c31af7Sopenharmony_ci    and pname:extent.depth must: be `1`
1224e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-imageType-00957]]
1225e5c31af7Sopenharmony_ci    If pname:imageType is ename:VK_IMAGE_TYPE_2D, pname:extent.depth must:
1226e5c31af7Sopenharmony_ci    be `1`
1227e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-mipLevels-00958]]
1228e5c31af7Sopenharmony_ci    pname:mipLevels must: be less than or equal to the number of levels in
1229e5c31af7Sopenharmony_ci    the complete mipmap chain based on [eq]#pname:extent.width#,
1230e5c31af7Sopenharmony_ci    [eq]#pname:extent.height#, and [eq]#pname:extent.depth#
1231e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-mipLevels-02255]]
1232e5c31af7Sopenharmony_ci    pname:mipLevels must: be less than or equal to
1233e5c31af7Sopenharmony_ci    pname:imageCreateMaxMipLevels (as defined in
1234e5c31af7Sopenharmony_ci    <<resources-image-creation-limits,Image Creation Limits>>)
1235e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-arrayLayers-02256]]
1236e5c31af7Sopenharmony_ci    pname:arrayLayers must: be less than or equal to
1237e5c31af7Sopenharmony_ci    pname:imageCreateMaxArrayLayers (as defined in
1238e5c31af7Sopenharmony_ci    <<resources-image-creation-limits,Image Creation Limits>>)
1239e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-imageType-00961]]
1240e5c31af7Sopenharmony_ci    If pname:imageType is ename:VK_IMAGE_TYPE_3D, pname:arrayLayers must: be
1241e5c31af7Sopenharmony_ci    `1`
1242e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-samples-02257]]
1243e5c31af7Sopenharmony_ci    If pname:samples is not ename:VK_SAMPLE_COUNT_1_BIT, then
1244e5c31af7Sopenharmony_ci    pname:imageType must: be ename:VK_IMAGE_TYPE_2D, pname:flags must: not
1245e5c31af7Sopenharmony_ci    contain ename:VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT, pname:mipLevels must:
1246e5c31af7Sopenharmony_ci    be equal to `1`, and pname:imageCreateMaybeLinear (as defined in
1247e5c31af7Sopenharmony_ci    <<resources-image-creation-limits,Image Creation Limits>>) must: be
1248e5c31af7Sopenharmony_ci    ename:VK_FALSE,
1249e5c31af7Sopenharmony_ciifdef::VK_EXT_fragment_density_map[]
1250e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-samples-02558]]
1251e5c31af7Sopenharmony_ci    If pname:samples is not ename:VK_SAMPLE_COUNT_1_BIT, pname:usage must:
1252e5c31af7Sopenharmony_ci    not contain ename:VK_IMAGE_USAGE_FRAGMENT_DENSITY_MAP_BIT_EXT
1253e5c31af7Sopenharmony_ciendif::VK_EXT_fragment_density_map[]
1254e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-usage-00963]]
1255e5c31af7Sopenharmony_ci    If pname:usage includes ename:VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT,
1256e5c31af7Sopenharmony_ci    then bits other than ename:VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT,
1257e5c31af7Sopenharmony_ci    ename:VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT, and
1258e5c31af7Sopenharmony_ci    ename:VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT must: not be set
1259e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-usage-00964]]
1260e5c31af7Sopenharmony_ci    If pname:usage includes ename:VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT,
1261e5c31af7Sopenharmony_ci    ename:VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT,
1262e5c31af7Sopenharmony_ci    ename:VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT, or
1263e5c31af7Sopenharmony_ci    ename:VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT, pname:extent.width must: be
1264e5c31af7Sopenharmony_ci    less than or equal to
1265e5c31af7Sopenharmony_ci    sname:VkPhysicalDeviceLimits::pname:maxFramebufferWidth
1266e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-usage-00965]]
1267e5c31af7Sopenharmony_ci    If pname:usage includes ename:VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT,
1268e5c31af7Sopenharmony_ci    ename:VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT,
1269e5c31af7Sopenharmony_ci    ename:VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT, or
1270e5c31af7Sopenharmony_ci    ename:VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT, pname:extent.height must: be
1271e5c31af7Sopenharmony_ci    less than or equal to
1272e5c31af7Sopenharmony_ci    sname:VkPhysicalDeviceLimits::pname:maxFramebufferHeight
1273e5c31af7Sopenharmony_ciifdef::VK_EXT_fragment_density_map[]
1274e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-usage-02559]]
1275e5c31af7Sopenharmony_ci    If pname:usage includes
1276e5c31af7Sopenharmony_ci    ename:VK_IMAGE_USAGE_FRAGMENT_DENSITY_MAP_BIT_EXT, pname:extent.width
1277e5c31af7Sopenharmony_ci    must: be less than or equal to
1278e5c31af7Sopenharmony_ci    latexmath:[\left\lceil{\frac{maxFramebufferWidth}{minFragmentDensityTexelSize_{width}}}\right\rceil]
1279e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-usage-02560]]
1280e5c31af7Sopenharmony_ci    If pname:usage includes
1281e5c31af7Sopenharmony_ci    ename:VK_IMAGE_USAGE_FRAGMENT_DENSITY_MAP_BIT_EXT, pname:extent.height
1282e5c31af7Sopenharmony_ci    must: be less than or equal to
1283e5c31af7Sopenharmony_ci    latexmath:[\left\lceil{\frac{maxFramebufferHeight}{minFragmentDensityTexelSize_{height}}}\right\rceil]
1284e5c31af7Sopenharmony_ciendif::VK_EXT_fragment_density_map[]
1285e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-usage-00966]]
1286e5c31af7Sopenharmony_ci    If pname:usage includes ename:VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT,
1287e5c31af7Sopenharmony_ci    pname:usage must: also contain at least one of
1288e5c31af7Sopenharmony_ci    ename:VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT,
1289e5c31af7Sopenharmony_ci    ename:VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT, or
1290e5c31af7Sopenharmony_ci    ename:VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT
1291e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-samples-02258]]
1292e5c31af7Sopenharmony_ci    pname:samples must: be a bit value that is set in
1293e5c31af7Sopenharmony_ci    pname:imageCreateSampleCounts (as defined in
1294e5c31af7Sopenharmony_ci    <<resources-image-creation-limits,Image Creation Limits>>)
1295e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-usage-00968]]
1296e5c31af7Sopenharmony_ci    If the <<features-shaderStorageImageMultisample,multisampled storage
1297e5c31af7Sopenharmony_ci    images>> feature is not enabled, and pname:usage contains
1298e5c31af7Sopenharmony_ci    ename:VK_IMAGE_USAGE_STORAGE_BIT, pname:samples must: be
1299e5c31af7Sopenharmony_ci    ename:VK_SAMPLE_COUNT_1_BIT
1300e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-flags-00969]]
1301e5c31af7Sopenharmony_ci    If the <<features-sparseBinding,sparse bindings>> feature is not
1302e5c31af7Sopenharmony_ci    enabled, pname:flags must: not contain
1303e5c31af7Sopenharmony_ci    ename:VK_IMAGE_CREATE_SPARSE_BINDING_BIT
1304e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-flags-01924]]
1305e5c31af7Sopenharmony_ci    If the <<features-sparseResidencyAliased,sparse aliased residency>>
1306e5c31af7Sopenharmony_ci    feature is not enabled, pname:flags must: not contain
1307e5c31af7Sopenharmony_ci    ename:VK_IMAGE_CREATE_SPARSE_ALIASED_BIT
1308e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-tiling-04121]]
1309e5c31af7Sopenharmony_ci    If pname:tiling is ename:VK_IMAGE_TILING_LINEAR, pname:flags must: not
1310e5c31af7Sopenharmony_ci    contain ename:VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT
1311e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-imageType-00970]]
1312e5c31af7Sopenharmony_ci    If pname:imageType is ename:VK_IMAGE_TYPE_1D, pname:flags must: not
1313e5c31af7Sopenharmony_ci    contain ename:VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT
1314e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-imageType-00971]]
1315e5c31af7Sopenharmony_ci    If the <<features-sparseResidencyImage2D,sparse residency for 2D
1316e5c31af7Sopenharmony_ci    images>> feature is not enabled, and pname:imageType is
1317e5c31af7Sopenharmony_ci    ename:VK_IMAGE_TYPE_2D, pname:flags must: not contain
1318e5c31af7Sopenharmony_ci    ename:VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT
1319e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-imageType-00972]]
1320e5c31af7Sopenharmony_ci    If the <<features-sparseResidencyImage3D,sparse residency for 3D
1321e5c31af7Sopenharmony_ci    images>> feature is not enabled, and pname:imageType is
1322e5c31af7Sopenharmony_ci    ename:VK_IMAGE_TYPE_3D, pname:flags must: not contain
1323e5c31af7Sopenharmony_ci    ename:VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT
1324e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-imageType-00973]]
1325e5c31af7Sopenharmony_ci    If the <<features-sparseResidency2Samples,sparse residency for images
1326e5c31af7Sopenharmony_ci    with 2 samples>> feature is not enabled, pname:imageType is
1327e5c31af7Sopenharmony_ci    ename:VK_IMAGE_TYPE_2D, and pname:samples is
1328e5c31af7Sopenharmony_ci    ename:VK_SAMPLE_COUNT_2_BIT, pname:flags must: not contain
1329e5c31af7Sopenharmony_ci    ename:VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT
1330e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-imageType-00974]]
1331e5c31af7Sopenharmony_ci    If the <<features-sparseResidency4Samples,sparse residency for images
1332e5c31af7Sopenharmony_ci    with 4 samples>> feature is not enabled, pname:imageType is
1333e5c31af7Sopenharmony_ci    ename:VK_IMAGE_TYPE_2D, and pname:samples is
1334e5c31af7Sopenharmony_ci    ename:VK_SAMPLE_COUNT_4_BIT, pname:flags must: not contain
1335e5c31af7Sopenharmony_ci    ename:VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT
1336e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-imageType-00975]]
1337e5c31af7Sopenharmony_ci    If the <<features-sparseResidency8Samples,sparse residency for images
1338e5c31af7Sopenharmony_ci    with 8 samples>> feature is not enabled, pname:imageType is
1339e5c31af7Sopenharmony_ci    ename:VK_IMAGE_TYPE_2D, and pname:samples is
1340e5c31af7Sopenharmony_ci    ename:VK_SAMPLE_COUNT_8_BIT, pname:flags must: not contain
1341e5c31af7Sopenharmony_ci    ename:VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT
1342e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-imageType-00976]]
1343e5c31af7Sopenharmony_ci    If the <<features-sparseResidency16Samples,sparse residency for images
1344e5c31af7Sopenharmony_ci    with 16 samples>> feature is not enabled, pname:imageType is
1345e5c31af7Sopenharmony_ci    ename:VK_IMAGE_TYPE_2D, and pname:samples is
1346e5c31af7Sopenharmony_ci    ename:VK_SAMPLE_COUNT_16_BIT, pname:flags must: not contain
1347e5c31af7Sopenharmony_ci    ename:VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT
1348e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-flags-00987]]
1349e5c31af7Sopenharmony_ci    If pname:flags contains ename:VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT or
1350e5c31af7Sopenharmony_ci    ename:VK_IMAGE_CREATE_SPARSE_ALIASED_BIT, it must: also contain
1351e5c31af7Sopenharmony_ci    ename:VK_IMAGE_CREATE_SPARSE_BINDING_BIT
1352e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-None-01925]]
1353e5c31af7Sopenharmony_ci    If any of the bits ename:VK_IMAGE_CREATE_SPARSE_BINDING_BIT,
1354e5c31af7Sopenharmony_ci    ename:VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT, or
1355e5c31af7Sopenharmony_ci    ename:VK_IMAGE_CREATE_SPARSE_ALIASED_BIT are set,
1356e5c31af7Sopenharmony_ci    ename:VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT must: not also be set
1357e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1[]
1358e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-flags-01890]]
1359e5c31af7Sopenharmony_ci    If the protected memory feature is not enabled, pname:flags must: not
1360e5c31af7Sopenharmony_ci    contain ename:VK_IMAGE_CREATE_PROTECTED_BIT
1361e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-None-01891]]
1362e5c31af7Sopenharmony_ci    If any of the bits ename:VK_IMAGE_CREATE_SPARSE_BINDING_BIT,
1363e5c31af7Sopenharmony_ci    ename:VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT, or
1364e5c31af7Sopenharmony_ci    ename:VK_IMAGE_CREATE_SPARSE_ALIASED_BIT are set,
1365e5c31af7Sopenharmony_ci    ename:VK_IMAGE_CREATE_PROTECTED_BIT must: not also be set
1366e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1[]
1367e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_external_memory[]
1368e5c31af7Sopenharmony_ciifdef::VK_NV_external_memory[]
1369e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-pNext-00988]]
1370e5c31af7Sopenharmony_ci    If the pname:pNext chain includes a
1371e5c31af7Sopenharmony_ci    slink:VkExternalMemoryImageCreateInfoNV structure, it must: not contain
1372e5c31af7Sopenharmony_ci    a slink:VkExternalMemoryImageCreateInfo structure
1373e5c31af7Sopenharmony_ciendif::VK_NV_external_memory[]
1374e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-pNext-00990]]
1375e5c31af7Sopenharmony_ci    If the pname:pNext chain includes a
1376e5c31af7Sopenharmony_ci    slink:VkExternalMemoryImageCreateInfo structure, its pname:handleTypes
1377e5c31af7Sopenharmony_ci    member must: only contain bits that are also in
1378e5c31af7Sopenharmony_ci    slink:VkExternalImageFormatProperties::pname:externalMemoryProperties.compatibleHandleTypes,
1379e5c31af7Sopenharmony_ci    as returned by flink:vkGetPhysicalDeviceImageFormatProperties2 with
1380e5c31af7Sopenharmony_ci    pname:format, pname:imageType, pname:tiling, pname:usage, and
1381e5c31af7Sopenharmony_ci    pname:flags equal to those in this structure, and with a
1382e5c31af7Sopenharmony_ci    slink:VkPhysicalDeviceExternalImageFormatInfo structure included in the
1383e5c31af7Sopenharmony_ci    pname:pNext chain, with a pname:handleType equal to any one of the
1384e5c31af7Sopenharmony_ci    handle types specified in
1385e5c31af7Sopenharmony_ci    slink:VkExternalMemoryImageCreateInfo::pname:handleTypes
1386e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_external_memory[]
1387e5c31af7Sopenharmony_ciifdef::VK_NV_external_memory+VK_NV_external_memory_capabilities[]
1388e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-pNext-00991]]
1389e5c31af7Sopenharmony_ci    If the pname:pNext chain includes a
1390e5c31af7Sopenharmony_ci    slink:VkExternalMemoryImageCreateInfoNV structure, its pname:handleTypes
1391e5c31af7Sopenharmony_ci    member must: only contain bits that are also in
1392e5c31af7Sopenharmony_ci    slink:VkExternalImageFormatPropertiesNV::pname:externalMemoryProperties.compatibleHandleTypes,
1393e5c31af7Sopenharmony_ci    as returned by flink:vkGetPhysicalDeviceExternalImageFormatPropertiesNV
1394e5c31af7Sopenharmony_ci    with pname:format, pname:imageType, pname:tiling, pname:usage, and
1395e5c31af7Sopenharmony_ci    pname:flags equal to those in this structure, and with
1396e5c31af7Sopenharmony_ci    pname:externalHandleType equal to any one of the handle types specified
1397e5c31af7Sopenharmony_ci    in slink:VkExternalMemoryImageCreateInfoNV::pname:handleTypes
1398e5c31af7Sopenharmony_ciendif::VK_NV_external_memory+VK_NV_external_memory_capabilities[]
1399e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_device_group[]
1400e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-physicalDeviceCount-01421]]
1401e5c31af7Sopenharmony_ci    If the logical device was created with
1402e5c31af7Sopenharmony_ci    slink:VkDeviceGroupDeviceCreateInfo::pname:physicalDeviceCount equal to
1403e5c31af7Sopenharmony_ci    1, pname:flags must: not contain
1404e5c31af7Sopenharmony_ci    ename:VK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT
1405e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-flags-02259]]
1406e5c31af7Sopenharmony_ci    If pname:flags contains
1407e5c31af7Sopenharmony_ci    ename:VK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT, then
1408e5c31af7Sopenharmony_ci    pname:mipLevels must: be one, pname:arrayLayers must: be one,
1409e5c31af7Sopenharmony_ci    pname:imageType must: be ename:VK_IMAGE_TYPE_2D.
1410e5c31af7Sopenharmony_ci    and pname:imageCreateMaybeLinear (as defined in
1411e5c31af7Sopenharmony_ci    <<resources-image-creation-limits,Image Creation Limits>>) must: be
1412e5c31af7Sopenharmony_ci    ename:VK_FALSE
1413e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_device_group[]
1414e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_maintenance2[]
1415e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-flags-01572]]
1416e5c31af7Sopenharmony_ci    If pname:flags contains
1417e5c31af7Sopenharmony_ci    ename:VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT, then pname:format
1418e5c31af7Sopenharmony_ci    must: be a <<compressed_image_formats,compressed image format>>
1419e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-flags-01573]]
1420e5c31af7Sopenharmony_ci    If pname:flags contains
1421e5c31af7Sopenharmony_ci    ename:VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT, then pname:flags
1422e5c31af7Sopenharmony_ci    must: also contain ename:VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT
1423e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_maintenance2[]
1424e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-initialLayout-00993]]
1425e5c31af7Sopenharmony_ci    pname:initialLayout must: be ename:VK_IMAGE_LAYOUT_UNDEFINED or
1426e5c31af7Sopenharmony_ci    ename:VK_IMAGE_LAYOUT_PREINITIALIZED
1427e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_external_memory,VK_NV_external_memory[]
1428e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-pNext-01443]]
1429e5c31af7Sopenharmony_ci    If the pname:pNext chain includes a
1430e5c31af7Sopenharmony_ci    slink:VkExternalMemoryImageCreateInfo or
1431e5c31af7Sopenharmony_ci    sname:VkExternalMemoryImageCreateInfoNV structure whose
1432e5c31af7Sopenharmony_ci    pname:handleTypes member is not `0`, pname:initialLayout must: be
1433e5c31af7Sopenharmony_ci    ename:VK_IMAGE_LAYOUT_UNDEFINED
1434e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_external_memory,VK_NV_external_memory[]
1435e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
1436e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-format-06410]]
1437e5c31af7Sopenharmony_ci    If the image pname:format is one of the
1438e5c31af7Sopenharmony_ci    <<formats-requiring-sampler-ycbcr-conversion, formats that require a
1439e5c31af7Sopenharmony_ci    sampler Y'C~B~C~R~ conversion>>, pname:mipLevels must: be 1
1440e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-format-06411]]
1441e5c31af7Sopenharmony_ci    If the image pname:format is one of the
1442e5c31af7Sopenharmony_ci    <<formats-requiring-sampler-ycbcr-conversion, formats that require a
1443e5c31af7Sopenharmony_ci    sampler Y'C~B~C~R~ conversion>>, pname:samples must: be
1444e5c31af7Sopenharmony_ci    ename:VK_SAMPLE_COUNT_1_BIT
1445e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-format-06412]]
1446e5c31af7Sopenharmony_ci    If the image pname:format is one of the
1447e5c31af7Sopenharmony_ci    <<formats-requiring-sampler-ycbcr-conversion, formats that require a
1448e5c31af7Sopenharmony_ci    sampler Y'C~B~C~R~ conversion>>, pname:imageType must: be
1449e5c31af7Sopenharmony_ci    ename:VK_IMAGE_TYPE_2D
1450e5c31af7Sopenharmony_ciifdef::VK_EXT_ycbcr_image_arrays[]
1451e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-format-06413]]
1452e5c31af7Sopenharmony_ci    If the image pname:format is one of the
1453e5c31af7Sopenharmony_ci    <<formats-requiring-sampler-ycbcr-conversion, formats that require a
1454e5c31af7Sopenharmony_ci    sampler Y'C~B~C~R~ conversion>>, and the pname:ycbcrImageArrays feature
1455e5c31af7Sopenharmony_ci    is not enabled, pname:arrayLayers must: be 1
1456e5c31af7Sopenharmony_ciendif::VK_EXT_ycbcr_image_arrays[]
1457e5c31af7Sopenharmony_ciifndef::VK_EXT_ycbcr_image_arrays[]
1458e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-format-06414]]
1459e5c31af7Sopenharmony_ci    If the image pname:format is one of the
1460e5c31af7Sopenharmony_ci    <<formats-requiring-sampler-ycbcr-conversion, formats that require a
1461e5c31af7Sopenharmony_ci    sampler Y'C~B~C~R~ conversion>>, pname:arrayLayers must: be 1
1462e5c31af7Sopenharmony_ciendif::VK_EXT_ycbcr_image_arrays[]
1463e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-imageCreateFormatFeatures-02260]]
1464e5c31af7Sopenharmony_ci    If pname:format is a _multi-planar_ format, and if
1465e5c31af7Sopenharmony_ci    pname:imageCreateFormatFeatures (as defined in
1466e5c31af7Sopenharmony_ci    <<resources-image-creation-limits,Image Creation Limits>>) does not
1467e5c31af7Sopenharmony_ci    contain ename:VK_FORMAT_FEATURE_DISJOINT_BIT, then pname:flags must: not
1468e5c31af7Sopenharmony_ci    contain ename:VK_IMAGE_CREATE_DISJOINT_BIT
1469e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-format-01577]]
1470e5c31af7Sopenharmony_ci    If pname:format is not a _multi-planar_ format, and pname:flags does not
1471e5c31af7Sopenharmony_ci    include ename:VK_IMAGE_CREATE_ALIAS_BIT, pname:flags must: not contain
1472e5c31af7Sopenharmony_ci    ename:VK_IMAGE_CREATE_DISJOINT_BIT
1473e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-format-04712]]
1474e5c31af7Sopenharmony_ci    If pname:format has a code:_422 or code:_420 suffix, pname:width must:
1475e5c31af7Sopenharmony_ci    be a multiple of 2
1476e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-format-04713]]
1477e5c31af7Sopenharmony_ci    If pname:format has a code:_420 suffix, pname:height must: be a multiple
1478e5c31af7Sopenharmony_ci    of 2
1479e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
1480e5c31af7Sopenharmony_ciifdef::VK_EXT_image_drm_format_modifier[]
1481e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-tiling-02261]]
1482e5c31af7Sopenharmony_ci    If pname:tiling is ename:VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT, then
1483e5c31af7Sopenharmony_ci    the pname:pNext chain must: include exactly one of
1484e5c31af7Sopenharmony_ci    slink:VkImageDrmFormatModifierListCreateInfoEXT or
1485e5c31af7Sopenharmony_ci    slink:VkImageDrmFormatModifierExplicitCreateInfoEXT structures
1486e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-pNext-02262]]
1487e5c31af7Sopenharmony_ci    If the pname:pNext chain includes a
1488e5c31af7Sopenharmony_ci    slink:VkImageDrmFormatModifierListCreateInfoEXT or
1489e5c31af7Sopenharmony_ci    slink:VkImageDrmFormatModifierExplicitCreateInfoEXT structure, then
1490e5c31af7Sopenharmony_ci    pname:tiling must: be ename:VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT
1491e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-tiling-02353]]
1492e5c31af7Sopenharmony_ci    If pname:tiling is ename:VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT and
1493e5c31af7Sopenharmony_ci    pname:flags contains ename:VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT, then the
1494e5c31af7Sopenharmony_ci    pname:pNext chain must: include a slink:VkImageFormatListCreateInfo
1495e5c31af7Sopenharmony_ci    structure with non-zero pname:viewFormatCount
1496e5c31af7Sopenharmony_ciendif::VK_EXT_image_drm_format_modifier[]
1497e5c31af7Sopenharmony_ciifdef::VK_EXT_sample_locations[]
1498e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-flags-01533]]
1499e5c31af7Sopenharmony_ci    If pname:flags contains
1500e5c31af7Sopenharmony_ci    ename:VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT
1501e5c31af7Sopenharmony_ci    pname:format must: be a depth or depth/stencil format
1502e5c31af7Sopenharmony_ciendif::VK_EXT_sample_locations[]
1503e5c31af7Sopenharmony_ciifdef::VK_ANDROID_external_memory_android_hardware_buffer[]
1504e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-pNext-02393]]
1505e5c31af7Sopenharmony_ci    If the pname:pNext chain includes a
1506e5c31af7Sopenharmony_ci    slink:VkExternalMemoryImageCreateInfo structure whose pname:handleTypes
1507e5c31af7Sopenharmony_ci    member includes
1508e5c31af7Sopenharmony_ci    ename:VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID,
1509e5c31af7Sopenharmony_ci    pname:imageType must: be ename:VK_IMAGE_TYPE_2D
1510e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-pNext-02394]]
1511e5c31af7Sopenharmony_ci    If the pname:pNext chain includes a
1512e5c31af7Sopenharmony_ci    slink:VkExternalMemoryImageCreateInfo structure whose pname:handleTypes
1513e5c31af7Sopenharmony_ci    member includes
1514e5c31af7Sopenharmony_ci    ename:VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID,
1515e5c31af7Sopenharmony_ci    pname:mipLevels must: either be `1` or equal to the number of levels in
1516e5c31af7Sopenharmony_ci    the complete mipmap chain based on [eq]#pname:extent.width#,
1517e5c31af7Sopenharmony_ci    [eq]#pname:extent.height#, and [eq]#pname:extent.depth#
1518e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-pNext-02396]]
1519e5c31af7Sopenharmony_ci    If the pname:pNext chain includes a slink:VkExternalFormatANDROID
1520e5c31af7Sopenharmony_ci    structure whose pname:externalFormat member is not `0`, pname:flags
1521e5c31af7Sopenharmony_ci    must: not include ename:VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT
1522e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-pNext-02397]]
1523e5c31af7Sopenharmony_ci    If the pname:pNext chain includes a slink:VkExternalFormatANDROID
1524e5c31af7Sopenharmony_ci    structure whose pname:externalFormat member is not `0`, pname:usage
1525e5c31af7Sopenharmony_ci    must: not include any usages except ename:VK_IMAGE_USAGE_SAMPLED_BIT
1526e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-pNext-02398]]
1527e5c31af7Sopenharmony_ci    If the pname:pNext chain includes a slink:VkExternalFormatANDROID
1528e5c31af7Sopenharmony_ci    structure whose pname:externalFormat member is not `0`, pname:tiling
1529e5c31af7Sopenharmony_ci    must: be ename:VK_IMAGE_TILING_OPTIMAL
1530e5c31af7Sopenharmony_ciendif::VK_ANDROID_external_memory_android_hardware_buffer[]
1531e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_EXT_separate_stencil_usage[]
1532e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-format-02795]]
1533e5c31af7Sopenharmony_ci    If pname:format is a depth-stencil format, pname:usage includes
1534e5c31af7Sopenharmony_ci    ename:VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT, and the pname:pNext
1535e5c31af7Sopenharmony_ci    chain includes a slink:VkImageStencilUsageCreateInfo structure, then its
1536e5c31af7Sopenharmony_ci    slink:VkImageStencilUsageCreateInfo::pname:stencilUsage member must:
1537e5c31af7Sopenharmony_ci    also include ename:VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT
1538e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-format-02796]]
1539e5c31af7Sopenharmony_ci    If pname:format is a depth-stencil format, pname:usage does not include
1540e5c31af7Sopenharmony_ci    ename:VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT, and the pname:pNext
1541e5c31af7Sopenharmony_ci    chain includes a slink:VkImageStencilUsageCreateInfo structure, then its
1542e5c31af7Sopenharmony_ci    slink:VkImageStencilUsageCreateInfo::pname:stencilUsage member must:
1543e5c31af7Sopenharmony_ci    also not include ename:VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT
1544e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-format-02797]]
1545e5c31af7Sopenharmony_ci    If pname:format is a depth-stencil format, pname:usage includes
1546e5c31af7Sopenharmony_ci    ename:VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT, and the pname:pNext chain
1547e5c31af7Sopenharmony_ci    includes a slink:VkImageStencilUsageCreateInfo structure, then its
1548e5c31af7Sopenharmony_ci    slink:VkImageStencilUsageCreateInfo::pname:stencilUsage member must:
1549e5c31af7Sopenharmony_ci    also include ename:VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT
1550e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-format-02798]]
1551e5c31af7Sopenharmony_ci    If pname:format is a depth-stencil format, pname:usage does not include
1552e5c31af7Sopenharmony_ci    ename:VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT, and the pname:pNext chain
1553e5c31af7Sopenharmony_ci    includes a slink:VkImageStencilUsageCreateInfo structure, then its
1554e5c31af7Sopenharmony_ci    slink:VkImageStencilUsageCreateInfo::pname:stencilUsage member must:
1555e5c31af7Sopenharmony_ci    also not include ename:VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT
1556e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-Format-02536]]
1557e5c31af7Sopenharmony_ci    If pname:Format is a depth-stencil format and the pname:pNext chain
1558e5c31af7Sopenharmony_ci    includes a slink:VkImageStencilUsageCreateInfo structure with its
1559e5c31af7Sopenharmony_ci    pname:stencilUsage member including
1560e5c31af7Sopenharmony_ci    ename:VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT, pname:extent.width must: be
1561e5c31af7Sopenharmony_ci    less than or equal to
1562e5c31af7Sopenharmony_ci    sname:VkPhysicalDeviceLimits::pname:maxFramebufferWidth
1563e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-format-02537]]
1564e5c31af7Sopenharmony_ci    If pname:format is a depth-stencil format and the pname:pNext chain
1565e5c31af7Sopenharmony_ci    includes a slink:VkImageStencilUsageCreateInfo structure with its
1566e5c31af7Sopenharmony_ci    pname:stencilUsage member including
1567e5c31af7Sopenharmony_ci    ename:VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT, pname:extent.height must: be
1568e5c31af7Sopenharmony_ci    less than or equal to
1569e5c31af7Sopenharmony_ci    sname:VkPhysicalDeviceLimits::pname:maxFramebufferHeight
1570e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-format-02538]]
1571e5c31af7Sopenharmony_ci    If the <<features-shaderStorageImageMultisample,multisampled storage
1572e5c31af7Sopenharmony_ci    images>> feature is not enabled, pname:format is a depth-stencil format
1573e5c31af7Sopenharmony_ci    and the pname:pNext chain includes a slink:VkImageStencilUsageCreateInfo
1574e5c31af7Sopenharmony_ci    structure with its pname:stencilUsage including
1575e5c31af7Sopenharmony_ci    ename:VK_IMAGE_USAGE_STORAGE_BIT, pname:samples must: be
1576e5c31af7Sopenharmony_ci    ename:VK_SAMPLE_COUNT_1_BIT
1577e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_EXT_separate_stencil_usage[]
1578e5c31af7Sopenharmony_ciifdef::VK_NV_corner_sampled_image[]
1579e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-flags-02050]]
1580e5c31af7Sopenharmony_ci    If pname:flags contains ename:VK_IMAGE_CREATE_CORNER_SAMPLED_BIT_NV,
1581e5c31af7Sopenharmony_ci    pname:imageType must: be ename:VK_IMAGE_TYPE_2D or
1582e5c31af7Sopenharmony_ci    ename:VK_IMAGE_TYPE_3D
1583e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-flags-02051]]
1584e5c31af7Sopenharmony_ci    If pname:flags contains ename:VK_IMAGE_CREATE_CORNER_SAMPLED_BIT_NV, it
1585e5c31af7Sopenharmony_ci    must: not contain ename:VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT and the
1586e5c31af7Sopenharmony_ci    pname:format must: not be a depth/stencil format
1587e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-flags-02052]]
1588e5c31af7Sopenharmony_ci    If pname:flags contains ename:VK_IMAGE_CREATE_CORNER_SAMPLED_BIT_NV and
1589e5c31af7Sopenharmony_ci    pname:imageType is ename:VK_IMAGE_TYPE_2D, pname:extent.width and
1590e5c31af7Sopenharmony_ci    pname:extent.height must: be greater than `1`
1591e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-flags-02053]]
1592e5c31af7Sopenharmony_ci    If pname:flags contains ename:VK_IMAGE_CREATE_CORNER_SAMPLED_BIT_NV and
1593e5c31af7Sopenharmony_ci    pname:imageType is ename:VK_IMAGE_TYPE_3D, pname:extent.width,
1594e5c31af7Sopenharmony_ci    pname:extent.height, and pname:extent.depth must: be greater than `1`
1595e5c31af7Sopenharmony_ciendif::VK_NV_corner_sampled_image[]
1596e5c31af7Sopenharmony_ciifdef::VK_KHR_fragment_shading_rate,VK_NV_shading_rate_image[]
1597e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-imageType-02082]]
1598e5c31af7Sopenharmony_ci    If pname:usage includes
1599e5c31af7Sopenharmony_ci    ename:VK_IMAGE_USAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR,
1600e5c31af7Sopenharmony_ci    pname:imageType must: be ename:VK_IMAGE_TYPE_2D
1601e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-samples-02083]]
1602e5c31af7Sopenharmony_ci    If pname:usage includes
1603e5c31af7Sopenharmony_ci    ename:VK_IMAGE_USAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR,
1604e5c31af7Sopenharmony_ci    pname:samples must: be ename:VK_SAMPLE_COUNT_1_BIT
1605e5c31af7Sopenharmony_ciendif::VK_KHR_fragment_shading_rate,VK_NV_shading_rate_image[]
1606e5c31af7Sopenharmony_ciifdef::VK_NV_shading_rate_image[]
1607e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-tiling-02084]]
1608e5c31af7Sopenharmony_ci    If pname:usage includes ename:VK_IMAGE_USAGE_SHADING_RATE_IMAGE_BIT_NV,
1609e5c31af7Sopenharmony_ci    pname:tiling must: be ename:VK_IMAGE_TILING_OPTIMAL
1610e5c31af7Sopenharmony_ciendif::VK_NV_shading_rate_image[]
1611e5c31af7Sopenharmony_ciifdef::VK_EXT_fragment_density_map[]
1612e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-flags-02565]]
1613e5c31af7Sopenharmony_ci    If pname:flags contains ename:VK_IMAGE_CREATE_SUBSAMPLED_BIT_EXT,
1614e5c31af7Sopenharmony_ci    pname:tiling must: be ename:VK_IMAGE_TILING_OPTIMAL
1615e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-flags-02566]]
1616e5c31af7Sopenharmony_ci    If pname:flags contains ename:VK_IMAGE_CREATE_SUBSAMPLED_BIT_EXT,
1617e5c31af7Sopenharmony_ci    pname:imageType must: be ename:VK_IMAGE_TYPE_2D
1618e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-flags-02567]]
1619e5c31af7Sopenharmony_ci    If pname:flags contains ename:VK_IMAGE_CREATE_SUBSAMPLED_BIT_EXT,
1620e5c31af7Sopenharmony_ci    pname:flags must: not contain ename:VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT
1621e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-flags-02568]]
1622e5c31af7Sopenharmony_ci    If pname:flags contains ename:VK_IMAGE_CREATE_SUBSAMPLED_BIT_EXT,
1623e5c31af7Sopenharmony_ci    pname:mipLevels must: be `1`
1624e5c31af7Sopenharmony_ciendif::VK_EXT_fragment_density_map[]
1625e5c31af7Sopenharmony_ciifdef::VK_HUAWEI_invocation_mask[]
1626e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-usage-04992]]
1627e5c31af7Sopenharmony_ci    If pname:usage includes ename:VK_IMAGE_USAGE_INVOCATION_MASK_BIT_HUAWEI,
1628e5c31af7Sopenharmony_ci    pname:tiling must: be ename:VK_IMAGE_TILING_LINEAR
1629e5c31af7Sopenharmony_ciendif::VK_HUAWEI_invocation_mask[]
1630e5c31af7Sopenharmony_ciifdef::VK_KHR_portability_subset[]
1631e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-imageView2DOn3DImage-04459]]
1632e5c31af7Sopenharmony_ci    If the `apiext:VK_KHR_portability_subset` extension is enabled, and
1633e5c31af7Sopenharmony_ci    slink:VkPhysicalDevicePortabilitySubsetFeaturesKHR::pname:imageView2DOn3DImage
1634e5c31af7Sopenharmony_ci    is ename:VK_FALSE, pname:flags must: not contain
1635e5c31af7Sopenharmony_ci    ename:VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT
1636e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-multisampleArrayImage-04460]]
1637e5c31af7Sopenharmony_ci    If the `apiext:VK_KHR_portability_subset` extension is enabled, and
1638e5c31af7Sopenharmony_ci    slink:VkPhysicalDevicePortabilitySubsetFeaturesKHR::pname:multisampleArrayImage
1639e5c31af7Sopenharmony_ci    is ename:VK_FALSE, and pname:samples is not ename:VK_SAMPLE_COUNT_1_BIT,
1640e5c31af7Sopenharmony_ci    then pname:arrayLayers must: be `1`
1641e5c31af7Sopenharmony_ciendif::VK_KHR_portability_subset[]
1642e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_KHR_image_format_list[]
1643e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-pNext-04737]]
1644e5c31af7Sopenharmony_ci    If a slink:VkImageFormatListCreateInfo structure was included in the
1645e5c31af7Sopenharmony_ci    pname:pNext chain and
1646e5c31af7Sopenharmony_ci    slink:VkImageFormatListCreateInfo::pname:viewFormatCount is not zero,
1647e5c31af7Sopenharmony_ci    then all of the formats in
1648e5c31af7Sopenharmony_ci    slink:VkImageFormatListCreateInfo::pname:pViewFormats must: be
1649e5c31af7Sopenharmony_ci    compatible with the pname:format as described in the
1650e5c31af7Sopenharmony_ci    <<formats-compatibility,compatibility table>>
1651e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-flags-04738]]
1652e5c31af7Sopenharmony_ci    If pname:flags does not contain ename:VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT
1653e5c31af7Sopenharmony_ci    and the pname:pNext chain includes a slink:VkImageFormatListCreateInfo
1654e5c31af7Sopenharmony_ci    structure, then slink:VkImageFormatListCreateInfo::pname:viewFormatCount
1655e5c31af7Sopenharmony_ci    must: be `0` or `1`
1656e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_KHR_image_format_list[]
1657e5c31af7Sopenharmony_ciifdef::VK_KHR_video_decode_queue[]
1658e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-usage-04815]]
1659e5c31af7Sopenharmony_ci    If pname:usage includes ename:VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR,
1660e5c31af7Sopenharmony_ci    ename:VK_IMAGE_USAGE_VIDEO_DECODE_SRC_BIT_KHR,
1661e5c31af7Sopenharmony_ci    ename:VK_IMAGE_USAGE_VIDEO_DECODE_DPB_BIT_KHR, then the pname:pNext
1662e5c31af7Sopenharmony_ci    chain must: include a valid slink:VkVideoProfilesKHR structure which
1663e5c31af7Sopenharmony_ci    includes at least one slink:VkVideoProfileKHR with a decode
1664e5c31af7Sopenharmony_ci    codec-operation
1665e5c31af7Sopenharmony_ciendif::VK_KHR_video_decode_queue[]
1666e5c31af7Sopenharmony_ciifdef::VK_KHR_video_encode_queue[]
1667e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-usage-04816]]
1668e5c31af7Sopenharmony_ci    If pname:usage includes ename:VK_IMAGE_USAGE_VIDEO_ENCODE_DST_BIT_KHR,
1669e5c31af7Sopenharmony_ci    ename:VK_IMAGE_USAGE_VIDEO_ENCODE_SRC_BIT_KHR,
1670e5c31af7Sopenharmony_ci    ename:VK_IMAGE_USAGE_VIDEO_ENCODE_DPB_BIT_KHR, then the pname:pNext
1671e5c31af7Sopenharmony_ci    chain must: include a valid slink:VkVideoProfilesKHR structure which
1672e5c31af7Sopenharmony_ci    includes at least one slink:VkVideoProfileKHR with a encode
1673e5c31af7Sopenharmony_ci    codec-operation
1674e5c31af7Sopenharmony_ciendif::VK_KHR_video_encode_queue[]
1675e5c31af7Sopenharmony_ciifdef::VK_FUCHSIA_buffer_collection[]
1676e5c31af7Sopenharmony_ci  * [[VUID-VkImageCreateInfo-pNext-06390]]
1677e5c31af7Sopenharmony_ci    If the slink:VkImage is to be used to import memory from a
1678e5c31af7Sopenharmony_ci    slink:VkBufferCollectionFUCHSIA, a
1679e5c31af7Sopenharmony_ci    slink:VkBufferCollectionImageCreateInfoFUCHSIA structure must: be
1680e5c31af7Sopenharmony_ci    chained to pname:pNext.
1681e5c31af7Sopenharmony_ciendif::VK_FUCHSIA_buffer_collection[]
1682e5c31af7Sopenharmony_ci****
1683e5c31af7Sopenharmony_ci
1684e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkImageCreateInfo.txt[]
1685e5c31af7Sopenharmony_ci--
1686e5c31af7Sopenharmony_ci
1687e5c31af7Sopenharmony_ciifdef::VK_FUCHSIA_buffer_collection[]
1688e5c31af7Sopenharmony_ci[open,refpage='VkBufferCollectionImageCreateInfoFUCHSIA',desc='Create a VkBufferCollectionFUCHSIA-compatible VkImage',type='structs']
1689e5c31af7Sopenharmony_ci--
1690e5c31af7Sopenharmony_ciThe sname:VkBufferCollectionImageCreateInfoFUCHSIA structure is defined as:
1691e5c31af7Sopenharmony_ci
1692e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkBufferCollectionImageCreateInfoFUCHSIA.txt[]
1693e5c31af7Sopenharmony_ci
1694e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure
1695e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
1696e5c31af7Sopenharmony_ci    structure
1697e5c31af7Sopenharmony_ci  * pname:collection is the slink:VkBufferCollectionFUCHSIA handle
1698e5c31af7Sopenharmony_ci  * pname:index is the index of the buffer in the buffer collection from
1699e5c31af7Sopenharmony_ci    which the memory will be imported
1700e5c31af7Sopenharmony_ci
1701e5c31af7Sopenharmony_ci.Valid Usage
1702e5c31af7Sopenharmony_ci****
1703e5c31af7Sopenharmony_ci  * [[VUID-VkBufferCollectionImageCreateInfoFUCHSIA-index-06391]]
1704e5c31af7Sopenharmony_ci    pname:index must: be less than
1705e5c31af7Sopenharmony_ci    slink:VkBufferCollectionPropertiesFUCHSIA::pname:bufferCount
1706e5c31af7Sopenharmony_ci****
1707e5c31af7Sopenharmony_ci
1708e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkBufferCollectionImageCreateInfoFUCHSIA.txt[]
1709e5c31af7Sopenharmony_ci--
1710e5c31af7Sopenharmony_ciendif::VK_FUCHSIA_buffer_collection[]
1711e5c31af7Sopenharmony_ci
1712e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_EXT_separate_stencil_usage[]
1713e5c31af7Sopenharmony_ci[open,refpage='VkImageStencilUsageCreateInfo',desc='Specify separate usage flags for the stencil aspect of a depth-stencil image',type='structs',alias='VkImageStencilUsageCreateInfoEXT']
1714e5c31af7Sopenharmony_ci--
1715e5c31af7Sopenharmony_ciThe sname:VkImageStencilUsageCreateInfo structure is defined as:
1716e5c31af7Sopenharmony_ci
1717e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkImageStencilUsageCreateInfo.txt[]
1718e5c31af7Sopenharmony_ci
1719e5c31af7Sopenharmony_ciifdef::VK_EXT_separate_stencil_usage[]
1720e5c31af7Sopenharmony_cior the equivalent
1721e5c31af7Sopenharmony_ci
1722e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkImageStencilUsageCreateInfoEXT.txt[]
1723e5c31af7Sopenharmony_ciendif::VK_EXT_separate_stencil_usage[]
1724e5c31af7Sopenharmony_ci
1725e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure.
1726e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
1727e5c31af7Sopenharmony_ci    structure.
1728e5c31af7Sopenharmony_ci  * pname:stencilUsage is a bitmask of elink:VkImageUsageFlagBits describing
1729e5c31af7Sopenharmony_ci    the intended usage of the stencil aspect of the image.
1730e5c31af7Sopenharmony_ci
1731e5c31af7Sopenharmony_ciIf the pname:pNext chain of slink:VkImageCreateInfo includes a
1732e5c31af7Sopenharmony_cisname:VkImageStencilUsageCreateInfo structure, then that structure includes
1733e5c31af7Sopenharmony_cithe usage flags specific to the stencil aspect of the image for an image
1734e5c31af7Sopenharmony_ciwith a depth-stencil format.
1735e5c31af7Sopenharmony_ci
1736e5c31af7Sopenharmony_ciThis structure specifies image usages which only apply to the stencil aspect
1737e5c31af7Sopenharmony_ciof a depth/stencil format image.
1738e5c31af7Sopenharmony_ciWhen this structure is included in the pname:pNext chain of
1739e5c31af7Sopenharmony_cislink:VkImageCreateInfo, the stencil aspect of the image must: only be used
1740e5c31af7Sopenharmony_cias specified by pname:stencilUsage.
1741e5c31af7Sopenharmony_ciWhen this structure is not included in the pname:pNext chain of
1742e5c31af7Sopenharmony_cislink:VkImageCreateInfo, the stencil aspect of an image must: only be used
1743e5c31af7Sopenharmony_cias specified by slink:VkImageCreateInfo::pname:usage.
1744e5c31af7Sopenharmony_ciUse of other aspects of an image are unaffected by this structure.
1745e5c31af7Sopenharmony_ci
1746e5c31af7Sopenharmony_ciThis structure can: also be included in the pname:pNext chain of
1747e5c31af7Sopenharmony_cislink:VkPhysicalDeviceImageFormatInfo2 to query additional capabilities
1748e5c31af7Sopenharmony_cispecific to image creation parameter combinations including a separate set
1749e5c31af7Sopenharmony_ciof usage flags for the stencil aspect of the image using
1750e5c31af7Sopenharmony_ciflink:vkGetPhysicalDeviceImageFormatProperties2.
1751e5c31af7Sopenharmony_ciWhen this structure is not included in the pname:pNext chain of
1752e5c31af7Sopenharmony_cisname:VkPhysicalDeviceImageFormatInfo2 then the implicit value of
1753e5c31af7Sopenharmony_cipname:stencilUsage matches that of
1754e5c31af7Sopenharmony_cisname:VkPhysicalDeviceImageFormatInfo2::pname:usage.
1755e5c31af7Sopenharmony_ci
1756e5c31af7Sopenharmony_ci.Valid Usage
1757e5c31af7Sopenharmony_ci****
1758e5c31af7Sopenharmony_ci  * [[VUID-VkImageStencilUsageCreateInfo-stencilUsage-02539]]
1759e5c31af7Sopenharmony_ci    If pname:stencilUsage includes
1760e5c31af7Sopenharmony_ci    ename:VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT, it must: not include bits
1761e5c31af7Sopenharmony_ci    other than ename:VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT or
1762e5c31af7Sopenharmony_ci    ename:VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT
1763e5c31af7Sopenharmony_ci****
1764e5c31af7Sopenharmony_ci
1765e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkImageStencilUsageCreateInfo.txt[]
1766e5c31af7Sopenharmony_ci--
1767e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_EXT_separate_stencil_usage[]
1768e5c31af7Sopenharmony_ci
1769e5c31af7Sopenharmony_ciifdef::VK_NV_dedicated_allocation[]
1770e5c31af7Sopenharmony_ci[open,refpage='VkDedicatedAllocationImageCreateInfoNV',desc='Specify that an image is bound to a dedicated memory resource',type='structs']
1771e5c31af7Sopenharmony_ci--
1772e5c31af7Sopenharmony_ciIf the pname:pNext chain includes a
1773e5c31af7Sopenharmony_cisname:VkDedicatedAllocationImageCreateInfoNV structure, then that structure
1774e5c31af7Sopenharmony_ciincludes an enable controlling whether the image will have a dedicated
1775e5c31af7Sopenharmony_cimemory allocation bound to it.
1776e5c31af7Sopenharmony_ci
1777e5c31af7Sopenharmony_ciThe sname:VkDedicatedAllocationImageCreateInfoNV structure is defined as:
1778e5c31af7Sopenharmony_ci
1779e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkDedicatedAllocationImageCreateInfoNV.txt[]
1780e5c31af7Sopenharmony_ci
1781e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure.
1782e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
1783e5c31af7Sopenharmony_ci    structure.
1784e5c31af7Sopenharmony_ci  * pname:dedicatedAllocation specifies whether the image will have a
1785e5c31af7Sopenharmony_ci    dedicated allocation bound to it.
1786e5c31af7Sopenharmony_ci
1787e5c31af7Sopenharmony_ci[NOTE]
1788e5c31af7Sopenharmony_ci.Note
1789e5c31af7Sopenharmony_ci====
1790e5c31af7Sopenharmony_ciUsing a dedicated allocation for color and depth/stencil attachments or
1791e5c31af7Sopenharmony_ciother large images may: improve performance on some devices.
1792e5c31af7Sopenharmony_ci====
1793e5c31af7Sopenharmony_ci
1794e5c31af7Sopenharmony_ci.Valid Usage
1795e5c31af7Sopenharmony_ci****
1796e5c31af7Sopenharmony_ci  * [[VUID-VkDedicatedAllocationImageCreateInfoNV-dedicatedAllocation-00994]]
1797e5c31af7Sopenharmony_ci    If pname:dedicatedAllocation is ename:VK_TRUE,
1798e5c31af7Sopenharmony_ci    slink:VkImageCreateInfo::pname:flags must: not include
1799e5c31af7Sopenharmony_ci    ename:VK_IMAGE_CREATE_SPARSE_BINDING_BIT,
1800e5c31af7Sopenharmony_ci    ename:VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT, or
1801e5c31af7Sopenharmony_ci    ename:VK_IMAGE_CREATE_SPARSE_ALIASED_BIT
1802e5c31af7Sopenharmony_ci****
1803e5c31af7Sopenharmony_ci
1804e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkDedicatedAllocationImageCreateInfoNV.txt[]
1805e5c31af7Sopenharmony_ci--
1806e5c31af7Sopenharmony_ciendif::VK_NV_dedicated_allocation[]
1807e5c31af7Sopenharmony_ci
1808e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_external_memory[]
1809e5c31af7Sopenharmony_ci[open,refpage='VkExternalMemoryImageCreateInfo',desc='Specify that an image may be backed by external memory',type='structs']
1810e5c31af7Sopenharmony_ci--
1811e5c31af7Sopenharmony_ciTo define a set of external memory handle types that may: be used as backing
1812e5c31af7Sopenharmony_cistore for an image, add a slink:VkExternalMemoryImageCreateInfo structure to
1813e5c31af7Sopenharmony_cithe pname:pNext chain of the slink:VkImageCreateInfo structure.
1814e5c31af7Sopenharmony_ciThe sname:VkExternalMemoryImageCreateInfo structure is defined as:
1815e5c31af7Sopenharmony_ci
1816e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkExternalMemoryImageCreateInfo.txt[]
1817e5c31af7Sopenharmony_ci
1818e5c31af7Sopenharmony_ciifdef::VK_KHR_external_memory[]
1819e5c31af7Sopenharmony_cior the equivalent
1820e5c31af7Sopenharmony_ci
1821e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkExternalMemoryImageCreateInfoKHR.txt[]
1822e5c31af7Sopenharmony_ciendif::VK_KHR_external_memory[]
1823e5c31af7Sopenharmony_ci
1824e5c31af7Sopenharmony_ci[NOTE]
1825e5c31af7Sopenharmony_ci.Note
1826e5c31af7Sopenharmony_ci====
1827e5c31af7Sopenharmony_ciA sname:VkExternalMemoryImageCreateInfo structure with a non-zero
1828e5c31af7Sopenharmony_cipname:handleTypes field must be included in the creation parameters for an
1829e5c31af7Sopenharmony_ciimage that will be bound to memory that is either exported or imported.
1830e5c31af7Sopenharmony_ci====
1831e5c31af7Sopenharmony_ci
1832e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure.
1833e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
1834e5c31af7Sopenharmony_ci    structure.
1835e5c31af7Sopenharmony_ci  * pname:handleTypes is zero, or a bitmask of
1836e5c31af7Sopenharmony_ci    elink:VkExternalMemoryHandleTypeFlagBits specifying one or more external
1837e5c31af7Sopenharmony_ci    memory handle types.
1838e5c31af7Sopenharmony_ci
1839e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkExternalMemoryImageCreateInfo.txt[]
1840e5c31af7Sopenharmony_ci--
1841e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_external_memory[]
1842e5c31af7Sopenharmony_ci
1843e5c31af7Sopenharmony_ciifdef::VK_NV_external_memory[]
1844e5c31af7Sopenharmony_ci[open,refpage='VkExternalMemoryImageCreateInfoNV',desc='Specify that an image may be backed by external memory',type='structs']
1845e5c31af7Sopenharmony_ci--
1846e5c31af7Sopenharmony_ciIf the pname:pNext chain includes a sname:VkExternalMemoryImageCreateInfoNV
1847e5c31af7Sopenharmony_cistructure, then that structure defines a set of external memory handle types
1848e5c31af7Sopenharmony_cithat may: be used as backing store for the image.
1849e5c31af7Sopenharmony_ci
1850e5c31af7Sopenharmony_ciThe sname:VkExternalMemoryImageCreateInfoNV structure is defined as:
1851e5c31af7Sopenharmony_ci
1852e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkExternalMemoryImageCreateInfoNV.txt[]
1853e5c31af7Sopenharmony_ci
1854e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure.
1855e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
1856e5c31af7Sopenharmony_ci    structure.
1857e5c31af7Sopenharmony_ci  * pname:handleTypes is zero, or a bitmask of
1858e5c31af7Sopenharmony_ci    elink:VkExternalMemoryHandleTypeFlagBitsNV specifying one or more
1859e5c31af7Sopenharmony_ci    external memory handle types.
1860e5c31af7Sopenharmony_ci
1861e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkExternalMemoryImageCreateInfoNV.txt[]
1862e5c31af7Sopenharmony_ci--
1863e5c31af7Sopenharmony_ciendif::VK_NV_external_memory[]
1864e5c31af7Sopenharmony_ci
1865e5c31af7Sopenharmony_ciifdef::VK_ANDROID_external_memory_android_hardware_buffer[]
1866e5c31af7Sopenharmony_ci[open,refpage='VkExternalFormatANDROID',desc='Structure containing an Android hardware buffer external format',type='structs']
1867e5c31af7Sopenharmony_ci--
1868e5c31af7Sopenharmony_ciTo create an image with an
1869e5c31af7Sopenharmony_ci<<memory-external-android-hardware-buffer-external-formats,external
1870e5c31af7Sopenharmony_ciformat>>, add a sname:VkExternalFormatANDROID structure in the pname:pNext
1871e5c31af7Sopenharmony_cichain of slink:VkImageCreateInfo.
1872e5c31af7Sopenharmony_cisname:VkExternalFormatANDROID is defined as:
1873e5c31af7Sopenharmony_ci
1874e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkExternalFormatANDROID.txt[]
1875e5c31af7Sopenharmony_ci
1876e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure.
1877e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
1878e5c31af7Sopenharmony_ci    structure.
1879e5c31af7Sopenharmony_ci  * pname:externalFormat is an implementation-defined identifier for the
1880e5c31af7Sopenharmony_ci    external format
1881e5c31af7Sopenharmony_ci
1882e5c31af7Sopenharmony_ciIf pname:externalFormat is zero, the effect is as if the
1883e5c31af7Sopenharmony_cisname:VkExternalFormatANDROID structure was not present.
1884e5c31af7Sopenharmony_ciOtherwise, the pname:image will have the specified external format.
1885e5c31af7Sopenharmony_ci
1886e5c31af7Sopenharmony_ci.Valid Usage
1887e5c31af7Sopenharmony_ci****
1888e5c31af7Sopenharmony_ci  * [[VUID-VkExternalFormatANDROID-externalFormat-01894]]
1889e5c31af7Sopenharmony_ci    pname:externalFormat must: be `0` or a value returned in the
1890e5c31af7Sopenharmony_ci    pname:externalFormat member of
1891e5c31af7Sopenharmony_ci    slink:VkAndroidHardwareBufferFormatPropertiesANDROID by an earlier call
1892e5c31af7Sopenharmony_ci    to flink:vkGetAndroidHardwareBufferPropertiesANDROID
1893e5c31af7Sopenharmony_ci****
1894e5c31af7Sopenharmony_ci
1895e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkExternalFormatANDROID.txt[]
1896e5c31af7Sopenharmony_ci--
1897e5c31af7Sopenharmony_ciendif::VK_ANDROID_external_memory_android_hardware_buffer[]
1898e5c31af7Sopenharmony_ci
1899e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_device_group[]
1900e5c31af7Sopenharmony_ciifdef::VK_KHR_swapchain[]
1901e5c31af7Sopenharmony_ci[open,refpage='VkImageSwapchainCreateInfoKHR',desc='Specify that an image will be bound to swapchain memory',type='structs']
1902e5c31af7Sopenharmony_ci--
1903e5c31af7Sopenharmony_ciIf the pname:pNext chain of slink:VkImageCreateInfo includes a
1904e5c31af7Sopenharmony_cisname:VkImageSwapchainCreateInfoKHR structure, then that structure includes
1905e5c31af7Sopenharmony_cia swapchain handle indicating that the image will be bound to memory from
1906e5c31af7Sopenharmony_cithat swapchain.
1907e5c31af7Sopenharmony_ci
1908e5c31af7Sopenharmony_ciThe sname:VkImageSwapchainCreateInfoKHR structure is defined as:
1909e5c31af7Sopenharmony_ci
1910e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkImageSwapchainCreateInfoKHR.txt[]
1911e5c31af7Sopenharmony_ci
1912e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure.
1913e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
1914e5c31af7Sopenharmony_ci    structure.
1915e5c31af7Sopenharmony_ci  * pname:swapchain is dlink:VK_NULL_HANDLE or a handle of a swapchain that
1916e5c31af7Sopenharmony_ci    the image will be bound to.
1917e5c31af7Sopenharmony_ci
1918e5c31af7Sopenharmony_ci.Valid Usage
1919e5c31af7Sopenharmony_ci****
1920e5c31af7Sopenharmony_ci  * [[VUID-VkImageSwapchainCreateInfoKHR-swapchain-00995]]
1921e5c31af7Sopenharmony_ci    If pname:swapchain is not dlink:VK_NULL_HANDLE, the fields of
1922e5c31af7Sopenharmony_ci    slink:VkImageCreateInfo must: match the
1923e5c31af7Sopenharmony_ci    <<swapchain-wsi-image-create-info, implied image creation parameters>>
1924e5c31af7Sopenharmony_ci    of the swapchain
1925e5c31af7Sopenharmony_ci****
1926e5c31af7Sopenharmony_ci
1927e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkImageSwapchainCreateInfoKHR.txt[]
1928e5c31af7Sopenharmony_ci--
1929e5c31af7Sopenharmony_ciendif::VK_KHR_swapchain[]
1930e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_device_group[]
1931e5c31af7Sopenharmony_ci
1932e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_KHR_image_format_list[]
1933e5c31af7Sopenharmony_ci[open,refpage='VkImageFormatListCreateInfo',desc='Specify that an image can: be used with a particular set of formats',type='structs',alias='VkImageFormatListCreateInfoKHR']
1934e5c31af7Sopenharmony_ci--
1935e5c31af7Sopenharmony_ciIf the pname:pNext chain of slink:VkImageCreateInfo includes a
1936e5c31af7Sopenharmony_cisname:VkImageFormatListCreateInfo structure, then that structure contains a
1937e5c31af7Sopenharmony_cilist of all formats that can: be used when creating views of this image.
1938e5c31af7Sopenharmony_ci
1939e5c31af7Sopenharmony_ciThe sname:VkImageFormatListCreateInfo structure is defined as:
1940e5c31af7Sopenharmony_ci
1941e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkImageFormatListCreateInfo.txt[]
1942e5c31af7Sopenharmony_ci
1943e5c31af7Sopenharmony_ciifdef::VK_KHR_image_format_list[]
1944e5c31af7Sopenharmony_cior the equivalent
1945e5c31af7Sopenharmony_ci
1946e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkImageFormatListCreateInfoKHR.txt[]
1947e5c31af7Sopenharmony_ciendif::VK_KHR_image_format_list[]
1948e5c31af7Sopenharmony_ci
1949e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure.
1950e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
1951e5c31af7Sopenharmony_ci    structure.
1952e5c31af7Sopenharmony_ci  * pname:viewFormatCount is the number of entries in the pname:pViewFormats
1953e5c31af7Sopenharmony_ci    array.
1954e5c31af7Sopenharmony_ci  * pname:pViewFormats is a pointer to an array of elink:VkFormat values
1955e5c31af7Sopenharmony_ci    specifying all formats which can: be used when creating views of this
1956e5c31af7Sopenharmony_ci    image.
1957e5c31af7Sopenharmony_ci
1958e5c31af7Sopenharmony_ciIf pname:viewFormatCount is zero, pname:pViewFormats is ignored and the
1959e5c31af7Sopenharmony_ciimage is created as if the sname:VkImageFormatListCreateInfo structure were
1960e5c31af7Sopenharmony_cinot included in the pname:pNext chain of slink:VkImageCreateInfo.
1961e5c31af7Sopenharmony_ci
1962e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkImageFormatListCreateInfo.txt[]
1963e5c31af7Sopenharmony_ci--
1964e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_KHR_image_format_list[]
1965e5c31af7Sopenharmony_ci
1966e5c31af7Sopenharmony_ciifdef::VK_EXT_image_drm_format_modifier[]
1967e5c31af7Sopenharmony_ci[open,refpage='VkImageDrmFormatModifierListCreateInfoEXT',desc='Specify that an image must be created with a DRM format modifier from the provided list',type='structs']
1968e5c31af7Sopenharmony_ci--
1969e5c31af7Sopenharmony_ciIf the pname:pNext chain of slink:VkImageCreateInfo includes a
1970e5c31af7Sopenharmony_cislink:VkImageDrmFormatModifierListCreateInfoEXT structure, then the image
1971e5c31af7Sopenharmony_ciwill be created with one of the <<glossary-drm-format-modifier,Linux DRM
1972e5c31af7Sopenharmony_ciformat modifiers>> listed in the structure.
1973e5c31af7Sopenharmony_ciThe choice of modifier is implementation-dependent.
1974e5c31af7Sopenharmony_ci
1975e5c31af7Sopenharmony_ciThe slink:VkImageDrmFormatModifierListCreateInfoEXT structure is defined as:
1976e5c31af7Sopenharmony_ci
1977e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkImageDrmFormatModifierListCreateInfoEXT.txt[]
1978e5c31af7Sopenharmony_ci
1979e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure.
1980e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
1981e5c31af7Sopenharmony_ci    structure.
1982e5c31af7Sopenharmony_ci  * pname:drmFormatModifierCount is the length of the
1983e5c31af7Sopenharmony_ci    pname:pDrmFormatModifiers array.
1984e5c31af7Sopenharmony_ci  * pname:pDrmFormatModifiers is a pointer to an array of _Linux DRM format
1985e5c31af7Sopenharmony_ci    modifiers_.
1986e5c31af7Sopenharmony_ci
1987e5c31af7Sopenharmony_ci.Valid Usage
1988e5c31af7Sopenharmony_ci****
1989e5c31af7Sopenharmony_ci  * [[VUID-VkImageDrmFormatModifierListCreateInfoEXT-pDrmFormatModifiers-02263]]
1990e5c31af7Sopenharmony_ci    Each _modifier_ in pname:pDrmFormatModifiers must: be compatible with
1991e5c31af7Sopenharmony_ci    the parameters in slink:VkImageCreateInfo and its pname:pNext chain, as
1992e5c31af7Sopenharmony_ci    determined by querying slink:VkPhysicalDeviceImageFormatInfo2 extended
1993e5c31af7Sopenharmony_ci    with slink:VkPhysicalDeviceImageDrmFormatModifierInfoEXT
1994e5c31af7Sopenharmony_ci****
1995e5c31af7Sopenharmony_ci
1996e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkImageDrmFormatModifierListCreateInfoEXT.txt[]
1997e5c31af7Sopenharmony_ci--
1998e5c31af7Sopenharmony_ci
1999e5c31af7Sopenharmony_ci[open,refpage='VkImageDrmFormatModifierExplicitCreateInfoEXT',desc='Specify that an image be created with the provided DRM format modifier and explicit memory layout',type='structs']
2000e5c31af7Sopenharmony_ci--
2001e5c31af7Sopenharmony_ciIf the pname:pNext chain of slink:VkImageCreateInfo includes a
2002e5c31af7Sopenharmony_cislink:VkImageDrmFormatModifierExplicitCreateInfoEXT structure, then the
2003e5c31af7Sopenharmony_ciimage will be created with the <<glossary-drm-format-modifier,Linux DRM
2004e5c31af7Sopenharmony_ciformat modifier>> and memory layout defined by the structure.
2005e5c31af7Sopenharmony_ci
2006e5c31af7Sopenharmony_ciThe slink:VkImageDrmFormatModifierExplicitCreateInfoEXT structure is defined
2007e5c31af7Sopenharmony_cias:
2008e5c31af7Sopenharmony_ci
2009e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkImageDrmFormatModifierExplicitCreateInfoEXT.txt[]
2010e5c31af7Sopenharmony_ci
2011e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure.
2012e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
2013e5c31af7Sopenharmony_ci    structure.
2014e5c31af7Sopenharmony_ci  * pname:drmFormatModifier is the _Linux DRM format modifier_ with which
2015e5c31af7Sopenharmony_ci    the image will be created.
2016e5c31af7Sopenharmony_ci  * pname:drmFormatModifierPlaneCount is the number of _memory planes_ in
2017e5c31af7Sopenharmony_ci    the image (as reported by slink:VkDrmFormatModifierPropertiesEXT) as
2018e5c31af7Sopenharmony_ci    well as the length of the pname:pPlaneLayouts array.
2019e5c31af7Sopenharmony_ci  * pname:pPlaneLayouts is a pointer to an array of
2020e5c31af7Sopenharmony_ci    slink:VkSubresourceLayout structures describing the image's _memory
2021e5c31af7Sopenharmony_ci    planes_.
2022e5c31af7Sopenharmony_ci
2023e5c31af7Sopenharmony_ciThe etext:i^th^ member of pname:pPlaneLayouts describes the layout of the
2024e5c31af7Sopenharmony_ciimage's etext:i^th^ _memory plane_ (that is,
2025e5c31af7Sopenharmony_ci`VK_IMAGE_ASPECT_MEMORY_PLANE__{ibit}__BIT_EXT`).
2026e5c31af7Sopenharmony_ciIn each element of pname:pPlaneLayouts, the implementation must: ignore
2027e5c31af7Sopenharmony_cipname:size.
2028e5c31af7Sopenharmony_ciThe implementation calculates the size of each plane, which the application
2029e5c31af7Sopenharmony_cican: query with flink:vkGetImageSubresourceLayout.
2030e5c31af7Sopenharmony_ci
2031e5c31af7Sopenharmony_ciWhen creating an image with
2032e5c31af7Sopenharmony_cislink:VkImageDrmFormatModifierExplicitCreateInfoEXT, it is the application's
2033e5c31af7Sopenharmony_ciresponsibility to satisfy all valid usage requirements.
2034e5c31af7Sopenharmony_ciHowever, the implementation must: validate that the provided
2035e5c31af7Sopenharmony_cipname:pPlaneLayouts, when combined with the provided pname:drmFormatModifier
2036e5c31af7Sopenharmony_ciand other creation parameters in slink:VkImageCreateInfo and its pname:pNext
2037e5c31af7Sopenharmony_cichain, produce a valid image.
2038e5c31af7Sopenharmony_ci(This validation is necessarily implementation-dependent and outside the
2039e5c31af7Sopenharmony_ciscope of Vulkan, and therefore not described by valid usage requirements).
2040e5c31af7Sopenharmony_ciIf this validation fails, then flink:vkCreateImage returns
2041e5c31af7Sopenharmony_ciename:VK_ERROR_INVALID_DRM_FORMAT_MODIFIER_PLANE_LAYOUT_EXT.
2042e5c31af7Sopenharmony_ci
2043e5c31af7Sopenharmony_ci.Valid Usage
2044e5c31af7Sopenharmony_ci****
2045e5c31af7Sopenharmony_ci  * [[VUID-VkImageDrmFormatModifierExplicitCreateInfoEXT-drmFormatModifier-02264]]
2046e5c31af7Sopenharmony_ci    pname:drmFormatModifier must: be compatible with the parameters in
2047e5c31af7Sopenharmony_ci    slink:VkImageCreateInfo and its pname:pNext chain, as determined by
2048e5c31af7Sopenharmony_ci    querying slink:VkPhysicalDeviceImageFormatInfo2 extended with
2049e5c31af7Sopenharmony_ci    slink:VkPhysicalDeviceImageDrmFormatModifierInfoEXT
2050e5c31af7Sopenharmony_ci  * [[VUID-VkImageDrmFormatModifierExplicitCreateInfoEXT-drmFormatModifierPlaneCount-02265]]
2051e5c31af7Sopenharmony_ci    pname:drmFormatModifierPlaneCount must: be equal to the
2052e5c31af7Sopenharmony_ci    slink:VkDrmFormatModifierPropertiesEXT::pname:drmFormatModifierPlaneCount
2053e5c31af7Sopenharmony_ci    associated with slink:VkImageCreateInfo::pname:format and
2054e5c31af7Sopenharmony_ci    pname:drmFormatModifier, as found by querying
2055e5c31af7Sopenharmony_ci    slink:VkDrmFormatModifierPropertiesListEXT
2056e5c31af7Sopenharmony_ci  * [[VUID-VkImageDrmFormatModifierExplicitCreateInfoEXT-size-02267]]
2057e5c31af7Sopenharmony_ci    For each element of pname:pPlaneLayouts, pname:size must: be 0
2058e5c31af7Sopenharmony_ci  * [[VUID-VkImageDrmFormatModifierExplicitCreateInfoEXT-arrayPitch-02268]]
2059e5c31af7Sopenharmony_ci    For each element of pname:pPlaneLayouts, pname:arrayPitch must: be 0 if
2060e5c31af7Sopenharmony_ci    slink:VkImageCreateInfo::pname:arrayLayers is 1
2061e5c31af7Sopenharmony_ci  * [[VUID-VkImageDrmFormatModifierExplicitCreateInfoEXT-depthPitch-02269]]
2062e5c31af7Sopenharmony_ci    For each element of pname:pPlaneLayouts, pname:depthPitch must: be 0 if
2063e5c31af7Sopenharmony_ci    slink:VkImageCreateInfo::pname:extent.depth is 1
2064e5c31af7Sopenharmony_ci****
2065e5c31af7Sopenharmony_ci
2066e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkImageDrmFormatModifierExplicitCreateInfoEXT.txt[]
2067e5c31af7Sopenharmony_ci--
2068e5c31af7Sopenharmony_ciendif::VK_EXT_image_drm_format_modifier[]
2069e5c31af7Sopenharmony_ci
2070e5c31af7Sopenharmony_ci[open,refpage='VkImageUsageFlagBits',desc='Bitmask specifying intended usage of an image',type='enums']
2071e5c31af7Sopenharmony_ci--
2072e5c31af7Sopenharmony_ciBits which can: be set in
2073e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_maintenance2[]
2074e5c31af7Sopenharmony_cislink:VkImageViewUsageCreateInfo::pname:usage, or
2075e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_maintenance2[]
2076e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_EXT_separate_stencil_usage[]
2077e5c31af7Sopenharmony_cislink:VkImageStencilUsageCreateInfo::pname:stencilUsage, or
2078e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_EXT_separate_stencil_usage[]
2079e5c31af7Sopenharmony_cislink:VkImageCreateInfo::pname:usage, specifying intended usage of an image,
2080e5c31af7Sopenharmony_ciare:
2081e5c31af7Sopenharmony_ci
2082e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkImageUsageFlagBits.txt[]
2083e5c31af7Sopenharmony_ci
2084e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_USAGE_TRANSFER_SRC_BIT specifies that the image can: be
2085e5c31af7Sopenharmony_ci    used as the source of a transfer command.
2086e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_USAGE_TRANSFER_DST_BIT specifies that the image can: be
2087e5c31af7Sopenharmony_ci    used as the destination of a transfer command.
2088e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_USAGE_SAMPLED_BIT specifies that the image can: be used
2089e5c31af7Sopenharmony_ci    to create a sname:VkImageView suitable for occupying a
2090e5c31af7Sopenharmony_ci    sname:VkDescriptorSet slot either of type
2091e5c31af7Sopenharmony_ci    ename:VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE or
2092e5c31af7Sopenharmony_ci    ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, and be sampled by a
2093e5c31af7Sopenharmony_ci    shader.
2094e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_USAGE_STORAGE_BIT specifies that the image can: be used
2095e5c31af7Sopenharmony_ci    to create a sname:VkImageView suitable for occupying a
2096e5c31af7Sopenharmony_ci    sname:VkDescriptorSet slot of type
2097e5c31af7Sopenharmony_ci    ename:VK_DESCRIPTOR_TYPE_STORAGE_IMAGE.
2098e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT specifies that the image can:
2099e5c31af7Sopenharmony_ci    be used to create a sname:VkImageView suitable for use as a color or
2100e5c31af7Sopenharmony_ci    resolve attachment in a sname:VkFramebuffer.
2101e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT specifies that the
2102e5c31af7Sopenharmony_ci    image can: be used to create a sname:VkImageView suitable for use as a
2103e5c31af7Sopenharmony_ci    depth/stencil
2104e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_KHR_depth_stencil_resolve[]
2105e5c31af7Sopenharmony_ci    or depth/stencil resolve
2106e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_KHR_depth_stencil_resolve[]
2107e5c31af7Sopenharmony_ci    attachment in a sname:VkFramebuffer.
2108e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT specifies that
2109e5c31af7Sopenharmony_ci    implementations may: support using <<memory, memory allocations>> with
2110e5c31af7Sopenharmony_ci    the ename:VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT to back an image with
2111e5c31af7Sopenharmony_ci    this usage.
2112e5c31af7Sopenharmony_ci    This bit can: be set for any image that can: be used to create a
2113e5c31af7Sopenharmony_ci    sname:VkImageView suitable for use as a color, resolve, depth/stencil,
2114e5c31af7Sopenharmony_ci    or input attachment.
2115e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT specifies that the image can:
2116e5c31af7Sopenharmony_ci    be used to create a sname:VkImageView suitable for occupying
2117e5c31af7Sopenharmony_ci    sname:VkDescriptorSet slot of type
2118e5c31af7Sopenharmony_ci    ename:VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT; be read from a shader as an
2119e5c31af7Sopenharmony_ci    input attachment; and be used as an input attachment in a framebuffer.
2120e5c31af7Sopenharmony_ciifdef::VK_EXT_fragment_density_map[]
2121e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_USAGE_FRAGMENT_DENSITY_MAP_BIT_EXT specifies that the
2122e5c31af7Sopenharmony_ci    image can: be used to create a sname:VkImageView suitable for use as a
2123e5c31af7Sopenharmony_ci    <<fragmentdensitymapops, fragment density map image>>.
2124e5c31af7Sopenharmony_ciendif::VK_EXT_fragment_density_map[]
2125e5c31af7Sopenharmony_ciifdef::VK_KHR_fragment_shading_rate,VK_NV_shading_rate_image[]
2126e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_USAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR specifies
2127e5c31af7Sopenharmony_ci    that the image can: be used to create a sname:VkImageView suitable for
2128e5c31af7Sopenharmony_ci    use as a
2129e5c31af7Sopenharmony_ciifdef::VK_KHR_fragment_shading_rate[]
2130e5c31af7Sopenharmony_ci    <<primsrast-fragment-shading-rate-attachment, fragment shading rate
2131e5c31af7Sopenharmony_ci    attachment>>
2132e5c31af7Sopenharmony_ciendif::VK_KHR_fragment_shading_rate[]
2133e5c31af7Sopenharmony_ciifdef::VK_KHR_fragment_shading_rate+VK_NV_shading_rate_image[or]
2134e5c31af7Sopenharmony_ciifdef::VK_NV_shading_rate_image[]
2135e5c31af7Sopenharmony_ci    <<primsrast-shading-rate-image, shading rate image>>
2136e5c31af7Sopenharmony_ciendif::VK_NV_shading_rate_image[]
2137e5c31af7Sopenharmony_ciendif::VK_KHR_fragment_shading_rate,VK_NV_shading_rate_image[]
2138e5c31af7Sopenharmony_ciifdef::VK_KHR_video_decode_queue[]
2139e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR specifies that
2140e5c31af7Sopenharmony_ci    <<video-decode-operations, video decode operations>> can use the image
2141e5c31af7Sopenharmony_ci    as a <<reference-picture,reference picture>>, or a source of
2142e5c31af7Sopenharmony_ci    postprocessing, or transfer operation.
2143e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_USAGE_VIDEO_DECODE_DPB_BIT_KHR specifies that
2144e5c31af7Sopenharmony_ci    <<video-decode-operations, video decode operations>> can use the image
2145e5c31af7Sopenharmony_ci    as a <<video-picture-resources,DPB Video Picture Resource>>,
2146e5c31af7Sopenharmony_ci    representing a <<reference-picture,reference picture>>.
2147e5c31af7Sopenharmony_ci    This flag must: be combined with
2148e5c31af7Sopenharmony_ci    ename:VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR and
2149e5c31af7Sopenharmony_ci    ename:VK_IMAGE_USAGE_VIDEO_DECODE_SRC_BIT_KHR.
2150e5c31af7Sopenharmony_ci    ename:VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR is required for DPB image
2151e5c31af7Sopenharmony_ci    resources because these resources will be associated with
2152e5c31af7Sopenharmony_ci    <<reference-picture,reference pictures>> after acting as targets for
2153e5c31af7Sopenharmony_ci    video decode operations.
2154e5c31af7Sopenharmony_ci    ename:VK_IMAGE_USAGE_VIDEO_DECODE_SRC_BIT_KHR is required for DPB image
2155e5c31af7Sopenharmony_ci    resources because the <<reference-picture,reference pictures>>
2156e5c31af7Sopenharmony_ci    associated with them act as information sources for subsequent decode
2157e5c31af7Sopenharmony_ci    operations.
2158e5c31af7Sopenharmony_ciendif::VK_KHR_video_decode_queue[]
2159e5c31af7Sopenharmony_ciifdef::VK_KHR_video_encode_queue[]
2160e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_USAGE_VIDEO_ENCODE_SRC_BIT_KHR specifies that the image
2161e5c31af7Sopenharmony_ci    can be used as an <<input-encode-picture,input picture>> for
2162e5c31af7Sopenharmony_ci    <<video-encode-operations, video encode operations>>.
2163e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_USAGE_VIDEO_ENCODE_DPB_BIT_KHR specifies that
2164e5c31af7Sopenharmony_ci    <<video-encode-operations, video encode operations>> can use the image
2165e5c31af7Sopenharmony_ci    to hold a <<video-picture-resources,reconstructed picture>>, and to act
2166e5c31af7Sopenharmony_ci    as a <<reference-picture,reference picture>>.
2167e5c31af7Sopenharmony_ci    This flag must: be combined with
2168e5c31af7Sopenharmony_ci    ename:VK_IMAGE_USAGE_VIDEO_ENCODE_DST_BIT_KHR and
2169e5c31af7Sopenharmony_ci    ename:VK_IMAGE_USAGE_VIDEO_ENCODE_SRC_BIT_KHR.
2170e5c31af7Sopenharmony_ci    ename:VK_IMAGE_USAGE_VIDEO_ENCODE_DST_BIT_KHR is required for a DPB
2171e5c31af7Sopenharmony_ci    image resource because the reconstructed picture resulting from an
2172e5c31af7Sopenharmony_ci    encode operation will be written to it.
2173e5c31af7Sopenharmony_ci    ename:VK_IMAGE_USAGE_VIDEO_ENCODE_SRC_BIT_KHR is required for DPB image
2174e5c31af7Sopenharmony_ci    resources because it can be used as a <<reference-picture,reconstructed
2175e5c31af7Sopenharmony_ci    reference picture>> source for the encode operation.
2176e5c31af7Sopenharmony_ciendif::VK_KHR_video_encode_queue[]
2177e5c31af7Sopenharmony_ci--
2178e5c31af7Sopenharmony_ci
2179e5c31af7Sopenharmony_ci[open,refpage='VkImageUsageFlags',desc='Bitmask of VkImageUsageFlagBits',type='flags']
2180e5c31af7Sopenharmony_ci--
2181e5c31af7Sopenharmony_ciinclude::{generated}/api/flags/VkImageUsageFlags.txt[]
2182e5c31af7Sopenharmony_ci
2183e5c31af7Sopenharmony_citname:VkImageUsageFlags is a bitmask type for setting a mask of zero or more
2184e5c31af7Sopenharmony_cielink:VkImageUsageFlagBits.
2185e5c31af7Sopenharmony_ci
2186e5c31af7Sopenharmony_ci[[valid-imageview-imageusage]]
2187e5c31af7Sopenharmony_ciWhen creating a sname:VkImageView one of the following
2188e5c31af7Sopenharmony_cielink:VkImageUsageFlagBits must: be set:
2189e5c31af7Sopenharmony_ci
2190e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_USAGE_SAMPLED_BIT
2191e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_USAGE_STORAGE_BIT
2192e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT
2193e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT
2194e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT
2195e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT
2196e5c31af7Sopenharmony_ciifdef::VK_NV_shading_rate_image,VK_KHR_fragment_shading_rate[]
2197e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_USAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR
2198e5c31af7Sopenharmony_ciendif::VK_NV_shading_rate_image,VK_KHR_fragment_shading_rate[]
2199e5c31af7Sopenharmony_ciifdef::VK_EXT_fragment_density_map[]
2200e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_USAGE_FRAGMENT_DENSITY_MAP_BIT_EXT
2201e5c31af7Sopenharmony_ciendif::VK_EXT_fragment_density_map[]
2202e5c31af7Sopenharmony_ci--
2203e5c31af7Sopenharmony_ci
2204e5c31af7Sopenharmony_ci[open,refpage='VkImageCreateFlagBits',desc='Bitmask specifying additional parameters of an image',type='enums']
2205e5c31af7Sopenharmony_ci--
2206e5c31af7Sopenharmony_ciBits which can: be set in slink:VkImageCreateInfo::pname:flags, specifying
2207e5c31af7Sopenharmony_ciadditional parameters of an image, are:
2208e5c31af7Sopenharmony_ci
2209e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkImageCreateFlagBits.txt[]
2210e5c31af7Sopenharmony_ci
2211e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_CREATE_SPARSE_BINDING_BIT specifies that the image will
2212e5c31af7Sopenharmony_ci    be backed using sparse memory binding.
2213e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT specifies that the image can:
2214e5c31af7Sopenharmony_ci    be partially backed using sparse memory binding.
2215e5c31af7Sopenharmony_ci    Images created with this flag must: also be created with the
2216e5c31af7Sopenharmony_ci    ename:VK_IMAGE_CREATE_SPARSE_BINDING_BIT flag.
2217e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_CREATE_SPARSE_ALIASED_BIT specifies that the image will
2218e5c31af7Sopenharmony_ci    be backed using sparse memory binding with memory ranges that might also
2219e5c31af7Sopenharmony_ci    simultaneously be backing another image (or another portion of the same
2220e5c31af7Sopenharmony_ci    image).
2221e5c31af7Sopenharmony_ci    Images created with this flag must: also be created with the
2222e5c31af7Sopenharmony_ci    ename:VK_IMAGE_CREATE_SPARSE_BINDING_BIT flag.
2223e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT specifies that the image can:
2224e5c31af7Sopenharmony_ci    be used to create a sname:VkImageView with a different format from the
2225e5c31af7Sopenharmony_ci    image.
2226e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
2227e5c31af7Sopenharmony_ci    For <<formats-requiring-sampler-ycbcr-conversion,multi-planar>> formats,
2228e5c31af7Sopenharmony_ci    ename:VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT specifies that a
2229e5c31af7Sopenharmony_ci    sname:VkImageView can be created of a _plane_ of the image.
2230e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
2231e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT specifies that the image can:
2232e5c31af7Sopenharmony_ci    be used to create a sname:VkImageView of type
2233e5c31af7Sopenharmony_ci    ename:VK_IMAGE_VIEW_TYPE_CUBE or ename:VK_IMAGE_VIEW_TYPE_CUBE_ARRAY.
2234e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_maintenance1[]
2235e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT specifies that the image
2236e5c31af7Sopenharmony_ci    can: be used to create a sname:VkImageView of type
2237e5c31af7Sopenharmony_ci    ename:VK_IMAGE_VIEW_TYPE_2D or ename:VK_IMAGE_VIEW_TYPE_2D_ARRAY.
2238e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_maintenance1[]
2239e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1[]
2240e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_CREATE_PROTECTED_BIT specifies that the image is a
2241e5c31af7Sopenharmony_ci    protected image.
2242e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1[]
2243e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_device_group[]
2244e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT specifies that the
2245e5c31af7Sopenharmony_ci    image can: be used with a non-zero value of the
2246e5c31af7Sopenharmony_ci    pname:splitInstanceBindRegionCount member of a
2247e5c31af7Sopenharmony_ci    slink:VkBindImageMemoryDeviceGroupInfo structure passed into
2248e5c31af7Sopenharmony_ci    flink:vkBindImageMemory2.
2249e5c31af7Sopenharmony_ci    This flag also has the effect of making the image use the standard
2250e5c31af7Sopenharmony_ci    sparse image block dimensions.
2251e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_device_group[]
2252e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_maintenance2[]
2253e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT specifies that the
2254e5c31af7Sopenharmony_ci    image having a compressed format can: be used to create a
2255e5c31af7Sopenharmony_ci    sname:VkImageView with an uncompressed format where each texel in the
2256e5c31af7Sopenharmony_ci    image view corresponds to a compressed texel block of the image.
2257e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_CREATE_EXTENDED_USAGE_BIT specifies that the image can:
2258e5c31af7Sopenharmony_ci    be created with usage flags that are not supported for the format the
2259e5c31af7Sopenharmony_ci    image is created with but are supported for at least one format a
2260e5c31af7Sopenharmony_ci    sname:VkImageView created from the image can: have.
2261e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_maintenance2[]
2262e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
2263e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_CREATE_DISJOINT_BIT specifies that an image with a
2264e5c31af7Sopenharmony_ci    <<formats-requiring-sampler-ycbcr-conversion,multi-planar format>> must:
2265e5c31af7Sopenharmony_ci    have each plane separately bound to memory, rather than having a single
2266e5c31af7Sopenharmony_ci    memory binding for the whole image; the presence of this bit
2267e5c31af7Sopenharmony_ci    distinguishes a _disjoint image_ from an image without this bit set.
2268e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
2269e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_bind_memory2[]
2270e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_CREATE_ALIAS_BIT specifies that two images created with
2271e5c31af7Sopenharmony_ci    the same creation parameters and aliased to the same memory can:
2272e5c31af7Sopenharmony_ci    interpret the contents of the memory consistently with each other,
2273e5c31af7Sopenharmony_ci    subject to the rules described in the <<resources-memory-aliasing,Memory
2274e5c31af7Sopenharmony_ci    Aliasing>> section.
2275e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
2276e5c31af7Sopenharmony_ci    This flag further specifies that each plane of a _disjoint_ image can:
2277e5c31af7Sopenharmony_ci    share an in-memory non-linear representation with single-plane images,
2278e5c31af7Sopenharmony_ci    and that a single-plane image can: share an in-memory non-linear
2279e5c31af7Sopenharmony_ci    representation with a plane of a multi-planar disjoint image, according
2280e5c31af7Sopenharmony_ci    to the rules in <<formats-compatible-planes>>.
2281e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
2282e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_external_memory,VK_NV_external_memory[]
2283e5c31af7Sopenharmony_ci    If the pname:pNext chain includes a
2284e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_external_memory[slink:VkExternalMemoryImageCreateInfo]
2285e5c31af7Sopenharmony_ci// Jon: logic needs to incorporate VK_VERSION_1_1
2286e5c31af7Sopenharmony_ciifdef::VK_KHR_external_memory+VK_NV_external_memory[or]
2287e5c31af7Sopenharmony_ciifdef::VK_NV_external_memory[slink:VkExternalMemoryImageCreateInfoNV]
2288e5c31af7Sopenharmony_ci    structure whose pname:handleTypes member is not `0`, it is as if
2289e5c31af7Sopenharmony_ci    ename:VK_IMAGE_CREATE_ALIAS_BIT is set.
2290e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_external_memory,VK_NV_external_memory[]
2291e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_bind_memory2[]
2292e5c31af7Sopenharmony_ciifdef::VK_EXT_sample_locations[]
2293e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT
2294e5c31af7Sopenharmony_ci    specifies that an image with a depth or depth/stencil format can: be
2295e5c31af7Sopenharmony_ci    used with custom sample locations when used as a depth/stencil
2296e5c31af7Sopenharmony_ci    attachment.
2297e5c31af7Sopenharmony_ciendif::VK_EXT_sample_locations[]
2298e5c31af7Sopenharmony_ciifdef::VK_NV_corner_sampled_image[]
2299e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_CREATE_CORNER_SAMPLED_BIT_NV specifies that the image is
2300e5c31af7Sopenharmony_ci    a <<resources-images-corner-sampled,corner-sampled image>>.
2301e5c31af7Sopenharmony_ciendif::VK_NV_corner_sampled_image[]
2302e5c31af7Sopenharmony_ciifdef::VK_EXT_fragment_density_map[]
2303e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_CREATE_SUBSAMPLED_BIT_EXT specifies that an image can: be
2304e5c31af7Sopenharmony_ci    in a subsampled format which may: be more optimal when written as an
2305e5c31af7Sopenharmony_ci    attachment by a render pass that has a fragment density map attachment.
2306e5c31af7Sopenharmony_ci    Accessing a subsampled image has additional considerations:
2307e5c31af7Sopenharmony_ci  ** Image data read as an image sampler will have undefined: values if the
2308e5c31af7Sopenharmony_ci     sampler was not created with pname:flags containing
2309e5c31af7Sopenharmony_ci     ename:VK_SAMPLER_CREATE_SUBSAMPLED_BIT_EXT or was not sampled through
2310e5c31af7Sopenharmony_ci     the use of a combined image sampler with an immutable sampler in
2311e5c31af7Sopenharmony_ci     sname:VkDescriptorSetLayoutBinding.
2312e5c31af7Sopenharmony_ci  ** Image data read with an input attachment will have undefined: values if
2313e5c31af7Sopenharmony_ci     the contents were not written as an attachment in an earlier subpass of
2314e5c31af7Sopenharmony_ci     the same render pass.
2315e5c31af7Sopenharmony_ciifdef::VK_EXT_fragment_density_map2[]
2316e5c31af7Sopenharmony_ci  ** Image data read as an image sampler in the fragment shader will be
2317e5c31af7Sopenharmony_ci     additionally be read by the device during
2318e5c31af7Sopenharmony_ci     ename:VK_PIPELINE_STAGE_VERTEX_SHADER_BIT if
2319e5c31af7Sopenharmony_ci     <<limits-subsampledCoarseReconstructionEarlyAccess,sname:VkPhysicalDeviceFragmentDensityMap2PropertiesEXT::pname:subsampledCoarseReconstructionEarlyAccess>>
2320e5c31af7Sopenharmony_ci     is ename:VK_TRUE and the sampler was created with pname:flags
2321e5c31af7Sopenharmony_ci     containing
2322e5c31af7Sopenharmony_ci     ename:VK_SAMPLER_CREATE_SUBSAMPLED_COARSE_RECONSTRUCTION_BIT_EXT.
2323e5c31af7Sopenharmony_ci  ** Image data read with load operations are resampled to the fragment
2324e5c31af7Sopenharmony_ci     density of the render pass if
2325e5c31af7Sopenharmony_ci     <<limits-subsampledLoads,sname:VkPhysicalDeviceFragmentDensityMap2PropertiesEXT::pname:subsampledLoads>>
2326e5c31af7Sopenharmony_ci     is ename:VK_TRUE.
2327e5c31af7Sopenharmony_ci     Otherwise, values of image data are undefined:.
2328e5c31af7Sopenharmony_ciendif::VK_EXT_fragment_density_map2[]
2329e5c31af7Sopenharmony_ciifndef::VK_EXT_fragment_density_map2[]
2330e5c31af7Sopenharmony_ci  ** Image data read with load operations may: be resampled to the fragment
2331e5c31af7Sopenharmony_ci     density of the render pass.
2332e5c31af7Sopenharmony_ciendif::VK_EXT_fragment_density_map2[]
2333e5c31af7Sopenharmony_ci  ** Image contents outside of the render area take on undefined: values if
2334e5c31af7Sopenharmony_ci     the image is stored as a render pass attachment.
2335e5c31af7Sopenharmony_ciendif::VK_EXT_fragment_density_map[]
2336e5c31af7Sopenharmony_ci
2337e5c31af7Sopenharmony_ciSee <<sparsememory-sparseresourcefeatures,Sparse Resource Features>> and
2338e5c31af7Sopenharmony_ci<<sparsememory-physicalfeatures,Sparse Physical Device Features>> for more
2339e5c31af7Sopenharmony_cidetails.
2340e5c31af7Sopenharmony_ci--
2341e5c31af7Sopenharmony_ci
2342e5c31af7Sopenharmony_ci[open,refpage='VkImageCreateFlags',desc='Bitmask of VkImageCreateFlagBits',type='flags']
2343e5c31af7Sopenharmony_ci--
2344e5c31af7Sopenharmony_ciinclude::{generated}/api/flags/VkImageCreateFlags.txt[]
2345e5c31af7Sopenharmony_ci
2346e5c31af7Sopenharmony_citname:VkImageCreateFlags is a bitmask type for setting a mask of zero or
2347e5c31af7Sopenharmony_cimore elink:VkImageCreateFlagBits.
2348e5c31af7Sopenharmony_ci--
2349e5c31af7Sopenharmony_ci
2350e5c31af7Sopenharmony_ci[open,refpage='VkImageType',desc='Specifies the type of an image object',type='enums']
2351e5c31af7Sopenharmony_ci--
2352e5c31af7Sopenharmony_ciPossible values of slink:VkImageCreateInfo::pname:imageType, specifying the
2353e5c31af7Sopenharmony_cibasic dimensionality of an image, are:
2354e5c31af7Sopenharmony_ci
2355e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkImageType.txt[]
2356e5c31af7Sopenharmony_ci
2357e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_TYPE_1D specifies a one-dimensional image.
2358e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_TYPE_2D specifies a two-dimensional image.
2359e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_TYPE_3D specifies a three-dimensional image.
2360e5c31af7Sopenharmony_ci--
2361e5c31af7Sopenharmony_ci
2362e5c31af7Sopenharmony_ci[open,refpage='VkImageTiling',desc='Specifies the tiling arrangement of data in an image',type='enums']
2363e5c31af7Sopenharmony_ci--
2364e5c31af7Sopenharmony_ciPossible values of slink:VkImageCreateInfo::pname:tiling, specifying the
2365e5c31af7Sopenharmony_citiling arrangement of texel blocks in an image, are:
2366e5c31af7Sopenharmony_ci
2367e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkImageTiling.txt[]
2368e5c31af7Sopenharmony_ci
2369e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_TILING_OPTIMAL specifies optimal tiling (texels are laid
2370e5c31af7Sopenharmony_ci    out in an implementation-dependent arrangement, for more efficient
2371e5c31af7Sopenharmony_ci    memory access).
2372e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_TILING_LINEAR specifies linear tiling (texels are laid
2373e5c31af7Sopenharmony_ci    out in memory in row-major order, possibly with some padding on each
2374e5c31af7Sopenharmony_ci    row).
2375e5c31af7Sopenharmony_ciifdef::VK_EXT_image_drm_format_modifier[]
2376e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT indicates that the image's
2377e5c31af7Sopenharmony_ci    tiling is defined by a <<glossary-drm-format-modifier,Linux DRM format
2378e5c31af7Sopenharmony_ci    modifier>>.
2379e5c31af7Sopenharmony_ci    The modifier is specified at image creation with
2380e5c31af7Sopenharmony_ci    slink:VkImageDrmFormatModifierListCreateInfoEXT or
2381e5c31af7Sopenharmony_ci    slink:VkImageDrmFormatModifierExplicitCreateInfoEXT, and can: be queried
2382e5c31af7Sopenharmony_ci    with flink:vkGetImageDrmFormatModifierPropertiesEXT.
2383e5c31af7Sopenharmony_ciendif::VK_EXT_image_drm_format_modifier[]
2384e5c31af7Sopenharmony_ci--
2385e5c31af7Sopenharmony_ci
2386e5c31af7Sopenharmony_ci[open,refpage='vkGetImageSubresourceLayout',desc='Retrieve information about an image subresource',type='protos']
2387e5c31af7Sopenharmony_ci--
2388e5c31af7Sopenharmony_ciTo query the memory layout of an image subresource, call:
2389e5c31af7Sopenharmony_ci
2390e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkGetImageSubresourceLayout.txt[]
2391e5c31af7Sopenharmony_ci
2392e5c31af7Sopenharmony_ci  * pname:device is the logical device that owns the image.
2393e5c31af7Sopenharmony_ci  * pname:image is the image whose layout is being queried.
2394e5c31af7Sopenharmony_ci  * pname:pSubresource is a pointer to a slink:VkImageSubresource structure
2395e5c31af7Sopenharmony_ci    selecting a specific image for the image subresource.
2396e5c31af7Sopenharmony_ci  * pname:pLayout is a pointer to a slink:VkSubresourceLayout structure in
2397e5c31af7Sopenharmony_ci    which the layout is returned.
2398e5c31af7Sopenharmony_ci
2399e5c31af7Sopenharmony_ciifndef::VK_EXT_image_drm_format_modifier[]
2400e5c31af7Sopenharmony_ciThe image must: be <<glossary-linear-resource,linear>>.
2401e5c31af7Sopenharmony_ciThe
2402e5c31af7Sopenharmony_ciendif::VK_EXT_image_drm_format_modifier[]
2403e5c31af7Sopenharmony_ciifdef::VK_EXT_image_drm_format_modifier[]
2404e5c31af7Sopenharmony_ciIf the image is <<glossary-linear-resource,linear>>, then the
2405e5c31af7Sopenharmony_ciendif::VK_EXT_image_drm_format_modifier[]
2406e5c31af7Sopenharmony_cireturned layout is valid for <<memory-device-hostaccess, host access>>.
2407e5c31af7Sopenharmony_ci
2408e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
2409e5c31af7Sopenharmony_ciIf the image's
2410e5c31af7Sopenharmony_ciifdef::VK_EXT_image_drm_format_modifier[]
2411e5c31af7Sopenharmony_citiling is ename:VK_IMAGE_TILING_LINEAR and its
2412e5c31af7Sopenharmony_ciendif::VK_EXT_image_drm_format_modifier[]
2413e5c31af7Sopenharmony_ciformat is a <<formats-requiring-sampler-ycbcr-conversion,multi-planar
2414e5c31af7Sopenharmony_ciformat>>, then fname:vkGetImageSubresourceLayout describes one
2415e5c31af7Sopenharmony_ciifdef::VK_EXT_image_drm_format_modifier[_format plane_]
2416e5c31af7Sopenharmony_ciifndef::VK_EXT_image_drm_format_modifier[plane]
2417e5c31af7Sopenharmony_ciof the image.
2418e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
2419e5c31af7Sopenharmony_ciifdef::VK_EXT_image_drm_format_modifier[]
2420e5c31af7Sopenharmony_ciIf the image's tiling is ename:VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT, then
2421e5c31af7Sopenharmony_cifname:vkGetImageSubresourceLayout describes one _memory plane_ of the image.
2422e5c31af7Sopenharmony_ciIf the image's tiling is ename:VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT and
2423e5c31af7Sopenharmony_cithe image is <<glossary-linear-resource,non-linear>>, then the returned
2424e5c31af7Sopenharmony_cilayout has an implementation-dependent meaning; the vendor of the image's
2425e5c31af7Sopenharmony_ci<<glossary-drm-format-modifier,DRM format modifier>> may: provide
2426e5c31af7Sopenharmony_cidocumentation that explains how to interpret the returned layout.
2427e5c31af7Sopenharmony_ciendif::VK_EXT_image_drm_format_modifier[]
2428e5c31af7Sopenharmony_ci
2429e5c31af7Sopenharmony_cifname:vkGetImageSubresourceLayout is invariant for the lifetime of a single
2430e5c31af7Sopenharmony_ciimage.
2431e5c31af7Sopenharmony_ciifdef::VK_ANDROID_external_memory_android_hardware_buffer[]
2432e5c31af7Sopenharmony_ciHowever, the subresource layout of images in Android hardware buffer
2433e5c31af7Sopenharmony_ciexternal memory is not known until the image has been bound to memory, so
2434e5c31af7Sopenharmony_ciapplications must: not call flink:vkGetImageSubresourceLayout for such an
2435e5c31af7Sopenharmony_ciimage before it has been bound.
2436e5c31af7Sopenharmony_ciendif::VK_ANDROID_external_memory_android_hardware_buffer[]
2437e5c31af7Sopenharmony_ci
2438e5c31af7Sopenharmony_ci.Valid Usage
2439e5c31af7Sopenharmony_ci****
2440e5c31af7Sopenharmony_ciifndef::VK_EXT_image_drm_format_modifier[]
2441e5c31af7Sopenharmony_ci  * [[VUID-vkGetImageSubresourceLayout-image-00996]]
2442e5c31af7Sopenharmony_ci    pname:image must: have been created with pname:tiling equal to
2443e5c31af7Sopenharmony_ci    ename:VK_IMAGE_TILING_LINEAR
2444e5c31af7Sopenharmony_ciendif::VK_EXT_image_drm_format_modifier[]
2445e5c31af7Sopenharmony_ciifdef::VK_EXT_image_drm_format_modifier[]
2446e5c31af7Sopenharmony_ci  * [[VUID-vkGetImageSubresourceLayout-image-02270]]
2447e5c31af7Sopenharmony_ci    pname:image must: have been created with pname:tiling equal to
2448e5c31af7Sopenharmony_ci    ename:VK_IMAGE_TILING_LINEAR or
2449e5c31af7Sopenharmony_ci    ename:VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT
2450e5c31af7Sopenharmony_ciendif::VK_EXT_image_drm_format_modifier[]
2451e5c31af7Sopenharmony_ci  * [[VUID-vkGetImageSubresourceLayout-aspectMask-00997]]
2452e5c31af7Sopenharmony_ci    The pname:aspectMask member of pname:pSubresource must: only have a
2453e5c31af7Sopenharmony_ci    single bit set
2454e5c31af7Sopenharmony_ci  * [[VUID-vkGetImageSubresourceLayout-mipLevel-01716]]
2455e5c31af7Sopenharmony_ci    The pname:mipLevel member of pname:pSubresource must: be less than the
2456e5c31af7Sopenharmony_ci    pname:mipLevels specified in slink:VkImageCreateInfo when pname:image
2457e5c31af7Sopenharmony_ci    was created
2458e5c31af7Sopenharmony_ci  * [[VUID-vkGetImageSubresourceLayout-arrayLayer-01717]]
2459e5c31af7Sopenharmony_ci    The pname:arrayLayer member of pname:pSubresource must: be less than the
2460e5c31af7Sopenharmony_ci    pname:arrayLayers specified in slink:VkImageCreateInfo when pname:image
2461e5c31af7Sopenharmony_ci    was created
2462e5c31af7Sopenharmony_ci  * [[VUID-vkGetImageSubresourceLayout-format-04461]]
2463e5c31af7Sopenharmony_ci    If pname:format is a color format, the pname:aspectMask member of
2464e5c31af7Sopenharmony_ci    pname:pSubresource must: be ename:VK_IMAGE_ASPECT_COLOR_BIT
2465e5c31af7Sopenharmony_ci  * [[VUID-vkGetImageSubresourceLayout-format-04462]]
2466e5c31af7Sopenharmony_ci    If pname:format has a depth component, the pname:aspectMask member of
2467e5c31af7Sopenharmony_ci    pname:pSubresource must: contain ename:VK_IMAGE_ASPECT_DEPTH_BIT
2468e5c31af7Sopenharmony_ci  * [[VUID-vkGetImageSubresourceLayout-format-04463]]
2469e5c31af7Sopenharmony_ci    If pname:format has a stencil component, the pname:aspectMask member of
2470e5c31af7Sopenharmony_ci    pname:pSubresource must: contain ename:VK_IMAGE_ASPECT_STENCIL_BIT
2471e5c31af7Sopenharmony_ci  * [[VUID-vkGetImageSubresourceLayout-format-04464]]
2472e5c31af7Sopenharmony_ci    If pname:format does not contain a stencil or depth component, the
2473e5c31af7Sopenharmony_ci    pname:aspectMask member of pname:pSubresource must: not contain
2474e5c31af7Sopenharmony_ci    ename:VK_IMAGE_ASPECT_DEPTH_BIT or ename:VK_IMAGE_ASPECT_STENCIL_BIT
2475e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
2476e5c31af7Sopenharmony_ci  * [[VUID-vkGetImageSubresourceLayout-format-01581]]
2477e5c31af7Sopenharmony_ci    If the pname:tiling of the pname:image is ename:VK_IMAGE_TILING_LINEAR
2478e5c31af7Sopenharmony_ci    and its pname:format is a
2479e5c31af7Sopenharmony_ci    <<formats-requiring-sampler-ycbcr-conversion,multi-planar format>> with
2480e5c31af7Sopenharmony_ci    two planes, the pname:aspectMask member of pname:pSubresource must: be
2481e5c31af7Sopenharmony_ci    ename:VK_IMAGE_ASPECT_PLANE_0_BIT or ename:VK_IMAGE_ASPECT_PLANE_1_BIT
2482e5c31af7Sopenharmony_ci  * [[VUID-vkGetImageSubresourceLayout-format-01582]]
2483e5c31af7Sopenharmony_ci    If the pname:tiling of the pname:image is ename:VK_IMAGE_TILING_LINEAR
2484e5c31af7Sopenharmony_ci    and its pname:format is a
2485e5c31af7Sopenharmony_ci    <<formats-requiring-sampler-ycbcr-conversion,multi-planar format>> with
2486e5c31af7Sopenharmony_ci    three planes, the pname:aspectMask member of pname:pSubresource must: be
2487e5c31af7Sopenharmony_ci    ename:VK_IMAGE_ASPECT_PLANE_0_BIT, ename:VK_IMAGE_ASPECT_PLANE_1_BIT or
2488e5c31af7Sopenharmony_ci    ename:VK_IMAGE_ASPECT_PLANE_2_BIT
2489e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
2490e5c31af7Sopenharmony_ciifdef::VK_ANDROID_external_memory_android_hardware_buffer[]
2491e5c31af7Sopenharmony_ci  * [[VUID-vkGetImageSubresourceLayout-image-01895]]
2492e5c31af7Sopenharmony_ci    If pname:image was created with the
2493e5c31af7Sopenharmony_ci    ename:VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID
2494e5c31af7Sopenharmony_ci    external memory handle type, then pname:image must: be bound to memory
2495e5c31af7Sopenharmony_ciendif::VK_ANDROID_external_memory_android_hardware_buffer[]
2496e5c31af7Sopenharmony_ciifdef::VK_EXT_image_drm_format_modifier[]
2497e5c31af7Sopenharmony_ci  * [[VUID-vkGetImageSubresourceLayout-tiling-02271]]
2498e5c31af7Sopenharmony_ci    If the pname:tiling of the pname:image is
2499e5c31af7Sopenharmony_ci    ename:VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT, then the pname:aspectMask
2500e5c31af7Sopenharmony_ci    member of pname:pSubresource must: be
2501e5c31af7Sopenharmony_ci    `VK_IMAGE_ASPECT_MEMORY_PLANE__{ibit}__BIT_EXT` and the index _i_ must:
2502e5c31af7Sopenharmony_ci    be less than the
2503e5c31af7Sopenharmony_ci    slink:VkDrmFormatModifierPropertiesEXT::pname:drmFormatModifierPlaneCount
2504e5c31af7Sopenharmony_ci    associated with the image's pname:format and
2505e5c31af7Sopenharmony_ci    slink:VkImageDrmFormatModifierPropertiesEXT::pname:drmFormatModifier
2506e5c31af7Sopenharmony_ciendif::VK_EXT_image_drm_format_modifier[]
2507e5c31af7Sopenharmony_ci****
2508e5c31af7Sopenharmony_ci
2509e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkGetImageSubresourceLayout.txt[]
2510e5c31af7Sopenharmony_ci--
2511e5c31af7Sopenharmony_ci
2512e5c31af7Sopenharmony_ci[open,refpage='VkImageSubresource',desc='Structure specifying an image subresource',type='structs']
2513e5c31af7Sopenharmony_ci--
2514e5c31af7Sopenharmony_ciThe sname:VkImageSubresource structure is defined as:
2515e5c31af7Sopenharmony_ci
2516e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkImageSubresource.txt[]
2517e5c31af7Sopenharmony_ci
2518e5c31af7Sopenharmony_ci  * pname:aspectMask is a tlink:VkImageAspectFlags value selecting the image
2519e5c31af7Sopenharmony_ci    _aspect_.
2520e5c31af7Sopenharmony_ci  * pname:mipLevel selects the mipmap level.
2521e5c31af7Sopenharmony_ci  * pname:arrayLayer selects the array layer.
2522e5c31af7Sopenharmony_ci
2523e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkImageSubresource.txt[]
2524e5c31af7Sopenharmony_ci--
2525e5c31af7Sopenharmony_ci
2526e5c31af7Sopenharmony_ci[open,refpage='VkSubresourceLayout',desc='Structure specifying subresource layout',type='structs']
2527e5c31af7Sopenharmony_ci--
2528e5c31af7Sopenharmony_ciInformation about the layout of the image subresource is returned in a
2529e5c31af7Sopenharmony_cisname:VkSubresourceLayout structure:
2530e5c31af7Sopenharmony_ci
2531e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkSubresourceLayout.txt[]
2532e5c31af7Sopenharmony_ci
2533e5c31af7Sopenharmony_ci  * pname:offset is the byte offset from the start of the image
2534e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
2535e5c31af7Sopenharmony_ci    or the plane
2536e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
2537e5c31af7Sopenharmony_ci    where the image subresource begins.
2538e5c31af7Sopenharmony_ci  * pname:size is the size in bytes of the image subresource.
2539e5c31af7Sopenharmony_ci    pname:size includes any extra memory that is required based on
2540e5c31af7Sopenharmony_ci    pname:rowPitch.
2541e5c31af7Sopenharmony_ci  * pname:rowPitch describes the number of bytes between each row of texels
2542e5c31af7Sopenharmony_ci    in an image.
2543e5c31af7Sopenharmony_ci  * pname:arrayPitch describes the number of bytes between each array layer
2544e5c31af7Sopenharmony_ci    of an image.
2545e5c31af7Sopenharmony_ci  * pname:depthPitch describes the number of bytes between each slice of 3D
2546e5c31af7Sopenharmony_ci    image.
2547e5c31af7Sopenharmony_ci
2548e5c31af7Sopenharmony_ciIf the image is <<glossary-linear-resource,linear>>, then pname:rowPitch,
2549e5c31af7Sopenharmony_cipname:arrayPitch and pname:depthPitch describe the layout of the image
2550e5c31af7Sopenharmony_cisubresource in linear memory.
2551e5c31af7Sopenharmony_ciFor uncompressed formats, pname:rowPitch is the number of bytes between
2552e5c31af7Sopenharmony_citexels with the same x coordinate in adjacent rows (y coordinates differ by
2553e5c31af7Sopenharmony_cione).
2554e5c31af7Sopenharmony_cipname:arrayPitch is the number of bytes between texels with the same x and y
2555e5c31af7Sopenharmony_cicoordinate in adjacent array layers of the image (array layer values differ
2556e5c31af7Sopenharmony_ciby one).
2557e5c31af7Sopenharmony_cipname:depthPitch is the number of bytes between texels with the same x and y
2558e5c31af7Sopenharmony_cicoordinate in adjacent slices of a 3D image (z coordinates differ by one).
2559e5c31af7Sopenharmony_ciExpressed as an addressing formula, the starting byte of a texel in the
2560e5c31af7Sopenharmony_ciimage subresource has address:
2561e5c31af7Sopenharmony_ci
2562e5c31af7Sopenharmony_ci[source,c]
2563e5c31af7Sopenharmony_ci~~~~
2564e5c31af7Sopenharmony_ci// (x,y,z,layer) are in texel coordinates
2565e5c31af7Sopenharmony_ciaddress(x,y,z,layer) = layer*arrayPitch + z*depthPitch + y*rowPitch + x*elementSize + offset
2566e5c31af7Sopenharmony_ci~~~~
2567e5c31af7Sopenharmony_ci
2568e5c31af7Sopenharmony_ciFor compressed formats, the pname:rowPitch is the number of bytes between
2569e5c31af7Sopenharmony_cicompressed texel blocks in adjacent rows.
2570e5c31af7Sopenharmony_cipname:arrayPitch is the number of bytes between compressed texel blocks in
2571e5c31af7Sopenharmony_ciadjacent array layers.
2572e5c31af7Sopenharmony_cipname:depthPitch is the number of bytes between compressed texel blocks in
2573e5c31af7Sopenharmony_ciadjacent slices of a 3D image.
2574e5c31af7Sopenharmony_ci
2575e5c31af7Sopenharmony_ci[source,c]
2576e5c31af7Sopenharmony_ci~~~~
2577e5c31af7Sopenharmony_ci// (x,y,z,layer) are in compressed texel block coordinates
2578e5c31af7Sopenharmony_ciaddress(x,y,z,layer) = layer*arrayPitch + z*depthPitch + y*rowPitch + x*compressedTexelBlockByteSize + offset;
2579e5c31af7Sopenharmony_ci~~~~
2580e5c31af7Sopenharmony_ci
2581e5c31af7Sopenharmony_ciThe value of pname:arrayPitch is undefined: for images that were not created
2582e5c31af7Sopenharmony_cias arrays.
2583e5c31af7Sopenharmony_cipname:depthPitch is defined only for 3D images.
2584e5c31af7Sopenharmony_ci
2585e5c31af7Sopenharmony_ciIf the image has a
2586e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
2587e5c31af7Sopenharmony_ci_single-plane_
2588e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
2589e5c31af7Sopenharmony_cicolor format
2590e5c31af7Sopenharmony_ciifdef::VK_EXT_image_drm_format_modifier[]
2591e5c31af7Sopenharmony_ciand its tiling is ename:VK_IMAGE_TILING_LINEAR
2592e5c31af7Sopenharmony_ciendif::VK_EXT_image_drm_format_modifier[]
2593e5c31af7Sopenharmony_ci, then the pname:aspectMask member of sname:VkImageSubresource must: be
2594e5c31af7Sopenharmony_ciename:VK_IMAGE_ASPECT_COLOR_BIT.
2595e5c31af7Sopenharmony_ci
2596e5c31af7Sopenharmony_ciIf the image has a depth/stencil format
2597e5c31af7Sopenharmony_ciifdef::VK_EXT_image_drm_format_modifier[]
2598e5c31af7Sopenharmony_ciand its tiling is ename:VK_IMAGE_TILING_LINEAR
2599e5c31af7Sopenharmony_ciendif::VK_EXT_image_drm_format_modifier[]
2600e5c31af7Sopenharmony_ci, then pname:aspectMask must: be either ename:VK_IMAGE_ASPECT_DEPTH_BIT or
2601e5c31af7Sopenharmony_ciename:VK_IMAGE_ASPECT_STENCIL_BIT.
2602e5c31af7Sopenharmony_ciOn implementations that store depth and stencil aspects separately, querying
2603e5c31af7Sopenharmony_cieach of these image subresource layouts will return a different pname:offset
2604e5c31af7Sopenharmony_ciand pname:size representing the region of memory used for that aspect.
2605e5c31af7Sopenharmony_ciOn implementations that store depth and stencil aspects interleaved, the
2606e5c31af7Sopenharmony_cisame pname:offset and pname:size are returned and represent the interleaved
2607e5c31af7Sopenharmony_cimemory allocation.
2608e5c31af7Sopenharmony_ci
2609e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
2610e5c31af7Sopenharmony_ciIf the image has a <<formats-requiring-sampler-ycbcr-conversion,multi-planar
2611e5c31af7Sopenharmony_ciformat>>
2612e5c31af7Sopenharmony_ciifdef::VK_EXT_image_drm_format_modifier[]
2613e5c31af7Sopenharmony_ciand its tiling is ename:VK_IMAGE_TILING_LINEAR
2614e5c31af7Sopenharmony_ciendif::VK_EXT_image_drm_format_modifier[]
2615e5c31af7Sopenharmony_ci, then the pname:aspectMask member of sname:VkImageSubresource must: be
2616e5c31af7Sopenharmony_ciename:VK_IMAGE_ASPECT_PLANE_0_BIT, ename:VK_IMAGE_ASPECT_PLANE_1_BIT, or
2617e5c31af7Sopenharmony_ci(for 3-plane formats only) ename:VK_IMAGE_ASPECT_PLANE_2_BIT.
2618e5c31af7Sopenharmony_ciQuerying each of these image subresource layouts will return a different
2619e5c31af7Sopenharmony_cipname:offset and pname:size representing the region of memory used for that
2620e5c31af7Sopenharmony_ciplane.
2621e5c31af7Sopenharmony_ciIf the image is _disjoint_, then the pname:offset is relative to the base
2622e5c31af7Sopenharmony_ciaddress of the plane.
2623e5c31af7Sopenharmony_ciIf the image is _non-disjoint_, then the pname:offset is relative to the
2624e5c31af7Sopenharmony_cibase address of the image.
2625e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
2626e5c31af7Sopenharmony_ci
2627e5c31af7Sopenharmony_ciifdef::VK_EXT_image_drm_format_modifier[]
2628e5c31af7Sopenharmony_ciIf the image's tiling is ename:VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT, then
2629e5c31af7Sopenharmony_cithe pname:aspectMask member of sname:VkImageSubresource must: be one of
2630e5c31af7Sopenharmony_ci`VK_IMAGE_ASPECT_MEMORY_PLANE__{ibit}__BIT_EXT`, where the maximum allowed
2631e5c31af7Sopenharmony_ciplane index _i_ is defined by the
2632e5c31af7Sopenharmony_cislink:VkDrmFormatModifierPropertiesEXT::pname:drmFormatModifierPlaneCount
2633e5c31af7Sopenharmony_ciassociated with the image's slink:VkImageCreateInfo::pname:format and
2634e5c31af7Sopenharmony_ci<<glossary-drm-format-modifier,modifier>>.
2635e5c31af7Sopenharmony_ciThe memory range used by the subresource is described by pname:offset and
2636e5c31af7Sopenharmony_cipname:size.
2637e5c31af7Sopenharmony_ciIf the image is _disjoint_, then the pname:offset is relative to the base
2638e5c31af7Sopenharmony_ciaddress of the _memory plane_.
2639e5c31af7Sopenharmony_ciIf the image is _non-disjoint_, then the pname:offset is relative to the
2640e5c31af7Sopenharmony_cibase address of the image.
2641e5c31af7Sopenharmony_ciIf the image is <<glossary-linear-resource,non-linear>>, then
2642e5c31af7Sopenharmony_cipname:rowPitch, pname:arrayPitch, and pname:depthPitch have an
2643e5c31af7Sopenharmony_ciimplementation-dependent meaning.
2644e5c31af7Sopenharmony_ciendif::VK_EXT_image_drm_format_modifier[]
2645e5c31af7Sopenharmony_ci
2646e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkSubresourceLayout.txt[]
2647e5c31af7Sopenharmony_ci--
2648e5c31af7Sopenharmony_ci
2649e5c31af7Sopenharmony_ciifdef::VK_EXT_image_drm_format_modifier[]
2650e5c31af7Sopenharmony_ci[open,refpage='vkGetImageDrmFormatModifierPropertiesEXT',desc='Returns an image\'s DRM format modifier',type='protos']
2651e5c31af7Sopenharmony_ci--
2652e5c31af7Sopenharmony_ciIf an image was created with ename:VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT,
2653e5c31af7Sopenharmony_cithen the image has a <<glossary-drm-format-modifier,Linux DRM format
2654e5c31af7Sopenharmony_cimodifier>>.
2655e5c31af7Sopenharmony_ciTo query the _modifier_, call:
2656e5c31af7Sopenharmony_ci
2657e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkGetImageDrmFormatModifierPropertiesEXT.txt[]
2658e5c31af7Sopenharmony_ci
2659e5c31af7Sopenharmony_ci  * pname:device is the logical device that owns the image.
2660e5c31af7Sopenharmony_ci  * pname:image is the queried image.
2661e5c31af7Sopenharmony_ci  * pname:pProperties is a pointer to a
2662e5c31af7Sopenharmony_ci    slink:VkImageDrmFormatModifierPropertiesEXT structure in which
2663e5c31af7Sopenharmony_ci    properties of the image's _DRM format modifier_ are returned.
2664e5c31af7Sopenharmony_ci
2665e5c31af7Sopenharmony_ci.Valid Usage
2666e5c31af7Sopenharmony_ci****
2667e5c31af7Sopenharmony_ci  * [[VUID-vkGetImageDrmFormatModifierPropertiesEXT-image-02272]]
2668e5c31af7Sopenharmony_ci    pname:image must: have been created with
2669e5c31af7Sopenharmony_ci    <<VkImageCreateInfo,pname:tiling>> equal to
2670e5c31af7Sopenharmony_ci    ename:VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT
2671e5c31af7Sopenharmony_ci****
2672e5c31af7Sopenharmony_ci
2673e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkGetImageDrmFormatModifierPropertiesEXT.txt[]
2674e5c31af7Sopenharmony_ci--
2675e5c31af7Sopenharmony_ci
2676e5c31af7Sopenharmony_ci[open,refpage='VkImageDrmFormatModifierPropertiesEXT',desc='Properties of an image\'s Linux DRM format modifier',type='structs']
2677e5c31af7Sopenharmony_ci--
2678e5c31af7Sopenharmony_ciThe slink:VkImageDrmFormatModifierPropertiesEXT structure is defined as:
2679e5c31af7Sopenharmony_ci
2680e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkImageDrmFormatModifierPropertiesEXT.txt[]
2681e5c31af7Sopenharmony_ci
2682e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure.
2683e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
2684e5c31af7Sopenharmony_ci    structure.
2685e5c31af7Sopenharmony_ci  * pname:drmFormatModifier returns the image's
2686e5c31af7Sopenharmony_ci    <<glossary-drm-format-modifier,Linux DRM format modifier>>.
2687e5c31af7Sopenharmony_ci
2688e5c31af7Sopenharmony_ciIf the pname:image was created with
2689e5c31af7Sopenharmony_cislink:VkImageDrmFormatModifierListCreateInfoEXT, then the returned
2690e5c31af7Sopenharmony_cipname:drmFormatModifier must: belong to the list of modifiers provided at
2691e5c31af7Sopenharmony_citime of image creation in
2692e5c31af7Sopenharmony_cislink:VkImageDrmFormatModifierListCreateInfoEXT::pname:pDrmFormatModifiers.
2693e5c31af7Sopenharmony_ciIf the pname:image was created with
2694e5c31af7Sopenharmony_cislink:VkImageDrmFormatModifierExplicitCreateInfoEXT, then the returned
2695e5c31af7Sopenharmony_cipname:drmFormatModifier must: be the modifier provided at time of image
2696e5c31af7Sopenharmony_cicreation in
2697e5c31af7Sopenharmony_cislink:VkImageDrmFormatModifierExplicitCreateInfoEXT::pname:drmFormatModifier.
2698e5c31af7Sopenharmony_ci
2699e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkImageDrmFormatModifierPropertiesEXT.txt[]
2700e5c31af7Sopenharmony_ci--
2701e5c31af7Sopenharmony_ciendif::VK_EXT_image_drm_format_modifier[]
2702e5c31af7Sopenharmony_ci
2703e5c31af7Sopenharmony_ci[open,refpage='vkDestroyImage',desc='Destroy an image object',type='protos']
2704e5c31af7Sopenharmony_ci--
2705e5c31af7Sopenharmony_ciTo destroy an image, call:
2706e5c31af7Sopenharmony_ci
2707e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkDestroyImage.txt[]
2708e5c31af7Sopenharmony_ci
2709e5c31af7Sopenharmony_ci  * pname:device is the logical device that destroys the image.
2710e5c31af7Sopenharmony_ci  * pname:image is the image to destroy.
2711e5c31af7Sopenharmony_ci  * pname:pAllocator controls host memory allocation as described in the
2712e5c31af7Sopenharmony_ci    <<memory-allocation, Memory Allocation>> chapter.
2713e5c31af7Sopenharmony_ci
2714e5c31af7Sopenharmony_ci.Valid Usage
2715e5c31af7Sopenharmony_ci****
2716e5c31af7Sopenharmony_ci  * [[VUID-vkDestroyImage-image-01000]]
2717e5c31af7Sopenharmony_ci    All submitted commands that refer to pname:image, either directly or via
2718e5c31af7Sopenharmony_ci    a sname:VkImageView, must: have completed execution
2719e5c31af7Sopenharmony_ci  * [[VUID-vkDestroyImage-image-01001]]
2720e5c31af7Sopenharmony_ci    If sname:VkAllocationCallbacks were provided when pname:image was
2721e5c31af7Sopenharmony_ci    created, a compatible set of callbacks must: be provided here
2722e5c31af7Sopenharmony_ci  * [[VUID-vkDestroyImage-image-01002]]
2723e5c31af7Sopenharmony_ci    If no sname:VkAllocationCallbacks were provided when pname:image was
2724e5c31af7Sopenharmony_ci    created, pname:pAllocator must: be `NULL`
2725e5c31af7Sopenharmony_ciifdef::VK_KHR_swapchain[]
2726e5c31af7Sopenharmony_ci  * [[VUID-vkDestroyImage-image-04882]]
2727e5c31af7Sopenharmony_ci    pname:image must: not have been acquired from
2728e5c31af7Sopenharmony_ci    flink:vkGetSwapchainImagesKHR
2729e5c31af7Sopenharmony_ciendif::VK_KHR_swapchain[]
2730e5c31af7Sopenharmony_ci****
2731e5c31af7Sopenharmony_ci
2732e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkDestroyImage.txt[]
2733e5c31af7Sopenharmony_ci--
2734e5c31af7Sopenharmony_ci
2735e5c31af7Sopenharmony_ci
2736e5c31af7Sopenharmony_ci[[resources-image-format-features]]
2737e5c31af7Sopenharmony_ci=== Image Format Features
2738e5c31af7Sopenharmony_ci
2739e5c31af7Sopenharmony_ciValid uses of a slink:VkImage may: depend on the image's _format features_,
2740e5c31af7Sopenharmony_cidefined below.
2741e5c31af7Sopenharmony_ciSuch constraints are documented in the affected valid usage statement.
2742e5c31af7Sopenharmony_ci
2743e5c31af7Sopenharmony_ci  * If the image was created with ename:VK_IMAGE_TILING_LINEAR, then its set
2744e5c31af7Sopenharmony_ci    of _format features_ is the value of
2745e5c31af7Sopenharmony_ci    slink:VkFormatProperties::pname:linearTilingFeatures found by calling
2746e5c31af7Sopenharmony_ci    flink:vkGetPhysicalDeviceFormatProperties on the same pname:format as
2747e5c31af7Sopenharmony_ci    slink:VkImageCreateInfo::pname:format.
2748e5c31af7Sopenharmony_ci  * If the image was created with ename:VK_IMAGE_TILING_OPTIMAL,
2749e5c31af7Sopenharmony_ciifdef::VK_ANDROID_external_memory_android_hardware_buffer[]
2750e5c31af7Sopenharmony_ci    but without an
2751e5c31af7Sopenharmony_ci    <<memory-external-android-hardware-buffer-external-formats,Android
2752e5c31af7Sopenharmony_ci    hardware buffer external format>>,
2753e5c31af7Sopenharmony_ciendif::VK_ANDROID_external_memory_android_hardware_buffer[]
2754e5c31af7Sopenharmony_ciifdef::VK_FUCHSIA_buffer_collection[]
2755e5c31af7Sopenharmony_ciifndef::VK_ANDROID_external_memory_android_hardware_buffer[]
2756e5c31af7Sopenharmony_ci    but without an
2757e5c31af7Sopenharmony_ciendif::VK_ANDROID_external_memory_android_hardware_buffer[]
2758e5c31af7Sopenharmony_ciifdef::VK_ANDROID_external_memory_android_hardware_buffer[]
2759e5c31af7Sopenharmony_ci    or an
2760e5c31af7Sopenharmony_ciendif::VK_ANDROID_external_memory_android_hardware_buffer[]
2761e5c31af7Sopenharmony_ci    slink:VkBufferCollectionImageCreateInfoFUCHSIA,
2762e5c31af7Sopenharmony_ciendif::VK_FUCHSIA_buffer_collection[]
2763e5c31af7Sopenharmony_ci    then its set of _format features_ is the value of
2764e5c31af7Sopenharmony_ci    slink:VkFormatProperties::pname:optimalTilingFeatures found by calling
2765e5c31af7Sopenharmony_ci    flink:vkGetPhysicalDeviceFormatProperties on the same pname:format as
2766e5c31af7Sopenharmony_ci    slink:VkImageCreateInfo::pname:format.
2767e5c31af7Sopenharmony_ciifdef::VK_ANDROID_external_memory_android_hardware_buffer[]
2768e5c31af7Sopenharmony_ci  * If the image was created with an
2769e5c31af7Sopenharmony_ci    <<memory-external-android-hardware-buffer-external-formats,Android
2770e5c31af7Sopenharmony_ci    hardware buffer external format>>, then its set of _format features_ is
2771e5c31af7Sopenharmony_ci    the value of
2772e5c31af7Sopenharmony_ci    slink:VkAndroidHardwareBufferFormatPropertiesANDROID::pname:formatFeatures
2773e5c31af7Sopenharmony_ci    found by calling flink:vkGetAndroidHardwareBufferPropertiesANDROID on
2774e5c31af7Sopenharmony_ci    the Android hardware buffer that was imported to the
2775e5c31af7Sopenharmony_ci    slink:VkDeviceMemory to which the image is bound.
2776e5c31af7Sopenharmony_ciendif::VK_ANDROID_external_memory_android_hardware_buffer[]
2777e5c31af7Sopenharmony_ciifdef::VK_EXT_image_drm_format_modifier[]
2778e5c31af7Sopenharmony_ci  * If the image was created with
2779e5c31af7Sopenharmony_ci    ename:VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT, then:
2780e5c31af7Sopenharmony_ci  ** The image's DRM format modifier is the value of
2781e5c31af7Sopenharmony_ci     slink:VkImageDrmFormatModifierListCreateInfoEXT::pname:drmFormatModifier
2782e5c31af7Sopenharmony_ci     found by calling flink:vkGetImageDrmFormatModifierPropertiesEXT.
2783e5c31af7Sopenharmony_ci  ** Let
2784e5c31af7Sopenharmony_ci     slink:VkDrmFormatModifierPropertiesListEXT::pname:pDrmFormatModifierProperties
2785e5c31af7Sopenharmony_ci     be the array found by calling
2786e5c31af7Sopenharmony_ci     flink:vkGetPhysicalDeviceFormatProperties2 on the same pname:format as
2787e5c31af7Sopenharmony_ci     slink:VkImageCreateInfo::pname:format.
2788e5c31af7Sopenharmony_ci  ** Let `VkDrmFormatModifierPropertiesEXT prop` be an array element whose
2789e5c31af7Sopenharmony_ci     pname:drmFormatModifier member is the value of the image's DRM format
2790e5c31af7Sopenharmony_ci     modifier.
2791e5c31af7Sopenharmony_ci  ** Then the image set of _format features_ is the value of taking the
2792e5c31af7Sopenharmony_ci     bitwise intersection over the collected
2793e5c31af7Sopenharmony_ci     `prop`::pname:drmFormatModifierTilingFeatures.
2794e5c31af7Sopenharmony_ciendif::VK_EXT_image_drm_format_modifier[]
2795e5c31af7Sopenharmony_ci
2796e5c31af7Sopenharmony_ci
2797e5c31af7Sopenharmony_ciifdef::VK_NV_corner_sampled_image[]
2798e5c31af7Sopenharmony_ci[[resources-images-corner-sampled]]
2799e5c31af7Sopenharmony_ci=== Corner-Sampled Images
2800e5c31af7Sopenharmony_ci
2801e5c31af7Sopenharmony_ciA _corner-sampled image_ is an image where unnormalized texel coordinates
2802e5c31af7Sopenharmony_ciare centered on integer values rather than half-integer values.
2803e5c31af7Sopenharmony_ci
2804e5c31af7Sopenharmony_ciA corner-sampled image has a number of differences compared to conventional
2805e5c31af7Sopenharmony_citexture image:
2806e5c31af7Sopenharmony_ci
2807e5c31af7Sopenharmony_ci  * Texels are centered on integer coordinates.
2808e5c31af7Sopenharmony_ci    See <<textures-unnormalized-to-integer, Unnormalized Texel Coordinate
2809e5c31af7Sopenharmony_ci    Operations>>
2810e5c31af7Sopenharmony_ci  * Normalized coordinates are scaled using [eq]#coord {times} (dim - 1)#
2811e5c31af7Sopenharmony_ci    rather than [eq]#coord {times} dim#, where dim is the size of one
2812e5c31af7Sopenharmony_ci    dimension of the image.
2813e5c31af7Sopenharmony_ci    See <<textures-normalized-to-unnormalized, normalized texel coordinate
2814e5c31af7Sopenharmony_ci    transform>>.
2815e5c31af7Sopenharmony_ci  * Partial derivatives are scaled using [eq]#coord {times} (dim - 1)#
2816e5c31af7Sopenharmony_ci    rather than [eq]#coord {times} dim#.
2817e5c31af7Sopenharmony_ci    See <<textures-scale-factor,Scale Factor Operation>>.
2818e5c31af7Sopenharmony_ci  * Calculation of the next higher lod size goes according to
2819e5c31af7Sopenharmony_ci    [eq]#{lceil}dim / 2{rceil}# rather than [eq]#{lfloor}dim / 2{rfloor}#.
2820e5c31af7Sopenharmony_ci    See <<resources-image-miplevel-sizing,Image Miplevel Sizing>>.
2821e5c31af7Sopenharmony_ci  * The minimum level size is 2x2 for 2D images and 2x2x2 for 3D images.
2822e5c31af7Sopenharmony_ci    See <<resources-image-miplevel-sizing,Image Miplevel Sizing>>.
2823e5c31af7Sopenharmony_ci
2824e5c31af7Sopenharmony_ciCorner-sampling is only supported for 2D and 3D images.
2825e5c31af7Sopenharmony_ciWhen sampling a corner-sampled image, the sampler addressing mode must: be
2826e5c31af7Sopenharmony_ciename:VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE.
2827e5c31af7Sopenharmony_ciCorner-sampled images are not supported as cube maps or depth/stencil
2828e5c31af7Sopenharmony_ciimages.
2829e5c31af7Sopenharmony_ciendif::VK_NV_corner_sampled_image[]
2830e5c31af7Sopenharmony_ci
2831e5c31af7Sopenharmony_ci
2832e5c31af7Sopenharmony_ci[[resources-image-miplevel-sizing]]
2833e5c31af7Sopenharmony_ci=== Image Miplevel Sizing
2834e5c31af7Sopenharmony_ci
2835e5c31af7Sopenharmony_ciA _complete mipmap chain_ is the full set of miplevels, from the largest
2836e5c31af7Sopenharmony_cimiplevel provided, down to the _minimum miplevel size_.
2837e5c31af7Sopenharmony_ci
2838e5c31af7Sopenharmony_ci
2839e5c31af7Sopenharmony_ci==== Conventional Images
2840e5c31af7Sopenharmony_ci
2841e5c31af7Sopenharmony_ciFor conventional images, the dimensions of each successive miplevel,
2842e5c31af7Sopenharmony_ci[eq]#n+1#, are:
2843e5c31af7Sopenharmony_ci
2844e5c31af7Sopenharmony_ci  {empty}:: [eq]#pname:width~n+1~ = max({lfloor}pname:width~n~/2{rfloor},
2845e5c31af7Sopenharmony_ci            1)#
2846e5c31af7Sopenharmony_ci  {empty}:: [eq]#pname:height~n+1~ = max({lfloor}pname:height~n~/2{rfloor},
2847e5c31af7Sopenharmony_ci            1)#
2848e5c31af7Sopenharmony_ci  {empty}:: [eq]#pname:depth~n+1~ = max({lfloor}pname:depth~n~/2{rfloor},
2849e5c31af7Sopenharmony_ci            1)#
2850e5c31af7Sopenharmony_ci
2851e5c31af7Sopenharmony_ciwhere [eq]#pname:width~n~#, [eq]#pname:height~n~#, and [eq]#pname:depth~n~#
2852e5c31af7Sopenharmony_ciare the dimensions of the next larger miplevel, [eq]#n#.
2853e5c31af7Sopenharmony_ci
2854e5c31af7Sopenharmony_ciThe minimum miplevel size is:
2855e5c31af7Sopenharmony_ci
2856e5c31af7Sopenharmony_ci  * 1 for one-dimensional images,
2857e5c31af7Sopenharmony_ci  * 1x1 for two-dimensional images, and
2858e5c31af7Sopenharmony_ci  * 1x1x1 for three-dimensional images.
2859e5c31af7Sopenharmony_ci
2860e5c31af7Sopenharmony_ciThe number of levels in a complete mipmap chain is:
2861e5c31af7Sopenharmony_ci
2862e5c31af7Sopenharmony_ci  {empty}:: [eq]#{lfloor}log~2~(max(pname:width~0~, pname:height~0~,
2863e5c31af7Sopenharmony_ci            pname:depth~0~)){rfloor} {plus} 1#
2864e5c31af7Sopenharmony_ci
2865e5c31af7Sopenharmony_ciwhere [eq]#pname:width~0~#, [eq]#pname:height~0~#, and [eq]#pname:depth~0~#
2866e5c31af7Sopenharmony_ciare the dimensions of the largest (most detailed) miplevel, `0`.
2867e5c31af7Sopenharmony_ci
2868e5c31af7Sopenharmony_ci
2869e5c31af7Sopenharmony_ciifdef::VK_NV_corner_sampled_image[]
2870e5c31af7Sopenharmony_ci==== Corner-Sampled Images
2871e5c31af7Sopenharmony_ci
2872e5c31af7Sopenharmony_ciFor corner-sampled images, the dimensions of each successive miplevel,
2873e5c31af7Sopenharmony_ci[eq]#n+1#, are:
2874e5c31af7Sopenharmony_ci
2875e5c31af7Sopenharmony_ci  {empty}:: [eq]#pname:width~n+1~ = max({lceil}pname:width~n~/2{rceil}, 2)#
2876e5c31af7Sopenharmony_ci  {empty}:: [eq]#pname:height~n+1~ = max({lceil}pname:height~n~/2{rceil},
2877e5c31af7Sopenharmony_ci            2)#
2878e5c31af7Sopenharmony_ci  {empty}:: [eq]#pname:depth~n+1~ = max({lceil}pname:depth~n~/2{rceil}, 2)#
2879e5c31af7Sopenharmony_ci
2880e5c31af7Sopenharmony_ciwhere [eq]#pname:width~n~#, [eq]#pname:height~n~#, and [eq]#pname:depth~n~#
2881e5c31af7Sopenharmony_ciare the dimensions of the next larger miplevel, [eq]#n#.
2882e5c31af7Sopenharmony_ci
2883e5c31af7Sopenharmony_ciThe minimum miplevel size is:
2884e5c31af7Sopenharmony_ci
2885e5c31af7Sopenharmony_ci  * 2x2 for two-dimensional images, and
2886e5c31af7Sopenharmony_ci  * 2x2x2 for three-dimensional images.
2887e5c31af7Sopenharmony_ci
2888e5c31af7Sopenharmony_ciThe number of levels in a complete mipmap chain is:
2889e5c31af7Sopenharmony_ci
2890e5c31af7Sopenharmony_ci  {empty}:: [eq]#{lceil}log~2~(max(pname:width~0~, pname:height~0~,
2891e5c31af7Sopenharmony_ci            pname:depth~0~)){rceil}#
2892e5c31af7Sopenharmony_ci
2893e5c31af7Sopenharmony_ciwhere [eq]#pname:width~0~#, [eq]#pname:height~0~#, and [eq]#pname:depth~0~#
2894e5c31af7Sopenharmony_ciare the dimensions of the largest (most detailed) miplevel, `0`.
2895e5c31af7Sopenharmony_ciendif::VK_NV_corner_sampled_image[]
2896e5c31af7Sopenharmony_ci
2897e5c31af7Sopenharmony_ci
2898e5c31af7Sopenharmony_ci[[resources-image-layouts]]
2899e5c31af7Sopenharmony_ci== Image Layouts
2900e5c31af7Sopenharmony_ci
2901e5c31af7Sopenharmony_ciImages are stored in implementation-dependent opaque layouts in memory.
2902e5c31af7Sopenharmony_ciEach layout has limitations on what kinds of operations are supported for
2903e5c31af7Sopenharmony_ciimage subresources using the layout.
2904e5c31af7Sopenharmony_ciAt any given time, the data representing an image subresource in memory
2905e5c31af7Sopenharmony_ciexists in a particular layout which is determined by the most recent layout
2906e5c31af7Sopenharmony_citransition that was performed on that image subresource.
2907e5c31af7Sopenharmony_ciApplications have control over which layout each image subresource uses, and
2908e5c31af7Sopenharmony_cican: transition an image subresource from one layout to another.
2909e5c31af7Sopenharmony_ciTransitions can: happen with an image memory barrier, included as part of a
2910e5c31af7Sopenharmony_ciflink:vkCmdPipelineBarrier or a flink:vkCmdWaitEvents command buffer command
2911e5c31af7Sopenharmony_ci(see <<synchronization-image-memory-barriers>>), or as part of a subpass
2912e5c31af7Sopenharmony_cidependency within a render pass (see sname:VkSubpassDependency).
2913e5c31af7Sopenharmony_ci
2914e5c31af7Sopenharmony_ciImage layout is per-image subresource.
2915e5c31af7Sopenharmony_ciSeparate image subresources of the same image can: be in different layouts
2916e5c31af7Sopenharmony_ciat the same time, with the exception that depth and stencil aspects of a
2917e5c31af7Sopenharmony_cigiven image subresource can: only be in different layouts if the
2918e5c31af7Sopenharmony_ci<<features-separateDepthStencilLayouts, pname:separateDepthStencilLayouts>>
2919e5c31af7Sopenharmony_cifeature is enabled.
2920e5c31af7Sopenharmony_ci
2921e5c31af7Sopenharmony_ci[NOTE]
2922e5c31af7Sopenharmony_ci.Note
2923e5c31af7Sopenharmony_ci====
2924e5c31af7Sopenharmony_ciEach layout may: offer optimal performance for a specific usage of image
2925e5c31af7Sopenharmony_cimemory.
2926e5c31af7Sopenharmony_ciFor example, an image with a layout of
2927e5c31af7Sopenharmony_ciename:VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL may: provide optimal
2928e5c31af7Sopenharmony_ciperformance for use as a color attachment, but be unsupported for use in
2929e5c31af7Sopenharmony_citransfer commands.
2930e5c31af7Sopenharmony_ciApplications can: transition an image subresource from one layout to another
2931e5c31af7Sopenharmony_ciin order to achieve optimal performance when the image subresource is used
2932e5c31af7Sopenharmony_cifor multiple kinds of operations.
2933e5c31af7Sopenharmony_ciAfter initialization, applications need not use any layout other than the
2934e5c31af7Sopenharmony_cigeneral layout, though this may: produce suboptimal performance on some
2935e5c31af7Sopenharmony_ciimplementations.
2936e5c31af7Sopenharmony_ci====
2937e5c31af7Sopenharmony_ci
2938e5c31af7Sopenharmony_ciUpon creation, all image subresources of an image are initially in the same
2939e5c31af7Sopenharmony_cilayout, where that layout is selected by the
2940e5c31af7Sopenharmony_cisname:VkImageCreateInfo::pname:initialLayout member.
2941e5c31af7Sopenharmony_ciThe pname:initialLayout must: be either ename:VK_IMAGE_LAYOUT_UNDEFINED or
2942e5c31af7Sopenharmony_ciename:VK_IMAGE_LAYOUT_PREINITIALIZED.
2943e5c31af7Sopenharmony_ciIf it is ename:VK_IMAGE_LAYOUT_PREINITIALIZED, then the image data can: be
2944e5c31af7Sopenharmony_cipreinitialized by the host while using this layout, and the transition away
2945e5c31af7Sopenharmony_cifrom this layout will preserve that data.
2946e5c31af7Sopenharmony_ciIf it is ename:VK_IMAGE_LAYOUT_UNDEFINED, then the contents of the data are
2947e5c31af7Sopenharmony_ciconsidered to be undefined:, and the transition away from this layout is not
2948e5c31af7Sopenharmony_ciguaranteed to preserve that data.
2949e5c31af7Sopenharmony_ciFor either of these initial layouts, any image subresources must: be
2950e5c31af7Sopenharmony_citransitioned to another layout before they are accessed by the device.
2951e5c31af7Sopenharmony_ci
2952e5c31af7Sopenharmony_ciHost access to image memory is only well-defined for
2953e5c31af7Sopenharmony_ci<<glossary-linear-resource,linear>> images and for image subresources of
2954e5c31af7Sopenharmony_cithose images which are currently in either the
2955e5c31af7Sopenharmony_ciename:VK_IMAGE_LAYOUT_PREINITIALIZED or ename:VK_IMAGE_LAYOUT_GENERAL
2956e5c31af7Sopenharmony_cilayout.
2957e5c31af7Sopenharmony_ciCalling flink:vkGetImageSubresourceLayout for a linear image returns a
2958e5c31af7Sopenharmony_cisubresource layout mapping that is valid for either of those image layouts.
2959e5c31af7Sopenharmony_ci
2960e5c31af7Sopenharmony_ci[open,refpage='VkImageLayout',desc='Layout of image and image subresources',type='enums']
2961e5c31af7Sopenharmony_ci--
2962e5c31af7Sopenharmony_ciThe set of image layouts consists of:
2963e5c31af7Sopenharmony_ci
2964e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkImageLayout.txt[]
2965e5c31af7Sopenharmony_ci
2966e5c31af7Sopenharmony_ciThe type(s) of device access supported by each layout are:
2967e5c31af7Sopenharmony_ci
2968e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_LAYOUT_UNDEFINED specifies that the layout is unknown.
2969e5c31af7Sopenharmony_ci    Image memory cannot: be transitioned into this layout.
2970e5c31af7Sopenharmony_ci    This layout can: be used as the pname:initialLayout member of
2971e5c31af7Sopenharmony_ci    slink:VkImageCreateInfo.
2972e5c31af7Sopenharmony_ci    This layout can: be used in place of the current image layout in a
2973e5c31af7Sopenharmony_ci    layout transition, but doing so will cause the contents of the image's
2974e5c31af7Sopenharmony_ci    memory to be undefined:.
2975e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_LAYOUT_PREINITIALIZED specifies that an image's memory is
2976e5c31af7Sopenharmony_ci    in a defined layout and can: be populated by data, but that it has not
2977e5c31af7Sopenharmony_ci    yet been initialized by the driver.
2978e5c31af7Sopenharmony_ci    Image memory cannot: be transitioned into this layout.
2979e5c31af7Sopenharmony_ci    This layout can: be used as the pname:initialLayout member of
2980e5c31af7Sopenharmony_ci    slink:VkImageCreateInfo.
2981e5c31af7Sopenharmony_ci    This layout is intended to be used as the initial layout for an image
2982e5c31af7Sopenharmony_ci    whose contents are written by the host, and hence the data can: be
2983e5c31af7Sopenharmony_ci    written to memory immediately, without first executing a layout
2984e5c31af7Sopenharmony_ci    transition.
2985e5c31af7Sopenharmony_ci    Currently, ename:VK_IMAGE_LAYOUT_PREINITIALIZED is only useful with
2986e5c31af7Sopenharmony_ci    <<glossary-linear-resource,linear>> images because there is not a
2987e5c31af7Sopenharmony_ci    standard layout defined for ename:VK_IMAGE_TILING_OPTIMAL images.
2988e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_LAYOUT_GENERAL supports all types of device access.
2989e5c31af7Sopenharmony_ciifdef::VK_KHR_synchronization2[]
2990e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_LAYOUT_ATTACHMENT_OPTIMAL_KHR specifies a layout that
2991e5c31af7Sopenharmony_ci    must: only be used with attachment accesses in the graphics pipeline.
2992e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_LAYOUT_READ_ONLY_OPTIMAL_KHR specifies a layout allowing
2993e5c31af7Sopenharmony_ci    read only access as an attachment, or in shaders as a sampled image,
2994e5c31af7Sopenharmony_ci    combined image/sampler, or input attachment.
2995e5c31af7Sopenharmony_ciendif::VK_KHR_synchronization2[]
2996e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL must: only be used as a
2997e5c31af7Sopenharmony_ci    color or resolve attachment in a sname:VkFramebuffer.
2998e5c31af7Sopenharmony_ci    This layout is valid only for image subresources of images created with
2999e5c31af7Sopenharmony_ci    the ename:VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT usage bit enabled.
3000e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL specifies a
3001e5c31af7Sopenharmony_ci    layout for both the depth and stencil aspects of a depth/stencil format
3002e5c31af7Sopenharmony_ci    image allowing read and write access as a depth/stencil attachment.
3003e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_KHR_separate_depth_stencil_layouts[]
3004e5c31af7Sopenharmony_ci    It is equivalent to ename:VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL and
3005e5c31af7Sopenharmony_ci    ename:VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL.
3006e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_KHR_separate_depth_stencil_layouts[]
3007e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL specifies a layout
3008e5c31af7Sopenharmony_ci    for both the depth and stencil aspects of a depth/stencil format image
3009e5c31af7Sopenharmony_ci    allowing read only access as a depth/stencil attachment or in shaders as
3010e5c31af7Sopenharmony_ci    a sampled image, combined image/sampler, or input attachment.
3011e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_KHR_separate_depth_stencil_layouts[]
3012e5c31af7Sopenharmony_ci    It is equivalent to ename:VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL and
3013e5c31af7Sopenharmony_ci    ename:VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL.
3014e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_KHR_separate_depth_stencil_layouts[]
3015e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_maintenance2[]
3016e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL
3017e5c31af7Sopenharmony_ci    specifies a layout for depth/stencil format images allowing read and
3018e5c31af7Sopenharmony_ci    write access to the stencil aspect as a stencil attachment, and read
3019e5c31af7Sopenharmony_ci    only access to the depth aspect as a depth attachment or in shaders as a
3020e5c31af7Sopenharmony_ci    sampled image, combined image/sampler, or input attachment.
3021e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_KHR_separate_depth_stencil_layouts[]
3022e5c31af7Sopenharmony_ci    It is equivalent to ename:VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL and
3023e5c31af7Sopenharmony_ci    ename:VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL.
3024e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_KHR_separate_depth_stencil_layouts[]
3025e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL
3026e5c31af7Sopenharmony_ci    specifies a layout for depth/stencil format images allowing read and
3027e5c31af7Sopenharmony_ci    write access to the depth aspect as a depth attachment, and read only
3028e5c31af7Sopenharmony_ci    access to the stencil aspect as a stencil attachment or in shaders as a
3029e5c31af7Sopenharmony_ci    sampled image, combined image/sampler, or input attachment.
3030e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_KHR_separate_depth_stencil_layouts[]
3031e5c31af7Sopenharmony_ci    It is equivalent to ename:VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL and
3032e5c31af7Sopenharmony_ci    ename:VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL.
3033e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_KHR_separate_depth_stencil_layouts[]
3034e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_maintenance2[]
3035e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_KHR_separate_depth_stencil_layouts[]
3036e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL specifies a layout for
3037e5c31af7Sopenharmony_ci    the depth aspect of a depth/stencil format image allowing read and write
3038e5c31af7Sopenharmony_ci    access as a depth attachment.
3039e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL specifies a layout for the
3040e5c31af7Sopenharmony_ci    depth aspect of a depth/stencil format image allowing read-only access
3041e5c31af7Sopenharmony_ci    as a depth attachment or in shaders as a sampled image, combined
3042e5c31af7Sopenharmony_ci    image/sampler, or input attachment.
3043e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL specifies a layout for
3044e5c31af7Sopenharmony_ci    the stencil aspect of a depth/stencil format image allowing read and
3045e5c31af7Sopenharmony_ci    write access as a stencil attachment.
3046e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL specifies a layout for
3047e5c31af7Sopenharmony_ci    the stencil aspect of a depth/stencil format image allowing read-only
3048e5c31af7Sopenharmony_ci    access as a stencil attachment or in shaders as a sampled image,
3049e5c31af7Sopenharmony_ci    combined image/sampler, or input attachment.
3050e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_KHR_separate_depth_stencil_layouts[]
3051e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL specifies a layout
3052e5c31af7Sopenharmony_ci    allowing read-only access in a shader as a sampled image, combined
3053e5c31af7Sopenharmony_ci    image/sampler, or input attachment.
3054e5c31af7Sopenharmony_ci    This layout is valid only for image subresources of images created with
3055e5c31af7Sopenharmony_ci    the ename:VK_IMAGE_USAGE_SAMPLED_BIT or
3056e5c31af7Sopenharmony_ci    ename:VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT usage bits enabled.
3057e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL must: only be used as a
3058e5c31af7Sopenharmony_ci    source image of a transfer command (see the definition of
3059e5c31af7Sopenharmony_ci    <<synchronization-pipeline-stages-transfer,
3060e5c31af7Sopenharmony_ci    ename:VK_PIPELINE_STAGE_TRANSFER_BIT>>).
3061e5c31af7Sopenharmony_ci    This layout is valid only for image subresources of images created with
3062e5c31af7Sopenharmony_ci    the ename:VK_IMAGE_USAGE_TRANSFER_SRC_BIT usage bit enabled.
3063e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL must: only be used as a
3064e5c31af7Sopenharmony_ci    destination image of a transfer command.
3065e5c31af7Sopenharmony_ci    This layout is valid only for image subresources of images created with
3066e5c31af7Sopenharmony_ci    the ename:VK_IMAGE_USAGE_TRANSFER_DST_BIT usage bit enabled.
3067e5c31af7Sopenharmony_ciifdef::VK_KHR_swapchain[]
3068e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_LAYOUT_PRESENT_SRC_KHR must: only be used for presenting
3069e5c31af7Sopenharmony_ci    a presentable image for display.
3070e5c31af7Sopenharmony_ci    A swapchain's image must: be transitioned to this layout before calling
3071e5c31af7Sopenharmony_ci    flink:vkQueuePresentKHR, and must: be transitioned away from this layout
3072e5c31af7Sopenharmony_ci    after calling flink:vkAcquireNextImageKHR.
3073e5c31af7Sopenharmony_ciifdef::VK_KHR_shared_presentable_image[]
3074e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR is valid only for shared
3075e5c31af7Sopenharmony_ci    presentable images, and must: be used for any usage the image supports.
3076e5c31af7Sopenharmony_ciendif::VK_KHR_shared_presentable_image[]
3077e5c31af7Sopenharmony_ciendif::VK_KHR_swapchain[]
3078e5c31af7Sopenharmony_ciifdef::VK_KHR_fragment_shading_rate,VK_NV_shading_rate_image[]
3079e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_LAYOUT_FRAGMENT_SHADING_RATE_ATTACHMENT_OPTIMAL_KHR must:
3080e5c31af7Sopenharmony_ci    only be used as a
3081e5c31af7Sopenharmony_ciifdef::VK_KHR_fragment_shading_rate[]
3082e5c31af7Sopenharmony_ci    <<primsrast-fragment-shading-rate-attachment, fragment shading rate
3083e5c31af7Sopenharmony_ci    attachment>>
3084e5c31af7Sopenharmony_ciendif::VK_KHR_fragment_shading_rate[]
3085e5c31af7Sopenharmony_ciifdef::VK_KHR_fragment_shading_rate,VK_NV_shading_rate_image[or]
3086e5c31af7Sopenharmony_ciifdef::VK_NV_shading_rate_image[]
3087e5c31af7Sopenharmony_ci    <<primsrast-shading-rate-image, shading rate image>>.
3088e5c31af7Sopenharmony_ciendif::VK_NV_shading_rate_image[]
3089e5c31af7Sopenharmony_ci    This layout is valid only for image subresources of images created with
3090e5c31af7Sopenharmony_ci    the ename:VK_IMAGE_USAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR usage
3091e5c31af7Sopenharmony_ci    bit enabled.
3092e5c31af7Sopenharmony_ciendif::VK_KHR_fragment_shading_rate,VK_NV_shading_rate_image[]
3093e5c31af7Sopenharmony_ciifdef::VK_EXT_fragment_density_map[]
3094e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_LAYOUT_FRAGMENT_DENSITY_MAP_OPTIMAL_EXT must: only be
3095e5c31af7Sopenharmony_ci    used as a fragment density map attachment in a sname:VkRenderPass.
3096e5c31af7Sopenharmony_ci    This layout is valid only for image subresources of images created with
3097e5c31af7Sopenharmony_ci    the ename:VK_IMAGE_USAGE_FRAGMENT_DENSITY_MAP_BIT_EXT usage bit enabled.
3098e5c31af7Sopenharmony_ciendif::VK_EXT_fragment_density_map[]
3099e5c31af7Sopenharmony_ciifdef::VK_KHR_video_decode_queue[]
3100e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_LAYOUT_VIDEO_DECODE_DST_KHR must: only be used as a
3101e5c31af7Sopenharmony_ci    decode output image of a <<video-decode-operations, video decode
3102e5c31af7Sopenharmony_ci    operation>>.
3103e5c31af7Sopenharmony_ci    This layout is valid only for image subresources of images created with
3104e5c31af7Sopenharmony_ci    the ename:VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR usage bit enabled.
3105e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_LAYOUT_VIDEO_DECODE_SRC_KHR must: only be used as a
3106e5c31af7Sopenharmony_ci    decode source image of a <<video-decode-operations, video decode
3107e5c31af7Sopenharmony_ci    operation>>.
3108e5c31af7Sopenharmony_ci    This layout is valid only for image subresources of images created with
3109e5c31af7Sopenharmony_ci    the ename:VK_IMAGE_USAGE_VIDEO_DECODE_SRC_BIT_KHR usage bit enabled.
3110e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_LAYOUT_VIDEO_DECODE_DPB_KHR must: only be used as a
3111e5c31af7Sopenharmony_ci    decode source or destination image of a <<video-decode-operations, video
3112e5c31af7Sopenharmony_ci    decode operation>>.
3113e5c31af7Sopenharmony_ci    This layout is valid only for image subresources of images created with
3114e5c31af7Sopenharmony_ci    the ename:VK_IMAGE_USAGE_VIDEO_DECODE_DPB_BIT_KHR usage bit enabled.
3115e5c31af7Sopenharmony_ciendif::VK_KHR_video_decode_queue[]
3116e5c31af7Sopenharmony_ciifdef::VK_KHR_video_encode_queue[]
3117e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_LAYOUT_VIDEO_ENCODE_DST_KHR must: only be used as a
3118e5c31af7Sopenharmony_ci    encode output image of a <<video-encode-operations, video encode
3119e5c31af7Sopenharmony_ci    operation>>.
3120e5c31af7Sopenharmony_ci    This layout is valid only for image subresources of images created with
3121e5c31af7Sopenharmony_ci    the ename:VK_IMAGE_USAGE_VIDEO_ENCODE_DST_BIT_KHR usage bit enabled.
3122e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_LAYOUT_VIDEO_ENCODE_SRC_KHR must: only be used as a
3123e5c31af7Sopenharmony_ci    encode source image of a <<video-encode-operations, video encode
3124e5c31af7Sopenharmony_ci    operation>>.
3125e5c31af7Sopenharmony_ci    This layout is valid only for image subresources of images created with
3126e5c31af7Sopenharmony_ci    the ename:VK_IMAGE_USAGE_VIDEO_ENCODE_SRC_BIT_KHR usage bit enabled.
3127e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_LAYOUT_VIDEO_ENCODE_DPB_KHR must: only be used as a
3128e5c31af7Sopenharmony_ci    encode source or destination image of a <<video-encode-operations, video
3129e5c31af7Sopenharmony_ci    encode operation>>.
3130e5c31af7Sopenharmony_ci    This layout is valid only for image subresources of images created with
3131e5c31af7Sopenharmony_ci    the ename:VK_IMAGE_USAGE_VIDEO_ENCODE_DPB_BIT_KHR usage bit enabled.
3132e5c31af7Sopenharmony_ciendif::VK_KHR_video_encode_queue[]
3133e5c31af7Sopenharmony_ci
3134e5c31af7Sopenharmony_ciThe layout of each image subresource is not a state of the image subresource
3135e5c31af7Sopenharmony_ciitself, but is rather a property of how the data in memory is organized, and
3136e5c31af7Sopenharmony_cithus for each mechanism of accessing an image in the API the application
3137e5c31af7Sopenharmony_cimust: specify a parameter or structure member that indicates which image
3138e5c31af7Sopenharmony_cilayout the image subresource(s) are considered to be in when the image will
3139e5c31af7Sopenharmony_cibe accessed.
3140e5c31af7Sopenharmony_ciFor transfer commands, this is a parameter to the command (see <<clears>>
3141e5c31af7Sopenharmony_ciand <<copies>>).
3142e5c31af7Sopenharmony_ciFor use as a framebuffer attachment, this is a member in the substructures
3143e5c31af7Sopenharmony_ciof the slink:VkRenderPassCreateInfo (see <<renderpass,Render Pass>>).
3144e5c31af7Sopenharmony_ciFor use in a descriptor set, this is a member in the
3145e5c31af7Sopenharmony_cisname:VkDescriptorImageInfo structure (see <<descriptorsets-updates>>).
3146e5c31af7Sopenharmony_ci--
3147e5c31af7Sopenharmony_ci
3148e5c31af7Sopenharmony_ci
3149e5c31af7Sopenharmony_ci[[resources-image-layouts-matching-rule]]
3150e5c31af7Sopenharmony_ci=== Image Layout Matching Rules
3151e5c31af7Sopenharmony_ci
3152e5c31af7Sopenharmony_ciAt the time that any command buffer command accessing an image executes on
3153e5c31af7Sopenharmony_ciany queue, the layouts of the image subresources that are accessed must: all
3154e5c31af7Sopenharmony_cimatch exactly the layout specified via the API controlling those accesses
3155e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_maintenance2[]
3156e5c31af7Sopenharmony_ci, except in case of accesses to an image with a depth/stencil format
3157e5c31af7Sopenharmony_ciperformed through descriptors referring to only a single aspect of the
3158e5c31af7Sopenharmony_ciimage, where the following relaxed matching rules apply:
3159e5c31af7Sopenharmony_ci
3160e5c31af7Sopenharmony_ci  * Descriptors referring just to the depth aspect of a depth/stencil image
3161e5c31af7Sopenharmony_ci    only need to match in the image layout of the depth aspect, thus
3162e5c31af7Sopenharmony_ci    ename:VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL and
3163e5c31af7Sopenharmony_ci    ename:VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL are
3164e5c31af7Sopenharmony_ci    considered to match.
3165e5c31af7Sopenharmony_ci  * Descriptors referring just to the stencil aspect of a depth/stencil
3166e5c31af7Sopenharmony_ci    image only need to match in the image layout of the stencil aspect, thus
3167e5c31af7Sopenharmony_ci    ename:VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL and
3168e5c31af7Sopenharmony_ci    ename:VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL are
3169e5c31af7Sopenharmony_ci    considered to match
3170e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_maintenance2[]
3171e5c31af7Sopenharmony_ci.
3172e5c31af7Sopenharmony_ci
3173e5c31af7Sopenharmony_ciWhen performing a layout transition on an image subresource, the old layout
3174e5c31af7Sopenharmony_civalue must: either equal the current layout of the image subresource (at the
3175e5c31af7Sopenharmony_citime the transition executes), or else be ename:VK_IMAGE_LAYOUT_UNDEFINED
3176e5c31af7Sopenharmony_ci(implying that the contents of the image subresource need not be preserved).
3177e5c31af7Sopenharmony_ciThe new layout used in a transition must: not be
3178e5c31af7Sopenharmony_ciename:VK_IMAGE_LAYOUT_UNDEFINED or ename:VK_IMAGE_LAYOUT_PREINITIALIZED.
3179e5c31af7Sopenharmony_ci
3180e5c31af7Sopenharmony_ciifdef::VK_EXT_sample_locations[]
3181e5c31af7Sopenharmony_ci
3182e5c31af7Sopenharmony_ciThe image layout of each image subresource of a depth/stencil image created
3183e5c31af7Sopenharmony_ciwith ename:VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT is
3184e5c31af7Sopenharmony_cidependent on the last sample locations used to render to the image
3185e5c31af7Sopenharmony_cisubresource as a depth/stencil attachment, thus applications must: provide
3186e5c31af7Sopenharmony_cithe same sample locations that were last used to render to the given image
3187e5c31af7Sopenharmony_cisubresource whenever a layout transition of the image subresource happens,
3188e5c31af7Sopenharmony_ciotherwise the contents of the depth aspect of the image subresource become
3189e5c31af7Sopenharmony_ciundefined:.
3190e5c31af7Sopenharmony_ci
3191e5c31af7Sopenharmony_ciIn addition, depth reads from a depth/stencil attachment referring to an
3192e5c31af7Sopenharmony_ciimage subresource range of a depth/stencil image created with
3193e5c31af7Sopenharmony_ciename:VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT using
3194e5c31af7Sopenharmony_cidifferent sample locations than what have been last used to perform depth
3195e5c31af7Sopenharmony_ciwrites to the image subresources of the same image subresource range return
3196e5c31af7Sopenharmony_ciundefined: values.
3197e5c31af7Sopenharmony_ci
3198e5c31af7Sopenharmony_ciSimilarly, depth writes to a depth/stencil attachment referring to an image
3199e5c31af7Sopenharmony_cisubresource range of a depth/stencil image created with
3200e5c31af7Sopenharmony_ciename:VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT using
3201e5c31af7Sopenharmony_cidifferent sample locations than what have been last used to perform depth
3202e5c31af7Sopenharmony_ciwrites to the image subresources of the same image subresource range make
3203e5c31af7Sopenharmony_cithe contents of the depth aspect of those image subresources undefined:.
3204e5c31af7Sopenharmony_ci
3205e5c31af7Sopenharmony_ciendif::VK_EXT_sample_locations[]
3206e5c31af7Sopenharmony_ci
3207e5c31af7Sopenharmony_ci
3208e5c31af7Sopenharmony_ci[[resources-image-views]]
3209e5c31af7Sopenharmony_ci== Image Views
3210e5c31af7Sopenharmony_ci
3211e5c31af7Sopenharmony_ci[open,refpage='VkImageView',desc='Opaque handle to an image view object',type='handles']
3212e5c31af7Sopenharmony_ci--
3213e5c31af7Sopenharmony_ciImage objects are not directly accessed by pipeline shaders for reading or
3214e5c31af7Sopenharmony_ciwriting image data.
3215e5c31af7Sopenharmony_ciInstead, _image views_ representing contiguous ranges of the image
3216e5c31af7Sopenharmony_cisubresources and containing additional metadata are used for that purpose.
3217e5c31af7Sopenharmony_ciViews must: be created on images of compatible types, and must: represent a
3218e5c31af7Sopenharmony_civalid subset of image subresources.
3219e5c31af7Sopenharmony_ci
3220e5c31af7Sopenharmony_ciImage views are represented by sname:VkImageView handles:
3221e5c31af7Sopenharmony_ci
3222e5c31af7Sopenharmony_ciinclude::{generated}/api/handles/VkImageView.txt[]
3223e5c31af7Sopenharmony_ci--
3224e5c31af7Sopenharmony_ci
3225e5c31af7Sopenharmony_ci[open,refpage='VK_REMAINING_ARRAY_LAYERS',desc='Sentinel for all remaining array layers',type='consts']
3226e5c31af7Sopenharmony_ci--
3227e5c31af7Sopenharmony_ciename:VK_REMAINING_ARRAY_LAYERS is a special constant value used for image
3228e5c31af7Sopenharmony_civiews to indicate that all remaining array layers in an image after the base
3229e5c31af7Sopenharmony_cilayer should be included in the view.
3230e5c31af7Sopenharmony_ci
3231e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VK_REMAINING_ARRAY_LAYERS.txt[]
3232e5c31af7Sopenharmony_ci--
3233e5c31af7Sopenharmony_ci
3234e5c31af7Sopenharmony_ci[open,refpage='VK_REMAINING_MIP_LEVELS',desc='Sentinel for all remaining mipmap levels',type='consts']
3235e5c31af7Sopenharmony_ci--
3236e5c31af7Sopenharmony_ciename:VK_REMAINING_MIP_LEVELS is a special constant value used for image
3237e5c31af7Sopenharmony_civiews to indicate that all remaining mipmap levels in an image after the
3238e5c31af7Sopenharmony_cibase level should be included in the view.
3239e5c31af7Sopenharmony_ci
3240e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VK_REMAINING_MIP_LEVELS.txt[]
3241e5c31af7Sopenharmony_ci--
3242e5c31af7Sopenharmony_ci
3243e5c31af7Sopenharmony_ci[open,refpage='VkImageViewType',desc='Image view types',type='enums']
3244e5c31af7Sopenharmony_ci--
3245e5c31af7Sopenharmony_ciThe types of image views that can: be created are:
3246e5c31af7Sopenharmony_ci
3247e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkImageViewType.txt[]
3248e5c31af7Sopenharmony_ci--
3249e5c31af7Sopenharmony_ci
3250e5c31af7Sopenharmony_ci[open,refpage='vkCreateImageView',desc='Create an image view from an existing image',type='protos']
3251e5c31af7Sopenharmony_ci--
3252e5c31af7Sopenharmony_ciTo create an image view, call:
3253e5c31af7Sopenharmony_ci
3254e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCreateImageView.txt[]
3255e5c31af7Sopenharmony_ci
3256e5c31af7Sopenharmony_ci  * pname:device is the logical device that creates the image view.
3257e5c31af7Sopenharmony_ci  * pname:pCreateInfo is a pointer to a sname:VkImageViewCreateInfo
3258e5c31af7Sopenharmony_ci    structure containing parameters to be used to create the image view.
3259e5c31af7Sopenharmony_ci  * pname:pAllocator controls host memory allocation as described in the
3260e5c31af7Sopenharmony_ci    <<memory-allocation, Memory Allocation>> chapter.
3261e5c31af7Sopenharmony_ci  * pname:pView is a pointer to a slink:VkImageView handle in which the
3262e5c31af7Sopenharmony_ci    resulting image view object is returned.
3263e5c31af7Sopenharmony_ci
3264e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCreateImageView.txt[]
3265e5c31af7Sopenharmony_ci--
3266e5c31af7Sopenharmony_ci
3267e5c31af7Sopenharmony_ci[open,refpage='VkImageViewCreateInfo',desc='Structure specifying parameters of a newly created image view',type='structs']
3268e5c31af7Sopenharmony_ci--
3269e5c31af7Sopenharmony_ciThe sname:VkImageViewCreateInfo structure is defined as:
3270e5c31af7Sopenharmony_ci
3271e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkImageViewCreateInfo.txt[]
3272e5c31af7Sopenharmony_ci
3273e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure.
3274e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
3275e5c31af7Sopenharmony_ci    structure.
3276e5c31af7Sopenharmony_ci  * pname:flags is a bitmask of elink:VkImageViewCreateFlagBits describing
3277e5c31af7Sopenharmony_ci    additional parameters of the image view.
3278e5c31af7Sopenharmony_ci  * pname:image is a slink:VkImage on which the view will be created.
3279e5c31af7Sopenharmony_ci  * pname:viewType is a elink:VkImageViewType value specifying the type of
3280e5c31af7Sopenharmony_ci    the image view.
3281e5c31af7Sopenharmony_ci  * pname:format is a elink:VkFormat describing the format and type used to
3282e5c31af7Sopenharmony_ci    interpret texel blocks in the image.
3283e5c31af7Sopenharmony_ci  * pname:components is a slink:VkComponentMapping structure specifying a
3284e5c31af7Sopenharmony_ci    remapping of color components (or of depth or stencil components after
3285e5c31af7Sopenharmony_ci    they have been converted into color components).
3286e5c31af7Sopenharmony_ci  * pname:subresourceRange is a slink:VkImageSubresourceRange structure
3287e5c31af7Sopenharmony_ci    selecting the set of mipmap levels and array layers to be accessible to
3288e5c31af7Sopenharmony_ci    the view.
3289e5c31af7Sopenharmony_ci
3290e5c31af7Sopenharmony_ci[[resources-image-inherited-usage]]
3291e5c31af7Sopenharmony_ciSome of the pname:image creation parameters are inherited by the view.
3292e5c31af7Sopenharmony_ciIn particular, image view creation inherits the implicit parameter
3293e5c31af7Sopenharmony_cipname:usage specifying the allowed usages of the image view that, by
3294e5c31af7Sopenharmony_cidefault, takes the value of the corresponding pname:usage parameter
3295e5c31af7Sopenharmony_cispecified in slink:VkImageCreateInfo at image creation time.
3296e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_maintenance2[]
3297e5c31af7Sopenharmony_ciThe implicit pname:usage can: be overriden by adding a
3298e5c31af7Sopenharmony_cislink:VkImageViewUsageCreateInfo structure to the pname:pNext chain, but the
3299e5c31af7Sopenharmony_ciview usage must: be a subset of the image usage.
3300e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_maintenance2[]
3301e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_EXT_separate_stencil_usage[]
3302e5c31af7Sopenharmony_ciIf pname:image has a depth-stencil format and was created with a
3303e5c31af7Sopenharmony_cislink:VkImageStencilUsageCreateInfo structure included in the pname:pNext
3304e5c31af7Sopenharmony_cichain of slink:VkImageCreateInfo, the usage is calculated based on the
3305e5c31af7Sopenharmony_cipname:subresource.aspectMask provided:
3306e5c31af7Sopenharmony_ci
3307e5c31af7Sopenharmony_ci  * If pname:aspectMask includes only ename:VK_IMAGE_ASPECT_STENCIL_BIT, the
3308e5c31af7Sopenharmony_ci    implicit pname:usage is equal to
3309e5c31af7Sopenharmony_ci    slink:VkImageStencilUsageCreateInfo::pname:stencilUsage.
3310e5c31af7Sopenharmony_ci  * If pname:aspectMask includes only ename:VK_IMAGE_ASPECT_DEPTH_BIT, the
3311e5c31af7Sopenharmony_ci    implicit pname:usage is equal to slink:VkImageCreateInfo::pname:usage.
3312e5c31af7Sopenharmony_ci  * If both aspects are included in pname:aspectMask, the implicit
3313e5c31af7Sopenharmony_ci    pname:usage is equal to the intersection of
3314e5c31af7Sopenharmony_ci    slink:VkImageCreateInfo::pname:usage and
3315e5c31af7Sopenharmony_ci    slink:VkImageStencilUsageCreateInfo::pname:stencilUsage.
3316e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_EXT_separate_stencil_usage[]
3317e5c31af7Sopenharmony_ci
3318e5c31af7Sopenharmony_ciIf pname:image was created with the ename:VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT
3319e5c31af7Sopenharmony_ciflag,
3320e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
3321e5c31af7Sopenharmony_ciand if the pname:format of the image is not
3322e5c31af7Sopenharmony_ci<<formats-requiring-sampler-ycbcr-conversion,multi-planar>>,
3323e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
3324e5c31af7Sopenharmony_cipname:format can: be different from the image's format, but if
3325e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_maintenance2[]
3326e5c31af7Sopenharmony_cipname:image was created without the
3327e5c31af7Sopenharmony_ciename:VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT flag and
3328e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_maintenance2[]
3329e5c31af7Sopenharmony_cithey are not equal they must: be _compatible_.
3330e5c31af7Sopenharmony_ciImage format compatibility is defined in the
3331e5c31af7Sopenharmony_ci<<formats-compatibility-classes,Format Compatibility Classes>> section.
3332e5c31af7Sopenharmony_ciViews of compatible formats will have the same mapping between texel
3333e5c31af7Sopenharmony_cicoordinates and memory locations irrespective of the pname:format, with only
3334e5c31af7Sopenharmony_cithe interpretation of the bit pattern changing.
3335e5c31af7Sopenharmony_ci
3336e5c31af7Sopenharmony_ci[NOTE]
3337e5c31af7Sopenharmony_ci.Note
3338e5c31af7Sopenharmony_ci====
3339e5c31af7Sopenharmony_ciValues intended to be used with one view format may: not be exactly
3340e5c31af7Sopenharmony_cipreserved when written or read through a different format.
3341e5c31af7Sopenharmony_ciFor example, an integer value that happens to have the bit pattern of a
3342e5c31af7Sopenharmony_cifloating point denorm or NaN may: be flushed or canonicalized when written
3343e5c31af7Sopenharmony_cior read through a view with a floating point format.
3344e5c31af7Sopenharmony_ciSimilarly, a value written through a signed normalized format that has a bit
3345e5c31af7Sopenharmony_cipattern exactly equal to [eq]#-2^b^# may: be changed to [eq]#-2^b^ {plus} 1#
3346e5c31af7Sopenharmony_cias described in <<fundamentals-fixedfpconv,Conversion from Normalized
3347e5c31af7Sopenharmony_ciFixed-Point to Floating-Point>>.
3348e5c31af7Sopenharmony_ci====
3349e5c31af7Sopenharmony_ci
3350e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_maintenance2[]
3351e5c31af7Sopenharmony_ciIf pname:image was created with the
3352e5c31af7Sopenharmony_ciename:VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT flag, pname:format
3353e5c31af7Sopenharmony_cimust: be _compatible_ with the image's format as described above, or must:
3354e5c31af7Sopenharmony_cibe an uncompressed format in which case it must: be _size-compatible_ with
3355e5c31af7Sopenharmony_cithe image's format, as defined for
3356e5c31af7Sopenharmony_ci<<copies-images-format-size-compatibility, copying data between images>>.
3357e5c31af7Sopenharmony_ciIn this case, the resulting image view's texel dimensions equal the
3358e5c31af7Sopenharmony_cidimensions of the selected mip level divided by the compressed texel block
3359e5c31af7Sopenharmony_cisize and rounded up.
3360e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_maintenance2[]
3361e5c31af7Sopenharmony_ci
3362e5c31af7Sopenharmony_ciThe slink:VkComponentMapping pname:components member describes a remapping
3363e5c31af7Sopenharmony_cifrom components of the image to components of the vector returned by shader
3364e5c31af7Sopenharmony_ciimage instructions.
3365e5c31af7Sopenharmony_ciThis remapping must: be the identity swizzle for storage image descriptors,
3366e5c31af7Sopenharmony_ciinput attachment descriptors,
3367e5c31af7Sopenharmony_ciifndef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
3368e5c31af7Sopenharmony_ciand framebuffer attachments.
3369e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
3370e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
3371e5c31af7Sopenharmony_ciframebuffer attachments, and any sname:VkImageView used with a combined
3372e5c31af7Sopenharmony_ciimage sampler that enables <<samplers-YCbCr-conversion,sampler Y'C~B~C~R~
3373e5c31af7Sopenharmony_ciconversion>>.
3374e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
3375e5c31af7Sopenharmony_ci
3376e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
3377e5c31af7Sopenharmony_ciIf the image view is to be used with a sampler which supports
3378e5c31af7Sopenharmony_ci<<samplers-YCbCr-conversion,sampler {YCbCr} conversion>>, an _identically
3379e5c31af7Sopenharmony_cidefined object_ of type slink:VkSamplerYcbcrConversion to that used to
3380e5c31af7Sopenharmony_cicreate the sampler must: be passed to flink:vkCreateImageView in a
3381e5c31af7Sopenharmony_cislink:VkSamplerYcbcrConversionInfo included in the pname:pNext chain of
3382e5c31af7Sopenharmony_cislink:VkImageViewCreateInfo.
3383e5c31af7Sopenharmony_ciConversely, if a slink:VkSamplerYcbcrConversion object is passed to
3384e5c31af7Sopenharmony_ciflink:vkCreateImageView, an identically defined
3385e5c31af7Sopenharmony_cislink:VkSamplerYcbcrConversion object must: be used when sampling the image.
3386e5c31af7Sopenharmony_ci
3387e5c31af7Sopenharmony_ciIf the image has a
3388e5c31af7Sopenharmony_ci<<formats-requiring-sampler-ycbcr-conversion,multi-planar>> pname:format and
3389e5c31af7Sopenharmony_cipname:subresourceRange.aspectMask is ename:VK_IMAGE_ASPECT_COLOR_BIT,
3390e5c31af7Sopenharmony_ciifdef::VK_KHR_video_decode_queue[]
3391e5c31af7Sopenharmony_ciand pname:image has been created with a pname:usage value *not* containing
3392e5c31af7Sopenharmony_ciany of the ename:VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR,
3393e5c31af7Sopenharmony_ciename:VK_IMAGE_USAGE_VIDEO_DECODE_SRC_BIT_KHR,
3394e5c31af7Sopenharmony_ciename:VK_IMAGE_USAGE_VIDEO_DECODE_DPB_BIT_KHR,
3395e5c31af7Sopenharmony_ciename:VK_IMAGE_USAGE_VIDEO_ENCODE_DST_BIT_KHR,
3396e5c31af7Sopenharmony_ciename:VK_IMAGE_USAGE_VIDEO_ENCODE_SRC_BIT_KHR, and
3397e5c31af7Sopenharmony_ciename:VK_IMAGE_USAGE_VIDEO_ENCODE_DPB_BIT_KHR flags,
3398e5c31af7Sopenharmony_ciendif::VK_KHR_video_decode_queue[]
3399e5c31af7Sopenharmony_cithen the pname:format must: be identical to the image pname:format, and the
3400e5c31af7Sopenharmony_cisampler to be used with the image view must: enable
3401e5c31af7Sopenharmony_ci<<samplers-YCbCr-conversion,sampler {YCbCr} conversion>>.
3402e5c31af7Sopenharmony_ci
3403e5c31af7Sopenharmony_ciifdef::VK_KHR_video_decode_queue[]
3404e5c31af7Sopenharmony_ciIf the image has a
3405e5c31af7Sopenharmony_ci<<formats-requiring-sampler-ycbcr-conversion,multi-planar>> pname:format and
3406e5c31af7Sopenharmony_cithe pname:image has been created with a pname:usage value containing any of
3407e5c31af7Sopenharmony_cithe ename:VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR,
3408e5c31af7Sopenharmony_ciename:VK_IMAGE_USAGE_VIDEO_DECODE_SRC_BIT_KHR, and
3409e5c31af7Sopenharmony_ciename:VK_IMAGE_USAGE_VIDEO_DECODE_DPB_BIT_KHR flags, then all of the
3410e5c31af7Sopenharmony_ci<<video-decode-operations, video decode operations>> would ignore the
3411e5c31af7Sopenharmony_cislink:VkSamplerYcbcrConversionInfo structure and/or
3412e5c31af7Sopenharmony_ci<<samplers-YCbCr-conversion,sampler Y'C~B~C~R~ conversion>> object,
3413e5c31af7Sopenharmony_ciassociated with the image view.
3414e5c31af7Sopenharmony_ciendif::VK_KHR_video_decode_queue[]
3415e5c31af7Sopenharmony_ciifdef::VK_KHR_video_encode_queue[]
3416e5c31af7Sopenharmony_ciIf the image has a
3417e5c31af7Sopenharmony_ci<<formats-requiring-sampler-ycbcr-conversion,multi-planar>> pname:format and
3418e5c31af7Sopenharmony_cithe pname:image has been created with a pname:usage value containing any of
3419e5c31af7Sopenharmony_cithe ename:VK_IMAGE_USAGE_VIDEO_ENCODE_DST_BIT_KHR,
3420e5c31af7Sopenharmony_ciename:VK_IMAGE_USAGE_VIDEO_ENCODE_SRC_BIT_KHR, and
3421e5c31af7Sopenharmony_ciename:VK_IMAGE_USAGE_VIDEO_ENCODE_DPB_BIT_KHR flags, then all of the
3422e5c31af7Sopenharmony_ci<<video-encode-operations, video encode operations>> would ignore the
3423e5c31af7Sopenharmony_cislink:VkSamplerYcbcrConversionInfo structure and/or
3424e5c31af7Sopenharmony_ci<<samplers-YCbCr-conversion,sampler Y'C~B~C~R~ conversion>> object,
3425e5c31af7Sopenharmony_ciassociated with the image view.
3426e5c31af7Sopenharmony_ciendif::VK_KHR_video_encode_queue[]
3427e5c31af7Sopenharmony_ci
3428e5c31af7Sopenharmony_ciIf pname:image was created with the ename:VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT
3429e5c31af7Sopenharmony_ciand the image has a
3430e5c31af7Sopenharmony_ci<<formats-requiring-sampler-ycbcr-conversion,multi-planar>> pname:format,
3431e5c31af7Sopenharmony_ciand if pname:subresourceRange.aspectMask is
3432e5c31af7Sopenharmony_ciename:VK_IMAGE_ASPECT_PLANE_0_BIT, ename:VK_IMAGE_ASPECT_PLANE_1_BIT, or
3433e5c31af7Sopenharmony_ciename:VK_IMAGE_ASPECT_PLANE_2_BIT, pname:format must: be
3434e5c31af7Sopenharmony_ci<<formats-compatible-planes,compatible>> with the corresponding plane of the
3435e5c31af7Sopenharmony_ciimage, and the sampler to be used with the image view must: not enable
3436e5c31af7Sopenharmony_ci<<samplers-YCbCr-conversion,sampler {YCbCr} conversion>>.
3437e5c31af7Sopenharmony_ciThe pname:width and pname:height of the single-plane image view must: be
3438e5c31af7Sopenharmony_ciderived from the multi-planar image's dimensions in the manner listed for
3439e5c31af7Sopenharmony_ci<<formats-compatible-planes,plane compatibility>> for the plane.
3440e5c31af7Sopenharmony_ci
3441e5c31af7Sopenharmony_ciAny view of an image plane will have the same mapping between texel
3442e5c31af7Sopenharmony_cicoordinates and memory locations as used by the components of the color
3443e5c31af7Sopenharmony_ciaspect, subject to the formulae relating texel coordinates to
3444e5c31af7Sopenharmony_cilower-resolution planes as described in <<textures-chroma-reconstruction,
3445e5c31af7Sopenharmony_ciChroma Reconstruction>>.
3446e5c31af7Sopenharmony_ciThat is, if an R or B plane has a reduced resolution relative to the G plane
3447e5c31af7Sopenharmony_ciof the multi-planar image, the image view operates using the (_u~plane~_,
3448e5c31af7Sopenharmony_ci_v~plane~_) unnormalized coordinates of the reduced-resolution plane, and
3449e5c31af7Sopenharmony_cithese coordinates access the same memory locations as the (_u~color~_,
3450e5c31af7Sopenharmony_ci_v~color~_) unnormalized coordinates of the color aspect for which chroma
3451e5c31af7Sopenharmony_cireconstruction operations operate on the same (_u~plane~_, _v~plane~_) or
3452e5c31af7Sopenharmony_ci(_i~plane~_, _j~plane~_) coordinates.
3453e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
3454e5c31af7Sopenharmony_ci
3455e5c31af7Sopenharmony_ci[[resources-image-views-compatibility]]
3456e5c31af7Sopenharmony_ci.Image type and image view type compatibility requirements
3457e5c31af7Sopenharmony_ci[cols="35%,50%",options="header"]
3458e5c31af7Sopenharmony_ci|====
3459e5c31af7Sopenharmony_ci| Image View Type | Compatible Image Types
3460e5c31af7Sopenharmony_ci| ename:VK_IMAGE_VIEW_TYPE_1D         | ename:VK_IMAGE_TYPE_1D
3461e5c31af7Sopenharmony_ci| ename:VK_IMAGE_VIEW_TYPE_1D_ARRAY   | ename:VK_IMAGE_TYPE_1D
3462e5c31af7Sopenharmony_ci| ename:VK_IMAGE_VIEW_TYPE_2D         | ename:VK_IMAGE_TYPE_2D
3463e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_maintenance1[, ename:VK_IMAGE_TYPE_3D]
3464e5c31af7Sopenharmony_ci| ename:VK_IMAGE_VIEW_TYPE_2D_ARRAY   | ename:VK_IMAGE_TYPE_2D
3465e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_maintenance1[, ename:VK_IMAGE_TYPE_3D]
3466e5c31af7Sopenharmony_ci| ename:VK_IMAGE_VIEW_TYPE_CUBE       | ename:VK_IMAGE_TYPE_2D
3467e5c31af7Sopenharmony_ci| ename:VK_IMAGE_VIEW_TYPE_CUBE_ARRAY | ename:VK_IMAGE_TYPE_2D
3468e5c31af7Sopenharmony_ci| ename:VK_IMAGE_VIEW_TYPE_3D         | ename:VK_IMAGE_TYPE_3D
3469e5c31af7Sopenharmony_ci|====
3470e5c31af7Sopenharmony_ci
3471e5c31af7Sopenharmony_ci.Valid Usage
3472e5c31af7Sopenharmony_ci****
3473e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewCreateInfo-image-01003]]
3474e5c31af7Sopenharmony_ci    If pname:image was not created with
3475e5c31af7Sopenharmony_ci    ename:VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT then pname:viewType must: not
3476e5c31af7Sopenharmony_ci    be ename:VK_IMAGE_VIEW_TYPE_CUBE or ename:VK_IMAGE_VIEW_TYPE_CUBE_ARRAY
3477e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewCreateInfo-viewType-01004]]
3478e5c31af7Sopenharmony_ci    If the <<features-imageCubeArray,image cube map arrays>> feature is not
3479e5c31af7Sopenharmony_ci    enabled, pname:viewType must: not be ename:VK_IMAGE_VIEW_TYPE_CUBE_ARRAY
3480e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_maintenance1[]
3481e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewCreateInfo-image-01005]]
3482e5c31af7Sopenharmony_ci    If pname:image was created with ename:VK_IMAGE_TYPE_3D but without
3483e5c31af7Sopenharmony_ci    ename:VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT set then pname:viewType
3484e5c31af7Sopenharmony_ci    must: not be ename:VK_IMAGE_VIEW_TYPE_2D or
3485e5c31af7Sopenharmony_ci    ename:VK_IMAGE_VIEW_TYPE_2D_ARRAY
3486e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewCreateInfo-image-04970]]
3487e5c31af7Sopenharmony_ci    If pname:image was created with ename:VK_IMAGE_TYPE_3D and
3488e5c31af7Sopenharmony_ci    pname:viewType is ename:VK_IMAGE_VIEW_TYPE_2D or
3489e5c31af7Sopenharmony_ci    ename:VK_IMAGE_VIEW_TYPE_2D_ARRAY then pname:subresourceRange.levelCount
3490e5c31af7Sopenharmony_ci    must: be 1
3491e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewCreateInfo-image-04971]]
3492e5c31af7Sopenharmony_ci    If pname:image was created with ename:VK_IMAGE_TYPE_3D and
3493e5c31af7Sopenharmony_ci    pname:viewType is ename:VK_IMAGE_VIEW_TYPE_2D or
3494e5c31af7Sopenharmony_ci    ename:VK_IMAGE_VIEW_TYPE_2D_ARRAY then pname:flags must: not contain any
3495e5c31af7Sopenharmony_ci    of ename:VK_IMAGE_CREATE_SPARSE_BINDING_BIT,
3496e5c31af7Sopenharmony_ci    ename:VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT, and
3497e5c31af7Sopenharmony_ci    ename:VK_IMAGE_CREATE_SPARSE_ALIASED_BIT
3498e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewCreateInfo-image-04972]]
3499e5c31af7Sopenharmony_ci    If pname:image was created with a pname:samples value not equal to
3500e5c31af7Sopenharmony_ci    ename:VK_SAMPLE_COUNT_1_BIT then pname:viewType must: be either
3501e5c31af7Sopenharmony_ci    ename:VK_IMAGE_VIEW_TYPE_2D or ename:VK_IMAGE_VIEW_TYPE_2D_ARRAY
3502e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_maintenance1[]
3503e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewCreateInfo-image-04441]]
3504e5c31af7Sopenharmony_ci    pname:image must: have been created with a pname:usage value containing
3505e5c31af7Sopenharmony_ci    at least one of the usages defined in the <<valid-imageview-imageusage,
3506e5c31af7Sopenharmony_ci    valid image usage>> list for image views
3507e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewCreateInfo-None-02273]]
3508e5c31af7Sopenharmony_ci    The <<resources-image-view-format-features,format features>> of the
3509e5c31af7Sopenharmony_ci    resultant image view must: contain at least one bit
3510e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewCreateInfo-usage-02274]]
3511e5c31af7Sopenharmony_ci    If pname:usage contains ename:VK_IMAGE_USAGE_SAMPLED_BIT, then the
3512e5c31af7Sopenharmony_ci    <<resources-image-view-format-features,format features>> of the
3513e5c31af7Sopenharmony_ci    resultant image view must: contain
3514e5c31af7Sopenharmony_ci    ename:VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT
3515e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewCreateInfo-usage-02275]]
3516e5c31af7Sopenharmony_ci    If pname:usage contains ename:VK_IMAGE_USAGE_STORAGE_BIT, then the image
3517e5c31af7Sopenharmony_ci    view's <<resources-image-view-format-features,format features>> must:
3518e5c31af7Sopenharmony_ci    contain ename:VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT
3519e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewCreateInfo-usage-02276]]
3520e5c31af7Sopenharmony_ci    If pname:usage contains ename:VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, then
3521e5c31af7Sopenharmony_ci    the image view's <<resources-image-view-format-features,format
3522e5c31af7Sopenharmony_ci    features>> must: contain ename:VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT
3523e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewCreateInfo-usage-02277]]
3524e5c31af7Sopenharmony_ci    If pname:usage contains
3525e5c31af7Sopenharmony_ci    ename:VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT, then the image view's
3526e5c31af7Sopenharmony_ci    <<resources-image-view-format-features,format features>> must: contain
3527e5c31af7Sopenharmony_ci    ename:VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT
3528e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewCreateInfo-usage-02652]]
3529e5c31af7Sopenharmony_ci    If pname:usage contains ename:VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT, then
3530e5c31af7Sopenharmony_ci    the image view's <<resources-image-view-format-features,format
3531e5c31af7Sopenharmony_ci    features>> must: contain at least one of
3532e5c31af7Sopenharmony_ci    ename:VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT or
3533e5c31af7Sopenharmony_ci    ename:VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT
3534e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewCreateInfo-subresourceRange-01478]]
3535e5c31af7Sopenharmony_ci    pname:subresourceRange.baseMipLevel must: be less than the
3536e5c31af7Sopenharmony_ci    pname:mipLevels specified in slink:VkImageCreateInfo when pname:image
3537e5c31af7Sopenharmony_ci    was created
3538e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewCreateInfo-subresourceRange-01718]]
3539e5c31af7Sopenharmony_ci    If pname:subresourceRange.levelCount is not
3540e5c31af7Sopenharmony_ci    ename:VK_REMAINING_MIP_LEVELS, [eq]#pname:subresourceRange.baseMipLevel
3541e5c31af7Sopenharmony_ci    {plus} pname:subresourceRange.levelCount# must: be less than or equal to
3542e5c31af7Sopenharmony_ci    the pname:mipLevels specified in slink:VkImageCreateInfo when
3543e5c31af7Sopenharmony_ci    pname:image was created
3544e5c31af7Sopenharmony_ciifdef::VK_EXT_fragment_density_map[]
3545e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewCreateInfo-image-02571]]
3546e5c31af7Sopenharmony_ci    If pname:image was created with pname:usage containing
3547e5c31af7Sopenharmony_ci    ename:VK_IMAGE_USAGE_FRAGMENT_DENSITY_MAP_BIT_EXT,
3548e5c31af7Sopenharmony_ci    pname:subresourceRange.levelCount must: be `1`
3549e5c31af7Sopenharmony_ciendif::VK_EXT_fragment_density_map[]
3550e5c31af7Sopenharmony_ciifndef::VK_VERSION_1_1,VK_KHR_maintenance1[]
3551e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewCreateInfo-subresourceRange-01480]]
3552e5c31af7Sopenharmony_ci    pname:subresourceRange.baseArrayLayer must: be less than the
3553e5c31af7Sopenharmony_ci    pname:arrayLayers specified in slink:VkImageCreateInfo when pname:image
3554e5c31af7Sopenharmony_ci    was created
3555e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewCreateInfo-subresourceRange-01719]]
3556e5c31af7Sopenharmony_ci    If pname:subresourceRange.layerCount is not
3557e5c31af7Sopenharmony_ci    ename:VK_REMAINING_ARRAY_LAYERS,
3558e5c31af7Sopenharmony_ci    [eq]#pname:subresourceRange.baseArrayLayer {plus}
3559e5c31af7Sopenharmony_ci    pname:subresourceRange.layerCount# must: be less than or equal to the
3560e5c31af7Sopenharmony_ci    pname:arrayLayers specified in slink:VkImageCreateInfo when pname:image
3561e5c31af7Sopenharmony_ci    was created
3562e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_maintenance1[]
3563e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_maintenance1[]
3564e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewCreateInfo-image-01482]]
3565e5c31af7Sopenharmony_ci    If pname:image is not a 3D image created with
3566e5c31af7Sopenharmony_ci    ename:VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT set, or pname:viewType is
3567e5c31af7Sopenharmony_ci    not ename:VK_IMAGE_VIEW_TYPE_2D or ename:VK_IMAGE_VIEW_TYPE_2D_ARRAY,
3568e5c31af7Sopenharmony_ci    pname:subresourceRange.baseArrayLayer must: be less than the
3569e5c31af7Sopenharmony_ci    pname:arrayLayers specified in slink:VkImageCreateInfo when pname:image
3570e5c31af7Sopenharmony_ci    was created
3571e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewCreateInfo-subresourceRange-01483]]
3572e5c31af7Sopenharmony_ci    If pname:subresourceRange.layerCount is not
3573e5c31af7Sopenharmony_ci    ename:VK_REMAINING_ARRAY_LAYERS, pname:image is not a 3D image created
3574e5c31af7Sopenharmony_ci    with ename:VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT set, or
3575e5c31af7Sopenharmony_ci    pname:viewType is not ename:VK_IMAGE_VIEW_TYPE_2D or
3576e5c31af7Sopenharmony_ci    ename:VK_IMAGE_VIEW_TYPE_2D_ARRAY, pname:subresourceRange.layerCount
3577e5c31af7Sopenharmony_ci    must: be non-zero and [eq]#pname:subresourceRange.baseArrayLayer {plus}
3578e5c31af7Sopenharmony_ci    pname:subresourceRange.layerCount# must: be less than or equal to the
3579e5c31af7Sopenharmony_ci    pname:arrayLayers specified in slink:VkImageCreateInfo when pname:image
3580e5c31af7Sopenharmony_ci    was created
3581e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewCreateInfo-image-02724]]
3582e5c31af7Sopenharmony_ci    If pname:image is a 3D image created with
3583e5c31af7Sopenharmony_ci    ename:VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT set, and pname:viewType is
3584e5c31af7Sopenharmony_ci    ename:VK_IMAGE_VIEW_TYPE_2D or ename:VK_IMAGE_VIEW_TYPE_2D_ARRAY,
3585e5c31af7Sopenharmony_ci    pname:subresourceRange.baseArrayLayer must: be less than the depth
3586e5c31af7Sopenharmony_ci    computed from pname:baseMipLevel and pname:extent.depth specified in
3587e5c31af7Sopenharmony_ci    slink:VkImageCreateInfo when pname:image was created, according to the
3588e5c31af7Sopenharmony_ci    formula defined in <<resources-image-miplevel-sizing,Image Miplevel
3589e5c31af7Sopenharmony_ci    Sizing>>
3590e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewCreateInfo-subresourceRange-02725]]
3591e5c31af7Sopenharmony_ci    If pname:subresourceRange.layerCount is not
3592e5c31af7Sopenharmony_ci    ename:VK_REMAINING_ARRAY_LAYERS, pname:image is a 3D image created with
3593e5c31af7Sopenharmony_ci    ename:VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT set, and pname:viewType is
3594e5c31af7Sopenharmony_ci    ename:VK_IMAGE_VIEW_TYPE_2D or ename:VK_IMAGE_VIEW_TYPE_2D_ARRAY,
3595e5c31af7Sopenharmony_ci    pname:subresourceRange.layerCount must: be non-zero and
3596e5c31af7Sopenharmony_ci    [eq]#pname:subresourceRange.baseArrayLayer {plus}
3597e5c31af7Sopenharmony_ci    pname:subresourceRange.layerCount# must: be less than or equal to the
3598e5c31af7Sopenharmony_ci    depth computed from pname:baseMipLevel and pname:extent.depth specified
3599e5c31af7Sopenharmony_ci    in slink:VkImageCreateInfo when pname:image was created, according to
3600e5c31af7Sopenharmony_ci    the formula defined in <<resources-image-miplevel-sizing,Image Miplevel
3601e5c31af7Sopenharmony_ci    Sizing>>
3602e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_maintenance1[]
3603e5c31af7Sopenharmony_ci// The VU below comes in 4 alternate versions
3604e5c31af7Sopenharmony_ci// both disabled, both enabled, maintenance2 only, ycbcr only
3605e5c31af7Sopenharmony_ciifndef::VK_VERSION_1_1,VK_KHR_maintenance2[]
3606e5c31af7Sopenharmony_ciifndef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
3607e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewCreateInfo-image-01018]]
3608e5c31af7Sopenharmony_ci    If pname:image was created with the
3609e5c31af7Sopenharmony_ci    ename:VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT flag, pname:format must: be
3610e5c31af7Sopenharmony_ci    compatible with the pname:format used to create pname:image, as defined
3611e5c31af7Sopenharmony_ci    in <<formats-compatibility-classes,Format Compatibility Classes>>
3612e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
3613e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_maintenance2[]
3614e5c31af7Sopenharmony_ci// The nested ifdefs are there in anticipation of the hoped-for day when the
3615e5c31af7Sopenharmony_ci// VU extractor and validation layers can handle VU with imbedded
3616e5c31af7Sopenharmony_ci// conditionals. They are commented out until then.
3617e5c31af7Sopenharmony_ci//
3618e5c31af7Sopenharmony_ci// If VK_VERSION_1_1,VK_KHR_maintenance2 and NOT VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion
3619e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_maintenance2[]
3620e5c31af7Sopenharmony_ciifndef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
3621e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewCreateInfo-image-01759]]
3622e5c31af7Sopenharmony_ci    If pname:image was created with the
3623e5c31af7Sopenharmony_ci    ename:VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT flag, but without the
3624e5c31af7Sopenharmony_ci    ename:VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT flag, pname:format
3625e5c31af7Sopenharmony_ci    must: be compatible with the pname:format used to create pname:image, as
3626e5c31af7Sopenharmony_ci    defined in <<formats-compatibility-classes,Format Compatibility
3627e5c31af7Sopenharmony_ci    Classes>>
3628e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
3629e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_maintenance2[]
3630e5c31af7Sopenharmony_ci// If NOT VK_VERSION_1_1,VK_KHR_maintenance2 and VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion
3631e5c31af7Sopenharmony_ciifndef::VK_VERSION_1_1,VK_KHR_maintenance2[]
3632e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
3633e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewCreateInfo-image-01760]]
3634e5c31af7Sopenharmony_ci    If pname:image was created with the
3635e5c31af7Sopenharmony_ci    ename:VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT flag, and if the pname:format
3636e5c31af7Sopenharmony_ci    of the pname:image is not a
3637e5c31af7Sopenharmony_ci    <<formats-requiring-sampler-ycbcr-conversion,multi-planar>> format,
3638e5c31af7Sopenharmony_ci    pname:format must: be compatible with the pname:format used to create
3639e5c31af7Sopenharmony_ci    pname:image, as defined in <<formats-compatibility-classes,Format
3640e5c31af7Sopenharmony_ci    Compatibility Classes>>
3641e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
3642e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_maintenance2[]
3643e5c31af7Sopenharmony_ci// If VK_VERSION_1_1,VK_KHR_maintenance2 and VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion
3644e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_maintenance2[]
3645e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
3646e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewCreateInfo-image-01761]]
3647e5c31af7Sopenharmony_ci    If pname:image was created with the
3648e5c31af7Sopenharmony_ci    ename:VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT flag,
3649e5c31af7Sopenharmony_ci// ifdef::VK_VERSION_1_1,VK_KHR_maintenance2[]
3650e5c31af7Sopenharmony_ci    but without the ename:VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT
3651e5c31af7Sopenharmony_ci    flag,
3652e5c31af7Sopenharmony_ci// endif::VK_VERSION_1_1,VK_KHR_maintenance2[]
3653e5c31af7Sopenharmony_ci// ifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
3654e5c31af7Sopenharmony_ci    and if the pname:format of the pname:image is not a
3655e5c31af7Sopenharmony_ci    <<formats-requiring-sampler-ycbcr-conversion,multi-planar>> format,
3656e5c31af7Sopenharmony_ci// endif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
3657e5c31af7Sopenharmony_ci    pname:format must: be compatible with the pname:format used to create
3658e5c31af7Sopenharmony_ci    pname:image, as defined in <<formats-compatibility-classes,Format
3659e5c31af7Sopenharmony_ci    Compatibility Classes>>
3660e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
3661e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_maintenance2[]
3662e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_maintenance2[]
3663e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewCreateInfo-image-01583]]
3664e5c31af7Sopenharmony_ci    If pname:image was created with the
3665e5c31af7Sopenharmony_ci    ename:VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT flag, pname:format
3666e5c31af7Sopenharmony_ci    must: be compatible with, or must: be an uncompressed format that is
3667e5c31af7Sopenharmony_ci    size-compatible with, the pname:format used to create pname:image
3668e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewCreateInfo-image-01584]]
3669e5c31af7Sopenharmony_ci    If pname:image was created with the
3670e5c31af7Sopenharmony_ci    ename:VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT flag, the
3671e5c31af7Sopenharmony_ci    pname:levelCount and pname:layerCount members of pname:subresourceRange
3672e5c31af7Sopenharmony_ci    must: both be `1`
3673e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewCreateInfo-image-04739]]
3674e5c31af7Sopenharmony_ci    If pname:image was created with the
3675e5c31af7Sopenharmony_ci    ename:VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT flag and
3676e5c31af7Sopenharmony_ci    pname:format is a non-compressed format, pname:viewType must: not be
3677e5c31af7Sopenharmony_ci    ename:VK_IMAGE_VIEW_TYPE_3D
3678e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_maintenance2[]
3679e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_KHR_image_format_list[]
3680e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewCreateInfo-pNext-01585]]
3681e5c31af7Sopenharmony_ci    If a slink:VkImageFormatListCreateInfo structure was included in the
3682e5c31af7Sopenharmony_ci    pname:pNext chain of the slink:VkImageCreateInfo structure used when
3683e5c31af7Sopenharmony_ci    creating pname:image and
3684e5c31af7Sopenharmony_ci    slink:VkImageFormatListCreateInfo::pname:viewFormatCount is not zero
3685e5c31af7Sopenharmony_ci    then pname:format must: be one of the formats in
3686e5c31af7Sopenharmony_ci    slink:VkImageFormatListCreateInfo::pname:pViewFormats
3687e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_KHR_image_format_list[]
3688e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
3689e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewCreateInfo-image-01586]]
3690e5c31af7Sopenharmony_ci    If pname:image was created with the
3691e5c31af7Sopenharmony_ci    ename:VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT flag, if the pname:format of
3692e5c31af7Sopenharmony_ci    the pname:image is a
3693e5c31af7Sopenharmony_ci    <<formats-requiring-sampler-ycbcr-conversion,multi-planar>> format, and
3694e5c31af7Sopenharmony_ci    if pname:subresourceRange.aspectMask is one of
3695e5c31af7Sopenharmony_ci    ename:VK_IMAGE_ASPECT_PLANE_0_BIT, ename:VK_IMAGE_ASPECT_PLANE_1_BIT, or
3696e5c31af7Sopenharmony_ci    ename:VK_IMAGE_ASPECT_PLANE_2_BIT, then pname:format must: be compatible
3697e5c31af7Sopenharmony_ci    with the elink:VkFormat for the plane of the pname:image pname:format
3698e5c31af7Sopenharmony_ci    indicated by pname:subresourceRange.aspectMask, as defined in
3699e5c31af7Sopenharmony_ci    <<formats-compatible-planes>>
3700e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
3701e5c31af7Sopenharmony_ciifndef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
3702e5c31af7Sopenharmony_ci// The VU below comes in an alternate version when the extension is
3703e5c31af7Sopenharmony_ci// enabled.
3704e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewCreateInfo-image-01019]]
3705e5c31af7Sopenharmony_ci    If pname:image was not created with the
3706e5c31af7Sopenharmony_ci    ename:VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT flag, pname:format must: be
3707e5c31af7Sopenharmony_ci    identical to the pname:format used to create pname:image
3708e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
3709e5c31af7Sopenharmony_ci// The nested ifdefs are there in anticipation of the hoped-for day when the
3710e5c31af7Sopenharmony_ci// VU extractor and validation layers can handle VU with imbedded
3711e5c31af7Sopenharmony_ci// conditionals. They are commented out until then.
3712e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
3713e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewCreateInfo-image-01762]]
3714e5c31af7Sopenharmony_ci    If pname:image was not created with the
3715e5c31af7Sopenharmony_ci    ename:VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT flag,
3716e5c31af7Sopenharmony_ci// ifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
3717e5c31af7Sopenharmony_ci    or if the pname:format of the pname:image is a
3718e5c31af7Sopenharmony_ci    <<formats-requiring-sampler-ycbcr-conversion,multi-planar>> format and
3719e5c31af7Sopenharmony_ci    if pname:subresourceRange.aspectMask is ename:VK_IMAGE_ASPECT_COLOR_BIT,
3720e5c31af7Sopenharmony_ci// endif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
3721e5c31af7Sopenharmony_ci    pname:format must: be identical to the pname:format used to create
3722e5c31af7Sopenharmony_ci    pname:image
3723e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
3724e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
3725e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewCreateInfo-format-06415]]
3726e5c31af7Sopenharmony_ci    If the image pname:format is one of the
3727e5c31af7Sopenharmony_ci    <<formats-requiring-sampler-ycbcr-conversion, formats that require a
3728e5c31af7Sopenharmony_ci    sampler Y'C~B~C~R~ conversion>>, then the pname:pNext chain must:
3729e5c31af7Sopenharmony_ci    include a slink:VkSamplerYcbcrConversionInfo structure with a conversion
3730e5c31af7Sopenharmony_ci    value other than dlink:VK_NULL_HANDLE
3731e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewCreateInfo-format-04714]]
3732e5c31af7Sopenharmony_ci    If pname:format has a code:_422 or code:_420 suffix then pname:image
3733e5c31af7Sopenharmony_ci    must: have been created with a width that is a multiple of 2
3734e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewCreateInfo-format-04715]]
3735e5c31af7Sopenharmony_ci    If pname:format has a code:_420 suffix then pname:image must: have been
3736e5c31af7Sopenharmony_ci    created with a height that is a multiple of 2
3737e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewCreateInfo-pNext-01970]]
3738e5c31af7Sopenharmony_ci    If the pname:pNext chain includes a slink:VkSamplerYcbcrConversionInfo
3739e5c31af7Sopenharmony_ci    structure with a pname:conversion value other than dlink:VK_NULL_HANDLE,
3740e5c31af7Sopenharmony_ci    all members of pname:components must: have the
3741e5c31af7Sopenharmony_ci    <<resources-image-views-identity-mappings,identity swizzle>>
3742e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
3743e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewCreateInfo-image-01020]]
3744e5c31af7Sopenharmony_ci    If pname:image is non-sparse then it must: be bound completely and
3745e5c31af7Sopenharmony_ci    contiguously to a single sname:VkDeviceMemory object
3746e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewCreateInfo-subResourceRange-01021]]
3747e5c31af7Sopenharmony_ci    pname:viewType must: be compatible with the type of pname:image as shown
3748e5c31af7Sopenharmony_ci    in the <<resources-image-views-compatibility,view type compatibility
3749e5c31af7Sopenharmony_ci    table>>
3750e5c31af7Sopenharmony_ciifdef::VK_ANDROID_external_memory_android_hardware_buffer[]
3751e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewCreateInfo-image-02399]]
3752e5c31af7Sopenharmony_ci    If pname:image has an
3753e5c31af7Sopenharmony_ci    <<memory-external-android-hardware-buffer-external-formats,external
3754e5c31af7Sopenharmony_ci    format>>, pname:format must: be ename:VK_FORMAT_UNDEFINED
3755e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewCreateInfo-image-02400]]
3756e5c31af7Sopenharmony_ci    If pname:image has an
3757e5c31af7Sopenharmony_ci    <<memory-external-android-hardware-buffer-external-formats,external
3758e5c31af7Sopenharmony_ci    format>>, the pname:pNext chain must: include a
3759e5c31af7Sopenharmony_ci    slink:VkSamplerYcbcrConversionInfo structure with a pname:conversion
3760e5c31af7Sopenharmony_ci    object created with the same external format as pname:image
3761e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewCreateInfo-image-02401]]
3762e5c31af7Sopenharmony_ci    If pname:image has an
3763e5c31af7Sopenharmony_ci    <<memory-external-android-hardware-buffer-external-formats,external
3764e5c31af7Sopenharmony_ci    format>>, all members of pname:components must: be the
3765e5c31af7Sopenharmony_ci    <<resources-image-views-identity-mappings,identity swizzle>>
3766e5c31af7Sopenharmony_ciendif::VK_ANDROID_external_memory_android_hardware_buffer[]
3767e5c31af7Sopenharmony_ciifdef::VK_KHR_fragment_shading_rate,VK_NV_shading_rate_image[]
3768e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewCreateInfo-image-02086]]
3769e5c31af7Sopenharmony_ci    If pname:image was created with pname:usage containing
3770e5c31af7Sopenharmony_ci    ename:VK_IMAGE_USAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR,
3771e5c31af7Sopenharmony_ci    pname:viewType must: be ename:VK_IMAGE_VIEW_TYPE_2D or
3772e5c31af7Sopenharmony_ci    ename:VK_IMAGE_VIEW_TYPE_2D_ARRAY
3773e5c31af7Sopenharmony_ciendif::VK_KHR_fragment_shading_rate,VK_NV_shading_rate_image[]
3774e5c31af7Sopenharmony_ciifdef::VK_NV_shading_rate_image[]
3775e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewCreateInfo-image-02087]]
3776e5c31af7Sopenharmony_ci    If the <<features-shadingRateImage, pname:shadingRateImage feature>> is
3777e5c31af7Sopenharmony_ci    enabled, and If pname:image was created with pname:usage containing
3778e5c31af7Sopenharmony_ci    ename:VK_IMAGE_USAGE_SHADING_RATE_IMAGE_BIT_NV, pname:format must: be
3779e5c31af7Sopenharmony_ci    ename:VK_FORMAT_R8_UINT
3780e5c31af7Sopenharmony_ciendif::VK_NV_shading_rate_image[]
3781e5c31af7Sopenharmony_ciifdef::VK_KHR_fragment_shading_rate[]
3782e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewCreateInfo-usage-04550]]
3783e5c31af7Sopenharmony_ci    If the <<features-attachmentFragmentShadingRate,
3784e5c31af7Sopenharmony_ci    pname:attachmentFragmentShadingRate feature>> is enabled, and the
3785e5c31af7Sopenharmony_ci    pname:usage for the image view includes
3786e5c31af7Sopenharmony_ci    ename:VK_IMAGE_USAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR, then the
3787e5c31af7Sopenharmony_ci    image view's <<resources-image-view-format-features,format features>>
3788e5c31af7Sopenharmony_ci    must: contain
3789e5c31af7Sopenharmony_ci    ename:VK_FORMAT_FEATURE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR
3790e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewCreateInfo-usage-04551]]
3791e5c31af7Sopenharmony_ci    If the <<features-attachmentFragmentShadingRate,
3792e5c31af7Sopenharmony_ci    pname:attachmentFragmentShadingRate feature>> is enabled, the
3793e5c31af7Sopenharmony_ci    pname:usage for the image view includes
3794e5c31af7Sopenharmony_ci    ename:VK_IMAGE_USAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR, and
3795e5c31af7Sopenharmony_ci    <<limits-layeredShadingRateAttachments,
3796e5c31af7Sopenharmony_ci    pname:layeredShadingRateAttachments>> is ename:VK_FALSE,
3797e5c31af7Sopenharmony_ci    pname:subresourceRange.layerCount must: be `1`
3798e5c31af7Sopenharmony_ciendif::VK_KHR_fragment_shading_rate[]
3799e5c31af7Sopenharmony_ciifdef::VK_EXT_fragment_density_map[]
3800e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewCreateInfo-flags-02572]]
3801e5c31af7Sopenharmony_ci    If <<features-fragmentDensityMapDynamic,dynamic fragment density map>>
3802e5c31af7Sopenharmony_ci    feature is not enabled, pname:flags must: not contain
3803e5c31af7Sopenharmony_ci    ename:VK_IMAGE_VIEW_CREATE_FRAGMENT_DENSITY_MAP_DYNAMIC_BIT_EXT
3804e5c31af7Sopenharmony_ciifdef::VK_EXT_fragment_density_map2[]
3805e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewCreateInfo-flags-03567]]
3806e5c31af7Sopenharmony_ci    If <<features-fragmentDensityMapDeferred,deferred fragment density map>>
3807e5c31af7Sopenharmony_ci    feature is not enabled, pname:flags must: not contain
3808e5c31af7Sopenharmony_ci    ename:VK_IMAGE_VIEW_CREATE_FRAGMENT_DENSITY_MAP_DEFERRED_BIT_EXT
3809e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewCreateInfo-flags-03568]]
3810e5c31af7Sopenharmony_ci    If pname:flags contains
3811e5c31af7Sopenharmony_ci    ename:VK_IMAGE_VIEW_CREATE_FRAGMENT_DENSITY_MAP_DEFERRED_BIT_EXT,
3812e5c31af7Sopenharmony_ci    pname:flags must: not contain
3813e5c31af7Sopenharmony_ci    ename:VK_IMAGE_VIEW_CREATE_FRAGMENT_DENSITY_MAP_DYNAMIC_BIT_EXT
3814e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewCreateInfo-image-03569]]
3815e5c31af7Sopenharmony_ci    If pname:image was created with pname:flags containing
3816e5c31af7Sopenharmony_ci    ename:VK_IMAGE_CREATE_SUBSAMPLED_BIT_EXT and pname:usage containing
3817e5c31af7Sopenharmony_ci    ename:VK_IMAGE_USAGE_SAMPLED_BIT, pname:subresourceRange.layerCount
3818e5c31af7Sopenharmony_ci    must: be less than or equal to
3819e5c31af7Sopenharmony_ci    <<limits-maxSubsampledArrayLayers,sname:VkPhysicalDeviceFragmentDensityMap2PropertiesEXT::pname:maxSubsampledArrayLayers>>
3820e5c31af7Sopenharmony_ciendif::VK_EXT_fragment_density_map2[]
3821e5c31af7Sopenharmony_ciifdef::VK_HUAWEI_invocation_mask[]
3822e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewCreateInfo-invocationMask-04993]]
3823e5c31af7Sopenharmony_ci    If the <<features-invocationMask, pname:invocationMask feature>> is
3824e5c31af7Sopenharmony_ci    enabled, and if pname:image was created with pname:usage containing
3825e5c31af7Sopenharmony_ci    ename:VK_IMAGE_USAGE_INVOCATION_MASK_BIT_HUAWEI, pname:format must: be
3826e5c31af7Sopenharmony_ci    ename:VK_FORMAT_R8_UINT
3827e5c31af7Sopenharmony_ciendif::VK_HUAWEI_invocation_mask[]
3828e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewCreateInfo-flags-04116]]
3829e5c31af7Sopenharmony_ci    If pname:flags does not contain
3830e5c31af7Sopenharmony_ci    ename:VK_IMAGE_VIEW_CREATE_FRAGMENT_DENSITY_MAP_DYNAMIC_BIT_EXT and
3831e5c31af7Sopenharmony_ci    pname:image was created with pname:usage containing
3832e5c31af7Sopenharmony_ci    ename:VK_IMAGE_USAGE_FRAGMENT_DENSITY_MAP_BIT_EXT, its pname:flags must:
3833e5c31af7Sopenharmony_ci    not contain any of ename:VK_IMAGE_CREATE_PROTECTED_BIT,
3834e5c31af7Sopenharmony_ci    ename:VK_IMAGE_CREATE_SPARSE_BINDING_BIT,
3835e5c31af7Sopenharmony_ci    ename:VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT, or
3836e5c31af7Sopenharmony_ci    ename:VK_IMAGE_CREATE_SPARSE_ALIASED_BIT
3837e5c31af7Sopenharmony_ciendif::VK_EXT_fragment_density_map[]
3838e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_maintenance2[]
3839e5c31af7Sopenharmony_ciifndef::VK_VERSION_1_2+VK_EXT_separate_stencil_usage[]
3840e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewCreateInfo-pNext-02661]]
3841e5c31af7Sopenharmony_ci    If the pname:pNext chain includes a slink:VkImageViewUsageCreateInfo
3842e5c31af7Sopenharmony_ci    structure, its pname:usage member must: not include any bits that were
3843e5c31af7Sopenharmony_ci    not set in the pname:usage member of the slink:VkImageCreateInfo
3844e5c31af7Sopenharmony_ci    structure used to create pname:image
3845e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2+VK_EXT_separate_stencil_usage[]
3846e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_EXT_separate_stencil_usage[]
3847e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewCreateInfo-pNext-02662]]
3848e5c31af7Sopenharmony_ci    If the pname:pNext chain includes a slink:VkImageViewUsageCreateInfo
3849e5c31af7Sopenharmony_ci    structure, and pname:image was not created with a
3850e5c31af7Sopenharmony_ci    slink:VkImageStencilUsageCreateInfo structure included in the
3851e5c31af7Sopenharmony_ci    pname:pNext chain of slink:VkImageCreateInfo, its pname:usage member
3852e5c31af7Sopenharmony_ci    must: not include any bits that were not set in the pname:usage member
3853e5c31af7Sopenharmony_ci    of the slink:VkImageCreateInfo structure used to create pname:image
3854e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewCreateInfo-pNext-02663]]
3855e5c31af7Sopenharmony_ci    If the pname:pNext chain includes a slink:VkImageViewUsageCreateInfo
3856e5c31af7Sopenharmony_ci    structure, pname:image was created with a
3857e5c31af7Sopenharmony_ci    slink:VkImageStencilUsageCreateInfo structure included in the
3858e5c31af7Sopenharmony_ci    pname:pNext chain of slink:VkImageCreateInfo, and
3859e5c31af7Sopenharmony_ci    pname:subresourceRange.aspectMask includes
3860e5c31af7Sopenharmony_ci    ename:VK_IMAGE_ASPECT_STENCIL_BIT, the pname:usage member of the
3861e5c31af7Sopenharmony_ci    slink:VkImageViewUsageCreateInfo structure must: not include any bits
3862e5c31af7Sopenharmony_ci    that were not set in the pname:usage member of the
3863e5c31af7Sopenharmony_ci    slink:VkImageStencilUsageCreateInfo structure used to create pname:image
3864e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewCreateInfo-pNext-02664]]
3865e5c31af7Sopenharmony_ci    If the pname:pNext chain includes a slink:VkImageViewUsageCreateInfo
3866e5c31af7Sopenharmony_ci    structure, pname:image was created with a
3867e5c31af7Sopenharmony_ci    slink:VkImageStencilUsageCreateInfo structure included in the
3868e5c31af7Sopenharmony_ci    pname:pNext chain of slink:VkImageCreateInfo, and
3869e5c31af7Sopenharmony_ci    pname:subresourceRange.aspectMask includes bits other than
3870e5c31af7Sopenharmony_ci    ename:VK_IMAGE_ASPECT_STENCIL_BIT, the pname:usage member of the
3871e5c31af7Sopenharmony_ci    slink:VkImageViewUsageCreateInfo structure must: not include any bits
3872e5c31af7Sopenharmony_ci    that were not set in the pname:usage member of the
3873e5c31af7Sopenharmony_ci    slink:VkImageCreateInfo structure used to create pname:image
3874e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_EXT_separate_stencil_usage[]
3875e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_maintenance2[]
3876e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewCreateInfo-imageViewType-04973]]
3877e5c31af7Sopenharmony_ci    If pname:viewType is ename:VK_IMAGE_VIEW_TYPE_1D,
3878e5c31af7Sopenharmony_ci    ename:VK_IMAGE_VIEW_TYPE_2D, or ename:VK_IMAGE_VIEW_TYPE_3D; and
3879e5c31af7Sopenharmony_ci    pname:subresourceRange.layerCount is not
3880e5c31af7Sopenharmony_ci    ename:VK_REMAINING_ARRAY_LAYERS, then pname:subresourceRange.layerCount
3881e5c31af7Sopenharmony_ci    must: be 1
3882e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewCreateInfo-imageViewType-04974]]
3883e5c31af7Sopenharmony_ci    If pname:viewType is ename:VK_IMAGE_VIEW_TYPE_1D,
3884e5c31af7Sopenharmony_ci    ename:VK_IMAGE_VIEW_TYPE_2D, or ename:VK_IMAGE_VIEW_TYPE_3D; and
3885e5c31af7Sopenharmony_ci    pname:subresourceRange.layerCount is ename:VK_REMAINING_ARRAY_LAYERS,
3886e5c31af7Sopenharmony_ci    then the remaining number of layers must: be 1
3887e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewCreateInfo-viewType-02960]]
3888e5c31af7Sopenharmony_ci    If pname:viewType is ename:VK_IMAGE_VIEW_TYPE_CUBE and
3889e5c31af7Sopenharmony_ci    pname:subresourceRange.layerCount is not
3890e5c31af7Sopenharmony_ci    ename:VK_REMAINING_ARRAY_LAYERS, pname:subresourceRange.layerCount must:
3891e5c31af7Sopenharmony_ci    be `6`
3892e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewCreateInfo-viewType-02961]]
3893e5c31af7Sopenharmony_ci    If pname:viewType is ename:VK_IMAGE_VIEW_TYPE_CUBE_ARRAY and
3894e5c31af7Sopenharmony_ci    pname:subresourceRange.layerCount is not
3895e5c31af7Sopenharmony_ci    ename:VK_REMAINING_ARRAY_LAYERS, pname:subresourceRange.layerCount must:
3896e5c31af7Sopenharmony_ci    be a multiple of `6`
3897e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewCreateInfo-viewType-02962]]
3898e5c31af7Sopenharmony_ci    If pname:viewType is ename:VK_IMAGE_VIEW_TYPE_CUBE and
3899e5c31af7Sopenharmony_ci    pname:subresourceRange.layerCount is ename:VK_REMAINING_ARRAY_LAYERS,
3900e5c31af7Sopenharmony_ci    the remaining number of layers must: be `6`
3901e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewCreateInfo-viewType-02963]]
3902e5c31af7Sopenharmony_ci    If pname:viewType is ename:VK_IMAGE_VIEW_TYPE_CUBE_ARRAY and
3903e5c31af7Sopenharmony_ci    pname:subresourceRange.layerCount is ename:VK_REMAINING_ARRAY_LAYERS,
3904e5c31af7Sopenharmony_ci    the remaining number of layers must: be a multiple of `6`
3905e5c31af7Sopenharmony_ciifdef::VK_KHR_portability_subset[]
3906e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewCreateInfo-imageViewFormatSwizzle-04465]]
3907e5c31af7Sopenharmony_ci    If the `apiext:VK_KHR_portability_subset` extension is enabled, and
3908e5c31af7Sopenharmony_ci    slink:VkPhysicalDevicePortabilitySubsetFeaturesKHR::pname:imageViewFormatSwizzle
3909e5c31af7Sopenharmony_ci    is ename:VK_FALSE, all elements of pname:components must: have the
3910e5c31af7Sopenharmony_ci    <<resources-image-views-identity-mappings,identity swizzle>>
3911e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewCreateInfo-imageViewFormatReinterpretation-04466]]
3912e5c31af7Sopenharmony_ci    If the `apiext:VK_KHR_portability_subset` extension is enabled, and
3913e5c31af7Sopenharmony_ci    slink:VkPhysicalDevicePortabilitySubsetFeaturesKHR::pname:imageViewFormatReinterpretation
3914e5c31af7Sopenharmony_ci    is ename:VK_FALSE, the elink:VkFormat in pname:format must: not contain
3915e5c31af7Sopenharmony_ci    a different number of components, or a different number of bits in each
3916e5c31af7Sopenharmony_ci    component, than the format of the sname:VkImage in pname:image
3917e5c31af7Sopenharmony_ciendif::VK_KHR_portability_subset[]
3918e5c31af7Sopenharmony_ciifdef::VK_KHR_video_decode_queue[]
3919e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewCreateInfo-image-04817]]
3920e5c31af7Sopenharmony_ci    If pname:image was created with pname:usage containing
3921e5c31af7Sopenharmony_ci    ename:VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR,
3922e5c31af7Sopenharmony_ci    ename:VK_IMAGE_USAGE_VIDEO_DECODE_SRC_BIT_KHR,
3923e5c31af7Sopenharmony_ci    ename:VK_IMAGE_USAGE_VIDEO_DECODE_DPB_BIT_KHR, then the pname:viewType
3924e5c31af7Sopenharmony_ci    must: be ename:VK_IMAGE_VIEW_TYPE_2D or
3925e5c31af7Sopenharmony_ci    ename:VK_IMAGE_VIEW_TYPE_2D_ARRAY and all members of pname:components
3926e5c31af7Sopenharmony_ci    must: have the <<resources-image-views-identity-mappings,identity
3927e5c31af7Sopenharmony_ci    swizzle>>
3928e5c31af7Sopenharmony_ciendif::VK_KHR_video_decode_queue[]
3929e5c31af7Sopenharmony_ciifdef::VK_KHR_video_encode_queue[]
3930e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewCreateInfo-image-04818]]
3931e5c31af7Sopenharmony_ci    If pname:image was created with pname:usage containing
3932e5c31af7Sopenharmony_ci    ename:VK_IMAGE_USAGE_VIDEO_ENCODE_DST_BIT_KHR,
3933e5c31af7Sopenharmony_ci    ename:VK_IMAGE_USAGE_VIDEO_ENCODE_SRC_BIT_KHR,
3934e5c31af7Sopenharmony_ci    ename:VK_IMAGE_USAGE_VIDEO_ENCODE_DPB_BIT_KHR, then the pname:viewType
3935e5c31af7Sopenharmony_ci    must: be ename:VK_IMAGE_VIEW_TYPE_2D or
3936e5c31af7Sopenharmony_ci    ename:VK_IMAGE_VIEW_TYPE_2D_ARRAY and all members of pname:components
3937e5c31af7Sopenharmony_ci    must: have the <<resources-image-views-identity-mappings,identity
3938e5c31af7Sopenharmony_ci    swizzle>>
3939e5c31af7Sopenharmony_ciendif::VK_KHR_video_encode_queue[]
3940e5c31af7Sopenharmony_ci****
3941e5c31af7Sopenharmony_ci
3942e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkImageViewCreateInfo.txt[]
3943e5c31af7Sopenharmony_ci--
3944e5c31af7Sopenharmony_ci
3945e5c31af7Sopenharmony_ci[open,refpage='VkImageViewCreateFlagBits',desc='Bitmask specifying additional parameters of an image view',type='enums']
3946e5c31af7Sopenharmony_ci--
3947e5c31af7Sopenharmony_ciBits which can: be set in slink:VkImageViewCreateInfo::pname:flags,
3948e5c31af7Sopenharmony_cispecifying additional parameters of an image view, are:
3949e5c31af7Sopenharmony_ci
3950e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkImageViewCreateFlagBits.txt[]
3951e5c31af7Sopenharmony_ci
3952e5c31af7Sopenharmony_ciifdef::VK_EXT_fragment_density_map[]
3953e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_VIEW_CREATE_FRAGMENT_DENSITY_MAP_DYNAMIC_BIT_EXT
3954e5c31af7Sopenharmony_ci    specifies that the fragment density map will be read by device during
3955e5c31af7Sopenharmony_ci    ename:VK_PIPELINE_STAGE_FRAGMENT_DENSITY_PROCESS_BIT_EXT
3956e5c31af7Sopenharmony_ciendif::VK_EXT_fragment_density_map[]
3957e5c31af7Sopenharmony_ciifdef::VK_EXT_fragment_density_map2[]
3958e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_VIEW_CREATE_FRAGMENT_DENSITY_MAP_DEFERRED_BIT_EXT
3959e5c31af7Sopenharmony_ci    specifies that the fragment density map will be read by the host during
3960e5c31af7Sopenharmony_ci    flink:vkEndCommandBuffer for the primary command buffer that the render
3961e5c31af7Sopenharmony_ci    pass is recorded into
3962e5c31af7Sopenharmony_ciendif::VK_EXT_fragment_density_map2[]
3963e5c31af7Sopenharmony_ci--
3964e5c31af7Sopenharmony_ci
3965e5c31af7Sopenharmony_ci[open,refpage='VkImageViewCreateFlags',desc='Reserved for future use',type='flags']
3966e5c31af7Sopenharmony_ci--
3967e5c31af7Sopenharmony_ciinclude::{generated}/api/flags/VkImageViewCreateFlags.txt[]
3968e5c31af7Sopenharmony_ci
3969e5c31af7Sopenharmony_citname:VkImageViewCreateFlags is a bitmask type for setting a mask of zero or
3970e5c31af7Sopenharmony_cimore elink:VkImageViewCreateFlagBits.
3971e5c31af7Sopenharmony_ci--
3972e5c31af7Sopenharmony_ci
3973e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_maintenance2[]
3974e5c31af7Sopenharmony_ci[open,refpage='VkImageViewUsageCreateInfo',desc='Specify the intended usage of an image view',type='structs']
3975e5c31af7Sopenharmony_ci--
3976e5c31af7Sopenharmony_ciThe set of usages for the created image view can: be restricted compared to
3977e5c31af7Sopenharmony_cithe parent image's pname:usage flags by adding a
3978e5c31af7Sopenharmony_cisname:VkImageViewUsageCreateInfo structure to the pname:pNext chain of
3979e5c31af7Sopenharmony_cislink:VkImageViewCreateInfo.
3980e5c31af7Sopenharmony_ci
3981e5c31af7Sopenharmony_ciThe sname:VkImageViewUsageCreateInfo structure is defined as:
3982e5c31af7Sopenharmony_ci
3983e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkImageViewUsageCreateInfo.txt[]
3984e5c31af7Sopenharmony_ci
3985e5c31af7Sopenharmony_ciifdef::VK_KHR_maintenance2[]
3986e5c31af7Sopenharmony_cior the equivalent
3987e5c31af7Sopenharmony_ci
3988e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkImageViewUsageCreateInfoKHR.txt[]
3989e5c31af7Sopenharmony_ciendif::VK_KHR_maintenance2[]
3990e5c31af7Sopenharmony_ci
3991e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure.
3992e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
3993e5c31af7Sopenharmony_ci    structure.
3994e5c31af7Sopenharmony_ci  * pname:usage is a bitmask of elink:VkImageUsageFlagBits specifying
3995e5c31af7Sopenharmony_ci    allowed usages of the image view.
3996e5c31af7Sopenharmony_ci
3997e5c31af7Sopenharmony_ciWhen this structure is chained to slink:VkImageViewCreateInfo the
3998e5c31af7Sopenharmony_cipname:usage field overrides the implicit pname:usage parameter inherited
3999e5c31af7Sopenharmony_cifrom image creation time and its value is used instead for the purposes of
4000e5c31af7Sopenharmony_cidetermining the valid usage conditions of slink:VkImageViewCreateInfo.
4001e5c31af7Sopenharmony_ci
4002e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkImageViewUsageCreateInfo.txt[]
4003e5c31af7Sopenharmony_ci--
4004e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_maintenance2[]
4005e5c31af7Sopenharmony_ci
4006e5c31af7Sopenharmony_ci[open,refpage='VkImageSubresourceRange',desc='Structure specifying an image subresource range',type='structs']
4007e5c31af7Sopenharmony_ci--
4008e5c31af7Sopenharmony_ciThe sname:VkImageSubresourceRange structure is defined as:
4009e5c31af7Sopenharmony_ci
4010e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkImageSubresourceRange.txt[]
4011e5c31af7Sopenharmony_ci
4012e5c31af7Sopenharmony_ci  * pname:aspectMask is a bitmask of elink:VkImageAspectFlagBits specifying
4013e5c31af7Sopenharmony_ci    which aspect(s) of the image are included in the view.
4014e5c31af7Sopenharmony_ci  * pname:baseMipLevel is the first mipmap level accessible to the view.
4015e5c31af7Sopenharmony_ci  * pname:levelCount is the number of mipmap levels (starting from
4016e5c31af7Sopenharmony_ci    pname:baseMipLevel) accessible to the view.
4017e5c31af7Sopenharmony_ci  * pname:baseArrayLayer is the first array layer accessible to the view.
4018e5c31af7Sopenharmony_ci  * pname:layerCount is the number of array layers (starting from
4019e5c31af7Sopenharmony_ci    pname:baseArrayLayer) accessible to the view.
4020e5c31af7Sopenharmony_ci
4021e5c31af7Sopenharmony_ciThe number of mipmap levels and array layers must: be a subset of the image
4022e5c31af7Sopenharmony_cisubresources in the image.
4023e5c31af7Sopenharmony_ciIf an application wants to use all mip levels or layers in an image after
4024e5c31af7Sopenharmony_cithe pname:baseMipLevel or pname:baseArrayLayer, it can: set pname:levelCount
4025e5c31af7Sopenharmony_ciand pname:layerCount to the special values ename:VK_REMAINING_MIP_LEVELS and
4026e5c31af7Sopenharmony_ciename:VK_REMAINING_ARRAY_LAYERS without knowing the exact number of mip
4027e5c31af7Sopenharmony_cilevels or layers.
4028e5c31af7Sopenharmony_ci
4029e5c31af7Sopenharmony_ciFor cube and cube array image views, the layers of the image view starting
4030e5c31af7Sopenharmony_ciat pname:baseArrayLayer correspond to faces in the order +X, -X, +Y, -Y, +Z,
4031e5c31af7Sopenharmony_ci-Z.
4032e5c31af7Sopenharmony_ciFor cube arrays, each set of six sequential layers is a single cube, so the
4033e5c31af7Sopenharmony_cinumber of cube maps in a cube map array view is _pname:layerCount / 6_, and
4034e5c31af7Sopenharmony_ciimage array layer [eq]#(pname:baseArrayLayer {plus} i)# is face index
4035e5c31af7Sopenharmony_ci[eq]#(i mod 6)# of cube _i / 6_.
4036e5c31af7Sopenharmony_ciIf the number of layers in the view, whether set explicitly in
4037e5c31af7Sopenharmony_cipname:layerCount or implied by ename:VK_REMAINING_ARRAY_LAYERS, is not a
4038e5c31af7Sopenharmony_cimultiple of 6, the last cube map in the array must: not be accessed.
4039e5c31af7Sopenharmony_ci
4040e5c31af7Sopenharmony_cipname:aspectMask must: be only ename:VK_IMAGE_ASPECT_COLOR_BIT,
4041e5c31af7Sopenharmony_ciename:VK_IMAGE_ASPECT_DEPTH_BIT or ename:VK_IMAGE_ASPECT_STENCIL_BIT if
4042e5c31af7Sopenharmony_cipname:format is a color, depth-only or stencil-only format,
4043e5c31af7Sopenharmony_ciifndef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
4044e5c31af7Sopenharmony_cirespectively.
4045e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
4046e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
4047e5c31af7Sopenharmony_cirespectively, except if pname:format is a
4048e5c31af7Sopenharmony_ci<<formats-requiring-sampler-ycbcr-conversion,multi-planar format>>.
4049e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
4050e5c31af7Sopenharmony_ciIf using a depth/stencil format with both depth and stencil components,
4051e5c31af7Sopenharmony_cipname:aspectMask must: include at least one of
4052e5c31af7Sopenharmony_ciename:VK_IMAGE_ASPECT_DEPTH_BIT and ename:VK_IMAGE_ASPECT_STENCIL_BIT, and
4053e5c31af7Sopenharmony_cican: include both.
4054e5c31af7Sopenharmony_ci
4055e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_maintenance1[]
4056e5c31af7Sopenharmony_ciWhen the sname:VkImageSubresourceRange structure is used to select a subset
4057e5c31af7Sopenharmony_ciof the slices of a 3D image's mip level in order to create a 2D or 2D array
4058e5c31af7Sopenharmony_ciimage view of a 3D image created with
4059e5c31af7Sopenharmony_ciename:VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT, pname:baseArrayLayer and
4060e5c31af7Sopenharmony_cipname:layerCount specify the first slice index and the number of slices to
4061e5c31af7Sopenharmony_ciinclude in the created image view.
4062e5c31af7Sopenharmony_ciSuch an image view can: be used as a framebuffer attachment that refers only
4063e5c31af7Sopenharmony_cito the specified range of slices of the selected mip level.
4064e5c31af7Sopenharmony_ciHowever, any layout transitions performed on such an attachment view during
4065e5c31af7Sopenharmony_cia render pass instance still apply to the entire subresource referenced
4066e5c31af7Sopenharmony_ciwhich includes all the slices of the selected mip level.
4067e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_maintenance1[]
4068e5c31af7Sopenharmony_ci
4069e5c31af7Sopenharmony_ciWhen using an image view of a depth/stencil image to populate a descriptor
4070e5c31af7Sopenharmony_ciset (e.g. for sampling in the shader, or for use as an input attachment),
4071e5c31af7Sopenharmony_cithe pname:aspectMask must: only include one bit, which selects whether the
4072e5c31af7Sopenharmony_ciimage view is used for depth reads (i.e. using a floating-point sampler or
4073e5c31af7Sopenharmony_ciinput attachment in the shader) or stencil reads (i.e. using an unsigned
4074e5c31af7Sopenharmony_ciinteger sampler or input attachment in the shader).
4075e5c31af7Sopenharmony_ciWhen an image view of a depth/stencil image is used as a depth/stencil
4076e5c31af7Sopenharmony_ciframebuffer attachment, the pname:aspectMask is ignored and both depth and
4077e5c31af7Sopenharmony_cistencil image subresources are used.
4078e5c31af7Sopenharmony_ci
4079e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
4080e5c31af7Sopenharmony_ciWhen creating a sname:VkImageView, if <<samplers-YCbCr-conversion,sampler
4081e5c31af7Sopenharmony_ci{YCbCr} conversion>> is enabled in the sampler, the pname:aspectMask of a
4082e5c31af7Sopenharmony_cipname:subresourceRange used by the sname:VkImageView must: be
4083e5c31af7Sopenharmony_ciename:VK_IMAGE_ASPECT_COLOR_BIT.
4084e5c31af7Sopenharmony_ci
4085e5c31af7Sopenharmony_ciWhen creating a sname:VkImageView, if sampler {YCbCr} conversion is not
4086e5c31af7Sopenharmony_cienabled in the sampler and the image pname:format is
4087e5c31af7Sopenharmony_ci<<formats-requiring-sampler-ycbcr-conversion,multi-planar>>, the image must:
4088e5c31af7Sopenharmony_cihave been created with ename:VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT, and the
4089e5c31af7Sopenharmony_cipname:aspectMask of the sname:VkImageView's pname:subresourceRange must: be
4090e5c31af7Sopenharmony_ciename:VK_IMAGE_ASPECT_PLANE_0_BIT, ename:VK_IMAGE_ASPECT_PLANE_1_BIT or
4091e5c31af7Sopenharmony_ciename:VK_IMAGE_ASPECT_PLANE_2_BIT.
4092e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
4093e5c31af7Sopenharmony_ci
4094e5c31af7Sopenharmony_ci.Valid Usage
4095e5c31af7Sopenharmony_ci****
4096e5c31af7Sopenharmony_ci  * [[VUID-VkImageSubresourceRange-levelCount-01720]]
4097e5c31af7Sopenharmony_ci    If pname:levelCount is not ename:VK_REMAINING_MIP_LEVELS, it must: be
4098e5c31af7Sopenharmony_ci    greater than `0`
4099e5c31af7Sopenharmony_ci  * [[VUID-VkImageSubresourceRange-layerCount-01721]]
4100e5c31af7Sopenharmony_ci    If pname:layerCount is not ename:VK_REMAINING_ARRAY_LAYERS, it must: be
4101e5c31af7Sopenharmony_ci    greater than `0`
4102e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
4103e5c31af7Sopenharmony_ci  * [[VUID-VkImageSubresourceRange-aspectMask-01670]]
4104e5c31af7Sopenharmony_ci    If pname:aspectMask includes ename:VK_IMAGE_ASPECT_COLOR_BIT, then it
4105e5c31af7Sopenharmony_ci    must: not include any of ename:VK_IMAGE_ASPECT_PLANE_0_BIT,
4106e5c31af7Sopenharmony_ci    ename:VK_IMAGE_ASPECT_PLANE_1_BIT, or ename:VK_IMAGE_ASPECT_PLANE_2_BIT
4107e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
4108e5c31af7Sopenharmony_ciifdef::VK_EXT_image_drm_format_modifier[]
4109e5c31af7Sopenharmony_ci  * [[VUID-VkImageSubresourceRange-aspectMask-02278]]
4110e5c31af7Sopenharmony_ci    pname:aspectMask must: not include
4111e5c31af7Sopenharmony_ci    `VK_IMAGE_ASPECT_MEMORY_PLANE__{ibit}__BIT_EXT` for any index _i_
4112e5c31af7Sopenharmony_ciendif::VK_EXT_image_drm_format_modifier[]
4113e5c31af7Sopenharmony_ci****
4114e5c31af7Sopenharmony_ci
4115e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkImageSubresourceRange.txt[]
4116e5c31af7Sopenharmony_ci--
4117e5c31af7Sopenharmony_ci
4118e5c31af7Sopenharmony_ci[open,refpage='VkImageAspectFlagBits',desc='Bitmask specifying which aspects of an image are included in a view',type='enums']
4119e5c31af7Sopenharmony_ci--
4120e5c31af7Sopenharmony_ciBits which can: be set in an aspect mask to specify aspects of an image for
4121e5c31af7Sopenharmony_cipurposes such as identifying a subresource, are:
4122e5c31af7Sopenharmony_ci
4123e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkImageAspectFlagBits.txt[]
4124e5c31af7Sopenharmony_ci
4125e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_ASPECT_COLOR_BIT specifies the color aspect.
4126e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_ASPECT_DEPTH_BIT specifies the depth aspect.
4127e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_ASPECT_STENCIL_BIT specifies the stencil aspect.
4128e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_ASPECT_METADATA_BIT specifies the metadata aspect, used
4129e5c31af7Sopenharmony_ci    for <<sparsememory, sparse resource>> operations.
4130e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
4131e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_ASPECT_PLANE_0_BIT specifies plane 0 of a _multi-planar_
4132e5c31af7Sopenharmony_ci    image format.
4133e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_ASPECT_PLANE_1_BIT specifies plane 1 of a _multi-planar_
4134e5c31af7Sopenharmony_ci    image format.
4135e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_ASPECT_PLANE_2_BIT specifies plane 2 of a _multi-planar_
4136e5c31af7Sopenharmony_ci    image format.
4137e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
4138e5c31af7Sopenharmony_ciifdef::VK_EXT_image_drm_format_modifier[]
4139e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_ASPECT_MEMORY_PLANE_0_BIT_EXT specifies _memory plane_ 0.
4140e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_ASPECT_MEMORY_PLANE_1_BIT_EXT specifies _memory plane_ 1.
4141e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_ASPECT_MEMORY_PLANE_2_BIT_EXT specifies _memory plane_ 2.
4142e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_ASPECT_MEMORY_PLANE_3_BIT_EXT specifies _memory plane_ 3.
4143e5c31af7Sopenharmony_ciendif::VK_EXT_image_drm_format_modifier[]
4144e5c31af7Sopenharmony_ci--
4145e5c31af7Sopenharmony_ci
4146e5c31af7Sopenharmony_ci[open,refpage='VkImageAspectFlags',desc='Bitmask of VkImageAspectFlagBits',type='flags']
4147e5c31af7Sopenharmony_ci--
4148e5c31af7Sopenharmony_ciinclude::{generated}/api/flags/VkImageAspectFlags.txt[]
4149e5c31af7Sopenharmony_ci
4150e5c31af7Sopenharmony_citname:VkImageAspectFlags is a bitmask type for setting a mask of zero or
4151e5c31af7Sopenharmony_cimore elink:VkImageAspectFlagBits.
4152e5c31af7Sopenharmony_ci--
4153e5c31af7Sopenharmony_ci
4154e5c31af7Sopenharmony_ci[open,refpage='VkComponentMapping',desc='Structure specifying a color component mapping',type='structs']
4155e5c31af7Sopenharmony_ci--
4156e5c31af7Sopenharmony_ciThe sname:VkComponentMapping structure is defined as:
4157e5c31af7Sopenharmony_ci
4158e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkComponentMapping.txt[]
4159e5c31af7Sopenharmony_ci
4160e5c31af7Sopenharmony_ci  * pname:r is a elink:VkComponentSwizzle specifying the component value
4161e5c31af7Sopenharmony_ci    placed in the R component of the output vector.
4162e5c31af7Sopenharmony_ci  * pname:g is a elink:VkComponentSwizzle specifying the component value
4163e5c31af7Sopenharmony_ci    placed in the G component of the output vector.
4164e5c31af7Sopenharmony_ci  * pname:b is a elink:VkComponentSwizzle specifying the component value
4165e5c31af7Sopenharmony_ci    placed in the B component of the output vector.
4166e5c31af7Sopenharmony_ci  * pname:a is a elink:VkComponentSwizzle specifying the component value
4167e5c31af7Sopenharmony_ci    placed in the A component of the output vector.
4168e5c31af7Sopenharmony_ci
4169e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkComponentMapping.txt[]
4170e5c31af7Sopenharmony_ci--
4171e5c31af7Sopenharmony_ci
4172e5c31af7Sopenharmony_ci[open,refpage='VkComponentSwizzle',desc='Specify how a component is swizzled',type='enums']
4173e5c31af7Sopenharmony_ci--
4174e5c31af7Sopenharmony_ciPossible values of the members of slink:VkComponentMapping, specifying the
4175e5c31af7Sopenharmony_cicomponent values placed in each component of the output vector, are:
4176e5c31af7Sopenharmony_ci
4177e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkComponentSwizzle.txt[]
4178e5c31af7Sopenharmony_ci
4179e5c31af7Sopenharmony_ci  * ename:VK_COMPONENT_SWIZZLE_IDENTITY specifies that the component is set
4180e5c31af7Sopenharmony_ci    to the identity swizzle.
4181e5c31af7Sopenharmony_ci  * ename:VK_COMPONENT_SWIZZLE_ZERO specifies that the component is set to
4182e5c31af7Sopenharmony_ci    zero.
4183e5c31af7Sopenharmony_ci  * ename:VK_COMPONENT_SWIZZLE_ONE specifies that the component is set to
4184e5c31af7Sopenharmony_ci    either 1 or 1.0, depending on whether the type of the image view format
4185e5c31af7Sopenharmony_ci    is integer or floating-point respectively, as determined by the
4186e5c31af7Sopenharmony_ci    <<formats-definition,Format Definition>> section for each
4187e5c31af7Sopenharmony_ci    elink:VkFormat.
4188e5c31af7Sopenharmony_ci  * ename:VK_COMPONENT_SWIZZLE_R specifies that the component is set to the
4189e5c31af7Sopenharmony_ci    value of the R component of the image.
4190e5c31af7Sopenharmony_ci  * ename:VK_COMPONENT_SWIZZLE_G specifies that the component is set to the
4191e5c31af7Sopenharmony_ci    value of the G component of the image.
4192e5c31af7Sopenharmony_ci  * ename:VK_COMPONENT_SWIZZLE_B specifies that the component is set to the
4193e5c31af7Sopenharmony_ci    value of the B component of the image.
4194e5c31af7Sopenharmony_ci  * ename:VK_COMPONENT_SWIZZLE_A specifies that the component is set to the
4195e5c31af7Sopenharmony_ci    value of the A component of the image.
4196e5c31af7Sopenharmony_ci
4197e5c31af7Sopenharmony_ci[[resources-image-views-identity-mappings]]
4198e5c31af7Sopenharmony_ciSetting the identity swizzle on a component is equivalent to setting the
4199e5c31af7Sopenharmony_ciidentity mapping on that component.
4200e5c31af7Sopenharmony_ciThat is:
4201e5c31af7Sopenharmony_ci
4202e5c31af7Sopenharmony_ci.Component Mappings Equivalent To ename:VK_COMPONENT_SWIZZLE_IDENTITY
4203e5c31af7Sopenharmony_ci[options="header"]
4204e5c31af7Sopenharmony_ci|====
4205e5c31af7Sopenharmony_ci| Component          | Identity Mapping
4206e5c31af7Sopenharmony_ci| pname:components.r | ename:VK_COMPONENT_SWIZZLE_R
4207e5c31af7Sopenharmony_ci| pname:components.g | ename:VK_COMPONENT_SWIZZLE_G
4208e5c31af7Sopenharmony_ci| pname:components.b | ename:VK_COMPONENT_SWIZZLE_B
4209e5c31af7Sopenharmony_ci| pname:components.a | ename:VK_COMPONENT_SWIZZLE_A
4210e5c31af7Sopenharmony_ci|====
4211e5c31af7Sopenharmony_ci--
4212e5c31af7Sopenharmony_ci
4213e5c31af7Sopenharmony_ciifdef::VK_EXT_astc_decode_mode[]
4214e5c31af7Sopenharmony_ci[open,refpage='VkImageViewASTCDecodeModeEXT',desc='Structure describing the ASTC decode mode for an image view',type='structs']
4215e5c31af7Sopenharmony_ci--
4216e5c31af7Sopenharmony_ciIf the pname:pNext chain includes a sname:VkImageViewASTCDecodeModeEXT
4217e5c31af7Sopenharmony_cistructure, then that structure includes a parameter specifying the decode
4218e5c31af7Sopenharmony_cimode for image views using ASTC compressed formats.
4219e5c31af7Sopenharmony_ci
4220e5c31af7Sopenharmony_ciThe sname:VkImageViewASTCDecodeModeEXT structure is defined as:
4221e5c31af7Sopenharmony_ci
4222e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkImageViewASTCDecodeModeEXT.txt[]
4223e5c31af7Sopenharmony_ci
4224e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure.
4225e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
4226e5c31af7Sopenharmony_ci    structure.
4227e5c31af7Sopenharmony_ci  * pname:decodeMode is the intermediate format used to decode ASTC
4228e5c31af7Sopenharmony_ci    compressed formats.
4229e5c31af7Sopenharmony_ci
4230e5c31af7Sopenharmony_ci.Valid Usage
4231e5c31af7Sopenharmony_ci****
4232e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewASTCDecodeModeEXT-decodeMode-02230]]
4233e5c31af7Sopenharmony_ci    pname:decodeMode must: be one of ename:VK_FORMAT_R16G16B16A16_SFLOAT,
4234e5c31af7Sopenharmony_ci    ename:VK_FORMAT_R8G8B8A8_UNORM, or
4235e5c31af7Sopenharmony_ci    ename:VK_FORMAT_E5B9G9R9_UFLOAT_PACK32
4236e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewASTCDecodeModeEXT-decodeMode-02231]]
4237e5c31af7Sopenharmony_ci    If the <<features-astc-decodeModeSharedExponent,
4238e5c31af7Sopenharmony_ci    pname:decodeModeSharedExponent>> feature is not enabled,
4239e5c31af7Sopenharmony_ci    pname:decodeMode must: not be ename:VK_FORMAT_E5B9G9R9_UFLOAT_PACK32
4240e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewASTCDecodeModeEXT-decodeMode-02232]]
4241e5c31af7Sopenharmony_ci    If pname:decodeMode is ename:VK_FORMAT_R8G8B8A8_UNORM the image view
4242e5c31af7Sopenharmony_ci    must: not include blocks using any of the ASTC HDR modes
4243e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewASTCDecodeModeEXT-format-04084]]
4244e5c31af7Sopenharmony_ci    pname:format of the image view must: be one of the
4245e5c31af7Sopenharmony_ci    <<appendix-compressedtex-astc, ASTC Compressed Image Formats>>
4246e5c31af7Sopenharmony_ci****
4247e5c31af7Sopenharmony_ci
4248e5c31af7Sopenharmony_ciIf pname:format uses sRGB encoding then the pname:decodeMode has no effect.
4249e5c31af7Sopenharmony_ci
4250e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkImageViewASTCDecodeModeEXT.txt[]
4251e5c31af7Sopenharmony_ci--
4252e5c31af7Sopenharmony_ciendif::VK_EXT_astc_decode_mode[]
4253e5c31af7Sopenharmony_ci
4254e5c31af7Sopenharmony_ci[open,refpage='vkDestroyImageView',desc='Destroy an image view object',type='protos']
4255e5c31af7Sopenharmony_ci--
4256e5c31af7Sopenharmony_ciTo destroy an image view, call:
4257e5c31af7Sopenharmony_ci
4258e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkDestroyImageView.txt[]
4259e5c31af7Sopenharmony_ci
4260e5c31af7Sopenharmony_ci  * pname:device is the logical device that destroys the image view.
4261e5c31af7Sopenharmony_ci  * pname:imageView is the image view to destroy.
4262e5c31af7Sopenharmony_ci  * pname:pAllocator controls host memory allocation as described in the
4263e5c31af7Sopenharmony_ci    <<memory-allocation, Memory Allocation>> chapter.
4264e5c31af7Sopenharmony_ci
4265e5c31af7Sopenharmony_ci.Valid Usage
4266e5c31af7Sopenharmony_ci****
4267e5c31af7Sopenharmony_ci  * [[VUID-vkDestroyImageView-imageView-01026]]
4268e5c31af7Sopenharmony_ci    All submitted commands that refer to pname:imageView must: have
4269e5c31af7Sopenharmony_ci    completed execution
4270e5c31af7Sopenharmony_ci  * [[VUID-vkDestroyImageView-imageView-01027]]
4271e5c31af7Sopenharmony_ci    If sname:VkAllocationCallbacks were provided when pname:imageView was
4272e5c31af7Sopenharmony_ci    created, a compatible set of callbacks must: be provided here
4273e5c31af7Sopenharmony_ci  * [[VUID-vkDestroyImageView-imageView-01028]]
4274e5c31af7Sopenharmony_ci    If no sname:VkAllocationCallbacks were provided when pname:imageView was
4275e5c31af7Sopenharmony_ci    created, pname:pAllocator must: be `NULL`
4276e5c31af7Sopenharmony_ci****
4277e5c31af7Sopenharmony_ci
4278e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkDestroyImageView.txt[]
4279e5c31af7Sopenharmony_ci--
4280e5c31af7Sopenharmony_ci
4281e5c31af7Sopenharmony_ciifdef::VK_NVX_image_view_handle[]
4282e5c31af7Sopenharmony_ci[open,refpage='vkGetImageViewHandleNVX',desc='Get the handle for an image view for a specific descriptor type',type='protos']
4283e5c31af7Sopenharmony_ci--
4284e5c31af7Sopenharmony_ciTo get the handle for an image view, call:
4285e5c31af7Sopenharmony_ci
4286e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkGetImageViewHandleNVX.txt[]
4287e5c31af7Sopenharmony_ci
4288e5c31af7Sopenharmony_ci  * pname:device is the logical device that owns the image view.
4289e5c31af7Sopenharmony_ci  * pname:pInfo describes the image view to query and type of handle.
4290e5c31af7Sopenharmony_ci
4291e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkGetImageViewHandleNVX.txt[]
4292e5c31af7Sopenharmony_ci--
4293e5c31af7Sopenharmony_ci
4294e5c31af7Sopenharmony_ci[open,refpage='VkImageViewHandleInfoNVX',desc='Structure specifying the image view for handle queries',type='structs']
4295e5c31af7Sopenharmony_ci--
4296e5c31af7Sopenharmony_ciThe sname:VkImageViewHandleInfoNVX structure is defined as:
4297e5c31af7Sopenharmony_ci
4298e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkImageViewHandleInfoNVX.txt[]
4299e5c31af7Sopenharmony_ci
4300e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure.
4301e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
4302e5c31af7Sopenharmony_ci    structure.
4303e5c31af7Sopenharmony_ci  * pname:imageView is the image view to query.
4304e5c31af7Sopenharmony_ci  * pname:descriptorType is the type of descriptor for which to query a
4305e5c31af7Sopenharmony_ci    handle.
4306e5c31af7Sopenharmony_ci  * pname:sampler is the sampler to combine with the image view when
4307e5c31af7Sopenharmony_ci    generating the handle.
4308e5c31af7Sopenharmony_ci
4309e5c31af7Sopenharmony_ci.Valid Usage
4310e5c31af7Sopenharmony_ci****
4311e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewHandleInfoNVX-descriptorType-02654]]
4312e5c31af7Sopenharmony_ci    pname:descriptorType must: be ename:VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE,
4313e5c31af7Sopenharmony_ci    ename:VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, or
4314e5c31af7Sopenharmony_ci    ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER
4315e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewHandleInfoNVX-sampler-02655]]
4316e5c31af7Sopenharmony_ci    pname:sampler must: be a valid slink:VkSampler if pname:descriptorType
4317e5c31af7Sopenharmony_ci    is ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER
4318e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewHandleInfoNVX-imageView-02656]]
4319e5c31af7Sopenharmony_ci    If descriptorType is ename:VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE or
4320e5c31af7Sopenharmony_ci    ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, the image that
4321e5c31af7Sopenharmony_ci    pname:imageView was created from must: have been created with the
4322e5c31af7Sopenharmony_ci    ename:VK_IMAGE_USAGE_SAMPLED_BIT usage bit set
4323e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewHandleInfoNVX-imageView-02657]]
4324e5c31af7Sopenharmony_ci    If descriptorType is ename:VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, the image
4325e5c31af7Sopenharmony_ci    that pname:imageView was created from must: have been created with the
4326e5c31af7Sopenharmony_ci    ename:VK_IMAGE_USAGE_STORAGE_BIT usage bit set
4327e5c31af7Sopenharmony_ci****
4328e5c31af7Sopenharmony_ci
4329e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkImageViewHandleInfoNVX.txt[]
4330e5c31af7Sopenharmony_ci--
4331e5c31af7Sopenharmony_ci
4332e5c31af7Sopenharmony_ci[open,refpage='vkGetImageViewAddressNVX',desc='Get the device address of an image view',type='protos']
4333e5c31af7Sopenharmony_ci--
4334e5c31af7Sopenharmony_ciTo get the device address for an image view, call:
4335e5c31af7Sopenharmony_ci
4336e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkGetImageViewAddressNVX.txt[]
4337e5c31af7Sopenharmony_ci
4338e5c31af7Sopenharmony_ci  * pname:device is the logical device that owns the image view.
4339e5c31af7Sopenharmony_ci  * pname:imageView is a handle to the image view.
4340e5c31af7Sopenharmony_ci  * pname:pProperties contains the device address and size when the call
4341e5c31af7Sopenharmony_ci    returns.
4342e5c31af7Sopenharmony_ci
4343e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkGetImageViewAddressNVX.txt[]
4344e5c31af7Sopenharmony_ci--
4345e5c31af7Sopenharmony_ci
4346e5c31af7Sopenharmony_ci[open,refpage='VkImageViewAddressPropertiesNVX',desc='Structure specifying the image view for handle queries',type='structs']
4347e5c31af7Sopenharmony_ci--
4348e5c31af7Sopenharmony_ciThe sname:VkImageViewAddressPropertiesNVX structure is defined as:
4349e5c31af7Sopenharmony_ci
4350e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkImageViewAddressPropertiesNVX.txt[]
4351e5c31af7Sopenharmony_ci
4352e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure.
4353e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
4354e5c31af7Sopenharmony_ci    structure.
4355e5c31af7Sopenharmony_ci  * pname:deviceAddress is the device address of the image view.
4356e5c31af7Sopenharmony_ci  * pname:size is the size in bytes of the image view device memory.
4357e5c31af7Sopenharmony_ci
4358e5c31af7Sopenharmony_ci
4359e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkImageViewAddressPropertiesNVX.txt[]
4360e5c31af7Sopenharmony_ci--
4361e5c31af7Sopenharmony_ciendif::VK_NVX_image_view_handle[]
4362e5c31af7Sopenharmony_ci
4363e5c31af7Sopenharmony_ci
4364e5c31af7Sopenharmony_ci[[resources-image-view-format-features]]
4365e5c31af7Sopenharmony_ci=== Image View Format Features
4366e5c31af7Sopenharmony_ci
4367e5c31af7Sopenharmony_ciValid uses of a slink:VkImageView may: depend on the image view's _format
4368e5c31af7Sopenharmony_cifeatures_, defined below.
4369e5c31af7Sopenharmony_ciSuch constraints are documented in the affected valid usage statement.
4370e5c31af7Sopenharmony_ci
4371e5c31af7Sopenharmony_ciifndef::VK_KHR_format_feature_flags2[]
4372e5c31af7Sopenharmony_ci  * If slink:VkImageViewCreateInfo::pname:image was created with
4373e5c31af7Sopenharmony_ci    ename:VK_IMAGE_TILING_LINEAR, then the image view's set of _format
4374e5c31af7Sopenharmony_ci    features_ is the value of
4375e5c31af7Sopenharmony_ci    slink:VkFormatProperties::pname:linearTilingFeatures found by calling
4376e5c31af7Sopenharmony_ci    flink:vkGetPhysicalDeviceFormatProperties on the same pname:format as
4377e5c31af7Sopenharmony_ci    slink:VkImageViewCreateInfo::pname:format.
4378e5c31af7Sopenharmony_ciendif::VK_KHR_format_feature_flags2[]
4379e5c31af7Sopenharmony_ciifdef::VK_KHR_format_feature_flags2[]
4380e5c31af7Sopenharmony_ci  * If the extension `apiext:VK_KHR_format_feature_flags2` is enabled and
4381e5c31af7Sopenharmony_ci    slink:VkImageViewCreateInfo::pname:image was created with
4382e5c31af7Sopenharmony_ci    ename:VK_IMAGE_TILING_LINEAR, then the image view's set of _format
4383e5c31af7Sopenharmony_ci    features_ is the value of
4384e5c31af7Sopenharmony_ci    slink:VkFormatProperties3KHR::pname:linearTilingFeatures found by
4385e5c31af7Sopenharmony_ci    calling flink:vkGetPhysicalDeviceFormatProperties2 on the same
4386e5c31af7Sopenharmony_ci    pname:format as slink:VkImageViewCreateInfo::pname:format.
4387e5c31af7Sopenharmony_ci  * If the extension `apiext:VK_KHR_format_feature_flags2` is not enabled
4388e5c31af7Sopenharmony_ci    and slink:VkImageViewCreateInfo::pname:image was created with
4389e5c31af7Sopenharmony_ci    ename:VK_IMAGE_TILING_LINEAR, then the image view's set of _format
4390e5c31af7Sopenharmony_ci    features_ is the union of the value of
4391e5c31af7Sopenharmony_ci    slink:VkFormatProperties::pname:linearTilingFeatures found by calling
4392e5c31af7Sopenharmony_ci    flink:vkGetPhysicalDeviceFormatProperties on the same pname:format as
4393e5c31af7Sopenharmony_ci    slink:VkImageViewCreateInfo::pname:format, with:
4394e5c31af7Sopenharmony_ci    - ename:VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_DEPTH_COMPARISON_BIT_KHR if
4395e5c31af7Sopenharmony_ci      the format is a depth/stencil format and the image view features also
4396e5c31af7Sopenharmony_ci      contain ename:VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_BIT_KHR.
4397e5c31af7Sopenharmony_ci    - ename:VK_FORMAT_FEATURE_2_STORAGE_READ_WITHOUT_FORMAT_BIT_KHR if the
4398e5c31af7Sopenharmony_ci      format is one of the <<formats-without-shader-storage-format,extended
4399e5c31af7Sopenharmony_ci      storage formats>> and pname:shaderStorageImageReadWithoutFormat is
4400e5c31af7Sopenharmony_ci      enabled on the device.
4401e5c31af7Sopenharmony_ci    - ename:VK_FORMAT_FEATURE_2_STORAGE_WRITE_WITHOUT_FORMAT_BIT_KHR if the
4402e5c31af7Sopenharmony_ci      format is one of the <<formats-without-shader-storage-format,extended
4403e5c31af7Sopenharmony_ci      storage formats>> and pname:shaderStorageImageWriteWithoutFormat is
4404e5c31af7Sopenharmony_ci      enabled on the device.
4405e5c31af7Sopenharmony_ciendif::VK_KHR_format_feature_flags2[]
4406e5c31af7Sopenharmony_ciifndef::VK_KHR_format_feature_flags2[]
4407e5c31af7Sopenharmony_ci  * If slink:VkImageViewCreateInfo::pname:image was created with
4408e5c31af7Sopenharmony_ci    ename:VK_IMAGE_TILING_OPTIMAL,
4409e5c31af7Sopenharmony_ciifdef::VK_ANDROID_external_memory_android_hardware_buffer[]
4410e5c31af7Sopenharmony_ci    but without an
4411e5c31af7Sopenharmony_ci    <<memory-external-android-hardware-buffer-external-formats,Android
4412e5c31af7Sopenharmony_ci    hardware buffer external format>>,
4413e5c31af7Sopenharmony_ciendif::VK_ANDROID_external_memory_android_hardware_buffer[]
4414e5c31af7Sopenharmony_ci    then the image view's set of _format features_ is the value of
4415e5c31af7Sopenharmony_ci    slink:VkFormatProperties::pname:optimalTilingFeatures found by calling
4416e5c31af7Sopenharmony_ci    flink:vkGetPhysicalDeviceFormatProperties on the same pname:format as
4417e5c31af7Sopenharmony_ci    slink:VkImageViewCreateInfo::pname:format.
4418e5c31af7Sopenharmony_ciendif::VK_KHR_format_feature_flags2[]
4419e5c31af7Sopenharmony_ciifdef::VK_KHR_format_feature_flags2[]
4420e5c31af7Sopenharmony_ci  * If the extension `apiext:VK_KHR_format_feature_flags2` is enabled and
4421e5c31af7Sopenharmony_ci    slink:VkImageViewCreateInfo::pname:image was created with
4422e5c31af7Sopenharmony_ci    ename:VK_IMAGE_TILING_OPTIMAL,
4423e5c31af7Sopenharmony_ciifdef::VK_ANDROID_external_memory_android_hardware_buffer[]
4424e5c31af7Sopenharmony_ci    but without an
4425e5c31af7Sopenharmony_ci    <<memory-external-android-hardware-buffer-external-formats,Android
4426e5c31af7Sopenharmony_ci    hardware buffer external format>>,
4427e5c31af7Sopenharmony_ciendif::VK_ANDROID_external_memory_android_hardware_buffer[]
4428e5c31af7Sopenharmony_ci    then the image view's set of _format features_ is the value of
4429e5c31af7Sopenharmony_ci    slink:VkFormatProperties::pname:optimalTilingFeatures or
4430e5c31af7Sopenharmony_ci    slink:VkFormatProperties3KHR::pname:optimalTilingFeatures found by
4431e5c31af7Sopenharmony_ci    calling flink:vkGetPhysicalDeviceFormatProperties or
4432e5c31af7Sopenharmony_ci    flink:vkGetPhysicalDeviceImageFormatProperties2 on the same pname:format
4433e5c31af7Sopenharmony_ci    as slink:VkImageViewCreateInfo::pname:format.
4434e5c31af7Sopenharmony_ci  * If the extension `apiext:VK_KHR_format_feature_flags2` is not enabled
4435e5c31af7Sopenharmony_ci    and slink:VkImageViewCreateInfo::pname:image was created with
4436e5c31af7Sopenharmony_ci    ename:VK_IMAGE_TILING_OPTIMAL,
4437e5c31af7Sopenharmony_ciifdef::VK_ANDROID_external_memory_android_hardware_buffer[]
4438e5c31af7Sopenharmony_ci    but without an
4439e5c31af7Sopenharmony_ci    <<memory-external-android-hardware-buffer-external-formats,Android
4440e5c31af7Sopenharmony_ci    hardware buffer external format>>,
4441e5c31af7Sopenharmony_ciendif::VK_ANDROID_external_memory_android_hardware_buffer[]
4442e5c31af7Sopenharmony_ci    then the image view's set of _format features_ is the union of the value
4443e5c31af7Sopenharmony_ci    of slink:VkFormatProperties::pname:optimalTilingFeatures found by
4444e5c31af7Sopenharmony_ci    calling flink:vkGetPhysicalDeviceFormatProperties on the same
4445e5c31af7Sopenharmony_ci    pname:format as slink:VkImageViewCreateInfo::pname:format, with:
4446e5c31af7Sopenharmony_ci    - ename:VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_DEPTH_COMPARISON_BIT_KHR if
4447e5c31af7Sopenharmony_ci      the format is a depth/stencil format and the image view features also
4448e5c31af7Sopenharmony_ci      contain ename:VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_BIT_KHR.
4449e5c31af7Sopenharmony_ci    - ename:VK_FORMAT_FEATURE_2_STORAGE_READ_WITHOUT_FORMAT_BIT_KHR if the
4450e5c31af7Sopenharmony_ci      format is one of the <<formats-without-shader-storage-format,extended
4451e5c31af7Sopenharmony_ci      storage formats>> and pname:shaderStorageImageReadWithoutFormat is
4452e5c31af7Sopenharmony_ci      enabled on the device.
4453e5c31af7Sopenharmony_ci    - ename:VK_FORMAT_FEATURE_2_STORAGE_WRITE_WITHOUT_FORMAT_BIT_KHR if the
4454e5c31af7Sopenharmony_ci      format is one of the <<formats-without-shader-storage-format,extended
4455e5c31af7Sopenharmony_ci      storage formats>> and pname:shaderStorageImageWriteWithoutFormat is
4456e5c31af7Sopenharmony_ci      enabled on the device.
4457e5c31af7Sopenharmony_ciendif::VK_KHR_format_feature_flags2[]
4458e5c31af7Sopenharmony_ciifdef::VK_ANDROID_external_memory_android_hardware_buffer[]
4459e5c31af7Sopenharmony_ci  * If slink:VkImageViewCreateInfo::pname:image was created with an
4460e5c31af7Sopenharmony_ci    <<memory-external-android-hardware-buffer-external-formats,Android
4461e5c31af7Sopenharmony_ci    hardware buffer external format>>, then the image views's set of _format
4462e5c31af7Sopenharmony_ci    features_ is the value of
4463e5c31af7Sopenharmony_ci    slink:VkAndroidHardwareBufferFormatPropertiesANDROID::pname:formatFeatures
4464e5c31af7Sopenharmony_ci    found by calling flink:vkGetAndroidHardwareBufferPropertiesANDROID on
4465e5c31af7Sopenharmony_ci    the Android hardware buffer that was imported to the
4466e5c31af7Sopenharmony_ci    slink:VkDeviceMemory to which the
4467e5c31af7Sopenharmony_ci    slink:VkImageViewCreateInfo::pname:image is bound.
4468e5c31af7Sopenharmony_ciendif::VK_ANDROID_external_memory_android_hardware_buffer[]
4469e5c31af7Sopenharmony_ciifdef::VK_FUCHSIA_buffer_collection[]
4470e5c31af7Sopenharmony_ci  * If slink:VkImageViewCreateInfo::pname:image was created with a chained
4471e5c31af7Sopenharmony_ci    slink:VkBufferCollectionImageCreateInfoFUCHSIA, then the image view's
4472e5c31af7Sopenharmony_ci    set of _format features_ is the value of
4473e5c31af7Sopenharmony_ci    slink:VkBufferCollectionPropertiesFUCHSIA::pname:formatFeatures found by
4474e5c31af7Sopenharmony_ci    calling flink:vkGetBufferCollectionPropertiesFUCHSIA on the buffer
4475e5c31af7Sopenharmony_ci    collection passed as
4476e5c31af7Sopenharmony_ci    slink:VkBufferCollectionImageCreateInfoFUCHSIA::pname:collection when
4477e5c31af7Sopenharmony_ci    the image was created.
4478e5c31af7Sopenharmony_ciendif::VK_FUCHSIA_buffer_collection[]
4479e5c31af7Sopenharmony_ciifdef::VK_EXT_image_drm_format_modifier[]
4480e5c31af7Sopenharmony_ci  * If slink:VkImageViewCreateInfo::pname:image was created with
4481e5c31af7Sopenharmony_ci    ename:VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT, then:
4482e5c31af7Sopenharmony_ci  ** The image's DRM format modifier is the value of
4483e5c31af7Sopenharmony_ci     slink:VkImageDrmFormatModifierListCreateInfoEXT::pname:drmFormatModifier
4484e5c31af7Sopenharmony_ci     found by calling flink:vkGetImageDrmFormatModifierPropertiesEXT.
4485e5c31af7Sopenharmony_ci  ** Let
4486e5c31af7Sopenharmony_ci     slink:VkDrmFormatModifierPropertiesListEXT::pname:pDrmFormatModifierProperties
4487e5c31af7Sopenharmony_ci     be the array found by calling
4488e5c31af7Sopenharmony_ci     flink:vkGetPhysicalDeviceFormatProperties2 on the same pname:format as
4489e5c31af7Sopenharmony_ci     slink:VkImageViewCreateInfo::pname:format.
4490e5c31af7Sopenharmony_ci  ** Let `VkDrmFormatModifierPropertiesEXT prop` be an array element whose
4491e5c31af7Sopenharmony_ci     pname:drmFormatModifier member is the value of the image's DRM format
4492e5c31af7Sopenharmony_ci     modifier.
4493e5c31af7Sopenharmony_ci  ** Then the image view's set of _format features_ is the value of taking
4494e5c31af7Sopenharmony_ci     the bitwise intersection, over the collected
4495e5c31af7Sopenharmony_ci     `prop`::pname:drmFormatModifierTilingFeatures.
4496e5c31af7Sopenharmony_ciendif::VK_EXT_image_drm_format_modifier[]
4497e5c31af7Sopenharmony_ci
4498e5c31af7Sopenharmony_ciifdef::VK_EXT_image_view_min_lod[]
4499e5c31af7Sopenharmony_ci[open,refpage='VkImageViewMinLodCreateInfoEXT',desc='Structure describing the minimum lod of an image view',type='structs']
4500e5c31af7Sopenharmony_ci--
4501e5c31af7Sopenharmony_ciIf the pname:pNext chain includes a sname:VkImageViewMinLodCreateInfoEXT
4502e5c31af7Sopenharmony_cistructure, then that structure includes a parameter specifying a value to
4503e5c31af7Sopenharmony_ciclamp the minimum LOD value during <<textures-image-level-selection,Image
4504e5c31af7Sopenharmony_ciLevel(s) Selection>> and <<textures-integer-coordinate-operations,Integer
4505e5c31af7Sopenharmony_ciTexel Coordinate Operations>>.
4506e5c31af7Sopenharmony_ci
4507e5c31af7Sopenharmony_ciThe sname:VkImageViewMinLodCreateInfoEXT structure is defined as:
4508e5c31af7Sopenharmony_ci
4509e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkImageViewMinLodCreateInfoEXT.txt[]
4510e5c31af7Sopenharmony_ci
4511e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure.
4512e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
4513e5c31af7Sopenharmony_ci    structure.
4514e5c31af7Sopenharmony_ci  * pname:minLod is the value to clamp the minimum LOD accessible by this
4515e5c31af7Sopenharmony_ci    slink:VkImageView.
4516e5c31af7Sopenharmony_ci
4517e5c31af7Sopenharmony_ci.Valid Usage
4518e5c31af7Sopenharmony_ci****
4519e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewMinLodCreateInfoEXT-minLod-06455]]
4520e5c31af7Sopenharmony_ci    If the <<features-minLod, pname:minLod>> feature is not enabled,
4521e5c31af7Sopenharmony_ci    pname:minLod must: be `0.0`.
4522e5c31af7Sopenharmony_ci  * [[VUID-VkImageViewMinLodCreateInfoEXT-minLod-06456]]
4523e5c31af7Sopenharmony_ci    pname:minLod must: be less or equal to the index of the last mipmap
4524e5c31af7Sopenharmony_ci    level accessible to the view.
4525e5c31af7Sopenharmony_ci****
4526e5c31af7Sopenharmony_ci
4527e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkImageViewMinLodCreateInfoEXT.txt[]
4528e5c31af7Sopenharmony_ci--
4529e5c31af7Sopenharmony_ciendif::VK_EXT_image_view_min_lod[]
4530e5c31af7Sopenharmony_ci
4531e5c31af7Sopenharmony_ci
4532e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing,VK_KHR_acceleration_structure[]
4533e5c31af7Sopenharmony_ci[[resources-acceleration-structures]]
4534e5c31af7Sopenharmony_ci== Acceleration Structures
4535e5c31af7Sopenharmony_ci
4536e5c31af7Sopenharmony_ci[open,refpage='VkAccelerationStructureKHR',desc='Opaque handle to an acceleration structure object',type='handles']
4537e5c31af7Sopenharmony_ci--
4538e5c31af7Sopenharmony_ci:refpage: VkAccelerationStructureKHR
4539e5c31af7Sopenharmony_ci
4540e5c31af7Sopenharmony_ciAcceleration structures are opaque data structures that are built by the
4541e5c31af7Sopenharmony_ciimplementation to more efficiently perform spatial queries on the provided
4542e5c31af7Sopenharmony_cigeometric data.
4543e5c31af7Sopenharmony_ciFor this extension, an acceleration structure is either a top-level
4544e5c31af7Sopenharmony_ciacceleration structure containing a set of bottom-level acceleration
4545e5c31af7Sopenharmony_cistructures or a bottom-level acceleration structure containing either a set
4546e5c31af7Sopenharmony_ciof axis-aligned bounding boxes for custom geometry or a set of triangles.
4547e5c31af7Sopenharmony_ci
4548e5c31af7Sopenharmony_ciEach instance in the top-level acceleration structure contains a reference
4549e5c31af7Sopenharmony_cito a bottom-level acceleration structure as well as an instance transform
4550e5c31af7Sopenharmony_ciplus information required to index into the shader bindings.
4551e5c31af7Sopenharmony_ciThe top-level acceleration structure is what is bound to the acceleration
4552e5c31af7Sopenharmony_cidescriptor, for example to trace inside the shader in the ray tracing
4553e5c31af7Sopenharmony_cipipeline.
4554e5c31af7Sopenharmony_ci
4555e5c31af7Sopenharmony_ciAcceleration structures are represented by sname:VkAccelerationStructureKHR
4556e5c31af7Sopenharmony_cihandles:
4557e5c31af7Sopenharmony_ci
4558e5c31af7Sopenharmony_ciinclude::{generated}/api/handles/VkAccelerationStructureKHR.txt[]
4559e5c31af7Sopenharmony_ci--
4560e5c31af7Sopenharmony_ci
4561e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing[]
4562e5c31af7Sopenharmony_ci[open,refpage='VkAccelerationStructureNV',desc='Opaque handle to an acceleration structure object',type='handles']
4563e5c31af7Sopenharmony_ci--
4564e5c31af7Sopenharmony_ci:refpage: VkAccelerationStructureNV
4565e5c31af7Sopenharmony_ci
4566e5c31af7Sopenharmony_ciAcceleration structures for the apiext:VK_NV_ray_tracing extension are
4567e5c31af7Sopenharmony_cirepresented by the similar sname:VkAccelerationStructureNV handles:
4568e5c31af7Sopenharmony_ci
4569e5c31af7Sopenharmony_ciinclude::{generated}/api/handles/VkAccelerationStructureNV.txt[]
4570e5c31af7Sopenharmony_ci--
4571e5c31af7Sopenharmony_ci
4572e5c31af7Sopenharmony_ci[open,refpage='vkCreateAccelerationStructureNV',desc='Create a new acceleration structure object',type='protos']
4573e5c31af7Sopenharmony_ci--
4574e5c31af7Sopenharmony_ci:refpage: vkCreateAccelerationStructureNV
4575e5c31af7Sopenharmony_ci
4576e5c31af7Sopenharmony_ciTo create acceleration structures, call:
4577e5c31af7Sopenharmony_ci
4578e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCreateAccelerationStructureNV.txt[]
4579e5c31af7Sopenharmony_ci
4580e5c31af7Sopenharmony_ci  * pname:device is the logical device that creates the buffer object.
4581e5c31af7Sopenharmony_ci  * pname:pCreateInfo is a pointer to a
4582e5c31af7Sopenharmony_ci    slink:VkAccelerationStructureCreateInfoNV structure containing
4583e5c31af7Sopenharmony_ci    parameters affecting creation of the acceleration structure.
4584e5c31af7Sopenharmony_ci  * pname:pAllocator controls host memory allocation as described in the
4585e5c31af7Sopenharmony_ci    <<memory-allocation, Memory Allocation>> chapter.
4586e5c31af7Sopenharmony_ci  * pname:pAccelerationStructure is a pointer to a
4587e5c31af7Sopenharmony_ci    slink:VkAccelerationStructureNV handle in which the resulting
4588e5c31af7Sopenharmony_ci    acceleration structure object is returned.
4589e5c31af7Sopenharmony_ci
4590e5c31af7Sopenharmony_ciSimilarly to other objects in Vulkan, the acceleration structure creation
4591e5c31af7Sopenharmony_cimerely creates an object with a specific "`shape`" as specified by the
4592e5c31af7Sopenharmony_ciinformation in slink:VkAccelerationStructureInfoNV and pname:compactedSize
4593e5c31af7Sopenharmony_ciin pname:pCreateInfo.
4594e5c31af7Sopenharmony_ciPopulating the data in the object after allocating and binding memory is
4595e5c31af7Sopenharmony_cidone with flink:vkCmdBuildAccelerationStructureNV and
4596e5c31af7Sopenharmony_ciflink:vkCmdCopyAccelerationStructureNV.
4597e5c31af7Sopenharmony_ci
4598e5c31af7Sopenharmony_ciAcceleration structure creation uses the count and type information from the
4599e5c31af7Sopenharmony_cigeometries, but does not use the data references in the structures.
4600e5c31af7Sopenharmony_ci
4601e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCreateAccelerationStructureNV.txt[]
4602e5c31af7Sopenharmony_ci--
4603e5c31af7Sopenharmony_ci
4604e5c31af7Sopenharmony_ci[open,refpage='VkAccelerationStructureCreateInfoNV',desc='Structure specifying the parameters of a newly created acceleration structure object',type='structs']
4605e5c31af7Sopenharmony_ci--
4606e5c31af7Sopenharmony_ci:refpage: VkAccelerationStructureCreateInfoNV
4607e5c31af7Sopenharmony_ci
4608e5c31af7Sopenharmony_ciThe sname:VkAccelerationStructureCreateInfoNV structure is defined as:
4609e5c31af7Sopenharmony_ci
4610e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkAccelerationStructureCreateInfoNV.txt[]
4611e5c31af7Sopenharmony_ci
4612e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure.
4613e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
4614e5c31af7Sopenharmony_ci    structure.
4615e5c31af7Sopenharmony_ci  * pname:compactedSize is the size from the result of
4616e5c31af7Sopenharmony_ci    flink:vkCmdWriteAccelerationStructuresPropertiesNV if this acceleration
4617e5c31af7Sopenharmony_ci    structure is going to be the target of a compacting copy.
4618e5c31af7Sopenharmony_ci  * pname:info is the slink:VkAccelerationStructureInfoNV structure
4619e5c31af7Sopenharmony_ci    specifying further parameters of the created acceleration structure.
4620e5c31af7Sopenharmony_ci
4621e5c31af7Sopenharmony_ci.Valid Usage
4622e5c31af7Sopenharmony_ci****
4623e5c31af7Sopenharmony_ci  * [[VUID-VkAccelerationStructureCreateInfoNV-compactedSize-02421]]
4624e5c31af7Sopenharmony_ci    If pname:compactedSize is not `0` then both pname:info.geometryCount and
4625e5c31af7Sopenharmony_ci    pname:info.instanceCount must: be `0`
4626e5c31af7Sopenharmony_ci****
4627e5c31af7Sopenharmony_ci
4628e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkAccelerationStructureCreateInfoNV.txt[]
4629e5c31af7Sopenharmony_ci--
4630e5c31af7Sopenharmony_ci
4631e5c31af7Sopenharmony_ci[open,refpage='VkAccelerationStructureInfoNV',desc='Structure specifying the parameters of acceleration structure object',type='structs']
4632e5c31af7Sopenharmony_ci--
4633e5c31af7Sopenharmony_ci:refpage: VkAccelerationStructureInfoNV
4634e5c31af7Sopenharmony_ci
4635e5c31af7Sopenharmony_ciThe sname:VkAccelerationStructureInfoNV structure is defined as:
4636e5c31af7Sopenharmony_ci
4637e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkAccelerationStructureInfoNV.txt[]
4638e5c31af7Sopenharmony_ci
4639e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure.
4640e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
4641e5c31af7Sopenharmony_ci    structure.
4642e5c31af7Sopenharmony_ci  * pname:type is a elink:VkAccelerationStructureTypeNV value specifying the
4643e5c31af7Sopenharmony_ci    type of acceleration structure that will be created.
4644e5c31af7Sopenharmony_ci  * pname:flags is a bitmask of elink:VkBuildAccelerationStructureFlagBitsNV
4645e5c31af7Sopenharmony_ci    specifying additional parameters of the acceleration structure.
4646e5c31af7Sopenharmony_ci  * pname:instanceCount specifies the number of instances that will be in
4647e5c31af7Sopenharmony_ci    the new acceleration structure.
4648e5c31af7Sopenharmony_ci  * pname:geometryCount specifies the number of geometries that will be in
4649e5c31af7Sopenharmony_ci    the new acceleration structure.
4650e5c31af7Sopenharmony_ci  * pname:pGeometries is a pointer to an array of pname:geometryCount
4651e5c31af7Sopenharmony_ci    slink:VkGeometryNV structures containing the scene data being passed
4652e5c31af7Sopenharmony_ci    into the acceleration structure.
4653e5c31af7Sopenharmony_ci
4654e5c31af7Sopenharmony_cisname:VkAccelerationStructureInfoNV contains information that is used both
4655e5c31af7Sopenharmony_cifor acceleration structure creation with
4656e5c31af7Sopenharmony_ciflink:vkCreateAccelerationStructureNV and in combination with the actual
4657e5c31af7Sopenharmony_cigeometric data to build the acceleration structure with
4658e5c31af7Sopenharmony_ciflink:vkCmdBuildAccelerationStructureNV.
4659e5c31af7Sopenharmony_ci
4660e5c31af7Sopenharmony_ci.Valid Usage
4661e5c31af7Sopenharmony_ci****
4662e5c31af7Sopenharmony_ci  * [[VUID-VkAccelerationStructureInfoNV-geometryCount-02422]]
4663e5c31af7Sopenharmony_ci    pname:geometryCount must: be less than or equal to
4664e5c31af7Sopenharmony_ci    slink:VkPhysicalDeviceRayTracingPropertiesNV::pname:maxGeometryCount
4665e5c31af7Sopenharmony_ci  * [[VUID-VkAccelerationStructureInfoNV-instanceCount-02423]]
4666e5c31af7Sopenharmony_ci    pname:instanceCount must: be less than or equal to
4667e5c31af7Sopenharmony_ci    slink:VkPhysicalDeviceRayTracingPropertiesNV::pname:maxInstanceCount
4668e5c31af7Sopenharmony_ci  * [[VUID-VkAccelerationStructureInfoNV-maxTriangleCount-02424]]
4669e5c31af7Sopenharmony_ci    The total number of triangles in all geometries must: be less than or
4670e5c31af7Sopenharmony_ci    equal to
4671e5c31af7Sopenharmony_ci    slink:VkPhysicalDeviceRayTracingPropertiesNV::pname:maxTriangleCount
4672e5c31af7Sopenharmony_ci  * [[VUID-VkAccelerationStructureInfoNV-type-02425]]
4673e5c31af7Sopenharmony_ci    If pname:type is ename:VK_ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_NV then
4674e5c31af7Sopenharmony_ci    pname:geometryCount must: be `0`
4675e5c31af7Sopenharmony_ci  * [[VUID-VkAccelerationStructureInfoNV-type-02426]]
4676e5c31af7Sopenharmony_ci    If pname:type is ename:VK_ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_NV
4677e5c31af7Sopenharmony_ci    then pname:instanceCount must: be `0`
4678e5c31af7Sopenharmony_ci  * [[VUID-VkAccelerationStructureInfoNV-type-02786]]
4679e5c31af7Sopenharmony_ci    If pname:type is ename:VK_ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_NV
4680e5c31af7Sopenharmony_ci    then the pname:geometryType member of each geometry in pname:pGeometries
4681e5c31af7Sopenharmony_ci    must: be the same
4682e5c31af7Sopenharmony_ciifdef::VK_KHR_acceleration_structure[]
4683e5c31af7Sopenharmony_ci  * [[VUID-VkAccelerationStructureInfoNV-type-04623]]
4684e5c31af7Sopenharmony_ci    pname:type must: not be ename:VK_ACCELERATION_STRUCTURE_TYPE_GENERIC_KHR
4685e5c31af7Sopenharmony_ciendif::VK_KHR_acceleration_structure[]
4686e5c31af7Sopenharmony_ci  * [[VUID-VkAccelerationStructureInfoNV-flags-02592]]
4687e5c31af7Sopenharmony_ci    If pname:flags has the
4688e5c31af7Sopenharmony_ci    ename:VK_BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_TRACE_BIT_NV bit set,
4689e5c31af7Sopenharmony_ci    then it must: not have the
4690e5c31af7Sopenharmony_ci    ename:VK_BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_BUILD_BIT_NV bit set
4691e5c31af7Sopenharmony_ci  * [[VUID-VkAccelerationStructureInfoNV-scratch-02781]]
4692e5c31af7Sopenharmony_ci    pname:scratch must: have been created with
4693e5c31af7Sopenharmony_ci    ename:VK_BUFFER_USAGE_RAY_TRACING_BIT_NV usage flag
4694e5c31af7Sopenharmony_ci  * [[VUID-VkAccelerationStructureInfoNV-instanceData-02782]]
4695e5c31af7Sopenharmony_ci    If pname:instanceData is not dlink:VK_NULL_HANDLE, pname:instanceData
4696e5c31af7Sopenharmony_ci    must: have been created with ename:VK_BUFFER_USAGE_RAY_TRACING_BIT_NV
4697e5c31af7Sopenharmony_ci    usage flag
4698e5c31af7Sopenharmony_ci****
4699e5c31af7Sopenharmony_ci
4700e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkAccelerationStructureInfoNV.txt[]
4701e5c31af7Sopenharmony_ci--
4702e5c31af7Sopenharmony_ciendif::VK_NV_ray_tracing[]
4703e5c31af7Sopenharmony_ci
4704e5c31af7Sopenharmony_ciifdef::VK_KHR_acceleration_structure[]
4705e5c31af7Sopenharmony_ci[open,refpage='vkCreateAccelerationStructureKHR',desc='Create a new acceleration structure object',type='protos']
4706e5c31af7Sopenharmony_ci--
4707e5c31af7Sopenharmony_ci:refpage: vkCreateAccelerationStructureKHR
4708e5c31af7Sopenharmony_ci
4709e5c31af7Sopenharmony_ciTo create an acceleration structure, call:
4710e5c31af7Sopenharmony_ci
4711e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCreateAccelerationStructureKHR.txt[]
4712e5c31af7Sopenharmony_ci
4713e5c31af7Sopenharmony_ci  * pname:device is the logical device that creates the acceleration
4714e5c31af7Sopenharmony_ci    structure object.
4715e5c31af7Sopenharmony_ci  * pname:pCreateInfo is a pointer to a
4716e5c31af7Sopenharmony_ci    slink:VkAccelerationStructureCreateInfoKHR structure containing
4717e5c31af7Sopenharmony_ci    parameters affecting creation of the acceleration structure.
4718e5c31af7Sopenharmony_ci  * pname:pAllocator controls host memory allocation as described in the
4719e5c31af7Sopenharmony_ci    <<memory-allocation, Memory Allocation>> chapter.
4720e5c31af7Sopenharmony_ci  * pname:pAccelerationStructure is a pointer to a
4721e5c31af7Sopenharmony_ci    sname:VkAccelerationStructureKHR handle in which the resulting
4722e5c31af7Sopenharmony_ci    acceleration structure object is returned.
4723e5c31af7Sopenharmony_ci
4724e5c31af7Sopenharmony_ciSimilar to other objects in Vulkan, the acceleration structure creation
4725e5c31af7Sopenharmony_cimerely creates an object with a specific "`shape`".
4726e5c31af7Sopenharmony_ciThe type and quantity of geometry that can be built into an acceleration
4727e5c31af7Sopenharmony_cistructure is determined by the parameters of
4728e5c31af7Sopenharmony_cislink:VkAccelerationStructureCreateInfoKHR.
4729e5c31af7Sopenharmony_ci
4730e5c31af7Sopenharmony_ciPopulating the data in the object after allocating and binding memory is
4731e5c31af7Sopenharmony_cidone with commands such as flink:vkCmdBuildAccelerationStructuresKHR,
4732e5c31af7Sopenharmony_ciflink:vkBuildAccelerationStructuresKHR,
4733e5c31af7Sopenharmony_ciflink:vkCmdCopyAccelerationStructureKHR, and
4734e5c31af7Sopenharmony_ciflink:vkCopyAccelerationStructureKHR.
4735e5c31af7Sopenharmony_ci
4736e5c31af7Sopenharmony_ciThe input buffers passed to acceleration structure build commands will be
4737e5c31af7Sopenharmony_cireferenced by the implementation for the duration of the command.
4738e5c31af7Sopenharmony_ciAfter the command completes, the acceleration structure may: hold a
4739e5c31af7Sopenharmony_cireference to any acceleration structure specified by an active instance
4740e5c31af7Sopenharmony_cicontained therein.
4741e5c31af7Sopenharmony_ciApart from this referencing, acceleration structures must: be fully
4742e5c31af7Sopenharmony_ciself-contained.
4743e5c31af7Sopenharmony_ciThe application may: re-use or free any memory which was used by the command
4744e5c31af7Sopenharmony_cias an input or as scratch without affecting the results of ray traversal.
4745e5c31af7Sopenharmony_ci
4746e5c31af7Sopenharmony_ci.Valid Usage
4747e5c31af7Sopenharmony_ci****
4748e5c31af7Sopenharmony_ci  * [[VUID-vkCreateAccelerationStructureKHR-accelerationStructure-03611]]
4749e5c31af7Sopenharmony_ci    The <<features-accelerationStructure, pname:accelerationStructure>>
4750e5c31af7Sopenharmony_ci    feature must: be enabled
4751e5c31af7Sopenharmony_ci  * [[VUID-vkCreateAccelerationStructureKHR-deviceAddress-03488]]
4752e5c31af7Sopenharmony_ci    If slink:VkAccelerationStructureCreateInfoKHR::pname:deviceAddress is
4753e5c31af7Sopenharmony_ci    not zero, the
4754e5c31af7Sopenharmony_ci    <<features-accelerationStructureCaptureReplay,pname:accelerationStructureCaptureReplay>>
4755e5c31af7Sopenharmony_ci    feature must: be enabled
4756e5c31af7Sopenharmony_ci  * [[VUID-vkCreateAccelerationStructureKHR-device-03489]]
4757e5c31af7Sopenharmony_ci    If pname:device was created with multiple physical devices, then the
4758e5c31af7Sopenharmony_ci    <<features-bufferDeviceAddressMultiDevice,bufferDeviceAddressMultiDevice>>
4759e5c31af7Sopenharmony_ci    feature must: be enabled
4760e5c31af7Sopenharmony_ci****
4761e5c31af7Sopenharmony_ci
4762e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCreateAccelerationStructureKHR.txt[]
4763e5c31af7Sopenharmony_ci--
4764e5c31af7Sopenharmony_ci
4765e5c31af7Sopenharmony_ci[open,refpage='VkAccelerationStructureCreateInfoKHR',desc='Structure specifying the parameters of a newly created acceleration structure object',type='structs']
4766e5c31af7Sopenharmony_ci--
4767e5c31af7Sopenharmony_ci:refpage: VkAccelerationStructureCreateInfoKHR
4768e5c31af7Sopenharmony_ci
4769e5c31af7Sopenharmony_ciThe sname:VkAccelerationStructureCreateInfoKHR structure is defined as:
4770e5c31af7Sopenharmony_ci
4771e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkAccelerationStructureCreateInfoKHR.txt[]
4772e5c31af7Sopenharmony_ci
4773e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure.
4774e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
4775e5c31af7Sopenharmony_ci    structure.
4776e5c31af7Sopenharmony_ci  * pname:createFlags is a bitmask of
4777e5c31af7Sopenharmony_ci    elink:VkAccelerationStructureCreateFlagBitsKHR specifying additional
4778e5c31af7Sopenharmony_ci    creation parameters of the acceleration structure.
4779e5c31af7Sopenharmony_ci  * pname:buffer is the buffer on which the acceleration structure will be
4780e5c31af7Sopenharmony_ci    stored.
4781e5c31af7Sopenharmony_ci  * pname:offset is an offset in bytes from the base address of the buffer
4782e5c31af7Sopenharmony_ci    at which the acceleration structure will be stored, and must: be a
4783e5c31af7Sopenharmony_ci    multiple of `256`.
4784e5c31af7Sopenharmony_ci  * pname:size is the size required for the acceleration structure.
4785e5c31af7Sopenharmony_ci  * pname:type is a elink:VkAccelerationStructureTypeKHR value specifying
4786e5c31af7Sopenharmony_ci    the type of acceleration structure that will be created.
4787e5c31af7Sopenharmony_ci  * pname:deviceAddress is the device address requested for the acceleration
4788e5c31af7Sopenharmony_ci    structure if the <<features-accelerationStructureCaptureReplay,
4789e5c31af7Sopenharmony_ci    pname:accelerationStructureCaptureReplay>> feature is being used.
4790e5c31af7Sopenharmony_ci
4791e5c31af7Sopenharmony_ciIf pname:deviceAddress is zero, no specific address is requested.
4792e5c31af7Sopenharmony_ci
4793e5c31af7Sopenharmony_ciIf pname:deviceAddress is not zero, pname:deviceAddress must: be an address
4794e5c31af7Sopenharmony_ciretrieved from an identically created acceleration structure on the same
4795e5c31af7Sopenharmony_ciimplementation.
4796e5c31af7Sopenharmony_ciThe acceleration structure must: also be placed on an identically created
4797e5c31af7Sopenharmony_cipname:buffer and at the same pname:offset.
4798e5c31af7Sopenharmony_ci
4799e5c31af7Sopenharmony_ciApplications should: avoid creating acceleration structures with
4800e5c31af7Sopenharmony_ciapplication-provided addresses and implementation-provided addresses in the
4801e5c31af7Sopenharmony_cisame process, to reduce the likelihood of
4802e5c31af7Sopenharmony_ciename:VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS_KHR errors.
4803e5c31af7Sopenharmony_ci
4804e5c31af7Sopenharmony_ci[NOTE]
4805e5c31af7Sopenharmony_ci.Note
4806e5c31af7Sopenharmony_ci====
4807e5c31af7Sopenharmony_ciThe expected usage for this is that a trace capture/replay tool will add the
4808e5c31af7Sopenharmony_ciename:VK_BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT flag to all buffers
4809e5c31af7Sopenharmony_cithat use ename:VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT, and will add
4810e5c31af7Sopenharmony_ciename:VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT to all buffers used as
4811e5c31af7Sopenharmony_cistorage for an acceleration structure where pname:deviceAddress is not zero.
4812e5c31af7Sopenharmony_ciThis also means that the tool will need to add
4813e5c31af7Sopenharmony_ciename:VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT to memory allocations to allow
4814e5c31af7Sopenharmony_cithe flag to be set where the application may not have otherwise required it.
4815e5c31af7Sopenharmony_ciDuring capture the tool will save the queried opaque device addresses in the
4816e5c31af7Sopenharmony_citrace.
4817e5c31af7Sopenharmony_ciDuring replay, the buffers will be created specifying the original address
4818e5c31af7Sopenharmony_ciso any address values stored in the trace data will remain valid.
4819e5c31af7Sopenharmony_ci
4820e5c31af7Sopenharmony_ciImplementations are expected to separate such buffers in the GPU address
4821e5c31af7Sopenharmony_cispace so normal allocations will avoid using these addresses.
4822e5c31af7Sopenharmony_ciApps/tools should avoid mixing app-provided and implementation-provided
4823e5c31af7Sopenharmony_ciaddresses for buffers created with
4824e5c31af7Sopenharmony_ciename:VK_BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT, to avoid address
4825e5c31af7Sopenharmony_cispace allocation conflicts.
4826e5c31af7Sopenharmony_ci====
4827e5c31af7Sopenharmony_ci
4828e5c31af7Sopenharmony_ci
4829e5c31af7Sopenharmony_ciApplications should: create an acceleration structure with a specific
4830e5c31af7Sopenharmony_cielink:VkAccelerationStructureTypeKHR other than
4831e5c31af7Sopenharmony_ciename:VK_ACCELERATION_STRUCTURE_TYPE_GENERIC_KHR.
4832e5c31af7Sopenharmony_ci
4833e5c31af7Sopenharmony_ciIf the acceleration structure will be the target of a build operation, the
4834e5c31af7Sopenharmony_cirequired size for an acceleration structure can: be queried with
4835e5c31af7Sopenharmony_ciflink:vkGetAccelerationStructureBuildSizesKHR.
4836e5c31af7Sopenharmony_ciIf the acceleration structure is going to be the target of a compacting
4837e5c31af7Sopenharmony_cicopy, flink:vkCmdWriteAccelerationStructuresPropertiesKHR or
4838e5c31af7Sopenharmony_ciflink:vkWriteAccelerationStructuresPropertiesKHR can: be used to obtain the
4839e5c31af7Sopenharmony_cicompacted size required.
4840e5c31af7Sopenharmony_ci
4841e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing_motion_blur[]
4842e5c31af7Sopenharmony_ciIf the acceleration structure will be the target of a build operation with
4843e5c31af7Sopenharmony_ciename:VK_BUILD_ACCELERATION_STRUCTURE_MOTION_BIT_NV it must: include
4844e5c31af7Sopenharmony_ciename:VK_ACCELERATION_STRUCTURE_CREATE_MOTION_BIT_NV in pname:flags and
4845e5c31af7Sopenharmony_ciinclude slink:VkAccelerationStructureMotionInfoNV as an extension structure
4846e5c31af7Sopenharmony_ciin pname:pNext with the number of instances as metadata for the object.
4847e5c31af7Sopenharmony_ciendif::VK_NV_ray_tracing_motion_blur[]
4848e5c31af7Sopenharmony_ci
4849e5c31af7Sopenharmony_ci.Valid Usage
4850e5c31af7Sopenharmony_ci****
4851e5c31af7Sopenharmony_ci  * [[VUID-VkAccelerationStructureCreateInfoKHR-deviceAddress-03612]]
4852e5c31af7Sopenharmony_ci    If pname:deviceAddress is not zero, pname:createFlags must: include
4853e5c31af7Sopenharmony_ci    ename:VK_ACCELERATION_STRUCTURE_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_KHR
4854e5c31af7Sopenharmony_ci  * [[VUID-VkAccelerationStructureCreateInfoKHR-createFlags-03613]]
4855e5c31af7Sopenharmony_ci    If pname:createFlags includes
4856e5c31af7Sopenharmony_ci    ename:VK_ACCELERATION_STRUCTURE_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_KHR,
4857e5c31af7Sopenharmony_ci    slink:VkPhysicalDeviceAccelerationStructureFeaturesKHR::pname:accelerationStructureCaptureReplay
4858e5c31af7Sopenharmony_ci    must: be ename:VK_TRUE
4859e5c31af7Sopenharmony_ci  * [[VUID-VkAccelerationStructureCreateInfoKHR-buffer-03614]]
4860e5c31af7Sopenharmony_ci    pname:buffer must: have been created with a pname:usage value containing
4861e5c31af7Sopenharmony_ci    ename:VK_BUFFER_USAGE_ACCELERATION_STRUCTURE_STORAGE_BIT_KHR
4862e5c31af7Sopenharmony_ci  * [[VUID-VkAccelerationStructureCreateInfoKHR-buffer-03615]]
4863e5c31af7Sopenharmony_ci    pname:buffer must: not have been created with
4864e5c31af7Sopenharmony_ci    ename:VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT
4865e5c31af7Sopenharmony_ci  * [[VUID-VkAccelerationStructureCreateInfoKHR-offset-03616]]
4866e5c31af7Sopenharmony_ci    The sum of pname:offset and pname:size must: be less than the size of
4867e5c31af7Sopenharmony_ci    pname:buffer
4868e5c31af7Sopenharmony_ci  * [[VUID-VkAccelerationStructureCreateInfoKHR-offset-03734]]
4869e5c31af7Sopenharmony_ci    pname:offset must: be a multiple of `256` bytes
4870e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing_motion_blur[]
4871e5c31af7Sopenharmony_ci  * [[VUID-VkAccelerationStructureCreateInfoKHR-flags-04954]]
4872e5c31af7Sopenharmony_ci    If ename:VK_ACCELERATION_STRUCTURE_CREATE_MOTION_BIT_NV is set in
4873e5c31af7Sopenharmony_ci    pname:flags and pname:type is
4874e5c31af7Sopenharmony_ci    ename:VK_ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR,
4875e5c31af7Sopenharmony_ci one member of the pname:pNext chain must: be a pointer to a valid instance
4876e5c31af7Sopenharmony_ci of slink:VkAccelerationStructureMotionInfoNV
4877e5c31af7Sopenharmony_ci  * [[VUID-VkAccelerationStructureCreateInfoKHR-flags-04955]]
4878e5c31af7Sopenharmony_ci    If any geometry includes
4879e5c31af7Sopenharmony_ci    sname:VkAccelerationStructureGeometryMotionTrianglesDataNV then
4880e5c31af7Sopenharmony_ci    pname:flags must: contain
4881e5c31af7Sopenharmony_ci    ename:VK_ACCELERATION_STRUCTURE_CREATE_MOTION_BIT_NV
4882e5c31af7Sopenharmony_ciendif::VK_NV_ray_tracing_motion_blur[]
4883e5c31af7Sopenharmony_ci****
4884e5c31af7Sopenharmony_ci
4885e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkAccelerationStructureCreateInfoKHR.txt[]
4886e5c31af7Sopenharmony_ci--
4887e5c31af7Sopenharmony_ci
4888e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing_motion_blur[]
4889e5c31af7Sopenharmony_ci[open,refpage='VkAccelerationStructureMotionInfoNV',desc='Structure specifying the parameters of a newly created acceleration structure object',type='structs']
4890e5c31af7Sopenharmony_ci--
4891e5c31af7Sopenharmony_ci:refpage: VkAccelerationStructureMotionInfoNV
4892e5c31af7Sopenharmony_ci
4893e5c31af7Sopenharmony_ciThe sname:VkAccelerationStructureMotionInfoNV structure is defined as:
4894e5c31af7Sopenharmony_ci
4895e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkAccelerationStructureMotionInfoNV.txt[]
4896e5c31af7Sopenharmony_ci
4897e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure.
4898e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
4899e5c31af7Sopenharmony_ci    structure.
4900e5c31af7Sopenharmony_ci  * pname:maxInstances is the maximum number of instances that may: be used
4901e5c31af7Sopenharmony_ci    in the motion top-level acceleration structure.
4902e5c31af7Sopenharmony_ci  * pname:flags is 0 and reserved for future use.
4903e5c31af7Sopenharmony_ci
4904e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkAccelerationStructureMotionInfoNV.txt[]
4905e5c31af7Sopenharmony_ci--
4906e5c31af7Sopenharmony_ci
4907e5c31af7Sopenharmony_ci[open,refpage='VkAccelerationStructureMotionInfoFlagsNV',desc='Reserved for future use',type='flags']
4908e5c31af7Sopenharmony_ci--
4909e5c31af7Sopenharmony_ciinclude::{generated}/api/flags/VkAccelerationStructureMotionInfoFlagsNV.txt[]
4910e5c31af7Sopenharmony_ci
4911e5c31af7Sopenharmony_citname:VkAccelerationStructureMotionInfoFlagsNV is a bitmask type for setting
4912e5c31af7Sopenharmony_cia mask, but is currently reserved for future use.
4913e5c31af7Sopenharmony_ci--
4914e5c31af7Sopenharmony_ciendif::VK_NV_ray_tracing_motion_blur[]
4915e5c31af7Sopenharmony_ci
4916e5c31af7Sopenharmony_ci[open,refpage='vkGetAccelerationStructureBuildSizesKHR',desc='Retrieve the required size for an acceleration structure',type='protos']
4917e5c31af7Sopenharmony_ci--
4918e5c31af7Sopenharmony_ci:refpage: vkGetAccelerationStructureBuildSizesKHR
4919e5c31af7Sopenharmony_ci
4920e5c31af7Sopenharmony_ciTo get the build sizes for an acceleration structure, call:
4921e5c31af7Sopenharmony_ci
4922e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkGetAccelerationStructureBuildSizesKHR.txt[]
4923e5c31af7Sopenharmony_ci
4924e5c31af7Sopenharmony_ci  * pname:device is the logical device that will be used for creating the
4925e5c31af7Sopenharmony_ci    acceleration structure.
4926e5c31af7Sopenharmony_ci  * pname:buildType defines whether host or device operations (or both) are
4927e5c31af7Sopenharmony_ci    being queried for.
4928e5c31af7Sopenharmony_ci  * pname:pBuildInfo is a pointer to a
4929e5c31af7Sopenharmony_ci    slink:VkAccelerationStructureBuildGeometryInfoKHR structure describing
4930e5c31af7Sopenharmony_ci    parameters of a build operation.
4931e5c31af7Sopenharmony_ci  * pname:pMaxPrimitiveCounts is a pointer to an array of
4932e5c31af7Sopenharmony_ci    pname:pBuildInfo->geometryCount code:uint32_t values defining the number
4933e5c31af7Sopenharmony_ci    of primitives built into each geometry.
4934e5c31af7Sopenharmony_ci  * pname:pSizeInfo is a pointer to a
4935e5c31af7Sopenharmony_ci    slink:VkAccelerationStructureBuildSizesInfoKHR structure which returns
4936e5c31af7Sopenharmony_ci    the size required for an acceleration structure and the sizes required
4937e5c31af7Sopenharmony_ci    for the scratch buffers, given the build parameters.
4938e5c31af7Sopenharmony_ci
4939e5c31af7Sopenharmony_ciThe pname:srcAccelerationStructure, pname:dstAccelerationStructure, and
4940e5c31af7Sopenharmony_cipname:mode members of pname:pBuildInfo are ignored.
4941e5c31af7Sopenharmony_ciAny slink:VkDeviceOrHostAddressKHR members of pname:pBuildInfo are ignored
4942e5c31af7Sopenharmony_ciby this command, except that the pname:hostAddress member of
4943e5c31af7Sopenharmony_cislink:VkAccelerationStructureGeometryTrianglesDataKHR::pname:transformData
4944e5c31af7Sopenharmony_ciwill be examined to check if it is `NULL`.
4945e5c31af7Sopenharmony_ci
4946e5c31af7Sopenharmony_ciAn acceleration structure created with the pname:accelerationStructureSize
4947e5c31af7Sopenharmony_cireturned by this command supports any build or update with a
4948e5c31af7Sopenharmony_cislink:VkAccelerationStructureBuildGeometryInfoKHR structure and array of
4949e5c31af7Sopenharmony_cislink:VkAccelerationStructureBuildRangeInfoKHR structures subject to the
4950e5c31af7Sopenharmony_cifollowing properties:
4951e5c31af7Sopenharmony_ci
4952e5c31af7Sopenharmony_ci  * The build command is a host build command, and pname:buildType is
4953e5c31af7Sopenharmony_ci    ename:VK_ACCELERATION_STRUCTURE_BUILD_TYPE_HOST_KHR or
4954e5c31af7Sopenharmony_ci    ename:VK_ACCELERATION_STRUCTURE_BUILD_TYPE_HOST_OR_DEVICE_KHR
4955e5c31af7Sopenharmony_ci  * The build command is a device build command, and pname:buildType is
4956e5c31af7Sopenharmony_ci    ename:VK_ACCELERATION_STRUCTURE_BUILD_TYPE_DEVICE_KHR or
4957e5c31af7Sopenharmony_ci    ename:VK_ACCELERATION_STRUCTURE_BUILD_TYPE_HOST_OR_DEVICE_KHR
4958e5c31af7Sopenharmony_ci  * For slink:VkAccelerationStructureBuildGeometryInfoKHR:
4959e5c31af7Sopenharmony_ci  ** Its pname:type, and pname:flags members are equal to
4960e5c31af7Sopenharmony_ci     pname:pBuildInfo->type andm pname:pBuildInfo->flags, respectively.
4961e5c31af7Sopenharmony_ci  ** pname:geometryCount is less than or equal to
4962e5c31af7Sopenharmony_ci     pname:pBuildInfo->geometryCount.
4963e5c31af7Sopenharmony_ci  ** For each element of either pname:pGeometries or pname:ppGeometries at a
4964e5c31af7Sopenharmony_ci     given index, its pname:geometryType member is equal to
4965e5c31af7Sopenharmony_ci     pname:pBuildInfo->geometryType.
4966e5c31af7Sopenharmony_ci  ** For each element of either pname:pGeometries or pname:ppGeometries at a
4967e5c31af7Sopenharmony_ci     given index, with a pname:geometryType member equal to
4968e5c31af7Sopenharmony_ci     ename:VK_GEOMETRY_TYPE_TRIANGLES_KHR, the pname:vertexFormat and
4969e5c31af7Sopenharmony_ci     pname:indexType members of pname:geometry.triangles are equal to the
4970e5c31af7Sopenharmony_ci     corresponding members of the same element in pname:pBuildInfo.
4971e5c31af7Sopenharmony_ci  ** For each element of either pname:pGeometries or pname:ppGeometries at a
4972e5c31af7Sopenharmony_ci     given index, with a pname:geometryType member equal to
4973e5c31af7Sopenharmony_ci     ename:VK_GEOMETRY_TYPE_TRIANGLES_KHR, the pname:maxVertex member of
4974e5c31af7Sopenharmony_ci     pname:geometry.triangles is less than or equal to the corresponding
4975e5c31af7Sopenharmony_ci     member of the same element in pname:pBuildInfo.
4976e5c31af7Sopenharmony_ci  ** For each element of either pname:pGeometries or pname:ppGeometries at a
4977e5c31af7Sopenharmony_ci     given index, with a pname:geometryType member equal to
4978e5c31af7Sopenharmony_ci     ename:VK_GEOMETRY_TYPE_TRIANGLES_KHR, if the applicable address in the
4979e5c31af7Sopenharmony_ci     pname:transformData member of pname:geometry.triangles is not `NULL`,
4980e5c31af7Sopenharmony_ci     the corresponding pname:transformData.hostAddress parameter in
4981e5c31af7Sopenharmony_ci     pname:pBuildInfo is not `NULL`.
4982e5c31af7Sopenharmony_ci  * For each slink:VkAccelerationStructureBuildRangeInfoKHR corresponding to
4983e5c31af7Sopenharmony_ci    the slink:VkAccelerationStructureBuildGeometryInfoKHR:
4984e5c31af7Sopenharmony_ci  ** Its pname:primitiveCount member is less than or equal to the
4985e5c31af7Sopenharmony_ci     corresponding element of pname:pMaxPrimitiveCounts.
4986e5c31af7Sopenharmony_ci
4987e5c31af7Sopenharmony_ciSimilarly, the pname:updateScratchSize value will support any build command
4988e5c31af7Sopenharmony_cispecifying the ename:VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR
4989e5c31af7Sopenharmony_cipname:mode under the above conditions, and the pname:buildScratchSize value
4990e5c31af7Sopenharmony_ciwill support any build command specifying the
4991e5c31af7Sopenharmony_ciename:VK_BUILD_ACCELERATION_STRUCTURE_MODE_BUILD_KHR pname:mode under the
4992e5c31af7Sopenharmony_ciabove conditions.
4993e5c31af7Sopenharmony_ci
4994e5c31af7Sopenharmony_ci.Valid Usage
4995e5c31af7Sopenharmony_ci****
4996e5c31af7Sopenharmony_ci  * [[VUID-vkGetAccelerationStructureBuildSizesKHR-rayTracingPipeline-03617]]
4997e5c31af7Sopenharmony_ci    The <<features-rayTracingPipeline, pname:rayTracingPipeline>> or
4998e5c31af7Sopenharmony_ci    <<features-rayQuery, pname:rayQuery>> feature must: be enabled
4999e5c31af7Sopenharmony_ci  * [[VUID-vkGetAccelerationStructureBuildSizesKHR-device-03618]]
5000e5c31af7Sopenharmony_ci    If pname:device was created with multiple physical devices, then the
5001e5c31af7Sopenharmony_ci    <<features-bufferDeviceAddressMultiDevice,bufferDeviceAddressMultiDevice>>
5002e5c31af7Sopenharmony_ci    feature must: be enabled
5003e5c31af7Sopenharmony_ci  * [[VUID-vkGetAccelerationStructureBuildSizesKHR-pBuildInfo-03619]]
5004e5c31af7Sopenharmony_ci    If pname:pBuildInfo->geometryCount is not `0`, pname:pMaxPrimitiveCounts
5005e5c31af7Sopenharmony_ci    must: be a valid pointer to an array of pname:pBuildInfo->geometryCount
5006e5c31af7Sopenharmony_ci    code:uint32_t values
5007e5c31af7Sopenharmony_ci  * [[VUID-vkGetAccelerationStructureBuildSizesKHR-pBuildInfo-03785]]
5008e5c31af7Sopenharmony_ci    If pname:pBuildInfo->pGeometries or pname:pBuildInfo->ppGeometries has a
5009e5c31af7Sopenharmony_ci    pname:geometryType of ename:VK_GEOMETRY_TYPE_INSTANCES_KHR, each
5010e5c31af7Sopenharmony_ci    pname:pMaxPrimitiveCounts[i] must: be less than or equal to
5011e5c31af7Sopenharmony_ci    slink:VkPhysicalDeviceAccelerationStructurePropertiesKHR::pname:maxInstanceCount
5012e5c31af7Sopenharmony_ci****
5013e5c31af7Sopenharmony_ci
5014e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkGetAccelerationStructureBuildSizesKHR.txt[]
5015e5c31af7Sopenharmony_ci--
5016e5c31af7Sopenharmony_ci
5017e5c31af7Sopenharmony_ci[open,refpage='VkAccelerationStructureBuildSizesInfoKHR',desc='Structure specifying build sizes for an acceleration structure',type='structs']
5018e5c31af7Sopenharmony_ci--
5019e5c31af7Sopenharmony_ci:refpage: VkAccelerationStructureBuildSizesInfoKHR
5020e5c31af7Sopenharmony_ci
5021e5c31af7Sopenharmony_ciThe sname:VkAccelerationStructureBuildSizesInfoKHR structure describes the
5022e5c31af7Sopenharmony_cirequired build sizes for an acceleration structure and scratch buffers and
5023e5c31af7Sopenharmony_ciis defined as:
5024e5c31af7Sopenharmony_ci
5025e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkAccelerationStructureBuildSizesInfoKHR.txt[]
5026e5c31af7Sopenharmony_ci
5027e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure.
5028e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
5029e5c31af7Sopenharmony_ci    structure.
5030e5c31af7Sopenharmony_ci  * pname:accelerationStructureSize is the size in bytes required in a
5031e5c31af7Sopenharmony_ci    slink:VkAccelerationStructureKHR for a build or update operation.
5032e5c31af7Sopenharmony_ci  * pname:updateScratchSize is the size in bytes required in a scratch
5033e5c31af7Sopenharmony_ci    buffer for an update operation.
5034e5c31af7Sopenharmony_ci  * pname:buildScratchSize is the size in bytes required in a scratch buffer
5035e5c31af7Sopenharmony_ci    for a build operation.
5036e5c31af7Sopenharmony_ci
5037e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkAccelerationStructureBuildSizesInfoKHR.txt[]
5038e5c31af7Sopenharmony_ci--
5039e5c31af7Sopenharmony_ciendif::VK_KHR_acceleration_structure[]
5040e5c31af7Sopenharmony_ci
5041e5c31af7Sopenharmony_ci[open,refpage='VkAccelerationStructureTypeKHR',desc='Type of acceleration structure',type='enums',alias='VkAccelerationStructureTypeNV']
5042e5c31af7Sopenharmony_ci--
5043e5c31af7Sopenharmony_ci:refpage: VkAccelerationStructureTypeKHR
5044e5c31af7Sopenharmony_ci
5045e5c31af7Sopenharmony_ciValues which can: be set in
5046e5c31af7Sopenharmony_ciifdef::VK_KHR_acceleration_structure[]
5047e5c31af7Sopenharmony_cislink:VkAccelerationStructureCreateInfoKHR::pname:type
5048e5c31af7Sopenharmony_ciendif::VK_KHR_acceleration_structure[]
5049e5c31af7Sopenharmony_ciifdef::VK_KHR_acceleration_structure+VK_NV_ray_tracing[or]
5050e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing[]
5051e5c31af7Sopenharmony_cislink:VkAccelerationStructureInfoNV::pname:type
5052e5c31af7Sopenharmony_ciendif::VK_NV_ray_tracing[]
5053e5c31af7Sopenharmony_cispecifying the type of acceleration structure, are:
5054e5c31af7Sopenharmony_ci
5055e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkAccelerationStructureTypeKHR.txt[]
5056e5c31af7Sopenharmony_ci
5057e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing[]
5058e5c31af7Sopenharmony_cior the equivalent
5059e5c31af7Sopenharmony_ci
5060e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkAccelerationStructureTypeNV.txt[]
5061e5c31af7Sopenharmony_ciendif::VK_NV_ray_tracing[]
5062e5c31af7Sopenharmony_ci
5063e5c31af7Sopenharmony_ci  * ename:VK_ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR is a top-level
5064e5c31af7Sopenharmony_ci    acceleration structure containing instance data referring to
5065e5c31af7Sopenharmony_ci    bottom-level acceleration structures.
5066e5c31af7Sopenharmony_ci  * ename:VK_ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR is a bottom-level
5067e5c31af7Sopenharmony_ci    acceleration structure containing the AABBs or geometry to be
5068e5c31af7Sopenharmony_ci    intersected.
5069e5c31af7Sopenharmony_ci  * ename:VK_ACCELERATION_STRUCTURE_TYPE_GENERIC_KHR is an acceleration
5070e5c31af7Sopenharmony_ci    structure whose type is determined at build time used for special
5071e5c31af7Sopenharmony_ci    circumstances.
5072e5c31af7Sopenharmony_ci--
5073e5c31af7Sopenharmony_ci
5074e5c31af7Sopenharmony_ciifdef::VK_KHR_acceleration_structure[]
5075e5c31af7Sopenharmony_ci[open,refpage='VkAccelerationStructureCreateFlagBitsKHR',desc='Bitmask specifying additional creation parameters for acceleration structure',type='enums']
5076e5c31af7Sopenharmony_ci--
5077e5c31af7Sopenharmony_ciBits which can: be set in
5078e5c31af7Sopenharmony_cislink:VkAccelerationStructureCreateInfoKHR::pname:createFlags specifying
5079e5c31af7Sopenharmony_ciadditional creation parameters for acceleration structures, are:
5080e5c31af7Sopenharmony_ci
5081e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkAccelerationStructureCreateFlagBitsKHR.txt[]
5082e5c31af7Sopenharmony_ci
5083e5c31af7Sopenharmony_ci  * ename:VK_ACCELERATION_STRUCTURE_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_KHR
5084e5c31af7Sopenharmony_ci    specifies that the acceleration structure's address can: be saved and
5085e5c31af7Sopenharmony_ci    reused on a subsequent run.
5086e5c31af7Sopenharmony_ci--
5087e5c31af7Sopenharmony_ci
5088e5c31af7Sopenharmony_ci[open,refpage='VkAccelerationStructureCreateFlagsKHR',desc='Bitmask of VkAccelerationStructureCreateFlagBitsKHR',type='flags']
5089e5c31af7Sopenharmony_ci--
5090e5c31af7Sopenharmony_ciinclude::{generated}/api/flags/VkAccelerationStructureCreateFlagsKHR.txt[]
5091e5c31af7Sopenharmony_ci
5092e5c31af7Sopenharmony_citname:VkAccelerationStructureCreateFlagsKHR is a bitmask type for setting a
5093e5c31af7Sopenharmony_cimask of zero or more elink:VkAccelerationStructureCreateFlagBitsKHR.
5094e5c31af7Sopenharmony_ci--
5095e5c31af7Sopenharmony_ciendif::VK_KHR_acceleration_structure[]
5096e5c31af7Sopenharmony_ci
5097e5c31af7Sopenharmony_ci[open,refpage='VkBuildAccelerationStructureFlagBitsKHR',desc='Bitmask specifying additional parameters for acceleration structure builds',type='enums',alias='VkBuildAccelerationStructureFlagBitsNV']
5098e5c31af7Sopenharmony_ci--
5099e5c31af7Sopenharmony_ci:refpage: VkBuildAccelerationStructureFlagBitsKHR
5100e5c31af7Sopenharmony_ci
5101e5c31af7Sopenharmony_ciBits which can: be set in
5102e5c31af7Sopenharmony_ciifdef::VK_KHR_acceleration_structure[]
5103e5c31af7Sopenharmony_cislink:VkAccelerationStructureBuildGeometryInfoKHR::pname:flags
5104e5c31af7Sopenharmony_ciendif::VK_KHR_acceleration_structure[]
5105e5c31af7Sopenharmony_ciifdef::VK_KHR_acceleration_structure+VK_NV_ray_tracing[or]
5106e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing[]
5107e5c31af7Sopenharmony_cislink:VkAccelerationStructureInfoNV::pname:flags
5108e5c31af7Sopenharmony_ciendif::VK_NV_ray_tracing[]
5109e5c31af7Sopenharmony_cispecifying additional parameters for acceleration structure builds, are:
5110e5c31af7Sopenharmony_ci
5111e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkBuildAccelerationStructureFlagBitsKHR.txt[]
5112e5c31af7Sopenharmony_ci
5113e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing[]
5114e5c31af7Sopenharmony_cior the equivalent
5115e5c31af7Sopenharmony_ci
5116e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkBuildAccelerationStructureFlagBitsNV.txt[]
5117e5c31af7Sopenharmony_ciendif::VK_NV_ray_tracing[]
5118e5c31af7Sopenharmony_ci
5119e5c31af7Sopenharmony_ci  * ename:VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_UPDATE_BIT_KHR indicates
5120e5c31af7Sopenharmony_ci    that the specified acceleration structure can: be updated with
5121e5c31af7Sopenharmony_ciifdef::VK_KHR_acceleration_structure[]
5122e5c31af7Sopenharmony_ci    a pname:mode of ename:VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR in
5123e5c31af7Sopenharmony_ci    slink:VkAccelerationStructureBuildGeometryInfoKHR
5124e5c31af7Sopenharmony_ciendif::VK_KHR_acceleration_structure[]
5125e5c31af7Sopenharmony_ciifdef::VK_KHR_acceleration_structure+VK_NV_ray_tracing[or]
5126e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing[]
5127e5c31af7Sopenharmony_ci    an pname:update of ename:VK_TRUE in
5128e5c31af7Sopenharmony_ci    flink:vkCmdBuildAccelerationStructureNV
5129e5c31af7Sopenharmony_ciendif::VK_NV_ray_tracing[]
5130e5c31af7Sopenharmony_ci    .
5131e5c31af7Sopenharmony_ci  * ename:VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_COMPACTION_BIT_KHR indicates
5132e5c31af7Sopenharmony_ci    that the specified acceleration structure can: act as the source for a
5133e5c31af7Sopenharmony_ci    copy acceleration structure command with pname:mode of
5134e5c31af7Sopenharmony_ci    ename:VK_COPY_ACCELERATION_STRUCTURE_MODE_COMPACT_KHR to produce a
5135e5c31af7Sopenharmony_ci    compacted acceleration structure.
5136e5c31af7Sopenharmony_ci  * ename:VK_BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_TRACE_BIT_KHR
5137e5c31af7Sopenharmony_ci    indicates that the given acceleration structure build should: prioritize
5138e5c31af7Sopenharmony_ci    trace performance over build time.
5139e5c31af7Sopenharmony_ci  * ename:VK_BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_BUILD_BIT_KHR
5140e5c31af7Sopenharmony_ci    indicates that the given acceleration structure build should: prioritize
5141e5c31af7Sopenharmony_ci    build time over trace performance.
5142e5c31af7Sopenharmony_ci  * ename:VK_BUILD_ACCELERATION_STRUCTURE_LOW_MEMORY_BIT_KHR indicates that
5143e5c31af7Sopenharmony_ci    this acceleration structure should: minimize the size of the scratch
5144e5c31af7Sopenharmony_ci    memory and the final result acceleration structure, potentially at the
5145e5c31af7Sopenharmony_ci    expense of build time or trace performance.
5146e5c31af7Sopenharmony_ci
5147e5c31af7Sopenharmony_ci[NOTE]
5148e5c31af7Sopenharmony_ci.Note
5149e5c31af7Sopenharmony_ci====
5150e5c31af7Sopenharmony_ciename:VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_UPDATE_BIT_KHR and
5151e5c31af7Sopenharmony_ciename:VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_COMPACTION_BIT_KHR may: take
5152e5c31af7Sopenharmony_cimore time and memory than a normal build, and so should: only be used when
5153e5c31af7Sopenharmony_cithose features are needed.
5154e5c31af7Sopenharmony_ci====
5155e5c31af7Sopenharmony_ci--
5156e5c31af7Sopenharmony_ci
5157e5c31af7Sopenharmony_ci[open,refpage='VkBuildAccelerationStructureFlagsKHR',desc='Bitmask of VkBuildAccelerationStructureFlagBitsKHR',type='flags',alias='VkBuildAccelerationStructureFlagsNV']
5158e5c31af7Sopenharmony_ci--
5159e5c31af7Sopenharmony_ci:refpage: VkBuildAccelerationStructureFlagsKHR
5160e5c31af7Sopenharmony_ci
5161e5c31af7Sopenharmony_ciinclude::{generated}/api/flags/VkBuildAccelerationStructureFlagsKHR.txt[]
5162e5c31af7Sopenharmony_ci
5163e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing[]
5164e5c31af7Sopenharmony_cior the equivalent
5165e5c31af7Sopenharmony_ci
5166e5c31af7Sopenharmony_ciinclude::{generated}/api/flags/VkBuildAccelerationStructureFlagsNV.txt[]
5167e5c31af7Sopenharmony_ciendif::VK_NV_ray_tracing[]
5168e5c31af7Sopenharmony_ci
5169e5c31af7Sopenharmony_citname:VkBuildAccelerationStructureFlagsKHR is a bitmask type for setting a
5170e5c31af7Sopenharmony_cimask of zero or more elink:VkBuildAccelerationStructureFlagBitsKHR.
5171e5c31af7Sopenharmony_ci--
5172e5c31af7Sopenharmony_ci
5173e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing[]
5174e5c31af7Sopenharmony_ci[open,refpage='VkGeometryNV',desc='Structure specifying a geometry in a bottom-level acceleration structure',type='structs']
5175e5c31af7Sopenharmony_ci--
5176e5c31af7Sopenharmony_ci:refpage: VkGeometryNV
5177e5c31af7Sopenharmony_ci
5178e5c31af7Sopenharmony_ciThe sname:VkGeometryNV structure describes geometry in a bottom-level
5179e5c31af7Sopenharmony_ciacceleration structure and is defined as:
5180e5c31af7Sopenharmony_ci
5181e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkGeometryNV.txt[]
5182e5c31af7Sopenharmony_ci
5183e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure.
5184e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
5185e5c31af7Sopenharmony_ci    structure.
5186e5c31af7Sopenharmony_ci  * pname:geometryType specifies the elink:VkGeometryTypeKHR which this
5187e5c31af7Sopenharmony_ci    geometry refers to.
5188e5c31af7Sopenharmony_ci  * pname:geometry contains the geometry data as described in
5189e5c31af7Sopenharmony_ci    slink:VkGeometryDataNV.
5190e5c31af7Sopenharmony_ci  * pname:flags has elink:VkGeometryFlagBitsKHR describing options for this
5191e5c31af7Sopenharmony_ci    geometry.
5192e5c31af7Sopenharmony_ci
5193e5c31af7Sopenharmony_ci.Valid Usage
5194e5c31af7Sopenharmony_ci****
5195e5c31af7Sopenharmony_ci  * [[VUID-VkGeometryNV-geometryType-03503]]
5196e5c31af7Sopenharmony_ci    pname:geometryType must: be ename:VK_GEOMETRY_TYPE_TRIANGLES_NV or
5197e5c31af7Sopenharmony_ci    ename:VK_GEOMETRY_TYPE_AABBS_NV
5198e5c31af7Sopenharmony_ci****
5199e5c31af7Sopenharmony_ci
5200e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkGeometryNV.txt[]
5201e5c31af7Sopenharmony_ci--
5202e5c31af7Sopenharmony_ciendif::VK_NV_ray_tracing[]
5203e5c31af7Sopenharmony_ci
5204e5c31af7Sopenharmony_ci[open,refpage='VkGeometryTypeKHR',desc='Enum specifying which type of geometry is provided',type='enums',alias='VkGeometryTypeNV']
5205e5c31af7Sopenharmony_ci--
5206e5c31af7Sopenharmony_ci:refpage: VkGeometryTypeKHR
5207e5c31af7Sopenharmony_ci
5208e5c31af7Sopenharmony_ciGeometry types are specified by elink:VkGeometryTypeKHR, which takes values:
5209e5c31af7Sopenharmony_ci
5210e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkGeometryTypeKHR.txt[]
5211e5c31af7Sopenharmony_ci
5212e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing[]
5213e5c31af7Sopenharmony_cior the equivalent
5214e5c31af7Sopenharmony_ci
5215e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkGeometryTypeNV.txt[]
5216e5c31af7Sopenharmony_ciendif::VK_NV_ray_tracing[]
5217e5c31af7Sopenharmony_ci
5218e5c31af7Sopenharmony_ci  * ename:VK_GEOMETRY_TYPE_TRIANGLES_KHR specifies a geometry type
5219e5c31af7Sopenharmony_ci    consisting of triangles.
5220e5c31af7Sopenharmony_ci  * ename:VK_GEOMETRY_TYPE_AABBS_KHR specifies a geometry type consisting of
5221e5c31af7Sopenharmony_ci    axis-aligned bounding boxes.
5222e5c31af7Sopenharmony_ciifdef::VK_KHR_acceleration_structure[]
5223e5c31af7Sopenharmony_ci  * ename:VK_GEOMETRY_TYPE_INSTANCES_KHR specifies a geometry type
5224e5c31af7Sopenharmony_ci    consisting of acceleration structure instances.
5225e5c31af7Sopenharmony_ciendif::VK_KHR_acceleration_structure[]
5226e5c31af7Sopenharmony_ci--
5227e5c31af7Sopenharmony_ci
5228e5c31af7Sopenharmony_ci[open,refpage='VkGeometryFlagBitsKHR',desc='Bitmask specifying additional parameters for a geometry',type='enums',alias='VkGeometryFlagBitsNV']
5229e5c31af7Sopenharmony_ci--
5230e5c31af7Sopenharmony_ci:refpage: VkGeometryFlagBitsKHR
5231e5c31af7Sopenharmony_ci
5232e5c31af7Sopenharmony_ciBits specifying additional parameters for geometries in acceleration
5233e5c31af7Sopenharmony_cistructure builds, are:
5234e5c31af7Sopenharmony_ci
5235e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkGeometryFlagBitsKHR.txt[]
5236e5c31af7Sopenharmony_ci
5237e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing[]
5238e5c31af7Sopenharmony_cior the equivalent
5239e5c31af7Sopenharmony_ci
5240e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkGeometryFlagBitsNV.txt[]
5241e5c31af7Sopenharmony_ciendif::VK_NV_ray_tracing[]
5242e5c31af7Sopenharmony_ci
5243e5c31af7Sopenharmony_ci  * ename:VK_GEOMETRY_OPAQUE_BIT_KHR indicates that this geometry does not
5244e5c31af7Sopenharmony_ci    invoke the any-hit shaders even if present in a hit group.
5245e5c31af7Sopenharmony_ci  * ename:VK_GEOMETRY_NO_DUPLICATE_ANY_HIT_INVOCATION_BIT_KHR indicates that
5246e5c31af7Sopenharmony_ci    the implementation must: only call the any-hit shader a single time for
5247e5c31af7Sopenharmony_ci    each primitive in this geometry.
5248e5c31af7Sopenharmony_ci    If this bit is absent an implementation may: invoke the any-hit shader
5249e5c31af7Sopenharmony_ci    more than once for this geometry.
5250e5c31af7Sopenharmony_ci--
5251e5c31af7Sopenharmony_ci
5252e5c31af7Sopenharmony_ci[open,refpage='VkGeometryFlagsKHR',desc='Bitmask of VkGeometryFlagBitsKHR',type='flags',alias='VkGeometryFlagsNV']
5253e5c31af7Sopenharmony_ci--
5254e5c31af7Sopenharmony_ci:refpage: VkGeometryFlagsKHR
5255e5c31af7Sopenharmony_ci
5256e5c31af7Sopenharmony_ciinclude::{generated}/api/flags/VkGeometryFlagsKHR.txt[]
5257e5c31af7Sopenharmony_ci
5258e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing[]
5259e5c31af7Sopenharmony_cior the equivalent
5260e5c31af7Sopenharmony_ci
5261e5c31af7Sopenharmony_ciinclude::{generated}/api/flags/VkGeometryFlagsNV.txt[]
5262e5c31af7Sopenharmony_ciendif::VK_NV_ray_tracing[]
5263e5c31af7Sopenharmony_ci
5264e5c31af7Sopenharmony_citname:VkGeometryFlagsKHR is a bitmask type for setting a mask of zero or
5265e5c31af7Sopenharmony_cimore elink:VkGeometryFlagBitsKHR.
5266e5c31af7Sopenharmony_ci--
5267e5c31af7Sopenharmony_ci
5268e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing[]
5269e5c31af7Sopenharmony_ci[open,refpage='VkGeometryDataNV',desc='Structure specifying geometry in a bottom-level acceleration structure',type='structs']
5270e5c31af7Sopenharmony_ci--
5271e5c31af7Sopenharmony_ci:refpage: VkGeometryDataNV
5272e5c31af7Sopenharmony_ci
5273e5c31af7Sopenharmony_ciThe sname:VkGeometryDataNV structure specifes geometry in a bottom-level
5274e5c31af7Sopenharmony_ciacceleration structure and is defined as:
5275e5c31af7Sopenharmony_ci
5276e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkGeometryDataNV.txt[]
5277e5c31af7Sopenharmony_ci
5278e5c31af7Sopenharmony_ci  * pname:triangles contains triangle data if
5279e5c31af7Sopenharmony_ci    slink:VkGeometryNV::pname:geometryType is
5280e5c31af7Sopenharmony_ci    ename:VK_GEOMETRY_TYPE_TRIANGLES_NV.
5281e5c31af7Sopenharmony_ci  * pname:aabbs contains axis-aligned bounding box data if
5282e5c31af7Sopenharmony_ci    slink:VkGeometryNV::pname:geometryType is
5283e5c31af7Sopenharmony_ci    ename:VK_GEOMETRY_TYPE_AABBS_NV.
5284e5c31af7Sopenharmony_ci
5285e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkGeometryDataNV.txt[]
5286e5c31af7Sopenharmony_ci--
5287e5c31af7Sopenharmony_ci
5288e5c31af7Sopenharmony_ci[open,refpage='VkGeometryTrianglesNV',desc='Structure specifying a triangle geometry in a bottom-level acceleration structure',type='structs']
5289e5c31af7Sopenharmony_ci--
5290e5c31af7Sopenharmony_ci:refpage: VkGeometryTrianglesNV
5291e5c31af7Sopenharmony_ci
5292e5c31af7Sopenharmony_ciThe sname:VkGeometryTrianglesNV structure specifies triangle geometry in a
5293e5c31af7Sopenharmony_cibottom-level acceleration structure and is defined as:
5294e5c31af7Sopenharmony_ci
5295e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkGeometryTrianglesNV.txt[]
5296e5c31af7Sopenharmony_ci
5297e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure.
5298e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
5299e5c31af7Sopenharmony_ci    structure.
5300e5c31af7Sopenharmony_ci  * pname:vertexData is the buffer containing vertex data for this geometry.
5301e5c31af7Sopenharmony_ci  * pname:vertexOffset is the offset in bytes within pname:vertexData
5302e5c31af7Sopenharmony_ci    containing vertex data for this geometry.
5303e5c31af7Sopenharmony_ci  * pname:vertexCount is the number of valid vertices.
5304e5c31af7Sopenharmony_ci  * pname:vertexStride is the stride in bytes between each vertex.
5305e5c31af7Sopenharmony_ci  * pname:vertexFormat is a elink:VkFormat describing the format of each
5306e5c31af7Sopenharmony_ci    vertex element.
5307e5c31af7Sopenharmony_ci  * pname:indexData is the buffer containing index data for this geometry.
5308e5c31af7Sopenharmony_ci  * pname:indexOffset is the offset in bytes within pname:indexData
5309e5c31af7Sopenharmony_ci    containing index data for this geometry.
5310e5c31af7Sopenharmony_ci  * pname:indexCount is the number of indices to include in this geometry.
5311e5c31af7Sopenharmony_ci  * pname:indexType is a elink:VkIndexType describing the format of each
5312e5c31af7Sopenharmony_ci    index.
5313e5c31af7Sopenharmony_ci  * pname:transformData is an optional buffer containing an
5314e5c31af7Sopenharmony_ci    slink:VkTransformMatrixNV structure defining a transformation to be
5315e5c31af7Sopenharmony_ci    applied to this geometry.
5316e5c31af7Sopenharmony_ci  * pname:transformOffset is the offset in bytes in pname:transformData of
5317e5c31af7Sopenharmony_ci    the transform information described above.
5318e5c31af7Sopenharmony_ci
5319e5c31af7Sopenharmony_ciIf pname:indexType is ename:VK_INDEX_TYPE_NONE_NV, then this structure
5320e5c31af7Sopenharmony_cidescribes a set of triangles determined by pname:vertexCount.
5321e5c31af7Sopenharmony_ciOtherwise, this structure describes a set of indexed triangles determined by
5322e5c31af7Sopenharmony_cipname:indexCount.
5323e5c31af7Sopenharmony_ci
5324e5c31af7Sopenharmony_ci.Valid Usage
5325e5c31af7Sopenharmony_ci****
5326e5c31af7Sopenharmony_ci  * [[VUID-VkGeometryTrianglesNV-vertexOffset-02428]]
5327e5c31af7Sopenharmony_ci    pname:vertexOffset must: be less than the size of pname:vertexData
5328e5c31af7Sopenharmony_ci  * [[VUID-VkGeometryTrianglesNV-vertexOffset-02429]]
5329e5c31af7Sopenharmony_ci    pname:vertexOffset must: be a multiple of the component size of
5330e5c31af7Sopenharmony_ci    pname:vertexFormat
5331e5c31af7Sopenharmony_ci  * [[VUID-VkGeometryTrianglesNV-vertexFormat-02430]]
5332e5c31af7Sopenharmony_ci    pname:vertexFormat must: be one of ename:VK_FORMAT_R32G32B32_SFLOAT,
5333e5c31af7Sopenharmony_ci    ename:VK_FORMAT_R32G32_SFLOAT, ename:VK_FORMAT_R16G16B16_SFLOAT,
5334e5c31af7Sopenharmony_ci    ename:VK_FORMAT_R16G16_SFLOAT, ename:VK_FORMAT_R16G16_SNORM, or
5335e5c31af7Sopenharmony_ci    ename:VK_FORMAT_R16G16B16_SNORM
5336e5c31af7Sopenharmony_ci  * [[VUID-VkGeometryTrianglesNV-vertexStride-03818]]
5337e5c31af7Sopenharmony_ci    pname:vertexStride must: be less than or equal to [eq]#2^32^-1#
5338e5c31af7Sopenharmony_ci  * [[VUID-VkGeometryTrianglesNV-indexOffset-02431]]
5339e5c31af7Sopenharmony_ci    pname:indexOffset must: be less than the size of pname:indexData
5340e5c31af7Sopenharmony_ci  * [[VUID-VkGeometryTrianglesNV-indexOffset-02432]]
5341e5c31af7Sopenharmony_ci    pname:indexOffset must: be a multiple of the element size of
5342e5c31af7Sopenharmony_ci    pname:indexType
5343e5c31af7Sopenharmony_ci  * [[VUID-VkGeometryTrianglesNV-indexType-02433]]
5344e5c31af7Sopenharmony_ci    pname:indexType must: be ename:VK_INDEX_TYPE_UINT16,
5345e5c31af7Sopenharmony_ci    ename:VK_INDEX_TYPE_UINT32, or ename:VK_INDEX_TYPE_NONE_NV
5346e5c31af7Sopenharmony_ci  * [[VUID-VkGeometryTrianglesNV-indexData-02434]]
5347e5c31af7Sopenharmony_ci    pname:indexData must: be dlink:VK_NULL_HANDLE if pname:indexType is
5348e5c31af7Sopenharmony_ci    ename:VK_INDEX_TYPE_NONE_NV
5349e5c31af7Sopenharmony_ci  * [[VUID-VkGeometryTrianglesNV-indexData-02435]]
5350e5c31af7Sopenharmony_ci    pname:indexData must: be a valid sname:VkBuffer handle if
5351e5c31af7Sopenharmony_ci    pname:indexType is not ename:VK_INDEX_TYPE_NONE_NV
5352e5c31af7Sopenharmony_ci  * [[VUID-VkGeometryTrianglesNV-indexCount-02436]]
5353e5c31af7Sopenharmony_ci    pname:indexCount must: be `0` if pname:indexType is
5354e5c31af7Sopenharmony_ci    ename:VK_INDEX_TYPE_NONE_NV
5355e5c31af7Sopenharmony_ci  * [[VUID-VkGeometryTrianglesNV-transformOffset-02437]]
5356e5c31af7Sopenharmony_ci    pname:transformOffset must: be less than the size of pname:transformData
5357e5c31af7Sopenharmony_ci  * [[VUID-VkGeometryTrianglesNV-transformOffset-02438]]
5358e5c31af7Sopenharmony_ci    pname:transformOffset must: be a multiple of `16`
5359e5c31af7Sopenharmony_ci****
5360e5c31af7Sopenharmony_ci
5361e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkGeometryTrianglesNV.txt[]
5362e5c31af7Sopenharmony_ci--
5363e5c31af7Sopenharmony_ci
5364e5c31af7Sopenharmony_ci[open,refpage='VkGeometryAABBNV',desc='Structure specifying axis-aligned bounding box geometry in a bottom-level acceleration structure',type='structs']
5365e5c31af7Sopenharmony_ci--
5366e5c31af7Sopenharmony_ci:refpage: VkGeometryAABBNV
5367e5c31af7Sopenharmony_ci
5368e5c31af7Sopenharmony_ciThe sname:VkGeometryAABBNV structure specifies axis-aligned bounding box
5369e5c31af7Sopenharmony_cigeometry in a bottom-level acceleration structure, and is defined as:
5370e5c31af7Sopenharmony_ci
5371e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkGeometryAABBNV.txt[]
5372e5c31af7Sopenharmony_ci
5373e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure.
5374e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
5375e5c31af7Sopenharmony_ci    structure.
5376e5c31af7Sopenharmony_ci  * pname:aabbData is the buffer containing axis-aligned bounding box data.
5377e5c31af7Sopenharmony_ci  * pname:numAABBs is the number of AABBs in this geometry.
5378e5c31af7Sopenharmony_ci  * pname:stride is the stride in bytes between AABBs in pname:aabbData.
5379e5c31af7Sopenharmony_ci  * pname:offset is the offset in bytes of the first AABB in pname:aabbData.
5380e5c31af7Sopenharmony_ci
5381e5c31af7Sopenharmony_ciThe AABB data in memory is six 32-bit floats consisting of the minimum x, y,
5382e5c31af7Sopenharmony_ciand z values followed by the maximum x, y, and z values.
5383e5c31af7Sopenharmony_ci
5384e5c31af7Sopenharmony_ci.Valid Usage
5385e5c31af7Sopenharmony_ci****
5386e5c31af7Sopenharmony_ci  * [[VUID-VkGeometryAABBNV-offset-02439]]
5387e5c31af7Sopenharmony_ci    pname:offset must: be less than the size of pname:aabbData
5388e5c31af7Sopenharmony_ci  * [[VUID-VkGeometryAABBNV-offset-02440]]
5389e5c31af7Sopenharmony_ci    pname:offset must: be a multiple of `8`
5390e5c31af7Sopenharmony_ci  * [[VUID-VkGeometryAABBNV-stride-02441]]
5391e5c31af7Sopenharmony_ci    pname:stride must: be a multiple of `8`
5392e5c31af7Sopenharmony_ci****
5393e5c31af7Sopenharmony_ci
5394e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkGeometryAABBNV.txt[]
5395e5c31af7Sopenharmony_ci--
5396e5c31af7Sopenharmony_ciendif::VK_NV_ray_tracing[]
5397e5c31af7Sopenharmony_ci
5398e5c31af7Sopenharmony_ci[open,refpage='vkDestroyAccelerationStructureKHR',desc='Destroy an acceleration structure object',type='protos']
5399e5c31af7Sopenharmony_ci--
5400e5c31af7Sopenharmony_ci:refpage: vkDestroyAccelerationStructureKHR
5401e5c31af7Sopenharmony_ci
5402e5c31af7Sopenharmony_ciTo destroy an acceleration structure, call:
5403e5c31af7Sopenharmony_ci
5404e5c31af7Sopenharmony_ciifdef::VK_KHR_acceleration_structure[]
5405e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkDestroyAccelerationStructureKHR.txt[]
5406e5c31af7Sopenharmony_ciendif::VK_KHR_acceleration_structure[]
5407e5c31af7Sopenharmony_ci
5408e5c31af7Sopenharmony_ci  * pname:device is the logical device that destroys the acceleration
5409e5c31af7Sopenharmony_ci    structure.
5410e5c31af7Sopenharmony_ci  * pname:accelerationStructure is the acceleration structure to destroy.
5411e5c31af7Sopenharmony_ci  * pname:pAllocator controls host memory allocation as described in the
5412e5c31af7Sopenharmony_ci    <<memory-allocation, Memory Allocation>> chapter.
5413e5c31af7Sopenharmony_ci
5414e5c31af7Sopenharmony_ci.Valid Usage
5415e5c31af7Sopenharmony_ci****
5416e5c31af7Sopenharmony_ci  * [[VUID-vkDestroyAccelerationStructureKHR-accelerationStructure-02442]]
5417e5c31af7Sopenharmony_ci    All submitted commands that refer to pname:accelerationStructure must:
5418e5c31af7Sopenharmony_ci    have completed execution
5419e5c31af7Sopenharmony_ci  * [[VUID-vkDestroyAccelerationStructureKHR-accelerationStructure-02443]]
5420e5c31af7Sopenharmony_ci    If sname:VkAllocationCallbacks were provided when
5421e5c31af7Sopenharmony_ci    pname:accelerationStructure was created, a compatible set of callbacks
5422e5c31af7Sopenharmony_ci    must: be provided here
5423e5c31af7Sopenharmony_ci  * [[VUID-vkDestroyAccelerationStructureKHR-accelerationStructure-02444]]
5424e5c31af7Sopenharmony_ci    If no sname:VkAllocationCallbacks were provided when
5425e5c31af7Sopenharmony_ci    pname:accelerationStructure was created, pname:pAllocator must: be
5426e5c31af7Sopenharmony_ci    `NULL`
5427e5c31af7Sopenharmony_ci****
5428e5c31af7Sopenharmony_ci
5429e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkDestroyAccelerationStructureKHR.txt[]
5430e5c31af7Sopenharmony_ci--
5431e5c31af7Sopenharmony_ci
5432e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing[]
5433e5c31af7Sopenharmony_ci[open,refpage='vkDestroyAccelerationStructureNV',desc='Destroy an acceleration structure object',type='protos']
5434e5c31af7Sopenharmony_ci--
5435e5c31af7Sopenharmony_ci:refpage: vkDestroyAccelerationStructureNV
5436e5c31af7Sopenharmony_ci
5437e5c31af7Sopenharmony_ciTo destroy an acceleration structure, call:
5438e5c31af7Sopenharmony_ci
5439e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkDestroyAccelerationStructureNV.txt[]
5440e5c31af7Sopenharmony_ci
5441e5c31af7Sopenharmony_ci  * pname:device is the logical device that destroys the buffer.
5442e5c31af7Sopenharmony_ci  * pname:accelerationStructure is the acceleration structure to destroy.
5443e5c31af7Sopenharmony_ci  * pname:pAllocator controls host memory allocation as described in the
5444e5c31af7Sopenharmony_ci    <<memory-allocation, Memory Allocation>> chapter.
5445e5c31af7Sopenharmony_ci
5446e5c31af7Sopenharmony_ci.Valid Usage
5447e5c31af7Sopenharmony_ci****
5448e5c31af7Sopenharmony_ci  * [[VUID-vkDestroyAccelerationStructureNV-accelerationStructure-03752]]
5449e5c31af7Sopenharmony_ci    All submitted commands that refer to pname:accelerationStructure must:
5450e5c31af7Sopenharmony_ci    have completed execution
5451e5c31af7Sopenharmony_ci  * [[VUID-vkDestroyAccelerationStructureNV-accelerationStructure-03753]]
5452e5c31af7Sopenharmony_ci    If sname:VkAllocationCallbacks were provided when
5453e5c31af7Sopenharmony_ci    pname:accelerationStructure was created, a compatible set of callbacks
5454e5c31af7Sopenharmony_ci    must: be provided here
5455e5c31af7Sopenharmony_ci  * [[VUID-vkDestroyAccelerationStructureNV-accelerationStructure-03754]]
5456e5c31af7Sopenharmony_ci    If no sname:VkAllocationCallbacks were provided when
5457e5c31af7Sopenharmony_ci    pname:accelerationStructure was created, pname:pAllocator must: be
5458e5c31af7Sopenharmony_ci    `NULL`
5459e5c31af7Sopenharmony_ci****
5460e5c31af7Sopenharmony_ci
5461e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkDestroyAccelerationStructureNV.txt[]
5462e5c31af7Sopenharmony_ci--
5463e5c31af7Sopenharmony_ci
5464e5c31af7Sopenharmony_ci[open,refpage='vkGetAccelerationStructureMemoryRequirementsNV',desc='Get acceleration structure memory requirements',type='protos']
5465e5c31af7Sopenharmony_ci--
5466e5c31af7Sopenharmony_ci:refpage: vkGetAccelerationStructureMemoryRequirementsNV
5467e5c31af7Sopenharmony_ci
5468e5c31af7Sopenharmony_ciAn acceleration structure has memory requirements for the structure object
5469e5c31af7Sopenharmony_ciitself, scratch space for the build, and scratch space for the update.
5470e5c31af7Sopenharmony_ci
5471e5c31af7Sopenharmony_ciScratch space is allocated as a sname:VkBuffer, so for
5472e5c31af7Sopenharmony_ciename:VK_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_BUILD_SCRATCH_NV
5473e5c31af7Sopenharmony_ciand
5474e5c31af7Sopenharmony_ciename:VK_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_UPDATE_SCRATCH_NV
5475e5c31af7Sopenharmony_cithe pname:pMemoryRequirements->alignment and
5476e5c31af7Sopenharmony_cipname:pMemoryRequirements->memoryTypeBits values returned by this call must:
5477e5c31af7Sopenharmony_cibe filled with zero, and should: be ignored by the application.
5478e5c31af7Sopenharmony_ci
5479e5c31af7Sopenharmony_ciTo query the memory requirements, call:
5480e5c31af7Sopenharmony_ci
5481e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkGetAccelerationStructureMemoryRequirementsNV.txt[]
5482e5c31af7Sopenharmony_ci
5483e5c31af7Sopenharmony_ci  * pname:device is the logical device on which the acceleration structure
5484e5c31af7Sopenharmony_ci    was created.
5485e5c31af7Sopenharmony_ci  * pname:pInfo is a pointer to a
5486e5c31af7Sopenharmony_ci    slink:VkAccelerationStructureMemoryRequirementsInfoNV structure
5487e5c31af7Sopenharmony_ci    specifying the acceleration structure to get memory requirements for.
5488e5c31af7Sopenharmony_ci  * pname:pMemoryRequirements is a pointer to a
5489e5c31af7Sopenharmony_ci    slink:VkMemoryRequirements2KHR structure in which the requested
5490e5c31af7Sopenharmony_ci    acceleration structure memory requirements are returned.
5491e5c31af7Sopenharmony_ci
5492e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkGetAccelerationStructureMemoryRequirementsNV.txt[]
5493e5c31af7Sopenharmony_ci--
5494e5c31af7Sopenharmony_ci
5495e5c31af7Sopenharmony_ci[open,refpage='VkAccelerationStructureMemoryRequirementsInfoNV',desc='Structure specifying acceleration to query for memory requirements',type='structs']
5496e5c31af7Sopenharmony_ci--
5497e5c31af7Sopenharmony_ci:refpage: VkAccelerationStructureMemoryRequirementsInfoNV
5498e5c31af7Sopenharmony_ci
5499e5c31af7Sopenharmony_ciThe sname:VkAccelerationStructureMemoryRequirementsInfoNV structure is
5500e5c31af7Sopenharmony_cidefined as:
5501e5c31af7Sopenharmony_ci
5502e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkAccelerationStructureMemoryRequirementsInfoNV.txt[]
5503e5c31af7Sopenharmony_ci
5504e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure.
5505e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
5506e5c31af7Sopenharmony_ci    structure.
5507e5c31af7Sopenharmony_ci  * pname:type selects the type of memory requirement being queried.
5508e5c31af7Sopenharmony_ci    ename:VK_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_OBJECT_NV
5509e5c31af7Sopenharmony_ci    returns the memory requirements for the object itself.
5510e5c31af7Sopenharmony_ci    ename:VK_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_BUILD_SCRATCH_NV
5511e5c31af7Sopenharmony_ci    returns the memory requirements for the scratch memory when doing a
5512e5c31af7Sopenharmony_ci    build.
5513e5c31af7Sopenharmony_ci    ename:VK_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_UPDATE_SCRATCH_NV
5514e5c31af7Sopenharmony_ci    returns the memory requirements for the scratch memory when doing an
5515e5c31af7Sopenharmony_ci    update.
5516e5c31af7Sopenharmony_ci  * pname:accelerationStructure is the acceleration structure to be queried
5517e5c31af7Sopenharmony_ci    for memory requirements.
5518e5c31af7Sopenharmony_ci
5519e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkAccelerationStructureMemoryRequirementsInfoNV.txt[]
5520e5c31af7Sopenharmony_ci--
5521e5c31af7Sopenharmony_ci
5522e5c31af7Sopenharmony_ci[open,refpage='VkAccelerationStructureMemoryRequirementsTypeNV',desc='Acceleration structure memory requirement type',type='enums']
5523e5c31af7Sopenharmony_ci--
5524e5c31af7Sopenharmony_ci:refpage: VkAccelerationStructureMemoryRequirementsTypeNV
5525e5c31af7Sopenharmony_ci
5526e5c31af7Sopenharmony_ciPossible values of pname:type in
5527e5c31af7Sopenharmony_cisname:VkAccelerationStructureMemoryRequirementsInfoNV are:,
5528e5c31af7Sopenharmony_ci
5529e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkAccelerationStructureMemoryRequirementsTypeNV.txt[]
5530e5c31af7Sopenharmony_ci
5531e5c31af7Sopenharmony_ci  * ename:VK_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_OBJECT_NV
5532e5c31af7Sopenharmony_ci    requests the memory requirement for the sname:VkAccelerationStructureNV
5533e5c31af7Sopenharmony_ci    backing store.
5534e5c31af7Sopenharmony_ci  * ename:VK_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_BUILD_SCRATCH_NV
5535e5c31af7Sopenharmony_ci    requests the memory requirement for scratch space during the initial
5536e5c31af7Sopenharmony_ci    build.
5537e5c31af7Sopenharmony_ci  * ename:VK_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_UPDATE_SCRATCH_NV
5538e5c31af7Sopenharmony_ci    requests the memory requirement for scratch space during an update.
5539e5c31af7Sopenharmony_ci--
5540e5c31af7Sopenharmony_ciendif::VK_NV_ray_tracing[]
5541e5c31af7Sopenharmony_ci
5542e5c31af7Sopenharmony_ciifdef::VK_KHR_acceleration_structure[]
5543e5c31af7Sopenharmony_ci[open,refpage='VkAccelerationStructureBuildTypeKHR',desc='Acceleration structure build type',type='enums']
5544e5c31af7Sopenharmony_ci--
5545e5c31af7Sopenharmony_ci:refpage: VkAccelerationStructureBuildTypeKHR
5546e5c31af7Sopenharmony_ci
5547e5c31af7Sopenharmony_ciPossible values of pname:buildType in
5548e5c31af7Sopenharmony_ciflink:vkGetAccelerationStructureBuildSizesKHR are:
5549e5c31af7Sopenharmony_ci
5550e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkAccelerationStructureBuildTypeKHR.txt[]
5551e5c31af7Sopenharmony_ci
5552e5c31af7Sopenharmony_ci  * ename:VK_ACCELERATION_STRUCTURE_BUILD_TYPE_HOST_KHR requests the memory
5553e5c31af7Sopenharmony_ci    requirement for operations performed by the host.
5554e5c31af7Sopenharmony_ci  * ename:VK_ACCELERATION_STRUCTURE_BUILD_TYPE_DEVICE_KHR requests the
5555e5c31af7Sopenharmony_ci    memory requirement for operations performed by the device.
5556e5c31af7Sopenharmony_ci  * ename:VK_ACCELERATION_STRUCTURE_BUILD_TYPE_HOST_OR_DEVICE_KHR requests
5557e5c31af7Sopenharmony_ci    the memory requirement for operations performed by either the host, or
5558e5c31af7Sopenharmony_ci    the device.
5559e5c31af7Sopenharmony_ci--
5560e5c31af7Sopenharmony_ciendif::VK_KHR_acceleration_structure[]
5561e5c31af7Sopenharmony_ci
5562e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing[]
5563e5c31af7Sopenharmony_ci[open,refpage='vkBindAccelerationStructureMemoryNV',desc='Bind acceleration structure memory',type='protos']
5564e5c31af7Sopenharmony_ci--
5565e5c31af7Sopenharmony_ci:refpage: vkBindAccelerationStructureMemoryNV
5566e5c31af7Sopenharmony_ci
5567e5c31af7Sopenharmony_ciTo attach memory to one or more acceleration structures at a time, call:
5568e5c31af7Sopenharmony_ci
5569e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkBindAccelerationStructureMemoryNV.txt[]
5570e5c31af7Sopenharmony_ci
5571e5c31af7Sopenharmony_ci  * pname:device is the logical device that owns the acceleration structures
5572e5c31af7Sopenharmony_ci    and memory.
5573e5c31af7Sopenharmony_ci  * pname:bindInfoCount is the number of elements in pname:pBindInfos.
5574e5c31af7Sopenharmony_ci  * pname:pBindInfos is a pointer to an array of
5575e5c31af7Sopenharmony_ci    slink:VkBindAccelerationStructureMemoryInfoNV structures describing
5576e5c31af7Sopenharmony_ci    acceleration structures and memory to bind.
5577e5c31af7Sopenharmony_ci
5578e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkBindAccelerationStructureMemoryNV.txt[]
5579e5c31af7Sopenharmony_ci--
5580e5c31af7Sopenharmony_ci
5581e5c31af7Sopenharmony_ci[open,refpage='VkBindAccelerationStructureMemoryInfoNV',desc='Structure specifying acceleration structure memory binding',type='structs']
5582e5c31af7Sopenharmony_ci--
5583e5c31af7Sopenharmony_ci:refpage: VkBindAccelerationStructureMemoryInfoNV
5584e5c31af7Sopenharmony_ci
5585e5c31af7Sopenharmony_ciThe sname:VkBindAccelerationStructureMemoryInfoNV structure is defined as:
5586e5c31af7Sopenharmony_ci
5587e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkBindAccelerationStructureMemoryInfoNV.txt[]
5588e5c31af7Sopenharmony_ci
5589e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure.
5590e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
5591e5c31af7Sopenharmony_ci    structure.
5592e5c31af7Sopenharmony_ci  * pname:accelerationStructure is the acceleration structure to be attached
5593e5c31af7Sopenharmony_ci    to memory.
5594e5c31af7Sopenharmony_ci  * pname:memory is a sname:VkDeviceMemory object describing the device
5595e5c31af7Sopenharmony_ci    memory to attach.
5596e5c31af7Sopenharmony_ci  * pname:memoryOffset is the start offset of the region of memory that is
5597e5c31af7Sopenharmony_ci    to be bound to the acceleration structure.
5598e5c31af7Sopenharmony_ci    The number of bytes returned in the
5599e5c31af7Sopenharmony_ci    slink:VkMemoryRequirements::pname:size member in pname:memory, starting
5600e5c31af7Sopenharmony_ci    from pname:memoryOffset bytes, will be bound to the specified
5601e5c31af7Sopenharmony_ci    acceleration structure.
5602e5c31af7Sopenharmony_ci  * pname:deviceIndexCount is the number of elements in
5603e5c31af7Sopenharmony_ci    pname:pDeviceIndices.
5604e5c31af7Sopenharmony_ci  * pname:pDeviceIndices is a pointer to an array of device indices.
5605e5c31af7Sopenharmony_ci
5606e5c31af7Sopenharmony_ci.Valid Usage
5607e5c31af7Sopenharmony_ci****
5608e5c31af7Sopenharmony_ci  * [[VUID-VkBindAccelerationStructureMemoryInfoNV-accelerationStructure-03620]]
5609e5c31af7Sopenharmony_ci    pname:accelerationStructure must: not already be backed by a memory
5610e5c31af7Sopenharmony_ci    object
5611e5c31af7Sopenharmony_ci  * [[VUID-VkBindAccelerationStructureMemoryInfoNV-memoryOffset-03621]]
5612e5c31af7Sopenharmony_ci    pname:memoryOffset must: be less than the size of pname:memory
5613e5c31af7Sopenharmony_ci  * [[VUID-VkBindAccelerationStructureMemoryInfoNV-memory-03622]]
5614e5c31af7Sopenharmony_ci    pname:memory must: have been allocated using one of the memory types
5615e5c31af7Sopenharmony_ci    allowed in the pname:memoryTypeBits member of the
5616e5c31af7Sopenharmony_ci    slink:VkMemoryRequirements structure returned from a call to
5617e5c31af7Sopenharmony_ci    flink:vkGetAccelerationStructureMemoryRequirementsNV with
5618e5c31af7Sopenharmony_ci    pname:accelerationStructure and pname:type of
5619e5c31af7Sopenharmony_ci    ename:VK_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_OBJECT_NV
5620e5c31af7Sopenharmony_ci  * [[VUID-VkBindAccelerationStructureMemoryInfoNV-memoryOffset-03623]]
5621e5c31af7Sopenharmony_ci    pname:memoryOffset must: be an integer multiple of the pname:alignment
5622e5c31af7Sopenharmony_ci    member of the slink:VkMemoryRequirements structure returned from a call
5623e5c31af7Sopenharmony_ci    to flink:vkGetAccelerationStructureMemoryRequirementsNV with
5624e5c31af7Sopenharmony_ci    pname:accelerationStructure and pname:type of
5625e5c31af7Sopenharmony_ci    ename:VK_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_OBJECT_NV
5626e5c31af7Sopenharmony_ci  * [[VUID-VkBindAccelerationStructureMemoryInfoNV-size-03624]]
5627e5c31af7Sopenharmony_ci    The pname:size member of the sname:VkMemoryRequirements structure
5628e5c31af7Sopenharmony_ci    returned from a call to
5629e5c31af7Sopenharmony_ci    flink:vkGetAccelerationStructureMemoryRequirementsNV with
5630e5c31af7Sopenharmony_ci    pname:accelerationStructure and pname:type of
5631e5c31af7Sopenharmony_ci    ename:VK_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_OBJECT_NV must:
5632e5c31af7Sopenharmony_ci    be less than or equal to the size of pname:memory minus
5633e5c31af7Sopenharmony_ci    pname:memoryOffset
5634e5c31af7Sopenharmony_ci****
5635e5c31af7Sopenharmony_ci
5636e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkBindAccelerationStructureMemoryInfoNV.txt[]
5637e5c31af7Sopenharmony_ci--
5638e5c31af7Sopenharmony_ci
5639e5c31af7Sopenharmony_ci[open,refpage='vkGetAccelerationStructureHandleNV',desc='Get opaque acceleration structure handle',type='protos']
5640e5c31af7Sopenharmony_ci--
5641e5c31af7Sopenharmony_ci:refpage: vkGetAccelerationStructureHandleNV
5642e5c31af7Sopenharmony_ci
5643e5c31af7Sopenharmony_ciTo allow constructing geometry instances with device code if desired, we
5644e5c31af7Sopenharmony_cineed to be able to query a opaque handle for an acceleration structure.
5645e5c31af7Sopenharmony_ciThis handle is a value of 8 bytes.
5646e5c31af7Sopenharmony_ciTo get this handle, call:
5647e5c31af7Sopenharmony_ci
5648e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkGetAccelerationStructureHandleNV.txt[]
5649e5c31af7Sopenharmony_ci
5650e5c31af7Sopenharmony_ci  * pname:device is the logical device that owns the acceleration
5651e5c31af7Sopenharmony_ci    structures.
5652e5c31af7Sopenharmony_ci  * pname:accelerationStructure is the acceleration structure.
5653e5c31af7Sopenharmony_ci  * pname:dataSize is the size in bytes of the buffer pointed to by
5654e5c31af7Sopenharmony_ci    pname:pData.
5655e5c31af7Sopenharmony_ci  * pname:pData is a pointer to a user-allocated buffer where the results
5656e5c31af7Sopenharmony_ci    will be written.
5657e5c31af7Sopenharmony_ci
5658e5c31af7Sopenharmony_ci.Valid Usage
5659e5c31af7Sopenharmony_ci****
5660e5c31af7Sopenharmony_ci  * [[VUID-vkGetAccelerationStructureHandleNV-dataSize-02240]]
5661e5c31af7Sopenharmony_ci    pname:dataSize must: be large enough to contain the result of the query,
5662e5c31af7Sopenharmony_ci    as described above
5663e5c31af7Sopenharmony_ci  * [[VUID-vkGetAccelerationStructureHandleNV-accelerationStructure-02787]]
5664e5c31af7Sopenharmony_ci    pname:accelerationStructure must: be bound completely and contiguously
5665e5c31af7Sopenharmony_ci    to a single sname:VkDeviceMemory object via
5666e5c31af7Sopenharmony_ci    flink:vkBindAccelerationStructureMemoryNV
5667e5c31af7Sopenharmony_ci****
5668e5c31af7Sopenharmony_ci
5669e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkGetAccelerationStructureHandleNV.txt[]
5670e5c31af7Sopenharmony_ci--
5671e5c31af7Sopenharmony_ciendif::VK_NV_ray_tracing[]
5672e5c31af7Sopenharmony_ci
5673e5c31af7Sopenharmony_ciifdef::VK_KHR_acceleration_structure[]
5674e5c31af7Sopenharmony_ci[open,refpage='vkGetAccelerationStructureDeviceAddressKHR',desc='Query an address of a acceleration structure',type='protos']
5675e5c31af7Sopenharmony_ci--
5676e5c31af7Sopenharmony_ci:refpage: vkGetAccelerationStructureDeviceAddressKHR
5677e5c31af7Sopenharmony_ci
5678e5c31af7Sopenharmony_ciTo query the 64-bit device address for an acceleration structure, call:
5679e5c31af7Sopenharmony_ci
5680e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkGetAccelerationStructureDeviceAddressKHR.txt[]
5681e5c31af7Sopenharmony_ci
5682e5c31af7Sopenharmony_ci  * pname:device is the logical device that the acceleration structure was
5683e5c31af7Sopenharmony_ci    created on.
5684e5c31af7Sopenharmony_ci  * pname:pInfo is a pointer to a
5685e5c31af7Sopenharmony_ci    slink:VkAccelerationStructureDeviceAddressInfoKHR structure specifying
5686e5c31af7Sopenharmony_ci    the acceleration structure to retrieve an address for.
5687e5c31af7Sopenharmony_ci
5688e5c31af7Sopenharmony_ciThe 64-bit return value is an address of the acceleration structure, which
5689e5c31af7Sopenharmony_cican be used for device and shader operations that involve acceleration
5690e5c31af7Sopenharmony_cistructures, such as
5691e5c31af7Sopenharmony_ciifdef::VK_KHR_ray_tracing_pipeline,VK_KHR_ray_query[]
5692e5c31af7Sopenharmony_ciray traversal and
5693e5c31af7Sopenharmony_ciendif::VK_KHR_ray_tracing_pipeline,VK_KHR_ray_query[]
5694e5c31af7Sopenharmony_ciacceleration structure building.
5695e5c31af7Sopenharmony_ci
5696e5c31af7Sopenharmony_ciIf the acceleration structure was created with a non-zero value of
5697e5c31af7Sopenharmony_cislink:VkAccelerationStructureCreateInfoKHR::pname:deviceAddress, the return
5698e5c31af7Sopenharmony_civalue will be the same address.
5699e5c31af7Sopenharmony_ci
5700e5c31af7Sopenharmony_ciIf the acceleration structure was created with a pname:type of
5701e5c31af7Sopenharmony_ciename:VK_ACCELERATION_STRUCTURE_TYPE_GENERIC_KHR, the returned address must:
5702e5c31af7Sopenharmony_cibe consistent with the relative offset to other acceleration structures with
5703e5c31af7Sopenharmony_cipname:type ename:VK_ACCELERATION_STRUCTURE_TYPE_GENERIC_KHR allocated with
5704e5c31af7Sopenharmony_cithe same slink:VkBuffer.
5705e5c31af7Sopenharmony_ciThat is, the difference in returned addresses between the two must: be the
5706e5c31af7Sopenharmony_cisame as the difference in offsets provided at acceleration structure
5707e5c31af7Sopenharmony_cicreation.
5708e5c31af7Sopenharmony_ci
5709e5c31af7Sopenharmony_ci[NOTE]
5710e5c31af7Sopenharmony_ci.Note
5711e5c31af7Sopenharmony_ci====
5712e5c31af7Sopenharmony_ciThe acceleration structure device address may: be different from the buffer
5713e5c31af7Sopenharmony_cidevice address corresponding to the acceleration structure's start offset in
5714e5c31af7Sopenharmony_ciits storage buffer for acceleration structure types other than
5715e5c31af7Sopenharmony_ciename:VK_ACCELERATION_STRUCTURE_TYPE_GENERIC_KHR.
5716e5c31af7Sopenharmony_ci====
5717e5c31af7Sopenharmony_ci
5718e5c31af7Sopenharmony_ci.Valid Usage
5719e5c31af7Sopenharmony_ci****
5720e5c31af7Sopenharmony_ci  * [[VUID-vkGetAccelerationStructureDeviceAddressKHR-device-03504]]
5721e5c31af7Sopenharmony_ci    If pname:device was created with multiple physical devices, then the
5722e5c31af7Sopenharmony_ci    <<features-bufferDeviceAddressMultiDevice,bufferDeviceAddressMultiDevice>>
5723e5c31af7Sopenharmony_ci    feature must: be enabled
5724e5c31af7Sopenharmony_ci****
5725e5c31af7Sopenharmony_ci
5726e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkGetAccelerationStructureDeviceAddressKHR.txt[]
5727e5c31af7Sopenharmony_ci--
5728e5c31af7Sopenharmony_ci
5729e5c31af7Sopenharmony_ci[open,refpage='VkAccelerationStructureDeviceAddressInfoKHR',desc='Structure specifying the acceleration structure to query an address for',type='structs']
5730e5c31af7Sopenharmony_ci--
5731e5c31af7Sopenharmony_ci:refpage: VkAccelerationStructureDeviceAddressInfoKHR
5732e5c31af7Sopenharmony_ci
5733e5c31af7Sopenharmony_ciThe sname:VkAccelerationStructureDeviceAddressInfoKHR structure is defined
5734e5c31af7Sopenharmony_cias:
5735e5c31af7Sopenharmony_ci
5736e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkAccelerationStructureDeviceAddressInfoKHR.txt[]
5737e5c31af7Sopenharmony_ci
5738e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure.
5739e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
5740e5c31af7Sopenharmony_ci    structure.
5741e5c31af7Sopenharmony_ci  * pname:accelerationStructure specifies the acceleration structure whose
5742e5c31af7Sopenharmony_ci    address is being queried.
5743e5c31af7Sopenharmony_ci
5744e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkAccelerationStructureDeviceAddressInfoKHR.txt[]
5745e5c31af7Sopenharmony_ci--
5746e5c31af7Sopenharmony_ciendif::VK_KHR_acceleration_structure[]
5747e5c31af7Sopenharmony_ciendif::VK_NV_ray_tracing,VK_KHR_acceleration_structure[]
5748e5c31af7Sopenharmony_ci
5749e5c31af7Sopenharmony_ci
5750e5c31af7Sopenharmony_ci[[resources-association]]
5751e5c31af7Sopenharmony_ci== Resource Memory Association
5752e5c31af7Sopenharmony_ci
5753e5c31af7Sopenharmony_ciResources are initially created as _virtual allocations_ with no backing
5754e5c31af7Sopenharmony_cimemory.
5755e5c31af7Sopenharmony_ciDevice memory is allocated separately (see <<memory-device>>) and then
5756e5c31af7Sopenharmony_ciassociated with the resource.
5757e5c31af7Sopenharmony_ciThis association is done differently for sparse and non-sparse resources.
5758e5c31af7Sopenharmony_ci
5759e5c31af7Sopenharmony_ciResources created with any of the sparse creation flags are considered
5760e5c31af7Sopenharmony_cisparse resources.
5761e5c31af7Sopenharmony_ciResources created without these flags are non-sparse.
5762e5c31af7Sopenharmony_ciThe details on resource memory association for sparse resources is described
5763e5c31af7Sopenharmony_ciin <<sparsememory>>.
5764e5c31af7Sopenharmony_ci
5765e5c31af7Sopenharmony_ciNon-sparse resources must: be bound completely and contiguously to a single
5766e5c31af7Sopenharmony_cisname:VkDeviceMemory object before the resource is passed as a parameter to
5767e5c31af7Sopenharmony_ciany of the following operations:
5768e5c31af7Sopenharmony_ci
5769e5c31af7Sopenharmony_ci  * creating image or buffer views
5770e5c31af7Sopenharmony_ci  * updating descriptor sets
5771e5c31af7Sopenharmony_ci  * recording commands in a command buffer
5772e5c31af7Sopenharmony_ci
5773e5c31af7Sopenharmony_ciOnce bound, the memory binding is immutable for the lifetime of the
5774e5c31af7Sopenharmony_ciresource.
5775e5c31af7Sopenharmony_ci
5776e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_device_group[]
5777e5c31af7Sopenharmony_ci
5778e5c31af7Sopenharmony_ciIn a logical device representing more than one physical device, buffer and
5779e5c31af7Sopenharmony_ciimage resources exist on all physical devices but can: be bound to memory
5780e5c31af7Sopenharmony_cidifferently on each.
5781e5c31af7Sopenharmony_ciEach such replicated resource is an _instance_ of the resource.
5782e5c31af7Sopenharmony_ciFor sparse resources, each instance can: be bound to memory arbitrarily
5783e5c31af7Sopenharmony_cidifferently.
5784e5c31af7Sopenharmony_ciFor non-sparse resources, each instance can: either be bound to the local or
5785e5c31af7Sopenharmony_cia peer instance of the memory, or for images can: be bound to rectangular
5786e5c31af7Sopenharmony_ciregions from the local and/or peer instances.
5787e5c31af7Sopenharmony_ciWhen a resource is used in a descriptor set, each physical device interprets
5788e5c31af7Sopenharmony_cithe descriptor according to its own instance's binding to memory.
5789e5c31af7Sopenharmony_ci
5790e5c31af7Sopenharmony_ci[NOTE]
5791e5c31af7Sopenharmony_ci.Note
5792e5c31af7Sopenharmony_ci====
5793e5c31af7Sopenharmony_ciThere are no new copy commands to transfer data between physical devices.
5794e5c31af7Sopenharmony_ciInstead, an application can: create a resource with a peer mapping and use
5795e5c31af7Sopenharmony_ciit as the source or destination of a transfer command executed by a single
5796e5c31af7Sopenharmony_ciphysical device to copy the data from one physical device to another.
5797e5c31af7Sopenharmony_ci====
5798e5c31af7Sopenharmony_ci
5799e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_device_group[]
5800e5c31af7Sopenharmony_ci
5801e5c31af7Sopenharmony_ci[open,refpage='vkGetBufferMemoryRequirements',desc='Returns the memory requirements for specified Vulkan object',type='protos']
5802e5c31af7Sopenharmony_ci--
5803e5c31af7Sopenharmony_ciTo determine the memory requirements for a buffer resource, call:
5804e5c31af7Sopenharmony_ci
5805e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkGetBufferMemoryRequirements.txt[]
5806e5c31af7Sopenharmony_ci
5807e5c31af7Sopenharmony_ci  * pname:device is the logical device that owns the buffer.
5808e5c31af7Sopenharmony_ci  * pname:buffer is the buffer to query.
5809e5c31af7Sopenharmony_ci  * pname:pMemoryRequirements is a pointer to a slink:VkMemoryRequirements
5810e5c31af7Sopenharmony_ci    structure in which the memory requirements of the buffer object are
5811e5c31af7Sopenharmony_ci    returned.
5812e5c31af7Sopenharmony_ci
5813e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkGetBufferMemoryRequirements.txt[]
5814e5c31af7Sopenharmony_ci--
5815e5c31af7Sopenharmony_ci
5816e5c31af7Sopenharmony_ci[open,refpage='vkGetImageMemoryRequirements',desc='Returns the memory requirements for specified Vulkan object',type='protos']
5817e5c31af7Sopenharmony_ci--
5818e5c31af7Sopenharmony_ciifndef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
5819e5c31af7Sopenharmony_ciTo determine the memory requirements for an image resource, call:
5820e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
5821e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
5822e5c31af7Sopenharmony_ciTo determine the memory requirements for an image resource which is not
5823e5c31af7Sopenharmony_cicreated with the ename:VK_IMAGE_CREATE_DISJOINT_BIT flag set, call:
5824e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
5825e5c31af7Sopenharmony_ci
5826e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkGetImageMemoryRequirements.txt[]
5827e5c31af7Sopenharmony_ci
5828e5c31af7Sopenharmony_ci  * pname:device is the logical device that owns the image.
5829e5c31af7Sopenharmony_ci  * pname:image is the image to query.
5830e5c31af7Sopenharmony_ci  * pname:pMemoryRequirements is a pointer to a slink:VkMemoryRequirements
5831e5c31af7Sopenharmony_ci    structure in which the memory requirements of the image object are
5832e5c31af7Sopenharmony_ci    returned.
5833e5c31af7Sopenharmony_ci
5834e5c31af7Sopenharmony_ci.Valid Usage
5835e5c31af7Sopenharmony_ci****
5836e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
5837e5c31af7Sopenharmony_ci  * [[VUID-vkGetImageMemoryRequirements-image-01588]]
5838e5c31af7Sopenharmony_ci    pname:image must: not have been created with the
5839e5c31af7Sopenharmony_ci    ename:VK_IMAGE_CREATE_DISJOINT_BIT flag set
5840e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
5841e5c31af7Sopenharmony_ciifdef::VK_ANDROID_external_memory_android_hardware_buffer[]
5842e5c31af7Sopenharmony_ci  * [[VUID-vkGetImageMemoryRequirements-image-04004]]
5843e5c31af7Sopenharmony_ci    If pname:image was created with the
5844e5c31af7Sopenharmony_ci    ename:VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID
5845e5c31af7Sopenharmony_ci    external memory handle type, then pname:image must: be bound to memory
5846e5c31af7Sopenharmony_ciendif::VK_ANDROID_external_memory_android_hardware_buffer[]
5847e5c31af7Sopenharmony_ci****
5848e5c31af7Sopenharmony_ci
5849e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkGetImageMemoryRequirements.txt[]
5850e5c31af7Sopenharmony_ci--
5851e5c31af7Sopenharmony_ci
5852e5c31af7Sopenharmony_ci[open,refpage='VkMemoryRequirements',desc='Structure specifying memory requirements',type='structs']
5853e5c31af7Sopenharmony_ci--
5854e5c31af7Sopenharmony_ciThe sname:VkMemoryRequirements structure is defined as:
5855e5c31af7Sopenharmony_ci
5856e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkMemoryRequirements.txt[]
5857e5c31af7Sopenharmony_ci
5858e5c31af7Sopenharmony_ci  * pname:size is the size, in bytes, of the memory allocation required: for
5859e5c31af7Sopenharmony_ci    the resource.
5860e5c31af7Sopenharmony_ci  * pname:alignment is the alignment, in bytes, of the offset within the
5861e5c31af7Sopenharmony_ci    allocation required: for the resource.
5862e5c31af7Sopenharmony_ci  * pname:memoryTypeBits is a bitmask and contains one bit set for every
5863e5c31af7Sopenharmony_ci    supported memory type for the resource.
5864e5c31af7Sopenharmony_ci    Bit `i` is set if and only if the memory type `i` in the
5865e5c31af7Sopenharmony_ci    sname:VkPhysicalDeviceMemoryProperties structure for the physical device
5866e5c31af7Sopenharmony_ci    is supported for the resource.
5867e5c31af7Sopenharmony_ci
5868e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkMemoryRequirements.txt[]
5869e5c31af7Sopenharmony_ci--
5870e5c31af7Sopenharmony_ci
5871e5c31af7Sopenharmony_ciifdef::VK_ANDROID_external_memory_android_hardware_buffer[]
5872e5c31af7Sopenharmony_ciThe precise size of images that will be bound to external Android hardware
5873e5c31af7Sopenharmony_cibuffer memory is unknown until the memory has been imported or allocated, so
5874e5c31af7Sopenharmony_ciapplications must: not call flink:vkGetImageMemoryRequirements or
5875e5c31af7Sopenharmony_ciflink:vkGetImageMemoryRequirements2 with such an slink:VkImage before it has
5876e5c31af7Sopenharmony_cibeen bound to memory.
5877e5c31af7Sopenharmony_ciifdef::VK_KHR_maintenance4[]
5878e5c31af7Sopenharmony_ciFor this reason, applications also must: not call
5879e5c31af7Sopenharmony_ciflink:vkGetDeviceImageMemoryRequirementsKHR with a slink:VkImageCreateInfo
5880e5c31af7Sopenharmony_cidescribing an external Android hardware buffer.
5881e5c31af7Sopenharmony_ciendif::VK_KHR_maintenance4[]
5882e5c31af7Sopenharmony_ciWhen importing Android hardware buffer memory, the pname:allocationSize can:
5883e5c31af7Sopenharmony_cibe determined by calling flink:vkGetAndroidHardwareBufferPropertiesANDROID.
5884e5c31af7Sopenharmony_ciWhen allocating new memory for a slink:VkImage that can: be exported to an
5885e5c31af7Sopenharmony_ciAndroid hardware buffer, the memory's pname:allocationSize must: be zero;
5886e5c31af7Sopenharmony_cithe actual size will be determined by the dedicated image's parameters.
5887e5c31af7Sopenharmony_ciAfter the memory has been allocated, the amount of space allocated from the
5888e5c31af7Sopenharmony_cimemory's heap can: be obtained by getting the image's memory requirements or
5889e5c31af7Sopenharmony_ciby calling flink:vkGetAndroidHardwareBufferPropertiesANDROID with the
5890e5c31af7Sopenharmony_ciAndroid hardware buffer exported from the memory.
5891e5c31af7Sopenharmony_ci
5892e5c31af7Sopenharmony_ciWhen allocating new memory for a slink:VkBuffer that can: be exported to an
5893e5c31af7Sopenharmony_ciAndroid hardware buffer an application may: still call
5894e5c31af7Sopenharmony_ciflink:vkGetBufferMemoryRequirements or flink:vkGetBufferMemoryRequirements2
5895e5c31af7Sopenharmony_ciwith slink:VkBuffer before it has been bound to memory.
5896e5c31af7Sopenharmony_ciendif::VK_ANDROID_external_memory_android_hardware_buffer[]
5897e5c31af7Sopenharmony_ci
5898e5c31af7Sopenharmony_ciifdef::VK_KHR_external_memory_win32[]
5899e5c31af7Sopenharmony_ciIf the resource being queried was created with the
5900e5c31af7Sopenharmony_ciename:VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT,
5901e5c31af7Sopenharmony_ciename:VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT, or
5902e5c31af7Sopenharmony_ciename:VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT external memory
5903e5c31af7Sopenharmony_cihandle type, the value of pname:size has no meaning and should: be ignored.
5904e5c31af7Sopenharmony_ciendif::VK_KHR_external_memory_win32[]
5905e5c31af7Sopenharmony_ci
5906e5c31af7Sopenharmony_ciThe implementation guarantees certain properties about the memory
5907e5c31af7Sopenharmony_cirequirements returned by
5908e5c31af7Sopenharmony_ciifdef::VK_KHR_get_memory_requirements2[]
5909e5c31af7Sopenharmony_ciflink:vkGetBufferMemoryRequirements2, flink:vkGetImageMemoryRequirements2,
5910e5c31af7Sopenharmony_ciendif::VK_KHR_get_memory_requirements2[]
5911e5c31af7Sopenharmony_ciifdef::VK_KHR_maintenance4[]
5912e5c31af7Sopenharmony_ciflink:vkGetDeviceBufferMemoryRequirementsKHR,
5913e5c31af7Sopenharmony_ciflink:vkGetDeviceImageMemoryRequirementsKHR,
5914e5c31af7Sopenharmony_ciendif::VK_KHR_maintenance4[]
5915e5c31af7Sopenharmony_ciflink:vkGetBufferMemoryRequirements and flink:vkGetImageMemoryRequirements:
5916e5c31af7Sopenharmony_ci
5917e5c31af7Sopenharmony_ci  * The pname:memoryTypeBits member always contains at least one bit set.
5918e5c31af7Sopenharmony_ci  * If pname:buffer is a sname:VkBuffer not created with the
5919e5c31af7Sopenharmony_ci    ename:VK_BUFFER_CREATE_SPARSE_BINDING_BIT bit set, or if pname:image is
5920e5c31af7Sopenharmony_ci    <<glossary-linear-resource,linear>> image, then the pname:memoryTypeBits
5921e5c31af7Sopenharmony_ci    member always contains at least one bit set corresponding to a
5922e5c31af7Sopenharmony_ci    sname:VkMemoryType with a pname:propertyFlags that has both the
5923e5c31af7Sopenharmony_ci    ename:VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT bit and the
5924e5c31af7Sopenharmony_ci    ename:VK_MEMORY_PROPERTY_HOST_COHERENT_BIT bit set.
5925e5c31af7Sopenharmony_ci    In other words, mappable coherent memory can: always be attached to
5926e5c31af7Sopenharmony_ci    these objects.
5927e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_external_memory[]
5928e5c31af7Sopenharmony_ci  * If pname:buffer was created with
5929e5c31af7Sopenharmony_ci    slink:VkExternalMemoryBufferCreateInfo::pname:handleTypes set to `0` or
5930e5c31af7Sopenharmony_ci    pname:image was created with
5931e5c31af7Sopenharmony_ci    slink:VkExternalMemoryImageCreateInfo::pname:handleTypes set to `0`, the
5932e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_external_memory[]
5933e5c31af7Sopenharmony_ciifndef::VK_VERSION_1_1,VK_KHR_external_memory[]
5934e5c31af7Sopenharmony_ci  * The
5935e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_external_memory[]
5936e5c31af7Sopenharmony_ci    pname:memoryTypeBits member always contains at least one bit set
5937e5c31af7Sopenharmony_ci    corresponding to a sname:VkMemoryType with a pname:propertyFlags that
5938e5c31af7Sopenharmony_ci    has the ename:VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT bit set.
5939e5c31af7Sopenharmony_ci  * The pname:memoryTypeBits member is identical for all sname:VkBuffer
5940e5c31af7Sopenharmony_ci    objects created with the same value for the pname:flags and pname:usage
5941e5c31af7Sopenharmony_ci    members in the slink:VkBufferCreateInfo structure
5942e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_external_memory[]
5943e5c31af7Sopenharmony_ci    and the pname:handleTypes member of the
5944e5c31af7Sopenharmony_ci    slink:VkExternalMemoryBufferCreateInfo structure
5945e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_external_memory[]
5946e5c31af7Sopenharmony_ci    passed to flink:vkCreateBuffer.
5947e5c31af7Sopenharmony_ci    Further, if code:usage1 and code:usage2 of type tlink:VkBufferUsageFlags
5948e5c31af7Sopenharmony_ci    are such that the bits set in code:usage2 are a subset of the bits set
5949e5c31af7Sopenharmony_ci    in code:usage1, and they have the same
5950e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_external_memory[]
5951e5c31af7Sopenharmony_ci    pname:flags and
5952e5c31af7Sopenharmony_ci    slink:VkExternalMemoryBufferCreateInfo::pname:handleTypes,
5953e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_external_memory[]
5954e5c31af7Sopenharmony_ciifndef::VK_VERSION_1_1,VK_KHR_external_memory[]
5955e5c31af7Sopenharmony_ci    pname:flags,
5956e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_external_memory[]
5957e5c31af7Sopenharmony_ci    then the bits set in pname:memoryTypeBits returned for code:usage1 must:
5958e5c31af7Sopenharmony_ci    be a subset of the bits set in pname:memoryTypeBits returned for
5959e5c31af7Sopenharmony_ci    code:usage2, for all values of pname:flags.
5960e5c31af7Sopenharmony_ci  * The pname:alignment member is a power of two.
5961e5c31af7Sopenharmony_ci  * The pname:alignment member is identical for all sname:VkBuffer objects
5962e5c31af7Sopenharmony_ci    created with the same combination of values for the pname:usage and
5963e5c31af7Sopenharmony_ci    pname:flags members in the slink:VkBufferCreateInfo structure passed to
5964e5c31af7Sopenharmony_ci    flink:vkCreateBuffer.
5965e5c31af7Sopenharmony_ciifdef::VK_KHR_maintenance4[]
5966e5c31af7Sopenharmony_ci  * If the <<features-maintenance4, pname:maintenance4>> feature is enabled,
5967e5c31af7Sopenharmony_ci    then the pname:alignment member is identical for all sname:VkImage
5968e5c31af7Sopenharmony_ci    objects created with the same combination of values for the pname:flags,
5969e5c31af7Sopenharmony_ci    pname:imageType, pname:format, pname:extent, pname:mipLevels,
5970e5c31af7Sopenharmony_ci    pname:arrayLayers, pname:samples, pname:tiling and pname:usage members
5971e5c31af7Sopenharmony_ci    in the slink:VkImageCreateInfo structure passed to flink:vkCreateImage.
5972e5c31af7Sopenharmony_ciendif::VK_KHR_maintenance4[]
5973e5c31af7Sopenharmony_ci  * The pname:alignment member satisfies the buffer descriptor offset
5974e5c31af7Sopenharmony_ci    alignment requirements associated with the sname:VkBuffer's pname:usage:
5975e5c31af7Sopenharmony_ci  ** If pname:usage included ename:VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT
5976e5c31af7Sopenharmony_ci     or ename:VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT, pname:alignment
5977e5c31af7Sopenharmony_ci     must: be an integer multiple of
5978e5c31af7Sopenharmony_ci     sname:VkPhysicalDeviceLimits::pname:minTexelBufferOffsetAlignment.
5979e5c31af7Sopenharmony_ci  ** If pname:usage included ename:VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT,
5980e5c31af7Sopenharmony_ci     pname:alignment must: be an integer multiple of
5981e5c31af7Sopenharmony_ci     sname:VkPhysicalDeviceLimits::pname:minUniformBufferOffsetAlignment.
5982e5c31af7Sopenharmony_ci  ** If pname:usage included ename:VK_BUFFER_USAGE_STORAGE_BUFFER_BIT,
5983e5c31af7Sopenharmony_ci     pname:alignment must: be an integer multiple of
5984e5c31af7Sopenharmony_ci     sname:VkPhysicalDeviceLimits::pname:minStorageBufferOffsetAlignment.
5985e5c31af7Sopenharmony_ci  * For images created with a color format, the pname:memoryTypeBits member
5986e5c31af7Sopenharmony_ci    is identical for all sname:VkImage objects created with the same
5987e5c31af7Sopenharmony_ci    combination of values for the pname:tiling member, the
5988e5c31af7Sopenharmony_ci    ename:VK_IMAGE_CREATE_SPARSE_BINDING_BIT bit of the pname:flags member,
5989e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_device_group[]
5990e5c31af7Sopenharmony_ci    the ename:VK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT bit of the
5991e5c31af7Sopenharmony_ci    pname:flags member,
5992e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_device_group[]
5993e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_external_memory[]
5994e5c31af7Sopenharmony_ci    pname:handleTypes member of slink:VkExternalMemoryImageCreateInfo,
5995e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_external_memory[]
5996e5c31af7Sopenharmony_ci    and the ename:VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT of the pname:usage
5997e5c31af7Sopenharmony_ci    member in the slink:VkImageCreateInfo structure passed to
5998e5c31af7Sopenharmony_ci    flink:vkCreateImage.
5999e5c31af7Sopenharmony_ci  * For images created with a depth/stencil format, the pname:memoryTypeBits
6000e5c31af7Sopenharmony_ci    member is identical for all sname:VkImage objects created with the same
6001e5c31af7Sopenharmony_ci    combination of values for the pname:format member, the pname:tiling
6002e5c31af7Sopenharmony_ci    member, the ename:VK_IMAGE_CREATE_SPARSE_BINDING_BIT bit of the
6003e5c31af7Sopenharmony_ci    pname:flags member,
6004e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_device_group[]
6005e5c31af7Sopenharmony_ci    the ename:VK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT bit of the
6006e5c31af7Sopenharmony_ci    pname:flags member,
6007e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_device_group[]
6008e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_external_memory[]
6009e5c31af7Sopenharmony_ci    pname:handleTypes member of slink:VkExternalMemoryImageCreateInfo,
6010e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_external_memory[]
6011e5c31af7Sopenharmony_ci    and the ename:VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT of the pname:usage
6012e5c31af7Sopenharmony_ci    member in the slink:VkImageCreateInfo structure passed to
6013e5c31af7Sopenharmony_ci    flink:vkCreateImage.
6014e5c31af7Sopenharmony_ci  * If the memory requirements are for a sname:VkImage, the
6015e5c31af7Sopenharmony_ci    pname:memoryTypeBits member must: not refer to a sname:VkMemoryType with
6016e5c31af7Sopenharmony_ci    a pname:propertyFlags that has the
6017e5c31af7Sopenharmony_ci    ename:VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT bit set if the pname:image
6018e5c31af7Sopenharmony_ci    did not have ename:VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT bit set in
6019e5c31af7Sopenharmony_ci    the pname:usage member of the slink:VkImageCreateInfo structure passed
6020e5c31af7Sopenharmony_ci    to flink:vkCreateImage.
6021e5c31af7Sopenharmony_ci  * If the memory requirements are for a sname:VkBuffer, the
6022e5c31af7Sopenharmony_ci    pname:memoryTypeBits member must: not refer to a sname:VkMemoryType with
6023e5c31af7Sopenharmony_ci    a pname:propertyFlags that has the
6024e5c31af7Sopenharmony_ci    ename:VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT bit set.
6025e5c31af7Sopenharmony_ci+
6026e5c31af7Sopenharmony_ci[NOTE]
6027e5c31af7Sopenharmony_ci.Note
6028e5c31af7Sopenharmony_ci====
6029e5c31af7Sopenharmony_ciThe implication of this requirement is that lazily allocated memory is
6030e5c31af7Sopenharmony_cidisallowed for buffers in all cases.
6031e5c31af7Sopenharmony_ci====
6032e5c31af7Sopenharmony_ci  * The pname:size member is identical for all sname:VkBuffer objects
6033e5c31af7Sopenharmony_ci    created with the same combination of creation parameters specified in
6034e5c31af7Sopenharmony_ci    slink:VkBufferCreateInfo and its pname:pNext chain.
6035e5c31af7Sopenharmony_ci  * The pname:size member is identical for all sname:VkImage objects created
6036e5c31af7Sopenharmony_ci    with the same combination of creation parameters specified in
6037e5c31af7Sopenharmony_ci    slink:VkImageCreateInfo and its pname:pNext chain.
6038e5c31af7Sopenharmony_ci+
6039e5c31af7Sopenharmony_ci[NOTE]
6040e5c31af7Sopenharmony_ci.Note
6041e5c31af7Sopenharmony_ci====
6042e5c31af7Sopenharmony_ciThis, however, does not imply that they interpret the contents of the bound
6043e5c31af7Sopenharmony_cimemory identically with each other.
6044e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_bind_memory2[]
6045e5c31af7Sopenharmony_ciThat additional guarantee, however, can: be explicitly requested using
6046e5c31af7Sopenharmony_ciename:VK_IMAGE_CREATE_ALIAS_BIT.
6047e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_bind_memory2[]
6048e5c31af7Sopenharmony_ci====
6049e5c31af7Sopenharmony_ciifdef::VK_KHR_maintenance4[]
6050e5c31af7Sopenharmony_ci  * If the <<features-maintenance4, pname:maintenance4>> feature is enabled,
6051e5c31af7Sopenharmony_ci    these additional guarantees apply:
6052e5c31af7Sopenharmony_ci  ** For a sname:VkBuffer, the pname:size memory requirement is never
6053e5c31af7Sopenharmony_ci     greater than that of another sname:VkBuffer created with a greater or
6054e5c31af7Sopenharmony_ci     equal pname:size specified in slink:VkBufferCreateInfo, all other
6055e5c31af7Sopenharmony_ci     creation parameters being identical.
6056e5c31af7Sopenharmony_ci  ** For a sname:VkBuffer, the pname:size memory requirement is never
6057e5c31af7Sopenharmony_ci     greater than the result of aligning
6058e5c31af7Sopenharmony_ci     slink:VkBufferCreateInfo::pname:size with the pname:alignment memory
6059e5c31af7Sopenharmony_ci     requirement.
6060e5c31af7Sopenharmony_ci  ** For a slink:VkImage, the pname:size memory requirement is never greater
6061e5c31af7Sopenharmony_ci     than that of another slink:VkImage created with a greater or equal
6062e5c31af7Sopenharmony_ci     value in each of pname:extent.width, pname:extent.height, and
6063e5c31af7Sopenharmony_ci     pname:extent.depth; all other creation parameters being identical.
6064e5c31af7Sopenharmony_ci  ** The memory requirements returned by
6065e5c31af7Sopenharmony_ci     flink:vkGetDeviceBufferMemoryRequirementsKHR are identical to those
6066e5c31af7Sopenharmony_ci     that would be returned by flink:vkGetBufferMemoryRequirements2 if it
6067e5c31af7Sopenharmony_ci     were called with a sname:VkBuffer created with the same
6068e5c31af7Sopenharmony_ci     slink:VkBufferCreateInfo values.
6069e5c31af7Sopenharmony_ci  ** The memory requirements returned by
6070e5c31af7Sopenharmony_ci     flink:vkGetDeviceImageMemoryRequirementsKHR are identical to those that
6071e5c31af7Sopenharmony_ci     would be returned by flink:vkGetImageMemoryRequirements2 if it were
6072e5c31af7Sopenharmony_ci     called with a sname:VkImage created with the same
6073e5c31af7Sopenharmony_ci     slink:VkImageCreateInfo values.
6074e5c31af7Sopenharmony_ciendif::VK_KHR_maintenance4[]
6075e5c31af7Sopenharmony_ci
6076e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_get_memory_requirements2[]
6077e5c31af7Sopenharmony_ci[open,refpage='vkGetBufferMemoryRequirements2',desc='Returns the memory requirements for specified Vulkan object',type='protos']
6078e5c31af7Sopenharmony_ci--
6079e5c31af7Sopenharmony_ciTo determine the memory requirements for a buffer resource, call:
6080e5c31af7Sopenharmony_ci
6081e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1[]
6082e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkGetBufferMemoryRequirements2.txt[]
6083e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1[]
6084e5c31af7Sopenharmony_ci
6085e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1+VK_KHR_get_memory_requirements2[or the equivalent command]
6086e5c31af7Sopenharmony_ci
6087e5c31af7Sopenharmony_ciifdef::VK_KHR_get_memory_requirements2[]
6088e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkGetBufferMemoryRequirements2KHR.txt[]
6089e5c31af7Sopenharmony_ciendif::VK_KHR_get_memory_requirements2[]
6090e5c31af7Sopenharmony_ci
6091e5c31af7Sopenharmony_ci  * pname:device is the logical device that owns the buffer.
6092e5c31af7Sopenharmony_ci  * pname:pInfo is a pointer to a slink:VkBufferMemoryRequirementsInfo2
6093e5c31af7Sopenharmony_ci    structure containing parameters required for the memory requirements
6094e5c31af7Sopenharmony_ci    query.
6095e5c31af7Sopenharmony_ci  * pname:pMemoryRequirements is a pointer to a slink:VkMemoryRequirements2
6096e5c31af7Sopenharmony_ci    structure in which the memory requirements of the buffer object are
6097e5c31af7Sopenharmony_ci    returned.
6098e5c31af7Sopenharmony_ci
6099e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkGetBufferMemoryRequirements2.txt[]
6100e5c31af7Sopenharmony_ci--
6101e5c31af7Sopenharmony_ci
6102e5c31af7Sopenharmony_ciifdef::VK_KHR_maintenance4[]
6103e5c31af7Sopenharmony_ci[open,refpage='vkGetDeviceBufferMemoryRequirementsKHR',desc='Returns the memory requirements for specified Vulkan object',type='protos']
6104e5c31af7Sopenharmony_ci--
6105e5c31af7Sopenharmony_ciTo determine the memory requirements for a buffer resource without creating
6106e5c31af7Sopenharmony_cian object, call:
6107e5c31af7Sopenharmony_ci
6108e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkGetDeviceBufferMemoryRequirementsKHR.txt[]
6109e5c31af7Sopenharmony_ci
6110e5c31af7Sopenharmony_ci  * pname:device is the logical device intended to own the buffer.
6111e5c31af7Sopenharmony_ci  * pname:pInfo is a pointer to a slink:VkDeviceBufferMemoryRequirementsKHR
6112e5c31af7Sopenharmony_ci    structure containing parameters required for the memory requirements
6113e5c31af7Sopenharmony_ci    query.
6114e5c31af7Sopenharmony_ci  * pname:pMemoryRequirements is a pointer to a slink:VkMemoryRequirements2
6115e5c31af7Sopenharmony_ci    structure in which the memory requirements of the buffer object are
6116e5c31af7Sopenharmony_ci    returned.
6117e5c31af7Sopenharmony_ci
6118e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkGetDeviceBufferMemoryRequirementsKHR.txt[]
6119e5c31af7Sopenharmony_ci--
6120e5c31af7Sopenharmony_ciendif::VK_KHR_maintenance4[]
6121e5c31af7Sopenharmony_ci
6122e5c31af7Sopenharmony_ci[open,refpage='VkBufferMemoryRequirementsInfo2',desc='(None)',type='structs']
6123e5c31af7Sopenharmony_ci--
6124e5c31af7Sopenharmony_ciThe sname:VkBufferMemoryRequirementsInfo2 structure is defined as:
6125e5c31af7Sopenharmony_ci
6126e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkBufferMemoryRequirementsInfo2.txt[]
6127e5c31af7Sopenharmony_ci
6128e5c31af7Sopenharmony_ciifdef::VK_KHR_get_memory_requirements2[]
6129e5c31af7Sopenharmony_cior the equivalent
6130e5c31af7Sopenharmony_ci
6131e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkBufferMemoryRequirementsInfo2KHR.txt[]
6132e5c31af7Sopenharmony_ciendif::VK_KHR_get_memory_requirements2[]
6133e5c31af7Sopenharmony_ci
6134e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure.
6135e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
6136e5c31af7Sopenharmony_ci    structure.
6137e5c31af7Sopenharmony_ci  * pname:buffer is the buffer to query.
6138e5c31af7Sopenharmony_ci
6139e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkBufferMemoryRequirementsInfo2.txt[]
6140e5c31af7Sopenharmony_ci--
6141e5c31af7Sopenharmony_ci
6142e5c31af7Sopenharmony_ciifdef::VK_KHR_maintenance4[]
6143e5c31af7Sopenharmony_ci[open,refpage='VkDeviceBufferMemoryRequirementsKHR',desc='(None)',type='structs']
6144e5c31af7Sopenharmony_ci--
6145e5c31af7Sopenharmony_ciThe sname:VkDeviceBufferMemoryRequirementsKHR structure is defined as:
6146e5c31af7Sopenharmony_ci
6147e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkDeviceBufferMemoryRequirementsKHR.txt[]
6148e5c31af7Sopenharmony_ci
6149e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure.
6150e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
6151e5c31af7Sopenharmony_ci    structure.
6152e5c31af7Sopenharmony_ci  * pname:pCreateInfo is a pointer to a slink:VkBufferCreateInfo structure
6153e5c31af7Sopenharmony_ci    containing parameters affecting creation of the buffer to query.
6154e5c31af7Sopenharmony_ci
6155e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkDeviceBufferMemoryRequirementsKHR.txt[]
6156e5c31af7Sopenharmony_ci--
6157e5c31af7Sopenharmony_ciendif::VK_KHR_maintenance4[]
6158e5c31af7Sopenharmony_ci
6159e5c31af7Sopenharmony_ci[open,refpage='vkGetImageMemoryRequirements2',desc='Returns the memory requirements for specified Vulkan object',type='protos']
6160e5c31af7Sopenharmony_ci--
6161e5c31af7Sopenharmony_ciTo determine the memory requirements for an image resource, call:
6162e5c31af7Sopenharmony_ci
6163e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1[]
6164e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkGetImageMemoryRequirements2.txt[]
6165e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1[]
6166e5c31af7Sopenharmony_ci
6167e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1+VK_KHR_get_memory_requirements2[or the equivalent command]
6168e5c31af7Sopenharmony_ci
6169e5c31af7Sopenharmony_ciifdef::VK_KHR_get_memory_requirements2[]
6170e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkGetImageMemoryRequirements2KHR.txt[]
6171e5c31af7Sopenharmony_ciendif::VK_KHR_get_memory_requirements2[]
6172e5c31af7Sopenharmony_ci
6173e5c31af7Sopenharmony_ci  * pname:device is the logical device that owns the image.
6174e5c31af7Sopenharmony_ci  * pname:pInfo is a pointer to a slink:VkImageMemoryRequirementsInfo2
6175e5c31af7Sopenharmony_ci    structure containing parameters required for the memory requirements
6176e5c31af7Sopenharmony_ci    query.
6177e5c31af7Sopenharmony_ci  * pname:pMemoryRequirements is a pointer to a slink:VkMemoryRequirements2
6178e5c31af7Sopenharmony_ci    structure in which the memory requirements of the image object are
6179e5c31af7Sopenharmony_ci    returned.
6180e5c31af7Sopenharmony_ci
6181e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkGetImageMemoryRequirements2.txt[]
6182e5c31af7Sopenharmony_ci--
6183e5c31af7Sopenharmony_ci
6184e5c31af7Sopenharmony_ciifdef::VK_KHR_maintenance4[]
6185e5c31af7Sopenharmony_ci[open,refpage='vkGetDeviceImageMemoryRequirementsKHR',desc='Returns the memory requirements for specified Vulkan object',type='protos']
6186e5c31af7Sopenharmony_ci--
6187e5c31af7Sopenharmony_ciTo determine the memory requirements for an image resource without creating
6188e5c31af7Sopenharmony_cian object, call:
6189e5c31af7Sopenharmony_ci
6190e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkGetDeviceImageMemoryRequirementsKHR.txt[]
6191e5c31af7Sopenharmony_ci
6192e5c31af7Sopenharmony_ci  * pname:device is the logical device intended to own the image.
6193e5c31af7Sopenharmony_ci  * pname:pInfo is a pointer to a slink:VkDeviceImageMemoryRequirementsKHR
6194e5c31af7Sopenharmony_ci    structure containing parameters required for the memory requirements
6195e5c31af7Sopenharmony_ci    query.
6196e5c31af7Sopenharmony_ci  * pname:pMemoryRequirements is a pointer to a slink:VkMemoryRequirements2
6197e5c31af7Sopenharmony_ci    structure in which the memory requirements of the image object are
6198e5c31af7Sopenharmony_ci    returned.
6199e5c31af7Sopenharmony_ci
6200e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkGetDeviceImageMemoryRequirementsKHR.txt[]
6201e5c31af7Sopenharmony_ci--
6202e5c31af7Sopenharmony_ciendif::VK_KHR_maintenance4[]
6203e5c31af7Sopenharmony_ci
6204e5c31af7Sopenharmony_ci[open,refpage='VkImageMemoryRequirementsInfo2',desc='(None)',type='structs']
6205e5c31af7Sopenharmony_ci--
6206e5c31af7Sopenharmony_ciThe sname:VkImageMemoryRequirementsInfo2 structure is defined as:
6207e5c31af7Sopenharmony_ci
6208e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkImageMemoryRequirementsInfo2.txt[]
6209e5c31af7Sopenharmony_ci
6210e5c31af7Sopenharmony_ciifdef::VK_KHR_get_memory_requirements2[]
6211e5c31af7Sopenharmony_cior the equivalent
6212e5c31af7Sopenharmony_ci
6213e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkImageMemoryRequirementsInfo2KHR.txt[]
6214e5c31af7Sopenharmony_ciendif::VK_KHR_get_memory_requirements2[]
6215e5c31af7Sopenharmony_ci
6216e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure.
6217e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
6218e5c31af7Sopenharmony_ci    structure.
6219e5c31af7Sopenharmony_ci  * pname:image is the image to query.
6220e5c31af7Sopenharmony_ci
6221e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
6222e5c31af7Sopenharmony_ci
6223e5c31af7Sopenharmony_ci.Valid Usage
6224e5c31af7Sopenharmony_ci****
6225e5c31af7Sopenharmony_ci  * [[VUID-VkImageMemoryRequirementsInfo2-image-01589]]
6226e5c31af7Sopenharmony_ci    If pname:image was created with a _multi-planar_ format and the
6227e5c31af7Sopenharmony_ci    ename:VK_IMAGE_CREATE_DISJOINT_BIT flag, there must: be a
6228e5c31af7Sopenharmony_ci    slink:VkImagePlaneMemoryRequirementsInfo included in the pname:pNext
6229e5c31af7Sopenharmony_ci    chain of the slink:VkImageMemoryRequirementsInfo2 structure
6230e5c31af7Sopenharmony_ciifdef::VK_EXT_image_drm_format_modifier[]
6231e5c31af7Sopenharmony_ci  * [[VUID-VkImageMemoryRequirementsInfo2-image-02279]]
6232e5c31af7Sopenharmony_ci    If pname:image was created with ename:VK_IMAGE_CREATE_DISJOINT_BIT and
6233e5c31af7Sopenharmony_ci    with ename:VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT, then there must: be
6234e5c31af7Sopenharmony_ci    a slink:VkImagePlaneMemoryRequirementsInfo included in the pname:pNext
6235e5c31af7Sopenharmony_ci    chain of the slink:VkImageMemoryRequirementsInfo2 structure
6236e5c31af7Sopenharmony_ciendif::VK_EXT_image_drm_format_modifier[]
6237e5c31af7Sopenharmony_ci  * [[VUID-VkImageMemoryRequirementsInfo2-image-01590]]
6238e5c31af7Sopenharmony_ci    If pname:image was not created with the
6239e5c31af7Sopenharmony_ci    ename:VK_IMAGE_CREATE_DISJOINT_BIT flag, there must: not be a
6240e5c31af7Sopenharmony_ci    slink:VkImagePlaneMemoryRequirementsInfo included in the pname:pNext
6241e5c31af7Sopenharmony_ci    chain of the slink:VkImageMemoryRequirementsInfo2 structure
6242e5c31af7Sopenharmony_ciifndef::VK_EXT_image_drm_format_modifier[]
6243e5c31af7Sopenharmony_ci  * [[VUID-VkImageMemoryRequirementsInfo2-image-01591]]
6244e5c31af7Sopenharmony_ci    If pname:image was created with a single-plane format, there must: not
6245e5c31af7Sopenharmony_ci    be a slink:VkImagePlaneMemoryRequirementsInfo included in the
6246e5c31af7Sopenharmony_ci    pname:pNext chain of the slink:VkImageMemoryRequirementsInfo2 structure
6247e5c31af7Sopenharmony_ciendif::VK_EXT_image_drm_format_modifier[]
6248e5c31af7Sopenharmony_ciifdef::VK_EXT_image_drm_format_modifier[]
6249e5c31af7Sopenharmony_ci  * [[VUID-VkImageMemoryRequirementsInfo2-image-02280]]
6250e5c31af7Sopenharmony_ci    If pname:image was created with a single-plane format and with any
6251e5c31af7Sopenharmony_ci    pname:tiling other than ename:VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT,
6252e5c31af7Sopenharmony_ci    then there must: not be a slink:VkImagePlaneMemoryRequirementsInfo
6253e5c31af7Sopenharmony_ci    included in the pname:pNext chain of the
6254e5c31af7Sopenharmony_ci    slink:VkImageMemoryRequirementsInfo2 structure
6255e5c31af7Sopenharmony_ciendif::VK_EXT_image_drm_format_modifier[]
6256e5c31af7Sopenharmony_ciifdef::VK_ANDROID_external_memory_android_hardware_buffer[]
6257e5c31af7Sopenharmony_ci  * [[VUID-VkImageMemoryRequirementsInfo2-image-01897]]
6258e5c31af7Sopenharmony_ci    If pname:image was created with the
6259e5c31af7Sopenharmony_ci    ename:VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID
6260e5c31af7Sopenharmony_ci    external memory handle type, then pname:image must: be bound to memory
6261e5c31af7Sopenharmony_ciendif::VK_ANDROID_external_memory_android_hardware_buffer[]
6262e5c31af7Sopenharmony_ci****
6263e5c31af7Sopenharmony_ci
6264e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
6265e5c31af7Sopenharmony_ci
6266e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkImageMemoryRequirementsInfo2.txt[]
6267e5c31af7Sopenharmony_ci--
6268e5c31af7Sopenharmony_ci
6269e5c31af7Sopenharmony_ciifdef::VK_KHR_maintenance4[]
6270e5c31af7Sopenharmony_ci[open,refpage='VkDeviceImageMemoryRequirementsKHR',desc='(None)',type='structs']
6271e5c31af7Sopenharmony_ci--
6272e5c31af7Sopenharmony_ciThe sname:VkDeviceImageMemoryRequirementsKHR structure is defined as:
6273e5c31af7Sopenharmony_ci
6274e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkDeviceImageMemoryRequirementsKHR.txt[]
6275e5c31af7Sopenharmony_ci
6276e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure.
6277e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
6278e5c31af7Sopenharmony_ci    structure.
6279e5c31af7Sopenharmony_ci  * pname:pCreateInfo is a pointer to a slink:VkImageCreateInfo structure
6280e5c31af7Sopenharmony_ci    containing parameters affecting creation of the image to query.
6281e5c31af7Sopenharmony_ci  * pname:planeAspect is a elink:VkImageAspectFlagBits value specifying the
6282e5c31af7Sopenharmony_ci    aspect corresponding to the image plane to query.
6283e5c31af7Sopenharmony_ci    This parameter is ignored unless pname:pCreateInfo::pname:flags has
6284e5c31af7Sopenharmony_ci    ename:VK_IMAGE_CREATE_DISJOINT_BIT
6285e5c31af7Sopenharmony_ciifdef::VK_EXT_image_drm_format_modifier[]
6286e5c31af7Sopenharmony_ci    or ename:VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT
6287e5c31af7Sopenharmony_ciendif::VK_EXT_image_drm_format_modifier[]
6288e5c31af7Sopenharmony_ci    set.
6289e5c31af7Sopenharmony_ci
6290e5c31af7Sopenharmony_ci.Valid Usage
6291e5c31af7Sopenharmony_ci****
6292e5c31af7Sopenharmony_ci  * [[VUID-VkDeviceImageMemoryRequirementsKHR-pCreateInfo-06416]]
6293e5c31af7Sopenharmony_ci    The pname:pCreateInfo::pname:pNext chain must: not contain a
6294e5c31af7Sopenharmony_ci    slink:VkImageSwapchainCreateInfoKHR structure
6295e5c31af7Sopenharmony_ci  * [[VUID-VkDeviceImageMemoryRequirementsKHR-pCreateInfo-06417]]
6296e5c31af7Sopenharmony_ci    If pname:pCreateInfo::pname:flags has ename:VK_IMAGE_CREATE_DISJOINT_BIT
6297e5c31af7Sopenharmony_ci    set then pname:planAspect must: not be zero
6298e5c31af7Sopenharmony_ciifdef::VK_EXT_image_drm_format_modifier[]
6299e5c31af7Sopenharmony_ci  * [[VUID-VkDeviceImageMemoryRequirementsKHR-pCreateInfo-06418]]
6300e5c31af7Sopenharmony_ci    If pname:pCreateInfo::pname:flags has
6301e5c31af7Sopenharmony_ci    ename:VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT set then pname:planAspect
6302e5c31af7Sopenharmony_ci    must: not be zero
6303e5c31af7Sopenharmony_ciendif::VK_EXT_image_drm_format_modifier[]
6304e5c31af7Sopenharmony_ci  * [[VUID-VkDeviceImageMemoryRequirementsKHR-pCreateInfo-06419]]
6305e5c31af7Sopenharmony_ci    If pname:pCreateInfo::pname:flags has ename:VK_IMAGE_CREATE_DISJOINT_BIT
6306e5c31af7Sopenharmony_ci    set and if the pname:pCreateInfo::pname:tiling is
6307e5c31af7Sopenharmony_ci    ename:VK_IMAGE_TILING_LINEAR or ename:VK_IMAGE_TILING_OPTIMAL, then
6308e5c31af7Sopenharmony_ci    pname:planeAspect must: be a single valid _format plane_ for the image
6309e5c31af7Sopenharmony_ci    (that is, for a two-plane image pname:planeAspect must: be
6310e5c31af7Sopenharmony_ci    ename:VK_IMAGE_ASPECT_PLANE_0_BIT or ename:VK_IMAGE_ASPECT_PLANE_1_BIT,
6311e5c31af7Sopenharmony_ci    and for a three-plane image pname:planeAspect must: be
6312e5c31af7Sopenharmony_ci    ename:VK_IMAGE_ASPECT_PLANE_0_BIT, ename:VK_IMAGE_ASPECT_PLANE_1_BIT or
6313e5c31af7Sopenharmony_ci    ename:VK_IMAGE_ASPECT_PLANE_2_BIT)
6314e5c31af7Sopenharmony_ciifdef::VK_EXT_image_drm_format_modifier[]
6315e5c31af7Sopenharmony_ci  * [[VUID-VkDeviceImageMemoryRequirementsKHR-pCreateInfo-06420]]
6316e5c31af7Sopenharmony_ci    If pname:pCreateInfo::pname:flags has
6317e5c31af7Sopenharmony_ci    ename:VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT set and the
6318e5c31af7Sopenharmony_ci    pname:pCreateInfo::pname:tiling is
6319e5c31af7Sopenharmony_ci    ename:VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT, then pname:planeAspect
6320e5c31af7Sopenharmony_ci    must: be a single valid _memory plane_ for the image (that is,
6321e5c31af7Sopenharmony_ci    pname:aspectMask must: specify a plane index that is less than the
6322e5c31af7Sopenharmony_ci    slink:VkDrmFormatModifierPropertiesEXT::pname:drmFormatModifierPlaneCount
6323e5c31af7Sopenharmony_ci    associated with the image's pname:format and
6324e5c31af7Sopenharmony_ci    slink:VkImageDrmFormatModifierPropertiesEXT::pname:drmFormatModifier)
6325e5c31af7Sopenharmony_ciendif::VK_EXT_image_drm_format_modifier[]
6326e5c31af7Sopenharmony_ci****
6327e5c31af7Sopenharmony_ci
6328e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkDeviceImageMemoryRequirementsKHR.txt[]
6329e5c31af7Sopenharmony_ci--
6330e5c31af7Sopenharmony_ciendif::VK_KHR_maintenance4[]
6331e5c31af7Sopenharmony_ci
6332e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
6333e5c31af7Sopenharmony_ci[open,refpage='VkImagePlaneMemoryRequirementsInfo',desc='Structure specifying image plane for memory requirements',type='structs']
6334e5c31af7Sopenharmony_ci--
6335e5c31af7Sopenharmony_ciTo determine the memory requirements for a plane of a disjoint image, add a
6336e5c31af7Sopenharmony_cisname:VkImagePlaneMemoryRequirementsInfo structure to the pname:pNext chain
6337e5c31af7Sopenharmony_ciof the sname:VkImageMemoryRequirementsInfo2 structure.
6338e5c31af7Sopenharmony_ci
6339e5c31af7Sopenharmony_ciThe sname:VkImagePlaneMemoryRequirementsInfo structure is defined as:
6340e5c31af7Sopenharmony_ci
6341e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkImagePlaneMemoryRequirementsInfo.txt[]
6342e5c31af7Sopenharmony_ci
6343e5c31af7Sopenharmony_ciifdef::VK_KHR_sampler_ycbcr_conversion[]
6344e5c31af7Sopenharmony_cior the equivalent
6345e5c31af7Sopenharmony_ci
6346e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkImagePlaneMemoryRequirementsInfoKHR.txt[]
6347e5c31af7Sopenharmony_ciendif::VK_KHR_sampler_ycbcr_conversion[]
6348e5c31af7Sopenharmony_ci
6349e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure.
6350e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
6351e5c31af7Sopenharmony_ci    structure.
6352e5c31af7Sopenharmony_ci  * pname:planeAspect is a elink:VkImageAspectFlagBits value specifying the
6353e5c31af7Sopenharmony_ci    aspect corresponding to the image plane to query.
6354e5c31af7Sopenharmony_ci
6355e5c31af7Sopenharmony_ci.Valid Usage
6356e5c31af7Sopenharmony_ci****
6357e5c31af7Sopenharmony_ci  * [[VUID-VkImagePlaneMemoryRequirementsInfo-planeAspect-02281]]
6358e5c31af7Sopenharmony_ci    If the image's pname:tiling is ename:VK_IMAGE_TILING_LINEAR or
6359e5c31af7Sopenharmony_ci    ename:VK_IMAGE_TILING_OPTIMAL, then pname:planeAspect must: be a single
6360e5c31af7Sopenharmony_ci    valid _format plane_ for the image (that is, for a two-plane image
6361e5c31af7Sopenharmony_ci    pname:planeAspect must: be ename:VK_IMAGE_ASPECT_PLANE_0_BIT or
6362e5c31af7Sopenharmony_ci    ename:VK_IMAGE_ASPECT_PLANE_1_BIT, and for a three-plane image
6363e5c31af7Sopenharmony_ci    pname:planeAspect must: be ename:VK_IMAGE_ASPECT_PLANE_0_BIT,
6364e5c31af7Sopenharmony_ci    ename:VK_IMAGE_ASPECT_PLANE_1_BIT or ename:VK_IMAGE_ASPECT_PLANE_2_BIT)
6365e5c31af7Sopenharmony_ciifdef::VK_EXT_image_drm_format_modifier[]
6366e5c31af7Sopenharmony_ci  * [[VUID-VkImagePlaneMemoryRequirementsInfo-planeAspect-02282]]
6367e5c31af7Sopenharmony_ci    If the image's pname:tiling is
6368e5c31af7Sopenharmony_ci    ename:VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT, then pname:planeAspect
6369e5c31af7Sopenharmony_ci    must: be a single valid _memory plane_ for the image (that is,
6370e5c31af7Sopenharmony_ci    pname:aspectMask must: specify a plane index that is less than the
6371e5c31af7Sopenharmony_ci    slink:VkDrmFormatModifierPropertiesEXT::pname:drmFormatModifierPlaneCount
6372e5c31af7Sopenharmony_ci    associated with the image's pname:format and
6373e5c31af7Sopenharmony_ci    slink:VkImageDrmFormatModifierPropertiesEXT::pname:drmFormatModifier)
6374e5c31af7Sopenharmony_ciendif::VK_EXT_image_drm_format_modifier[]
6375e5c31af7Sopenharmony_ci****
6376e5c31af7Sopenharmony_ci
6377e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkImagePlaneMemoryRequirementsInfo.txt[]
6378e5c31af7Sopenharmony_ci--
6379e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
6380e5c31af7Sopenharmony_ci
6381e5c31af7Sopenharmony_ci[open,refpage='VkMemoryRequirements2',desc='Structure specifying memory requirements',type='structs']
6382e5c31af7Sopenharmony_ci--
6383e5c31af7Sopenharmony_ciThe sname:VkMemoryRequirements2 structure is defined as:
6384e5c31af7Sopenharmony_ci
6385e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkMemoryRequirements2.txt[]
6386e5c31af7Sopenharmony_ci
6387e5c31af7Sopenharmony_ciifdef::VK_KHR_get_memory_requirements2[]
6388e5c31af7Sopenharmony_cior the equivalent
6389e5c31af7Sopenharmony_ci
6390e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkMemoryRequirements2KHR.txt[]
6391e5c31af7Sopenharmony_ciendif::VK_KHR_get_memory_requirements2[]
6392e5c31af7Sopenharmony_ci
6393e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure.
6394e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
6395e5c31af7Sopenharmony_ci    structure.
6396e5c31af7Sopenharmony_ci  * pname:memoryRequirements is a slink:VkMemoryRequirements structure
6397e5c31af7Sopenharmony_ci    describing the memory requirements of the resource.
6398e5c31af7Sopenharmony_ci
6399e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkMemoryRequirements2.txt[]
6400e5c31af7Sopenharmony_ci--
6401e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_get_memory_requirements2[]
6402e5c31af7Sopenharmony_ci
6403e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_dedicated_allocation[]
6404e5c31af7Sopenharmony_ci[open,refpage='VkMemoryDedicatedRequirements',desc='Structure describing dedicated allocation requirements of buffer and image resources',type='structs']
6405e5c31af7Sopenharmony_ci--
6406e5c31af7Sopenharmony_ciThe sname:VkMemoryDedicatedRequirements structure is defined as:
6407e5c31af7Sopenharmony_ci
6408e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkMemoryDedicatedRequirements.txt[]
6409e5c31af7Sopenharmony_ci
6410e5c31af7Sopenharmony_ciifdef::VK_KHR_dedicated_allocation[]
6411e5c31af7Sopenharmony_cior the equivalent
6412e5c31af7Sopenharmony_ci
6413e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkMemoryDedicatedRequirementsKHR.txt[]
6414e5c31af7Sopenharmony_ciendif::VK_KHR_dedicated_allocation[]
6415e5c31af7Sopenharmony_ci
6416e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure.
6417e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
6418e5c31af7Sopenharmony_ci    structure.
6419e5c31af7Sopenharmony_ci  * pname:prefersDedicatedAllocation specifies that the implementation would
6420e5c31af7Sopenharmony_ci    prefer a dedicated allocation for this resource.
6421e5c31af7Sopenharmony_ci    The application is still free to suballocate the resource but it may:
6422e5c31af7Sopenharmony_ci    get better performance if a dedicated allocation is used.
6423e5c31af7Sopenharmony_ci  * pname:requiresDedicatedAllocation specifies that a dedicated allocation
6424e5c31af7Sopenharmony_ci    is required for this resource.
6425e5c31af7Sopenharmony_ci
6426e5c31af7Sopenharmony_ciTo determine the dedicated allocation requirements of a buffer or image
6427e5c31af7Sopenharmony_ciresource, add a slink:VkMemoryDedicatedRequirements structure to the
6428e5c31af7Sopenharmony_cipname:pNext chain of the slink:VkMemoryRequirements2 structure passed as the
6429e5c31af7Sopenharmony_cipname:pMemoryRequirements parameter of flink:vkGetBufferMemoryRequirements2
6430e5c31af7Sopenharmony_cior flink:vkGetImageMemoryRequirements2, respectively.
6431e5c31af7Sopenharmony_ci
6432e5c31af7Sopenharmony_ciConstraints on the values returned for buffer resources are:
6433e5c31af7Sopenharmony_ci
6434e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_external_memory[]
6435e5c31af7Sopenharmony_ci  * pname:requiresDedicatedAllocation may: be ename:VK_TRUE if the
6436e5c31af7Sopenharmony_ci    pname:pNext chain of slink:VkBufferCreateInfo for the call to
6437e5c31af7Sopenharmony_ci    fname:vkCreateBuffer used to create the buffer being queried included a
6438e5c31af7Sopenharmony_ci    slink:VkExternalMemoryBufferCreateInfo structure, and any of the handle
6439e5c31af7Sopenharmony_ci    types specified in
6440e5c31af7Sopenharmony_ci    slink:VkExternalMemoryBufferCreateInfo::pname:handleTypes requires
6441e5c31af7Sopenharmony_ci    dedicated allocation, as reported by
6442e5c31af7Sopenharmony_ci    flink:vkGetPhysicalDeviceExternalBufferProperties in
6443e5c31af7Sopenharmony_ci    sname:VkExternalBufferProperties::pname:externalMemoryProperties.externalMemoryFeatures.
6444e5c31af7Sopenharmony_ci    Otherwise, pname:requiresDedicatedAllocation will be ename:VK_FALSE.
6445e5c31af7Sopenharmony_ci
6446e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_external_memory[]
6447e5c31af7Sopenharmony_ciifndef::VK_VERSION_1_1,VK_KHR_external_memory[]
6448e5c31af7Sopenharmony_ci  * pname:requiresDedicatedAllocation will be ename:VK_FALSE
6449e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_external_memory[]
6450e5c31af7Sopenharmony_ci  * When the implementation sets pname:requiresDedicatedAllocation to
6451e5c31af7Sopenharmony_ci    ename:VK_TRUE, it must: also set pname:prefersDedicatedAllocation to
6452e5c31af7Sopenharmony_ci    ename:VK_TRUE.
6453e5c31af7Sopenharmony_ci  * If ename:VK_BUFFER_CREATE_SPARSE_BINDING_BIT was set in
6454e5c31af7Sopenharmony_ci    slink:VkBufferCreateInfo::pname:flags when pname:buffer was created,
6455e5c31af7Sopenharmony_ci    then both pname:prefersDedicatedAllocation and
6456e5c31af7Sopenharmony_ci    pname:requiresDedicatedAllocation will be ename:VK_FALSE.
6457e5c31af7Sopenharmony_ci
6458e5c31af7Sopenharmony_ciConstraints on the values returned for image resources are:
6459e5c31af7Sopenharmony_ci
6460e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_external_memory[]
6461e5c31af7Sopenharmony_ci  * pname:requiresDedicatedAllocation may: be ename:VK_TRUE if the
6462e5c31af7Sopenharmony_ci    pname:pNext chain of slink:VkImageCreateInfo for the call to
6463e5c31af7Sopenharmony_ci    flink:vkCreateImage used to create the image being queried included a
6464e5c31af7Sopenharmony_ci    slink:VkExternalMemoryImageCreateInfo structure, and any of the handle
6465e5c31af7Sopenharmony_ci    types specified in
6466e5c31af7Sopenharmony_ci    slink:VkExternalMemoryImageCreateInfo::pname:handleTypes requires
6467e5c31af7Sopenharmony_ci    dedicated allocation, as reported by
6468e5c31af7Sopenharmony_ci    flink:vkGetPhysicalDeviceImageFormatProperties2 in
6469e5c31af7Sopenharmony_ci    sname:VkExternalImageFormatProperties::pname:externalMemoryProperties.externalMemoryFeatures.
6470e5c31af7Sopenharmony_ci    Otherwise, pname:requiresDedicatedAllocation will be ename:VK_FALSE.
6471e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_external_memory[]
6472e5c31af7Sopenharmony_ciifndef::VK_VERSION_1_1,VK_KHR_external_memory[]
6473e5c31af7Sopenharmony_ci  * pname:requiresDedicatedAllocation will be ename:VK_FALSE
6474e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_external_memory[]
6475e5c31af7Sopenharmony_ci  * If ename:VK_IMAGE_CREATE_SPARSE_BINDING_BIT was set in
6476e5c31af7Sopenharmony_ci    slink:VkImageCreateInfo::pname:flags when pname:image was created, then
6477e5c31af7Sopenharmony_ci    both pname:prefersDedicatedAllocation and
6478e5c31af7Sopenharmony_ci    pname:requiresDedicatedAllocation will be ename:VK_FALSE.
6479e5c31af7Sopenharmony_ci
6480e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkMemoryDedicatedRequirements.txt[]
6481e5c31af7Sopenharmony_ci--
6482e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_dedicated_allocation[]
6483e5c31af7Sopenharmony_ci
6484e5c31af7Sopenharmony_ci[open,refpage='vkBindBufferMemory',desc='Bind device memory to a buffer object',type='protos']
6485e5c31af7Sopenharmony_ci--
6486e5c31af7Sopenharmony_ci:refpage: vkBindBufferMemory
6487e5c31af7Sopenharmony_ci
6488e5c31af7Sopenharmony_ciTo attach memory to a buffer object, call:
6489e5c31af7Sopenharmony_ci
6490e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkBindBufferMemory.txt[]
6491e5c31af7Sopenharmony_ci
6492e5c31af7Sopenharmony_ci  * pname:device is the logical device that owns the buffer and memory.
6493e5c31af7Sopenharmony_ci  * pname:buffer is the buffer to be attached to memory.
6494e5c31af7Sopenharmony_ci  * pname:memory is a slink:VkDeviceMemory object describing the device
6495e5c31af7Sopenharmony_ci    memory to attach.
6496e5c31af7Sopenharmony_ci  * pname:memoryOffset is the start offset of the region of pname:memory
6497e5c31af7Sopenharmony_ci    which is to be bound to the buffer.
6498e5c31af7Sopenharmony_ci    The number of bytes returned in the
6499e5c31af7Sopenharmony_ci    sname:VkMemoryRequirements::pname:size member in pname:memory, starting
6500e5c31af7Sopenharmony_ci    from pname:memoryOffset bytes, will be bound to the specified buffer.
6501e5c31af7Sopenharmony_ci
6502e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_bind_memory2[]
6503e5c31af7Sopenharmony_cifname:vkBindBufferMemory is equivalent to passing the same parameters
6504e5c31af7Sopenharmony_cithrough slink:VkBindBufferMemoryInfo to flink:vkBindBufferMemory2.
6505e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_bind_memory2[]
6506e5c31af7Sopenharmony_ci
6507e5c31af7Sopenharmony_ci.Valid Usage
6508e5c31af7Sopenharmony_ci****
6509e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/bind_buffer_common.txt[]
6510e5c31af7Sopenharmony_ci****
6511e5c31af7Sopenharmony_ci
6512e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkBindBufferMemory.txt[]
6513e5c31af7Sopenharmony_ci--
6514e5c31af7Sopenharmony_ci
6515e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_bind_memory2[]
6516e5c31af7Sopenharmony_ci[open,refpage='vkBindBufferMemory2',desc='Bind device memory to buffer objects',type='protos']
6517e5c31af7Sopenharmony_ci--
6518e5c31af7Sopenharmony_ciTo attach memory to buffer objects for one or more buffers at a time, call:
6519e5c31af7Sopenharmony_ci
6520e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1[]
6521e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkBindBufferMemory2.txt[]
6522e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1[]
6523e5c31af7Sopenharmony_ci
6524e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1+VK_KHR_bind_memory2[or the equivalent command]
6525e5c31af7Sopenharmony_ci
6526e5c31af7Sopenharmony_ciifdef::VK_KHR_bind_memory2[]
6527e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkBindBufferMemory2KHR.txt[]
6528e5c31af7Sopenharmony_ciendif::VK_KHR_bind_memory2[]
6529e5c31af7Sopenharmony_ci
6530e5c31af7Sopenharmony_ci  * pname:device is the logical device that owns the buffers and memory.
6531e5c31af7Sopenharmony_ci  * pname:bindInfoCount is the number of elements in pname:pBindInfos.
6532e5c31af7Sopenharmony_ci  * pname:pBindInfos is a pointer to an array of pname:bindInfoCount
6533e5c31af7Sopenharmony_ci    slink:VkBindBufferMemoryInfo structures describing buffers and memory to
6534e5c31af7Sopenharmony_ci    bind.
6535e5c31af7Sopenharmony_ci
6536e5c31af7Sopenharmony_ciOn some implementations, it may: be more efficient to batch memory bindings
6537e5c31af7Sopenharmony_ciinto a single command.
6538e5c31af7Sopenharmony_ci
6539e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkBindBufferMemory2.txt[]
6540e5c31af7Sopenharmony_ci--
6541e5c31af7Sopenharmony_ci
6542e5c31af7Sopenharmony_ci[open,refpage='VkBindBufferMemoryInfo',desc='Structure specifying how to bind a buffer to memory',type='structs']
6543e5c31af7Sopenharmony_ci--
6544e5c31af7Sopenharmony_ci:refpage: VkBindBufferMemoryInfo
6545e5c31af7Sopenharmony_ci
6546e5c31af7Sopenharmony_cisname:VkBindBufferMemoryInfo contains members corresponding to the
6547e5c31af7Sopenharmony_ciparameters of flink:vkBindBufferMemory.
6548e5c31af7Sopenharmony_ci
6549e5c31af7Sopenharmony_ciThe sname:VkBindBufferMemoryInfo structure is defined as:
6550e5c31af7Sopenharmony_ci
6551e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkBindBufferMemoryInfo.txt[]
6552e5c31af7Sopenharmony_ci
6553e5c31af7Sopenharmony_ciifdef::VK_KHR_bind_memory2[]
6554e5c31af7Sopenharmony_cior the equivalent
6555e5c31af7Sopenharmony_ci
6556e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkBindBufferMemoryInfoKHR.txt[]
6557e5c31af7Sopenharmony_ciendif::VK_KHR_bind_memory2[]
6558e5c31af7Sopenharmony_ci
6559e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure.
6560e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
6561e5c31af7Sopenharmony_ci    structure.
6562e5c31af7Sopenharmony_ci  * pname:buffer is the buffer to be attached to memory.
6563e5c31af7Sopenharmony_ci  * pname:memory is a slink:VkDeviceMemory object describing the device
6564e5c31af7Sopenharmony_ci    memory to attach.
6565e5c31af7Sopenharmony_ci  * pname:memoryOffset is the start offset of the region of pname:memory
6566e5c31af7Sopenharmony_ci    which is to be bound to the buffer.
6567e5c31af7Sopenharmony_ci    The number of bytes returned in the
6568e5c31af7Sopenharmony_ci    sname:VkMemoryRequirements::pname:size member in pname:memory, starting
6569e5c31af7Sopenharmony_ci    from pname:memoryOffset bytes, will be bound to the specified buffer.
6570e5c31af7Sopenharmony_ci
6571e5c31af7Sopenharmony_ci.Valid Usage
6572e5c31af7Sopenharmony_ci****
6573e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/bind_buffer_common.txt[]
6574e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_device_group[]
6575e5c31af7Sopenharmony_ci  * [[VUID-VkBindBufferMemoryInfo-pNext-01605]]
6576e5c31af7Sopenharmony_ci    If the pname:pNext chain includes a
6577e5c31af7Sopenharmony_ci    slink:VkBindBufferMemoryDeviceGroupInfo structure, all instances of
6578e5c31af7Sopenharmony_ci    pname:memory specified by
6579e5c31af7Sopenharmony_ci    slink:VkBindBufferMemoryDeviceGroupInfo::pname:pDeviceIndices must: have
6580e5c31af7Sopenharmony_ci    been allocated
6581e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_device_group[]
6582e5c31af7Sopenharmony_ci****
6583e5c31af7Sopenharmony_ci
6584e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkBindBufferMemoryInfo.txt[]
6585e5c31af7Sopenharmony_ci--
6586e5c31af7Sopenharmony_ci
6587e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_device_group[]
6588e5c31af7Sopenharmony_ci[open,refpage='VkBindBufferMemoryDeviceGroupInfo',desc='Structure specifying device within a group to bind to',type='structs']
6589e5c31af7Sopenharmony_ci--
6590e5c31af7Sopenharmony_ciThe sname:VkBindBufferMemoryDeviceGroupInfo structure is defined as:
6591e5c31af7Sopenharmony_ci
6592e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkBindBufferMemoryDeviceGroupInfo.txt[]
6593e5c31af7Sopenharmony_ci
6594e5c31af7Sopenharmony_ci// Jon: this conditional needs to be enhanced for 1.1 / bind_memory_2
6595e5c31af7Sopenharmony_ciifdef::VK_KHR_device_group+VK_KHR_bind_memory2[]
6596e5c31af7Sopenharmony_cior the equivalent
6597e5c31af7Sopenharmony_ci
6598e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkBindBufferMemoryDeviceGroupInfoKHR.txt[]
6599e5c31af7Sopenharmony_ciendif::VK_KHR_device_group+VK_KHR_bind_memory2[]
6600e5c31af7Sopenharmony_ci
6601e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure.
6602e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
6603e5c31af7Sopenharmony_ci    structure.
6604e5c31af7Sopenharmony_ci  * pname:deviceIndexCount is the number of elements in
6605e5c31af7Sopenharmony_ci    pname:pDeviceIndices.
6606e5c31af7Sopenharmony_ci  * pname:pDeviceIndices is a pointer to an array of device indices.
6607e5c31af7Sopenharmony_ci
6608e5c31af7Sopenharmony_ciIf the pname:pNext chain of slink:VkBindBufferMemoryInfo includes a
6609e5c31af7Sopenharmony_cisname:VkBindBufferMemoryDeviceGroupInfo structure, then that structure
6610e5c31af7Sopenharmony_cidetermines how memory is bound to buffers across multiple devices in a
6611e5c31af7Sopenharmony_cidevice group.
6612e5c31af7Sopenharmony_ci
6613e5c31af7Sopenharmony_ciIf pname:deviceIndexCount is greater than zero, then on device index [eq]#i#
6614e5c31af7Sopenharmony_cithe buffer is attached to the instance of pname:memory on the physical
6615e5c31af7Sopenharmony_cidevice with device index [eq]#pname:pDeviceIndices[i]#.
6616e5c31af7Sopenharmony_ci
6617e5c31af7Sopenharmony_ciIf pname:deviceIndexCount is zero and pname:memory comes from a memory heap
6618e5c31af7Sopenharmony_ciwith the ename:VK_MEMORY_HEAP_MULTI_INSTANCE_BIT bit set, then it is as if
6619e5c31af7Sopenharmony_cipname:pDeviceIndices contains consecutive indices from zero to the number of
6620e5c31af7Sopenharmony_ciphysical devices in the logical device, minus one.
6621e5c31af7Sopenharmony_ciIn other words, by default each physical device attaches to its own instance
6622e5c31af7Sopenharmony_ciof pname:memory.
6623e5c31af7Sopenharmony_ci
6624e5c31af7Sopenharmony_ciIf pname:deviceIndexCount is zero and pname:memory comes from a memory heap
6625e5c31af7Sopenharmony_ciwithout the ename:VK_MEMORY_HEAP_MULTI_INSTANCE_BIT bit set, then it is as
6626e5c31af7Sopenharmony_ciif pname:pDeviceIndices contains an array of zeros.
6627e5c31af7Sopenharmony_ciIn other words, by default each physical device attaches to instance zero.
6628e5c31af7Sopenharmony_ci
6629e5c31af7Sopenharmony_ci.Valid Usage
6630e5c31af7Sopenharmony_ci****
6631e5c31af7Sopenharmony_ci  * [[VUID-VkBindBufferMemoryDeviceGroupInfo-deviceIndexCount-01606]]
6632e5c31af7Sopenharmony_ci    pname:deviceIndexCount must: either be zero or equal to the number of
6633e5c31af7Sopenharmony_ci    physical devices in the logical device
6634e5c31af7Sopenharmony_ci  * [[VUID-VkBindBufferMemoryDeviceGroupInfo-pDeviceIndices-01607]]
6635e5c31af7Sopenharmony_ci    All elements of pname:pDeviceIndices must: be valid device indices
6636e5c31af7Sopenharmony_ci****
6637e5c31af7Sopenharmony_ci
6638e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkBindBufferMemoryDeviceGroupInfo.txt[]
6639e5c31af7Sopenharmony_ci--
6640e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_device_group[]
6641e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_bind_memory2[]
6642e5c31af7Sopenharmony_ci
6643e5c31af7Sopenharmony_ci[open,refpage='vkBindImageMemory',desc='Bind device memory to an image object',type='protos']
6644e5c31af7Sopenharmony_ci--
6645e5c31af7Sopenharmony_ci:refpage: vkBindImageMemory
6646e5c31af7Sopenharmony_ci
6647e5c31af7Sopenharmony_ciifndef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
6648e5c31af7Sopenharmony_ciTo attach memory to an image object, call:
6649e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
6650e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
6651e5c31af7Sopenharmony_ciTo attach memory to a sname:VkImage object created without the
6652e5c31af7Sopenharmony_ciename:VK_IMAGE_CREATE_DISJOINT_BIT set, call:
6653e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
6654e5c31af7Sopenharmony_ci
6655e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkBindImageMemory.txt[]
6656e5c31af7Sopenharmony_ci
6657e5c31af7Sopenharmony_ci  * pname:device is the logical device that owns the image and memory.
6658e5c31af7Sopenharmony_ci  * pname:image is the image.
6659e5c31af7Sopenharmony_ci  * pname:memory is the slink:VkDeviceMemory object describing the device
6660e5c31af7Sopenharmony_ci    memory to attach.
6661e5c31af7Sopenharmony_ci  * pname:memoryOffset is the start offset of the region of pname:memory
6662e5c31af7Sopenharmony_ci    which is to be bound to the image.
6663e5c31af7Sopenharmony_ci    The number of bytes returned in the
6664e5c31af7Sopenharmony_ci    sname:VkMemoryRequirements::pname:size member in pname:memory, starting
6665e5c31af7Sopenharmony_ci    from pname:memoryOffset bytes, will be bound to the specified image.
6666e5c31af7Sopenharmony_ci
6667e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_bind_memory2[]
6668e5c31af7Sopenharmony_cifname:vkBindImageMemory is equivalent to passing the same parameters through
6669e5c31af7Sopenharmony_cislink:VkBindImageMemoryInfo to flink:vkBindImageMemory2.
6670e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_bind_memory2[]
6671e5c31af7Sopenharmony_ci
6672e5c31af7Sopenharmony_ci.Valid Usage
6673e5c31af7Sopenharmony_ci****
6674e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/bind_image_common.txt[]
6675e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
6676e5c31af7Sopenharmony_ci  * [[VUID-vkBindImageMemory-image-01608]]
6677e5c31af7Sopenharmony_ci    pname:image must: not have been created with the
6678e5c31af7Sopenharmony_ci    ename:VK_IMAGE_CREATE_DISJOINT_BIT set
6679e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
6680e5c31af7Sopenharmony_ci  * [[VUID-vkBindImageMemory-memory-01047]]
6681e5c31af7Sopenharmony_ci    pname:memory must: have been allocated using one of the memory types
6682e5c31af7Sopenharmony_ci    allowed in the pname:memoryTypeBits member of the
6683e5c31af7Sopenharmony_ci    sname:VkMemoryRequirements structure returned from a call to
6684e5c31af7Sopenharmony_ci    flink:vkGetImageMemoryRequirements with pname:image
6685e5c31af7Sopenharmony_ci  * [[VUID-vkBindImageMemory-memoryOffset-01048]]
6686e5c31af7Sopenharmony_ci    pname:memoryOffset must: be an integer multiple of the pname:alignment
6687e5c31af7Sopenharmony_ci    member of the sname:VkMemoryRequirements structure returned from a call
6688e5c31af7Sopenharmony_ci    to flink:vkGetImageMemoryRequirements with pname:image
6689e5c31af7Sopenharmony_ci  * [[VUID-vkBindImageMemory-size-01049]]
6690e5c31af7Sopenharmony_ci    The difference of the size of pname:memory and pname:memoryOffset must:
6691e5c31af7Sopenharmony_ci    be greater than or equal to the pname:size member of the
6692e5c31af7Sopenharmony_ci    slink:VkMemoryRequirements structure returned from a call to
6693e5c31af7Sopenharmony_ci    flink:vkGetImageMemoryRequirements with the same pname:image
6694e5c31af7Sopenharmony_ciifdef::VK_FUCHSIA_buffer_collection[]
6695e5c31af7Sopenharmony_ci  * [[VUID-vkBindImageMemory-image-06392]]
6696e5c31af7Sopenharmony_ci    If pname:image was created with
6697e5c31af7Sopenharmony_ci    slink:VkBufferCollectionImageCreateInfoFUCHSIA chained to
6698e5c31af7Sopenharmony_ci    slink:VkImageCreateInfo::pname:pNext, pname:memory must: be allocated
6699e5c31af7Sopenharmony_ci    with a slink:VkImportMemoryBufferCollectionFUCHSIA chained to
6700e5c31af7Sopenharmony_ci    slink:VkMemoryAllocateInfo::pname:pNext
6701e5c31af7Sopenharmony_ciendif::VK_FUCHSIA_buffer_collection[]
6702e5c31af7Sopenharmony_ci****
6703e5c31af7Sopenharmony_ci
6704e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkBindImageMemory.txt[]
6705e5c31af7Sopenharmony_ci--
6706e5c31af7Sopenharmony_ci
6707e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_bind_memory2[]
6708e5c31af7Sopenharmony_ci[open,refpage='vkBindImageMemory2',desc='Bind device memory to image objects',type='protos']
6709e5c31af7Sopenharmony_ci--
6710e5c31af7Sopenharmony_ciTo attach memory to image objects for one or more images at a time, call:
6711e5c31af7Sopenharmony_ci
6712e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1[]
6713e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkBindImageMemory2.txt[]
6714e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1[]
6715e5c31af7Sopenharmony_ci
6716e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1+VK_KHR_bind_memory2[or the equivalent command]
6717e5c31af7Sopenharmony_ci
6718e5c31af7Sopenharmony_ciifdef::VK_KHR_bind_memory2[]
6719e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkBindImageMemory2KHR.txt[]
6720e5c31af7Sopenharmony_ciendif::VK_KHR_bind_memory2[]
6721e5c31af7Sopenharmony_ci
6722e5c31af7Sopenharmony_ci  * pname:device is the logical device that owns the images and memory.
6723e5c31af7Sopenharmony_ci  * pname:bindInfoCount is the number of elements in pname:pBindInfos.
6724e5c31af7Sopenharmony_ci  * pname:pBindInfos is a pointer to an array of slink:VkBindImageMemoryInfo
6725e5c31af7Sopenharmony_ci    structures, describing images and memory to bind.
6726e5c31af7Sopenharmony_ci
6727e5c31af7Sopenharmony_ciOn some implementations, it may: be more efficient to batch memory bindings
6728e5c31af7Sopenharmony_ciinto a single command.
6729e5c31af7Sopenharmony_ci
6730e5c31af7Sopenharmony_ci.Valid Usage
6731e5c31af7Sopenharmony_ci****
6732e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
6733e5c31af7Sopenharmony_ci  * [[VUID-vkBindImageMemory2-pBindInfos-02858]]
6734e5c31af7Sopenharmony_ci    If any slink:VkBindImageMemoryInfo::pname:image was created with
6735e5c31af7Sopenharmony_ci    ename:VK_IMAGE_CREATE_DISJOINT_BIT then all planes of
6736e5c31af7Sopenharmony_ci    slink:VkBindImageMemoryInfo::pname:image must: be bound individually in
6737e5c31af7Sopenharmony_ci    separate pname:pBindInfos
6738e5c31af7Sopenharmony_ci  * [[VUID-vkBindImageMemory2-pBindInfos-04006]]
6739e5c31af7Sopenharmony_ci    pname:pBindInfos must: not refer to the same image subresource more than
6740e5c31af7Sopenharmony_ci    once
6741e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
6742e5c31af7Sopenharmony_ci****
6743e5c31af7Sopenharmony_ci
6744e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkBindImageMemory2.txt[]
6745e5c31af7Sopenharmony_ci--
6746e5c31af7Sopenharmony_ci
6747e5c31af7Sopenharmony_ci[open,refpage='VkBindImageMemoryInfo',desc='Structure specifying how to bind an image to memory',type='structs']
6748e5c31af7Sopenharmony_ci--
6749e5c31af7Sopenharmony_ci:refpage: VkBindImageMemoryInfo
6750e5c31af7Sopenharmony_ci
6751e5c31af7Sopenharmony_cisname:VkBindImageMemoryInfo contains members corresponding to the parameters
6752e5c31af7Sopenharmony_ciof flink:vkBindImageMemory.
6753e5c31af7Sopenharmony_ci
6754e5c31af7Sopenharmony_ciThe sname:VkBindImageMemoryInfo structure is defined as:
6755e5c31af7Sopenharmony_ci
6756e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkBindImageMemoryInfo.txt[]
6757e5c31af7Sopenharmony_ci
6758e5c31af7Sopenharmony_ciifdef::VK_KHR_bind_memory2[]
6759e5c31af7Sopenharmony_cior the equivalent
6760e5c31af7Sopenharmony_ci
6761e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkBindImageMemoryInfoKHR.txt[]
6762e5c31af7Sopenharmony_ciendif::VK_KHR_bind_memory2[]
6763e5c31af7Sopenharmony_ci
6764e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure.
6765e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
6766e5c31af7Sopenharmony_ci    structure.
6767e5c31af7Sopenharmony_ci  * pname:image is the image to be attached to memory.
6768e5c31af7Sopenharmony_ci  * pname:memory is a slink:VkDeviceMemory object describing the device
6769e5c31af7Sopenharmony_ci    memory to attach.
6770e5c31af7Sopenharmony_ci  * pname:memoryOffset is the start offset of the region of pname:memory
6771e5c31af7Sopenharmony_ci    which is to be bound to the image.
6772e5c31af7Sopenharmony_ci    The number of bytes returned in the
6773e5c31af7Sopenharmony_ci    sname:VkMemoryRequirements::pname:size member in pname:memory, starting
6774e5c31af7Sopenharmony_ci    from pname:memoryOffset bytes, will be bound to the specified image.
6775e5c31af7Sopenharmony_ci
6776e5c31af7Sopenharmony_ci.Valid Usage
6777e5c31af7Sopenharmony_ci****
6778e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/bind_image_common.txt[]
6779e5c31af7Sopenharmony_ciifndef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
6780e5c31af7Sopenharmony_ci  * [[VUID-VkBindImageMemoryInfo-memory-01612]]
6781e5c31af7Sopenharmony_ci    pname:memory must: have been allocated using one of the memory types
6782e5c31af7Sopenharmony_ci    allowed in the pname:memoryTypeBits member of the
6783e5c31af7Sopenharmony_ci    slink:VkMemoryRequirements structure returned from a call to
6784e5c31af7Sopenharmony_ci    flink:vkGetImageMemoryRequirements with pname:image
6785e5c31af7Sopenharmony_ci  * [[VUID-VkBindImageMemoryInfo-memoryOffset-01613]]
6786e5c31af7Sopenharmony_ci    pname:memoryOffset must: be an integer multiple of the pname:alignment
6787e5c31af7Sopenharmony_ci    member of the slink:VkMemoryRequirements structure returned from a call
6788e5c31af7Sopenharmony_ci    to flink:vkGetImageMemoryRequirements with pname:image
6789e5c31af7Sopenharmony_ci  * [[VUID-VkBindImageMemoryInfo-memory-01614]]
6790e5c31af7Sopenharmony_ci    The difference of the size of pname:memory and pname:memoryOffset must:
6791e5c31af7Sopenharmony_ci    be greater than or equal to the pname:size member of the
6792e5c31af7Sopenharmony_ci    slink:VkMemoryRequirements structure returned from a call to
6793e5c31af7Sopenharmony_ci    flink:vkGetImageMemoryRequirements with the same pname:image
6794e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
6795e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
6796e5c31af7Sopenharmony_ci  * [[VUID-VkBindImageMemoryInfo-pNext-01615]]
6797e5c31af7Sopenharmony_ci    If the pname:pNext chain does not include a
6798e5c31af7Sopenharmony_ci    slink:VkBindImagePlaneMemoryInfo structure, pname:memory must: have been
6799e5c31af7Sopenharmony_ci    allocated using one of the memory types allowed in the
6800e5c31af7Sopenharmony_ci    pname:memoryTypeBits member of the slink:VkMemoryRequirements structure
6801e5c31af7Sopenharmony_ci    returned from a call to flink:vkGetImageMemoryRequirements2 with
6802e5c31af7Sopenharmony_ci    pname:image
6803e5c31af7Sopenharmony_ci  * [[VUID-VkBindImageMemoryInfo-pNext-01616]]
6804e5c31af7Sopenharmony_ci    If the pname:pNext chain does not include a
6805e5c31af7Sopenharmony_ci    slink:VkBindImagePlaneMemoryInfo structure, pname:memoryOffset must: be
6806e5c31af7Sopenharmony_ci    an integer multiple of the pname:alignment member of the
6807e5c31af7Sopenharmony_ci    slink:VkMemoryRequirements structure returned from a call to
6808e5c31af7Sopenharmony_ci    flink:vkGetImageMemoryRequirements2 with pname:image
6809e5c31af7Sopenharmony_ci  * [[VUID-VkBindImageMemoryInfo-pNext-01617]]
6810e5c31af7Sopenharmony_ci    If the pname:pNext chain does not include a
6811e5c31af7Sopenharmony_ci    slink:VkBindImagePlaneMemoryInfo structure, the difference of the size
6812e5c31af7Sopenharmony_ci    of pname:memory and pname:memoryOffset must: be greater than or equal to
6813e5c31af7Sopenharmony_ci    the pname:size member of the slink:VkMemoryRequirements structure
6814e5c31af7Sopenharmony_ci    returned from a call to flink:vkGetImageMemoryRequirements2 with the
6815e5c31af7Sopenharmony_ci    same pname:image
6816e5c31af7Sopenharmony_ci  * [[VUID-VkBindImageMemoryInfo-pNext-01618]]
6817e5c31af7Sopenharmony_ci    If the pname:pNext chain includes a slink:VkBindImagePlaneMemoryInfo
6818e5c31af7Sopenharmony_ci    structure, pname:image must: have been created with the
6819e5c31af7Sopenharmony_ci    ename:VK_IMAGE_CREATE_DISJOINT_BIT bit set
6820e5c31af7Sopenharmony_ci  * [[VUID-VkBindImageMemoryInfo-pNext-01619]]
6821e5c31af7Sopenharmony_ci    If the pname:pNext chain includes a slink:VkBindImagePlaneMemoryInfo
6822e5c31af7Sopenharmony_ci    structure, pname:memory must: have been allocated using one of the
6823e5c31af7Sopenharmony_ci    memory types allowed in the pname:memoryTypeBits member of the
6824e5c31af7Sopenharmony_ci    slink:VkMemoryRequirements structure returned from a call to
6825e5c31af7Sopenharmony_ci    flink:vkGetImageMemoryRequirements2 with pname:image and where
6826e5c31af7Sopenharmony_ci    slink:VkBindImagePlaneMemoryInfo::pname:planeAspect corresponds to the
6827e5c31af7Sopenharmony_ci    slink:VkImagePlaneMemoryRequirementsInfo::pname:planeAspect in the
6828e5c31af7Sopenharmony_ci    slink:VkImageMemoryRequirementsInfo2 structure's pname:pNext chain
6829e5c31af7Sopenharmony_ci  * [[VUID-VkBindImageMemoryInfo-pNext-01620]]
6830e5c31af7Sopenharmony_ci    If the pname:pNext chain includes a slink:VkBindImagePlaneMemoryInfo
6831e5c31af7Sopenharmony_ci    structure, pname:memoryOffset must: be an integer multiple of the
6832e5c31af7Sopenharmony_ci    pname:alignment member of the slink:VkMemoryRequirements structure
6833e5c31af7Sopenharmony_ci    returned from a call to flink:vkGetImageMemoryRequirements2 with
6834e5c31af7Sopenharmony_ci    pname:image and where
6835e5c31af7Sopenharmony_ci    slink:VkBindImagePlaneMemoryInfo::pname:planeAspect corresponds to the
6836e5c31af7Sopenharmony_ci    slink:VkImagePlaneMemoryRequirementsInfo::pname:planeAspect in the
6837e5c31af7Sopenharmony_ci    slink:VkImageMemoryRequirementsInfo2 structure's pname:pNext chain
6838e5c31af7Sopenharmony_ci  * [[VUID-VkBindImageMemoryInfo-pNext-01621]]
6839e5c31af7Sopenharmony_ci    If the pname:pNext chain includes a slink:VkBindImagePlaneMemoryInfo
6840e5c31af7Sopenharmony_ci    structure, the difference of the size of pname:memory and
6841e5c31af7Sopenharmony_ci    pname:memoryOffset must: be greater than or equal to the pname:size
6842e5c31af7Sopenharmony_ci    member of the slink:VkMemoryRequirements structure returned from a call
6843e5c31af7Sopenharmony_ci    to flink:vkGetImageMemoryRequirements2 with the same pname:image and
6844e5c31af7Sopenharmony_ci    where slink:VkBindImagePlaneMemoryInfo::pname:planeAspect corresponds to
6845e5c31af7Sopenharmony_ci    the slink:VkImagePlaneMemoryRequirementsInfo::pname:planeAspect in the
6846e5c31af7Sopenharmony_ci    slink:VkImageMemoryRequirementsInfo2 structure's pname:pNext chain
6847e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
6848e5c31af7Sopenharmony_ciifndef::VK_VERSION_1_1+VK_KHR_swapchain[]
6849e5c31af7Sopenharmony_ciifndef::VK_KHR_device_group+VK_KHR_swapchain[]
6850e5c31af7Sopenharmony_ci  * [[VUID-VkBindImageMemoryInfo-memory-01625]]
6851e5c31af7Sopenharmony_ci    pname:memory must: be a valid slink:VkDeviceMemory handle
6852e5c31af7Sopenharmony_ciendif::VK_KHR_device_group+VK_KHR_swapchain[]
6853e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1+VK_KHR_swapchain[]
6854e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_device_group[]
6855e5c31af7Sopenharmony_ci  * [[VUID-VkBindImageMemoryInfo-pNext-01626]]
6856e5c31af7Sopenharmony_ci    If the pname:pNext chain includes a
6857e5c31af7Sopenharmony_ci    slink:VkBindImageMemoryDeviceGroupInfo structure, all instances of
6858e5c31af7Sopenharmony_ci    pname:memory specified by
6859e5c31af7Sopenharmony_ci    slink:VkBindImageMemoryDeviceGroupInfo::pname:pDeviceIndices must: have
6860e5c31af7Sopenharmony_ci    been allocated
6861e5c31af7Sopenharmony_ci  * [[VUID-VkBindImageMemoryInfo-pNext-01627]]
6862e5c31af7Sopenharmony_ci    If the pname:pNext chain includes a
6863e5c31af7Sopenharmony_ci    slink:VkBindImageMemoryDeviceGroupInfo structure, and
6864e5c31af7Sopenharmony_ci    slink:VkBindImageMemoryDeviceGroupInfo::pname:splitInstanceBindRegionCount
6865e5c31af7Sopenharmony_ci    is not zero, then pname:image must: have been created with the
6866e5c31af7Sopenharmony_ci    ename:VK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT bit set
6867e5c31af7Sopenharmony_ci  * [[VUID-VkBindImageMemoryInfo-pNext-01628]]
6868e5c31af7Sopenharmony_ci    If the pname:pNext chain includes a
6869e5c31af7Sopenharmony_ci    slink:VkBindImageMemoryDeviceGroupInfo structure, all elements of
6870e5c31af7Sopenharmony_ci    slink:VkBindImageMemoryDeviceGroupInfo::pname:pSplitInstanceBindRegions
6871e5c31af7Sopenharmony_ci    must: be valid rectangles contained within the dimensions of pname:image
6872e5c31af7Sopenharmony_ci  * [[VUID-VkBindImageMemoryInfo-pNext-01629]]
6873e5c31af7Sopenharmony_ci    If the pname:pNext chain includes a
6874e5c31af7Sopenharmony_ci    slink:VkBindImageMemoryDeviceGroupInfo structure, the union of the areas
6875e5c31af7Sopenharmony_ci    of all elements of
6876e5c31af7Sopenharmony_ci    slink:VkBindImageMemoryDeviceGroupInfo::pname:pSplitInstanceBindRegions
6877e5c31af7Sopenharmony_ci    that correspond to the same instance of pname:image must: cover the
6878e5c31af7Sopenharmony_ci    entire image
6879e5c31af7Sopenharmony_ciifdef::VK_KHR_swapchain[]
6880e5c31af7Sopenharmony_ci  * [[VUID-VkBindImageMemoryInfo-image-01630]]
6881e5c31af7Sopenharmony_ci    If pname:image was created with a valid swapchain handle in
6882e5c31af7Sopenharmony_ci    slink:VkImageSwapchainCreateInfoKHR::pname:swapchain, then the
6883e5c31af7Sopenharmony_ci    pname:pNext chain must: include a
6884e5c31af7Sopenharmony_ci    slink:VkBindImageMemorySwapchainInfoKHR structure containing the same
6885e5c31af7Sopenharmony_ci    swapchain handle
6886e5c31af7Sopenharmony_ci  * [[VUID-VkBindImageMemoryInfo-pNext-01631]]
6887e5c31af7Sopenharmony_ci    If the pname:pNext chain includes a
6888e5c31af7Sopenharmony_ci    slink:VkBindImageMemorySwapchainInfoKHR structure, pname:memory must: be
6889e5c31af7Sopenharmony_ci    dlink:VK_NULL_HANDLE
6890e5c31af7Sopenharmony_ci  * [[VUID-VkBindImageMemoryInfo-pNext-01632]]
6891e5c31af7Sopenharmony_ci    If the pname:pNext chain does not include a
6892e5c31af7Sopenharmony_ci    slink:VkBindImageMemorySwapchainInfoKHR structure, pname:memory must: be
6893e5c31af7Sopenharmony_ci    a valid slink:VkDeviceMemory handle
6894e5c31af7Sopenharmony_ciendif::VK_KHR_swapchain[]
6895e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_device_group[]
6896e5c31af7Sopenharmony_ci****
6897e5c31af7Sopenharmony_ci
6898e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkBindImageMemoryInfo.txt[]
6899e5c31af7Sopenharmony_ci--
6900e5c31af7Sopenharmony_ci
6901e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_device_group[]
6902e5c31af7Sopenharmony_ci[open,refpage='VkBindImageMemoryDeviceGroupInfo',desc='Structure specifying device within a group to bind to',type='structs']
6903e5c31af7Sopenharmony_ci--
6904e5c31af7Sopenharmony_ciThe sname:VkBindImageMemoryDeviceGroupInfo structure is defined as:
6905e5c31af7Sopenharmony_ci
6906e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkBindImageMemoryDeviceGroupInfo.txt[]
6907e5c31af7Sopenharmony_ci
6908e5c31af7Sopenharmony_ci// Jon: this conditional needs to be enhanced for 1.1 / bind_memory_2
6909e5c31af7Sopenharmony_ciifdef::VK_KHR_device_group+VK_KHR_bind_memory2[]
6910e5c31af7Sopenharmony_cior the equivalent
6911e5c31af7Sopenharmony_ci
6912e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkBindImageMemoryDeviceGroupInfoKHR.txt[]
6913e5c31af7Sopenharmony_ciendif::VK_KHR_device_group+VK_KHR_bind_memory2[]
6914e5c31af7Sopenharmony_ci
6915e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure.
6916e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
6917e5c31af7Sopenharmony_ci    structure.
6918e5c31af7Sopenharmony_ci  * pname:deviceIndexCount is the number of elements in
6919e5c31af7Sopenharmony_ci    pname:pDeviceIndices.
6920e5c31af7Sopenharmony_ci  * pname:pDeviceIndices is a pointer to an array of device indices.
6921e5c31af7Sopenharmony_ci  * pname:splitInstanceBindRegionCount is the number of elements in
6922e5c31af7Sopenharmony_ci    pname:pSplitInstanceBindRegions.
6923e5c31af7Sopenharmony_ci  * pname:pSplitInstanceBindRegions is a pointer to an array of
6924e5c31af7Sopenharmony_ci    slink:VkRect2D structures describing which regions of the image are
6925e5c31af7Sopenharmony_ci    attached to each instance of memory.
6926e5c31af7Sopenharmony_ci
6927e5c31af7Sopenharmony_ciIf the pname:pNext chain of slink:VkBindImageMemoryInfo includes a
6928e5c31af7Sopenharmony_cisname:VkBindImageMemoryDeviceGroupInfo structure, then that structure
6929e5c31af7Sopenharmony_cidetermines how memory is bound to images across multiple devices in a device
6930e5c31af7Sopenharmony_cigroup.
6931e5c31af7Sopenharmony_ci
6932e5c31af7Sopenharmony_ciIf pname:deviceIndexCount is greater than zero, then on device index [eq]#i#
6933e5c31af7Sopenharmony_cipname:image is attached to the instance of the memory on the physical device
6934e5c31af7Sopenharmony_ciwith device index [eq]#pDeviceIndices[i]#.
6935e5c31af7Sopenharmony_ci
6936e5c31af7Sopenharmony_ciLet [eq]#N# be the number of physical devices in the logical device.
6937e5c31af7Sopenharmony_ciIf pname:splitInstanceBindRegionCount is greater than zero, then
6938e5c31af7Sopenharmony_cipname:pSplitInstanceBindRegions is a pointer to an array of [eq]#N^2^#
6939e5c31af7Sopenharmony_cirectangles, where the image region specified by the rectangle at element
6940e5c31af7Sopenharmony_ci[eq]#i*N+j# in resource instance [eq]#i# is bound to the memory instance
6941e5c31af7Sopenharmony_ci[eq]#j#.
6942e5c31af7Sopenharmony_ciThe blocks of the memory that are bound to each sparse image block region
6943e5c31af7Sopenharmony_ciuse an offset in memory, relative to pname:memoryOffset, computed as if the
6944e5c31af7Sopenharmony_ciwhole image was being bound to a contiguous range of memory.
6945e5c31af7Sopenharmony_ciIn other words, horizontally adjacent image blocks use consecutive blocks of
6946e5c31af7Sopenharmony_cimemory, vertically adjacent image blocks are separated by the number of
6947e5c31af7Sopenharmony_cibytes per block multiplied by the width in blocks of pname:image, and the
6948e5c31af7Sopenharmony_ciblock at [eq]#(0,0)# corresponds to memory starting at pname:memoryOffset.
6949e5c31af7Sopenharmony_ci
6950e5c31af7Sopenharmony_ciIf pname:splitInstanceBindRegionCount and pname:deviceIndexCount are zero
6951e5c31af7Sopenharmony_ciand the memory comes from a memory heap with the
6952e5c31af7Sopenharmony_ciename:VK_MEMORY_HEAP_MULTI_INSTANCE_BIT bit set, then it is as if
6953e5c31af7Sopenharmony_cipname:pDeviceIndices contains consecutive indices from zero to the number of
6954e5c31af7Sopenharmony_ciphysical devices in the logical device, minus one.
6955e5c31af7Sopenharmony_ciIn other words, by default each physical device attaches to its own instance
6956e5c31af7Sopenharmony_ciof the memory.
6957e5c31af7Sopenharmony_ci
6958e5c31af7Sopenharmony_ciIf pname:splitInstanceBindRegionCount and pname:deviceIndexCount are zero
6959e5c31af7Sopenharmony_ciand the memory comes from a memory heap without the
6960e5c31af7Sopenharmony_ciename:VK_MEMORY_HEAP_MULTI_INSTANCE_BIT bit set, then it is as if
6961e5c31af7Sopenharmony_cipname:pDeviceIndices contains an array of zeros.
6962e5c31af7Sopenharmony_ciIn other words, by default each physical device attaches to instance zero.
6963e5c31af7Sopenharmony_ci
6964e5c31af7Sopenharmony_ci.Valid Usage
6965e5c31af7Sopenharmony_ci****
6966e5c31af7Sopenharmony_ci  * [[VUID-VkBindImageMemoryDeviceGroupInfo-deviceIndexCount-01633]]
6967e5c31af7Sopenharmony_ci    At least one of pname:deviceIndexCount and
6968e5c31af7Sopenharmony_ci    pname:splitInstanceBindRegionCount must: be zero
6969e5c31af7Sopenharmony_ci  * [[VUID-VkBindImageMemoryDeviceGroupInfo-deviceIndexCount-01634]]
6970e5c31af7Sopenharmony_ci    pname:deviceIndexCount must: either be zero or equal to the number of
6971e5c31af7Sopenharmony_ci    physical devices in the logical device
6972e5c31af7Sopenharmony_ci  * [[VUID-VkBindImageMemoryDeviceGroupInfo-pDeviceIndices-01635]]
6973e5c31af7Sopenharmony_ci    All elements of pname:pDeviceIndices must: be valid device indices
6974e5c31af7Sopenharmony_ci  * [[VUID-VkBindImageMemoryDeviceGroupInfo-splitInstanceBindRegionCount-01636]]
6975e5c31af7Sopenharmony_ci    pname:splitInstanceBindRegionCount must: either be zero or equal to the
6976e5c31af7Sopenharmony_ci    number of physical devices in the logical device squared
6977e5c31af7Sopenharmony_ci  * [[VUID-VkBindImageMemoryDeviceGroupInfo-pSplitInstanceBindRegions-01637]]
6978e5c31af7Sopenharmony_ci    Elements of pname:pSplitInstanceBindRegions that correspond to the same
6979e5c31af7Sopenharmony_ci    instance of an image must: not overlap
6980e5c31af7Sopenharmony_ci  * [[VUID-VkBindImageMemoryDeviceGroupInfo-offset-01638]]
6981e5c31af7Sopenharmony_ci    The pname:offset.x member of any element of
6982e5c31af7Sopenharmony_ci    pname:pSplitInstanceBindRegions must: be a multiple of the sparse image
6983e5c31af7Sopenharmony_ci    block width
6984e5c31af7Sopenharmony_ci    (sname:VkSparseImageFormatProperties::pname:imageGranularity.width) of
6985e5c31af7Sopenharmony_ci    all non-metadata aspects of the image
6986e5c31af7Sopenharmony_ci  * [[VUID-VkBindImageMemoryDeviceGroupInfo-offset-01639]]
6987e5c31af7Sopenharmony_ci    The pname:offset.y member of any element of
6988e5c31af7Sopenharmony_ci    pname:pSplitInstanceBindRegions must: be a multiple of the sparse image
6989e5c31af7Sopenharmony_ci    block height
6990e5c31af7Sopenharmony_ci    (sname:VkSparseImageFormatProperties::pname:imageGranularity.height) of
6991e5c31af7Sopenharmony_ci    all non-metadata aspects of the image
6992e5c31af7Sopenharmony_ci  * [[VUID-VkBindImageMemoryDeviceGroupInfo-extent-01640]]
6993e5c31af7Sopenharmony_ci    The pname:extent.width member of any element of
6994e5c31af7Sopenharmony_ci    pname:pSplitInstanceBindRegions must: either be a multiple of the sparse
6995e5c31af7Sopenharmony_ci    image block width of all non-metadata aspects of the image, or else
6996e5c31af7Sopenharmony_ci    pname:extent.width {plus} pname:offset.x must: equal the width of the
6997e5c31af7Sopenharmony_ci    image subresource
6998e5c31af7Sopenharmony_ci  * [[VUID-VkBindImageMemoryDeviceGroupInfo-extent-01641]]
6999e5c31af7Sopenharmony_ci    The pname:extent.height member of any element of
7000e5c31af7Sopenharmony_ci    pname:pSplitInstanceBindRegions must: either be a multiple of the sparse
7001e5c31af7Sopenharmony_ci    image block height of all non-metadata aspects of the image, or else
7002e5c31af7Sopenharmony_ci    pname:extent.height {plus} pname:offset.y must: equal the height of the
7003e5c31af7Sopenharmony_ci    image subresource
7004e5c31af7Sopenharmony_ci****
7005e5c31af7Sopenharmony_ci
7006e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkBindImageMemoryDeviceGroupInfo.txt[]
7007e5c31af7Sopenharmony_ci--
7008e5c31af7Sopenharmony_ci
7009e5c31af7Sopenharmony_ciifdef::VK_KHR_swapchain[]
7010e5c31af7Sopenharmony_ci[open,refpage='VkBindImageMemorySwapchainInfoKHR',desc='Structure specifying swapchain image memory to bind to',type='structs']
7011e5c31af7Sopenharmony_ci--
7012e5c31af7Sopenharmony_ciIf the pname:pNext chain of slink:VkBindImageMemoryInfo includes a
7013e5c31af7Sopenharmony_cisname:VkBindImageMemorySwapchainInfoKHR structure, then that structure
7014e5c31af7Sopenharmony_ciincludes a swapchain handle and image index indicating that the image will
7015e5c31af7Sopenharmony_cibe bound to memory from that swapchain.
7016e5c31af7Sopenharmony_ci
7017e5c31af7Sopenharmony_ciThe sname:VkBindImageMemorySwapchainInfoKHR structure is defined as:
7018e5c31af7Sopenharmony_ci
7019e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkBindImageMemorySwapchainInfoKHR.txt[]
7020e5c31af7Sopenharmony_ci
7021e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure.
7022e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
7023e5c31af7Sopenharmony_ci    structure.
7024e5c31af7Sopenharmony_ci  * pname:swapchain is dlink:VK_NULL_HANDLE or a swapchain handle.
7025e5c31af7Sopenharmony_ci  * pname:imageIndex is an image index within pname:swapchain.
7026e5c31af7Sopenharmony_ci
7027e5c31af7Sopenharmony_ciIf pname:swapchain is not `NULL`, the pname:swapchain and pname:imageIndex
7028e5c31af7Sopenharmony_ciare used to determine the memory that the image is bound to, instead of
7029e5c31af7Sopenharmony_cipname:memory and pname:memoryOffset.
7030e5c31af7Sopenharmony_ci
7031e5c31af7Sopenharmony_ciMemory can: be bound to a swapchain and use the pname:pDeviceIndices or
7032e5c31af7Sopenharmony_cipname:pSplitInstanceBindRegions members of
7033e5c31af7Sopenharmony_cislink:VkBindImageMemoryDeviceGroupInfo.
7034e5c31af7Sopenharmony_ci
7035e5c31af7Sopenharmony_ci.Valid Usage
7036e5c31af7Sopenharmony_ci****
7037e5c31af7Sopenharmony_ci  * [[VUID-VkBindImageMemorySwapchainInfoKHR-imageIndex-01644]]
7038e5c31af7Sopenharmony_ci    pname:imageIndex must: be less than the number of images in
7039e5c31af7Sopenharmony_ci    pname:swapchain
7040e5c31af7Sopenharmony_ci****
7041e5c31af7Sopenharmony_ci
7042e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkBindImageMemorySwapchainInfoKHR.txt[]
7043e5c31af7Sopenharmony_ci--
7044e5c31af7Sopenharmony_ciendif::VK_KHR_swapchain[]
7045e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_device_group[]
7046e5c31af7Sopenharmony_ci
7047e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
7048e5c31af7Sopenharmony_ci[open,refpage='VkBindImagePlaneMemoryInfo',desc='Structure specifying how to bind an image plane to memory',type='structs']
7049e5c31af7Sopenharmony_ci--
7050e5c31af7Sopenharmony_ciIn order to bind _planes_ of a _disjoint image_, add a
7051e5c31af7Sopenharmony_cisname:VkBindImagePlaneMemoryInfo structure to the pname:pNext chain of
7052e5c31af7Sopenharmony_cislink:VkBindImageMemoryInfo.
7053e5c31af7Sopenharmony_ci
7054e5c31af7Sopenharmony_ciThe sname:VkBindImagePlaneMemoryInfo structure is defined as:
7055e5c31af7Sopenharmony_ci
7056e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkBindImagePlaneMemoryInfo.txt[]
7057e5c31af7Sopenharmony_ci
7058e5c31af7Sopenharmony_ciifdef::VK_KHR_sampler_ycbcr_conversion[]
7059e5c31af7Sopenharmony_cior the equivalent
7060e5c31af7Sopenharmony_ci
7061e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkBindImagePlaneMemoryInfoKHR.txt[]
7062e5c31af7Sopenharmony_ciendif::VK_KHR_sampler_ycbcr_conversion[]
7063e5c31af7Sopenharmony_ci
7064e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure.
7065e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
7066e5c31af7Sopenharmony_ci    structure.
7067e5c31af7Sopenharmony_ci  * pname:planeAspect is a ename:VkImageAspectFlagBits value specifying the
7068e5c31af7Sopenharmony_ci    aspect of the disjoint image plane to bind.
7069e5c31af7Sopenharmony_ci
7070e5c31af7Sopenharmony_ci.Valid Usage
7071e5c31af7Sopenharmony_ci****
7072e5c31af7Sopenharmony_ci  * [[VUID-VkBindImagePlaneMemoryInfo-planeAspect-02283]]
7073e5c31af7Sopenharmony_ci    If the image's pname:tiling is ename:VK_IMAGE_TILING_LINEAR or
7074e5c31af7Sopenharmony_ci    ename:VK_IMAGE_TILING_OPTIMAL, then pname:planeAspect must: be a single
7075e5c31af7Sopenharmony_ci    valid _format plane_ for the image (that is, for a two-plane image
7076e5c31af7Sopenharmony_ci    pname:planeAspect must: be ename:VK_IMAGE_ASPECT_PLANE_0_BIT or
7077e5c31af7Sopenharmony_ci    ename:VK_IMAGE_ASPECT_PLANE_1_BIT, and for a three-plane image
7078e5c31af7Sopenharmony_ci    pname:planeAspect must: be ename:VK_IMAGE_ASPECT_PLANE_0_BIT,
7079e5c31af7Sopenharmony_ci    ename:VK_IMAGE_ASPECT_PLANE_1_BIT or ename:VK_IMAGE_ASPECT_PLANE_2_BIT)
7080e5c31af7Sopenharmony_ciifdef::VK_EXT_image_drm_format_modifier[]
7081e5c31af7Sopenharmony_ci  * [[VUID-VkBindImagePlaneMemoryInfo-planeAspect-02284]]
7082e5c31af7Sopenharmony_ci    If the image's pname:tiling is
7083e5c31af7Sopenharmony_ci    ename:VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT, then pname:planeAspect
7084e5c31af7Sopenharmony_ci    must: be a single valid _memory plane_ for the image (that is,
7085e5c31af7Sopenharmony_ci    pname:aspectMask must: specify a plane index that is less than the
7086e5c31af7Sopenharmony_ci    slink:VkDrmFormatModifierPropertiesEXT::pname:drmFormatModifierPlaneCount
7087e5c31af7Sopenharmony_ci    associated with the image's pname:format and
7088e5c31af7Sopenharmony_ci    slink:VkImageDrmFormatModifierPropertiesEXT::pname:drmFormatModifier)
7089e5c31af7Sopenharmony_ciendif::VK_EXT_image_drm_format_modifier[]
7090e5c31af7Sopenharmony_ci****
7091e5c31af7Sopenharmony_ci
7092e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkBindImagePlaneMemoryInfo.txt[]
7093e5c31af7Sopenharmony_ci--
7094e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
7095e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_bind_memory2[]
7096e5c31af7Sopenharmony_ci
7097e5c31af7Sopenharmony_ci
7098e5c31af7Sopenharmony_ci[[resources-bufferimagegranularity,Buffer-Image Granularity]]
7099e5c31af7Sopenharmony_ci.Buffer-Image Granularity
7100e5c31af7Sopenharmony_ciThe implementation-dependent limit <<limits-bufferImageGranularity,
7101e5c31af7Sopenharmony_cipname:bufferImageGranularity>> specifies a page-like granularity at which
7102e5c31af7Sopenharmony_cilinear and non-linear resources must: be placed in adjacent memory locations
7103e5c31af7Sopenharmony_cito avoid aliasing.
7104e5c31af7Sopenharmony_ciTwo resources which do not satisfy this granularity requirement are said to
7105e5c31af7Sopenharmony_ci<<resources-memory-aliasing,alias>>.
7106e5c31af7Sopenharmony_cipname:bufferImageGranularity is specified in bytes, and must: be a power of
7107e5c31af7Sopenharmony_citwo.
7108e5c31af7Sopenharmony_ciImplementations which do not impose a granularity restriction may: report a
7109e5c31af7Sopenharmony_cipname:bufferImageGranularity value of one.
7110e5c31af7Sopenharmony_ci
7111e5c31af7Sopenharmony_ci[NOTE]
7112e5c31af7Sopenharmony_ci.Note
7113e5c31af7Sopenharmony_ci====
7114e5c31af7Sopenharmony_ciDespite its name, pname:bufferImageGranularity is really a granularity
7115e5c31af7Sopenharmony_cibetween "`linear`" and "`non-linear`" resources.
7116e5c31af7Sopenharmony_ci====
7117e5c31af7Sopenharmony_ci
7118e5c31af7Sopenharmony_ciGiven resourceA at the lower memory offset and resourceB at the higher
7119e5c31af7Sopenharmony_cimemory offset in the same sname:VkDeviceMemory object, where one resource is
7120e5c31af7Sopenharmony_cilinear and the other is non-linear (as defined in the
7121e5c31af7Sopenharmony_ci<<glossary-linear-resource,Glossary>>), and the following:
7122e5c31af7Sopenharmony_ci
7123e5c31af7Sopenharmony_ci[source,c]
7124e5c31af7Sopenharmony_ci---------------------------------------------------
7125e5c31af7Sopenharmony_ciresourceA.end       = resourceA.memoryOffset + resourceA.size - 1
7126e5c31af7Sopenharmony_ciresourceA.endPage   = resourceA.end & ~(bufferImageGranularity-1)
7127e5c31af7Sopenharmony_ciresourceB.start     = resourceB.memoryOffset
7128e5c31af7Sopenharmony_ciresourceB.startPage = resourceB.start & ~(bufferImageGranularity-1)
7129e5c31af7Sopenharmony_ci---------------------------------------------------
7130e5c31af7Sopenharmony_ci
7131e5c31af7Sopenharmony_ciThe following property must: hold:
7132e5c31af7Sopenharmony_ci
7133e5c31af7Sopenharmony_ci[source,c]
7134e5c31af7Sopenharmony_ci---------------------------------------------------
7135e5c31af7Sopenharmony_ciresourceA.endPage < resourceB.startPage
7136e5c31af7Sopenharmony_ci---------------------------------------------------
7137e5c31af7Sopenharmony_ci
7138e5c31af7Sopenharmony_ciThat is, the end of the first resource (A) and the beginning of the second
7139e5c31af7Sopenharmony_ciresource (B) must: be on separate "`pages`" of size
7140e5c31af7Sopenharmony_cipname:bufferImageGranularity.
7141e5c31af7Sopenharmony_cipname:bufferImageGranularity may: be different than the physical page size
7142e5c31af7Sopenharmony_ciof the memory heap.
7143e5c31af7Sopenharmony_ciThis restriction is only needed when a linear resource and a non-linear
7144e5c31af7Sopenharmony_ciresource are adjacent in memory and will be used simultaneously.
7145e5c31af7Sopenharmony_ciThe memory ranges of adjacent resources can: be closer than
7146e5c31af7Sopenharmony_cipname:bufferImageGranularity, provided they meet the pname:alignment
7147e5c31af7Sopenharmony_cirequirement for the objects in question.
7148e5c31af7Sopenharmony_ci
7149e5c31af7Sopenharmony_ciSparse block size in bytes and sparse image and buffer memory alignments
7150e5c31af7Sopenharmony_cimust: all be multiples of the pname:bufferImageGranularity.
7151e5c31af7Sopenharmony_ciTherefore, memory bound to sparse resources naturally satisfies the
7152e5c31af7Sopenharmony_cipname:bufferImageGranularity.
7153e5c31af7Sopenharmony_ci
7154e5c31af7Sopenharmony_ci
7155e5c31af7Sopenharmony_ci[[resources-sharing]]
7156e5c31af7Sopenharmony_ci== Resource Sharing Mode
7157e5c31af7Sopenharmony_ci
7158e5c31af7Sopenharmony_ci[open,refpage='VkSharingMode',desc='Buffer and image sharing modes',type='enums']
7159e5c31af7Sopenharmony_ci--
7160e5c31af7Sopenharmony_ciBuffer and image objects are created with a _sharing mode_ controlling how
7161e5c31af7Sopenharmony_cithey can: be accessed from queues.
7162e5c31af7Sopenharmony_ciThe supported sharing modes are:
7163e5c31af7Sopenharmony_ci
7164e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkSharingMode.txt[]
7165e5c31af7Sopenharmony_ci
7166e5c31af7Sopenharmony_ci  * ename:VK_SHARING_MODE_EXCLUSIVE specifies that access to any range or
7167e5c31af7Sopenharmony_ci    image subresource of the object will be exclusive to a single queue
7168e5c31af7Sopenharmony_ci    family at a time.
7169e5c31af7Sopenharmony_ci  * ename:VK_SHARING_MODE_CONCURRENT specifies that concurrent access to any
7170e5c31af7Sopenharmony_ci    range or image subresource of the object from multiple queue families is
7171e5c31af7Sopenharmony_ci    supported.
7172e5c31af7Sopenharmony_ci
7173e5c31af7Sopenharmony_ci[NOTE]
7174e5c31af7Sopenharmony_ci.Note
7175e5c31af7Sopenharmony_ci====
7176e5c31af7Sopenharmony_ciename:VK_SHARING_MODE_CONCURRENT may: result in lower performance access to
7177e5c31af7Sopenharmony_cithe buffer or image than ename:VK_SHARING_MODE_EXCLUSIVE.
7178e5c31af7Sopenharmony_ci====
7179e5c31af7Sopenharmony_ci
7180e5c31af7Sopenharmony_ciRanges of buffers and image subresources of image objects created using
7181e5c31af7Sopenharmony_ciename:VK_SHARING_MODE_EXCLUSIVE must: only be accessed by queues in the
7182e5c31af7Sopenharmony_ciqueue family that has _ownership_ of the resource.
7183e5c31af7Sopenharmony_ciUpon creation, such resources are not owned by any queue family; ownership
7184e5c31af7Sopenharmony_ciis implicitly acquired upon first use within a queue.
7185e5c31af7Sopenharmony_ciOnce a resource using ename:VK_SHARING_MODE_EXCLUSIVE is owned by some queue
7186e5c31af7Sopenharmony_cifamily, the application must: perform a
7187e5c31af7Sopenharmony_ci<<synchronization-queue-transfers,queue family ownership transfer>> to make
7188e5c31af7Sopenharmony_cithe memory contents of a range or image subresource accessible to a
7189e5c31af7Sopenharmony_cidifferent queue family.
7190e5c31af7Sopenharmony_ci
7191e5c31af7Sopenharmony_ci[NOTE]
7192e5c31af7Sopenharmony_ci.Note
7193e5c31af7Sopenharmony_ci====
7194e5c31af7Sopenharmony_ciImages still require a <<resources-image-layouts, layout transition>> from
7195e5c31af7Sopenharmony_ciename:VK_IMAGE_LAYOUT_UNDEFINED or ename:VK_IMAGE_LAYOUT_PREINITIALIZED
7196e5c31af7Sopenharmony_cibefore being used on the first queue.
7197e5c31af7Sopenharmony_ci====
7198e5c31af7Sopenharmony_ci
7199e5c31af7Sopenharmony_ciA queue family can: take ownership of an image subresource or buffer range
7200e5c31af7Sopenharmony_ciof a resource created with ename:VK_SHARING_MODE_EXCLUSIVE, without an
7201e5c31af7Sopenharmony_ciownership transfer, in the same way as for a resource that was just created;
7202e5c31af7Sopenharmony_cihowever, taking ownership in this way has the effect that the contents of
7203e5c31af7Sopenharmony_cithe image subresource or buffer range are undefined:.
7204e5c31af7Sopenharmony_ci
7205e5c31af7Sopenharmony_ciRanges of buffers and image subresources of image objects created using
7206e5c31af7Sopenharmony_ciename:VK_SHARING_MODE_CONCURRENT must: only be accessed by queues from the
7207e5c31af7Sopenharmony_ciqueue families specified through the pname:queueFamilyIndexCount and
7208e5c31af7Sopenharmony_cipname:pQueueFamilyIndices members of the corresponding create info
7209e5c31af7Sopenharmony_cistructures.
7210e5c31af7Sopenharmony_ci--
7211e5c31af7Sopenharmony_ci
7212e5c31af7Sopenharmony_ci
7213e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_external_memory[]
7214e5c31af7Sopenharmony_ci[[resources-external-sharing]]
7215e5c31af7Sopenharmony_ci=== External Resource Sharing
7216e5c31af7Sopenharmony_ci
7217e5c31af7Sopenharmony_ciResources should: only be accessed in the Vulkan instance that has exclusive
7218e5c31af7Sopenharmony_ciownership of their underlying memory.
7219e5c31af7Sopenharmony_ciOnly one Vulkan instance has exclusive ownership of a resource's underlying
7220e5c31af7Sopenharmony_cimemory at a given time, regardless of whether the resource was created using
7221e5c31af7Sopenharmony_ciename:VK_SHARING_MODE_EXCLUSIVE or ename:VK_SHARING_MODE_CONCURRENT.
7222e5c31af7Sopenharmony_ciApplications can transfer ownership of a resource's underlying memory only
7223e5c31af7Sopenharmony_ciif the memory has been imported from or exported to another instance or
7224e5c31af7Sopenharmony_ciexternal API using external memory handles.
7225e5c31af7Sopenharmony_ciThe semantics for transferring ownership outside of the instance are similar
7226e5c31af7Sopenharmony_cito those used for transferring ownership of ename:VK_SHARING_MODE_EXCLUSIVE
7227e5c31af7Sopenharmony_ciresources between queues, and is also accomplished using
7228e5c31af7Sopenharmony_cislink:VkBufferMemoryBarrier or slink:VkImageMemoryBarrier operations.
7229e5c31af7Sopenharmony_ciTo make the contents of the underlying memory accessible in the destination
7230e5c31af7Sopenharmony_ciinstance or API, applications must:
7231e5c31af7Sopenharmony_ci
7232e5c31af7Sopenharmony_ci  . Release exclusive ownership from the source instance or API.
7233e5c31af7Sopenharmony_ci  . Ensure the release operation has completed using semaphores or fences.
7234e5c31af7Sopenharmony_ci  . Acquire exclusive ownership in the destination instance or API
7235e5c31af7Sopenharmony_ci
7236e5c31af7Sopenharmony_ciUnlike queue ownership transfers, the destination instance or API is not
7237e5c31af7Sopenharmony_cispecified explicitly when releasing ownership, nor is the source instance or
7238e5c31af7Sopenharmony_ciAPI specified when acquiring ownership.
7239e5c31af7Sopenharmony_ciInstead, the image or memory barrier's pname:dstQueueFamilyIndex or
7240e5c31af7Sopenharmony_cipname:srcQueueFamilyIndex parameters are set to the reserved queue family
7241e5c31af7Sopenharmony_ciindex ename:VK_QUEUE_FAMILY_EXTERNAL
7242e5c31af7Sopenharmony_ciifdef::VK_EXT_queue_family_foreign[]
7243e5c31af7Sopenharmony_cior ename:VK_QUEUE_FAMILY_FOREIGN_EXT
7244e5c31af7Sopenharmony_ciendif::VK_EXT_queue_family_foreign[]
7245e5c31af7Sopenharmony_cito represent the external destination or source respectively.
7246e5c31af7Sopenharmony_ci
7247e5c31af7Sopenharmony_ciBinding a resource to a memory object shared between multiple Vulkan
7248e5c31af7Sopenharmony_ciinstances or other APIs does not change the ownership of the underlying
7249e5c31af7Sopenharmony_cimemory.
7250e5c31af7Sopenharmony_ciThe first entity to access the resource implicitly acquires ownership.
7251e5c31af7Sopenharmony_ciAn entity can: also implicitly take ownership from another entity in the
7252e5c31af7Sopenharmony_cisame way without an explicit ownership transfer.
7253e5c31af7Sopenharmony_ciHowever, taking ownership in this way has the effect that the contents of
7254e5c31af7Sopenharmony_cithe underlying memory are undefined:.
7255e5c31af7Sopenharmony_ci
7256e5c31af7Sopenharmony_ciAccessing a resource backed by memory that is owned by a particular instance
7257e5c31af7Sopenharmony_cior API has the same semantics as accessing a ename:VK_SHARING_MODE_EXCLUSIVE
7258e5c31af7Sopenharmony_ciresource, with one exception: Implementations must: ensure layout
7259e5c31af7Sopenharmony_citransitions performed on one member of a set of identical subresources of
7260e5c31af7Sopenharmony_ciidentical images that alias the same range of an underlying memory object
7261e5c31af7Sopenharmony_ciaffect the layout of all the subresources in the set.
7262e5c31af7Sopenharmony_ci
7263e5c31af7Sopenharmony_ciAs a corollary, writes to any image subresources in such a set must: not
7264e5c31af7Sopenharmony_cimake the contents of memory used by other subresources in the set
7265e5c31af7Sopenharmony_ciundefined:.
7266e5c31af7Sopenharmony_ciAn application can: define the content of a subresource of one image by
7267e5c31af7Sopenharmony_ciperforming device writes to an identical subresource of another image
7268e5c31af7Sopenharmony_ciprovided both images are bound to the same region of external memory.
7269e5c31af7Sopenharmony_ciApplications may: also add resources to such a set after the content of the
7270e5c31af7Sopenharmony_ciexisting set members has been defined without making the content undefined:
7271e5c31af7Sopenharmony_ciby creating a new image with the initial layout
7272e5c31af7Sopenharmony_ciename:VK_IMAGE_LAYOUT_UNDEFINED and binding it to the same region of
7273e5c31af7Sopenharmony_ciexternal memory as the existing images.
7274e5c31af7Sopenharmony_ci
7275e5c31af7Sopenharmony_ci[NOTE]
7276e5c31af7Sopenharmony_ci.Note
7277e5c31af7Sopenharmony_ci====
7278e5c31af7Sopenharmony_ciBecause layout transitions apply to all identical images aliasing the same
7279e5c31af7Sopenharmony_ciregion of external memory, the actual layout of the memory backing a new
7280e5c31af7Sopenharmony_ciimage as well as an existing image with defined content will not be
7281e5c31af7Sopenharmony_ciundefined:.
7282e5c31af7Sopenharmony_ciSuch an image is not usable until it acquires ownership of its memory from
7283e5c31af7Sopenharmony_cithe existing owner.
7284e5c31af7Sopenharmony_ciTherefore, the layout specified as part of this transition will be the true
7285e5c31af7Sopenharmony_ciinitial layout of the image.
7286e5c31af7Sopenharmony_ciThe undefined: layout specified when creating it is a placeholder to
7287e5c31af7Sopenharmony_cisimplify valid usage requirements.
7288e5c31af7Sopenharmony_ci====
7289e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_external_memory[]
7290e5c31af7Sopenharmony_ci
7291e5c31af7Sopenharmony_ci
7292e5c31af7Sopenharmony_ci[[resources-memory-aliasing]]
7293e5c31af7Sopenharmony_ci== Memory Aliasing
7294e5c31af7Sopenharmony_ci
7295e5c31af7Sopenharmony_ciA range of a sname:VkDeviceMemory allocation is _aliased_ if it is bound to
7296e5c31af7Sopenharmony_cimultiple resources simultaneously, as described below, via
7297e5c31af7Sopenharmony_ciflink:vkBindImageMemory, flink:vkBindBufferMemory,
7298e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing[]
7299e5c31af7Sopenharmony_ciflink:vkBindAccelerationStructureMemoryNV,
7300e5c31af7Sopenharmony_ciendif::VK_NV_ray_tracing[]
7301e5c31af7Sopenharmony_ciifndef::VK_VERSION_1_1,VK_KHR_external_memory[]
7302e5c31af7Sopenharmony_cior via <<sparsememory-resource-binding,sparse memory bindings>>.
7303e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_external_memory[]
7304e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_external_memory[]
7305e5c31af7Sopenharmony_civia <<sparsememory-resource-binding,sparse memory bindings>>, or by binding
7306e5c31af7Sopenharmony_cithe memory to resources in multiple Vulkan instances or external APIs using
7307e5c31af7Sopenharmony_ciexternal memory handle export and import mechanisms.
7308e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_external_memory[]
7309e5c31af7Sopenharmony_ci
7310e5c31af7Sopenharmony_ciConsider two resources, resource~A~ and resource~B~, bound respectively to
7311e5c31af7Sopenharmony_cimemory range~A~ and range~B~.
7312e5c31af7Sopenharmony_ciLet paddedRange~A~ and paddedRange~B~ be, respectively, range~A~ and
7313e5c31af7Sopenharmony_cirange~B~ aligned to pname:bufferImageGranularity.
7314e5c31af7Sopenharmony_ciIf the resources are both linear or both non-linear (as defined in the
7315e5c31af7Sopenharmony_ci<<glossary-linear-resource,Glossary>>), then the resources _alias_ the
7316e5c31af7Sopenharmony_cimemory in the intersection of range~A~ and range~B~.
7317e5c31af7Sopenharmony_ciIf one resource is linear and the other is non-linear, then the resources
7318e5c31af7Sopenharmony_ci_alias_ the memory in the intersection of paddedRange~A~ and paddedRange~B~.
7319e5c31af7Sopenharmony_ci
7320e5c31af7Sopenharmony_ciApplications can: alias memory, but use of multiple aliases is subject to
7321e5c31af7Sopenharmony_ciseveral constraints.
7322e5c31af7Sopenharmony_ci
7323e5c31af7Sopenharmony_ci[NOTE]
7324e5c31af7Sopenharmony_ci.Note
7325e5c31af7Sopenharmony_ci====
7326e5c31af7Sopenharmony_ciMemory aliasing can: be useful to reduce the total device memory footprint
7327e5c31af7Sopenharmony_ciof an application, if some large resources are used for disjoint periods of
7328e5c31af7Sopenharmony_citime.
7329e5c31af7Sopenharmony_ci====
7330e5c31af7Sopenharmony_ci
7331e5c31af7Sopenharmony_ciWhen a <<glossary-linear-resource,non-linear>>,
7332e5c31af7Sopenharmony_cinon-ename:VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT image is bound to an aliased
7333e5c31af7Sopenharmony_cirange, all image subresources of the image _overlap_ the range.
7334e5c31af7Sopenharmony_ciWhen a linear image is bound to an aliased range, the image subresources
7335e5c31af7Sopenharmony_cithat (according to the image's advertised layout) include bytes from the
7336e5c31af7Sopenharmony_cialiased range overlap the range.
7337e5c31af7Sopenharmony_ciWhen a ename:VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT image has sparse image
7338e5c31af7Sopenharmony_ciblocks bound to an aliased range, only image subresources including those
7339e5c31af7Sopenharmony_cisparse image blocks overlap the range, and when the memory bound to the
7340e5c31af7Sopenharmony_ciimage's mip tail overlaps an aliased range all image subresources in the mip
7341e5c31af7Sopenharmony_citail overlap the range.
7342e5c31af7Sopenharmony_ci
7343e5c31af7Sopenharmony_ciBuffers, and linear image subresources in either the
7344e5c31af7Sopenharmony_ciename:VK_IMAGE_LAYOUT_PREINITIALIZED or ename:VK_IMAGE_LAYOUT_GENERAL
7345e5c31af7Sopenharmony_cilayouts, are _host-accessible subresources_.
7346e5c31af7Sopenharmony_ciThat is, the host has a well-defined addressing scheme to interpret the
7347e5c31af7Sopenharmony_cicontents, and thus the layout of the data in memory can: be consistently
7348e5c31af7Sopenharmony_ciinterpreted across aliases if each of those aliases is a host-accessible
7349e5c31af7Sopenharmony_cisubresource.
7350e5c31af7Sopenharmony_ciNon-linear images, and linear image subresources in other layouts, are not
7351e5c31af7Sopenharmony_cihost-accessible.
7352e5c31af7Sopenharmony_ci
7353e5c31af7Sopenharmony_ciIf two aliases are both host-accessible, then they interpret the contents of
7354e5c31af7Sopenharmony_cithe memory in consistent ways, and data written to one alias can: be read by
7355e5c31af7Sopenharmony_cithe other alias.
7356e5c31af7Sopenharmony_ci
7357e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_bind_memory2[]
7358e5c31af7Sopenharmony_ci[[resources-memory-aliasing-consistency]]
7359e5c31af7Sopenharmony_ciIf two aliases are both images that were created with identical creation
7360e5c31af7Sopenharmony_ciparameters, both were created with the ename:VK_IMAGE_CREATE_ALIAS_BIT flag
7361e5c31af7Sopenharmony_ciset, and both are bound identically to memory
7362e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_device_group[]
7363e5c31af7Sopenharmony_ciexcept for slink:VkBindImageMemoryDeviceGroupInfo::pname:pDeviceIndices and
7364e5c31af7Sopenharmony_cislink:VkBindImageMemoryDeviceGroupInfo::pname:pSplitInstanceBindRegions,
7365e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_device_group[]
7366e5c31af7Sopenharmony_cithen they interpret the contents of the memory in consistent ways, and data
7367e5c31af7Sopenharmony_ciwritten to one alias can: be read by the other alias.
7368e5c31af7Sopenharmony_ci
7369e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
7370e5c31af7Sopenharmony_ci[[resources-memory-aliasing-consistency-planes]]
7371e5c31af7Sopenharmony_ciAdditionally, if an individual plane of a multi-planar image and a
7372e5c31af7Sopenharmony_cisingle-plane image alias the same memory, then they also interpret the
7373e5c31af7Sopenharmony_cicontents of the memory in consistent ways under the same conditions, but
7374e5c31af7Sopenharmony_ciwith the following modifications:
7375e5c31af7Sopenharmony_ci
7376e5c31af7Sopenharmony_ci  * Both must: have been created with the ename:VK_IMAGE_CREATE_DISJOINT_BIT
7377e5c31af7Sopenharmony_ci    flag.
7378e5c31af7Sopenharmony_ci  * The single-plane image must: have a elink:VkFormat that is
7379e5c31af7Sopenharmony_ci    <<formats-compatible-planes,equivalent>> to that of the multi-planar
7380e5c31af7Sopenharmony_ci    image's individual plane.
7381e5c31af7Sopenharmony_ci  * The single-plane image and the individual plane of the multi-planar
7382e5c31af7Sopenharmony_ci    image must: be bound identically to memory
7383e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_device_group[]
7384e5c31af7Sopenharmony_ci    except for slink:VkBindImageMemoryDeviceGroupInfo::pname:pDeviceIndices
7385e5c31af7Sopenharmony_ci    and
7386e5c31af7Sopenharmony_ci    slink:VkBindImageMemoryDeviceGroupInfo::pname:pSplitInstanceBindRegions.
7387e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_device_group[]
7388e5c31af7Sopenharmony_ci  * The pname:width and pname:height of the single-plane image are derived
7389e5c31af7Sopenharmony_ci    from the multi-planar image's dimensions in the manner listed for
7390e5c31af7Sopenharmony_ci    <<formats-compatible-planes,plane compatibility>> for the aliased plane.
7391e5c31af7Sopenharmony_ciifdef::VK_EXT_image_drm_format_modifier[]
7392e5c31af7Sopenharmony_ci  * If either image's pname:tiling is
7393e5c31af7Sopenharmony_ci    ename:VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT, then both images must: be
7394e5c31af7Sopenharmony_ci    <<glossary-linear-resource,linear>>.
7395e5c31af7Sopenharmony_ciendif::VK_EXT_image_drm_format_modifier[]
7396e5c31af7Sopenharmony_ci  * All other creation parameters must: be identical
7397e5c31af7Sopenharmony_ci
7398e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
7399e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_bind_memory2[]
7400e5c31af7Sopenharmony_ci
7401e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_external_memory[]
7402e5c31af7Sopenharmony_ciAliases created by binding the same memory to resources in multiple Vulkan
7403e5c31af7Sopenharmony_ciinstances or external APIs using external memory handle export and import
7404e5c31af7Sopenharmony_cimechanisms interpret the contents of the memory in consistent ways, and data
7405e5c31af7Sopenharmony_ciwritten to one alias can: be read by the other alias.
7406e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_external_memory[]
7407e5c31af7Sopenharmony_ci
7408e5c31af7Sopenharmony_ciOtherwise, the aliases interpret the contents of the memory differently, and
7409e5c31af7Sopenharmony_ciwrites via one alias make the contents of memory partially or completely
7410e5c31af7Sopenharmony_ciundefined: to the other alias.
7411e5c31af7Sopenharmony_ciIf the first alias is a host-accessible subresource, then the bytes affected
7412e5c31af7Sopenharmony_ciare those written by the memory operations according to its addressing
7413e5c31af7Sopenharmony_cischeme.
7414e5c31af7Sopenharmony_ciIf the first alias is not host-accessible, then the bytes affected are those
7415e5c31af7Sopenharmony_cioverlapped by the image subresources that were written.
7416e5c31af7Sopenharmony_ciIf the second alias is a host-accessible subresource, the affected bytes
7417e5c31af7Sopenharmony_cibecome undefined:.
7418e5c31af7Sopenharmony_ciIf the second alias is not host-accessible, all sparse image blocks (for
7419e5c31af7Sopenharmony_cisparse partially-resident images) or all image subresources (for non-sparse
7420e5c31af7Sopenharmony_ciimage and fully resident sparse images) that overlap the affected bytes
7421e5c31af7Sopenharmony_cibecome undefined:.
7422e5c31af7Sopenharmony_ci
7423e5c31af7Sopenharmony_ciIf any image subresources are made undefined: due to writes to an alias,
7424e5c31af7Sopenharmony_cithen each of those image subresources must: have its layout transitioned
7425e5c31af7Sopenharmony_cifrom ename:VK_IMAGE_LAYOUT_UNDEFINED to a valid layout before it is used, or
7426e5c31af7Sopenharmony_cifrom ename:VK_IMAGE_LAYOUT_PREINITIALIZED if the memory has been written by
7427e5c31af7Sopenharmony_cithe host.
7428e5c31af7Sopenharmony_ciIf any sparse blocks of a sparse image have been made undefined:, then only
7429e5c31af7Sopenharmony_cithe image subresources containing them must: be transitioned.
7430e5c31af7Sopenharmony_ci
7431e5c31af7Sopenharmony_ciUse of an overlapping range by two aliases must: be separated by a memory
7432e5c31af7Sopenharmony_cidependency using the appropriate <<synchronization-access-types, access
7433e5c31af7Sopenharmony_citypes>> if at least one of those uses performs writes, whether the aliases
7434e5c31af7Sopenharmony_ciinterpret memory consistently or not.
7435e5c31af7Sopenharmony_ciIf buffer or image memory barriers are used, the scope of the barrier must:
7436e5c31af7Sopenharmony_cicontain the entire range and/or set of image subresources that overlap.
7437e5c31af7Sopenharmony_ci
7438e5c31af7Sopenharmony_ciIf two aliasing image views are used in the same framebuffer, then the
7439e5c31af7Sopenharmony_cirender pass must: declare the attachments using the
7440e5c31af7Sopenharmony_ci<<renderpass-aliasing,ename:VK_ATTACHMENT_DESCRIPTION_MAY_ALIAS_BIT>>, and
7441e5c31af7Sopenharmony_cifollow the other rules listed in that section.
7442e5c31af7Sopenharmony_ci
7443e5c31af7Sopenharmony_ci[NOTE]
7444e5c31af7Sopenharmony_ci.Note
7445e5c31af7Sopenharmony_ci====
7446e5c31af7Sopenharmony_ciMemory recycled via an application suballocator (i.e. without freeing and
7447e5c31af7Sopenharmony_cireallocating the memory objects) is not substantially different from memory
7448e5c31af7Sopenharmony_cialiasing.
7449e5c31af7Sopenharmony_ciHowever, a suballocator usually waits on a fence before recycling a region
7450e5c31af7Sopenharmony_ciof memory, and signaling a fence involves sufficient implicit dependencies
7451e5c31af7Sopenharmony_cito satisfy all the above requirements.
7452e5c31af7Sopenharmony_ci====
7453e5c31af7Sopenharmony_ci
7454e5c31af7Sopenharmony_ci
7455e5c31af7Sopenharmony_ciifdef::VK_FUCHSIA_buffer_collection[]
7456e5c31af7Sopenharmony_ci[[resources-buffer-collection-fuchsia]]
7457e5c31af7Sopenharmony_ci== Buffer Collections
7458e5c31af7Sopenharmony_ci
7459e5c31af7Sopenharmony_ci[open,refpage='VkBufferCollectionFUCHSIA',desc='Opaque handle to a buffer collection object',type='handles']
7460e5c31af7Sopenharmony_ci--
7461e5c31af7Sopenharmony_ciFuchsia's FIDL-based Sysmem service interoperates with Vulkan via the
7462e5c31af7Sopenharmony_ci`apiext:VK_FUCHSIA_buffer_collection` extension.
7463e5c31af7Sopenharmony_ci
7464e5c31af7Sopenharmony_ciA buffer collection is a set of one or more buffers which were allocated
7465e5c31af7Sopenharmony_citogether as a group and which all have the same properties.
7466e5c31af7Sopenharmony_ciThese properties describe the buffers' internal representation, such as its
7467e5c31af7Sopenharmony_cidimensions and memory layout.
7468e5c31af7Sopenharmony_ciThis ensures that all of the buffers can be used interchangeably by tasks
7469e5c31af7Sopenharmony_cithat require swapping among multiple buffers, such as double-buffered
7470e5c31af7Sopenharmony_cigraphics rendering.
7471e5c31af7Sopenharmony_ci
7472e5c31af7Sopenharmony_ciOn Fuchsia, the Sysmem service uses buffer collections as a core construct
7473e5c31af7Sopenharmony_ciin its design.
7474e5c31af7Sopenharmony_ci
7475e5c31af7Sopenharmony_ciBuffer collections are represented by sname:VkBufferCollectionFUCHSIA
7476e5c31af7Sopenharmony_cihandles:
7477e5c31af7Sopenharmony_ci
7478e5c31af7Sopenharmony_ciinclude::{generated}/api/handles/VkBufferCollectionFUCHSIA.txt[]
7479e5c31af7Sopenharmony_ci--
7480e5c31af7Sopenharmony_ci
7481e5c31af7Sopenharmony_ci
7482e5c31af7Sopenharmony_ci=== Definitions
7483e5c31af7Sopenharmony_ci
7484e5c31af7Sopenharmony_ci  * FIDL - Fuchsia Interface Definition Language.
7485e5c31af7Sopenharmony_ci    The declarative language used to define FIDL interprocess communication
7486e5c31af7Sopenharmony_ci    interfaces on Fuchsia.
7487e5c31af7Sopenharmony_ci    FIDL files use the `fidl` extension.
7488e5c31af7Sopenharmony_ci    FIDL is also used to refer to the services defined by interfaces
7489e5c31af7Sopenharmony_ci    declared in the FIDL language
7490e5c31af7Sopenharmony_ci  * Sysmem - The FIDL service that facilitates optimal buffer sharing and
7491e5c31af7Sopenharmony_ci    reuse on Fuchsia
7492e5c31af7Sopenharmony_ci  * client - Any participant of the buffer collection e.g. the Vulkan
7493e5c31af7Sopenharmony_ci    application
7494e5c31af7Sopenharmony_ci  * token - A code:zx_handle_t Zircon channel object that allows
7495e5c31af7Sopenharmony_ci    participation in the buffer collection
7496e5c31af7Sopenharmony_ci
7497e5c31af7Sopenharmony_ci
7498e5c31af7Sopenharmony_ci=== Platform initialization for buffer collections
7499e5c31af7Sopenharmony_ciTo initialize a buffer collection on Fuchsia:
7500e5c31af7Sopenharmony_ci
7501e5c31af7Sopenharmony_ci  * Connect to the Sysmem service to initialize a Sysmem allocator
7502e5c31af7Sopenharmony_ci  * Create an initial buffer collection token using the Sysmem allocator
7503e5c31af7Sopenharmony_ci  * Duplicate the token for each participant beyond the initiator
7504e5c31af7Sopenharmony_ci  * See the Sysmem Overview and fuchsia.sysmem FIDL documentation on
7505e5c31af7Sopenharmony_ci    fuchsia.dev for more detailed information
7506e5c31af7Sopenharmony_ci
7507e5c31af7Sopenharmony_ci
7508e5c31af7Sopenharmony_ci=== Create the buffer collection
7509e5c31af7Sopenharmony_ci
7510e5c31af7Sopenharmony_ci[open,refpage='vkCreateBufferCollectionFUCHSIA',desc='Create a new buffer collection',type='protos']
7511e5c31af7Sopenharmony_ci--
7512e5c31af7Sopenharmony_ciTo create an slink:VkBufferCollectionFUCHSIA for Vulkan to participate in
7513e5c31af7Sopenharmony_cithe buffer collection:
7514e5c31af7Sopenharmony_ci
7515e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCreateBufferCollectionFUCHSIA.txt[]
7516e5c31af7Sopenharmony_ci
7517e5c31af7Sopenharmony_ci  * pname:device is the logical device that creates the
7518e5c31af7Sopenharmony_ci    sname:VkBufferCollectionFUCHSIA
7519e5c31af7Sopenharmony_ci  * pname:pCreateInfo is a pointer to a
7520e5c31af7Sopenharmony_ci    slink:VkBufferCollectionCreateInfoFUCHSIA structure containing
7521e5c31af7Sopenharmony_ci    parameters affecting creation of the buffer collection
7522e5c31af7Sopenharmony_ci  * pname:pAllocator is a pointer to a slink:VkAllocationCallbacks structure
7523e5c31af7Sopenharmony_ci    controlling host memory allocation as described in the
7524e5c31af7Sopenharmony_ci    <<memory-allocation, Memory Allocation>> chapter
7525e5c31af7Sopenharmony_ci  * pname:pBufferCollection is a pointer to a
7526e5c31af7Sopenharmony_ci    slink:VkBufferCollectionFUCHSIA handle in which the resulting buffer
7527e5c31af7Sopenharmony_ci    collection object is returned
7528e5c31af7Sopenharmony_ci
7529e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCreateBufferCollectionFUCHSIA.txt[]
7530e5c31af7Sopenharmony_ci
7531e5c31af7Sopenharmony_ci.Host Access
7532e5c31af7Sopenharmony_ci****
7533e5c31af7Sopenharmony_ciAll functions referencing a slink:VkBufferCollectionFUCHSIA must: be
7534e5c31af7Sopenharmony_ciexternally synchronized with the exception of
7535e5c31af7Sopenharmony_cifname:vkCreateBufferCollectionFUCHSIA.
7536e5c31af7Sopenharmony_ci****
7537e5c31af7Sopenharmony_ci--
7538e5c31af7Sopenharmony_ci
7539e5c31af7Sopenharmony_ci
7540e5c31af7Sopenharmony_ci[open,refpage='VkBufferCollectionCreateInfoFUCHSIA',desc='Structure specifying desired parameters to create the buffer collection',type='structs']
7541e5c31af7Sopenharmony_ci--
7542e5c31af7Sopenharmony_ciThe sname:VkBufferCollectionCreateInfoFUCHSIA structure is defined as:
7543e5c31af7Sopenharmony_ci
7544e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkBufferCollectionCreateInfoFUCHSIA.txt[]
7545e5c31af7Sopenharmony_ci
7546e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure
7547e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
7548e5c31af7Sopenharmony_ci    structure
7549e5c31af7Sopenharmony_ci  * pname:collectionToken is a fname:zx_handle_t containing the Sysmem
7550e5c31af7Sopenharmony_ci    client's buffer collection token
7551e5c31af7Sopenharmony_ci
7552e5c31af7Sopenharmony_ci.Valid Usage
7553e5c31af7Sopenharmony_ci****
7554e5c31af7Sopenharmony_ci  * [[VUID-VkBufferCollectionCreateInfoFUCHSIA-collectionToken-06393]]
7555e5c31af7Sopenharmony_ci    pname:collectionToken must: be a valid code:zx_handle_t to a Zircon
7556e5c31af7Sopenharmony_ci    channel allocated from Sysmem
7557e5c31af7Sopenharmony_ci    (code:fuchsia.sysmem.Allocator/AllocateSharedCollection) with
7558e5c31af7Sopenharmony_ci    code:ZX_DEFAULT_CHANNEL_RIGHTS rights
7559e5c31af7Sopenharmony_ci****
7560e5c31af7Sopenharmony_ci
7561e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkBufferCollectionCreateInfoFUCHSIA.txt[]
7562e5c31af7Sopenharmony_ci--
7563e5c31af7Sopenharmony_ci
7564e5c31af7Sopenharmony_ci
7565e5c31af7Sopenharmony_ci=== Set the constraints
7566e5c31af7Sopenharmony_ciBuffer collections can be established for slink:VkImage allocations or
7567e5c31af7Sopenharmony_cislink:VkBuffer allocations.
7568e5c31af7Sopenharmony_ci
7569e5c31af7Sopenharmony_ci
7570e5c31af7Sopenharmony_ci==== Set image-based buffer collection constraints
7571e5c31af7Sopenharmony_ci
7572e5c31af7Sopenharmony_ci[open,refpage='vkSetBufferCollectionImageConstraintsFUCHSIA',desc='Set image-based constraints for a buffer collection',type='protos']
7573e5c31af7Sopenharmony_ci--
7574e5c31af7Sopenharmony_ciSetting the constraints on the buffer collection initiates the format
7575e5c31af7Sopenharmony_cinegotiation and allocation of the buffer collection.
7576e5c31af7Sopenharmony_ciTo set the constraints on a slink:VkImage buffer collection, call:
7577e5c31af7Sopenharmony_ci
7578e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkSetBufferCollectionImageConstraintsFUCHSIA.txt[]
7579e5c31af7Sopenharmony_ci
7580e5c31af7Sopenharmony_ci  * pname:device is the logical device
7581e5c31af7Sopenharmony_ci  * pname:collection is the slink:VkBufferCollectionFUCHSIA handle
7582e5c31af7Sopenharmony_ci  * pname:pImageConstraintsInfo is a pointer to a
7583e5c31af7Sopenharmony_ci    slink:VkImageConstraintsInfoFUCHSIA structure
7584e5c31af7Sopenharmony_ci
7585e5c31af7Sopenharmony_cifname:vkSetBufferCollectionImageConstraintsFUCHSIA may: fail if
7586e5c31af7Sopenharmony_cipname:pImageConstraintsInfo::pname:formatConstraintsCount is larger than the
7587e5c31af7Sopenharmony_ciimplementation-defined limit.
7588e5c31af7Sopenharmony_ciIf that occurs, flink:vkSetBufferCollectionImageConstraintsFUCHSIA will
7589e5c31af7Sopenharmony_cireturn VK_ERROR_INITIALIZATION_FAILED.
7590e5c31af7Sopenharmony_ci
7591e5c31af7Sopenharmony_cifname:vkSetBufferCollectionImageConstraintsFUCHSIA may: fail if the
7592e5c31af7Sopenharmony_ciimplementation does not support any of the formats described by the
7593e5c31af7Sopenharmony_cipname:pImageConstraintsInfo structure.
7594e5c31af7Sopenharmony_ciIf that occurs, flink:vkSetBufferCollectionImageConstraintsFUCHSIA will
7595e5c31af7Sopenharmony_cireturn ename:VK_ERROR_FORMAT_NOT_SUPPORTED.
7596e5c31af7Sopenharmony_ci
7597e5c31af7Sopenharmony_ci.Valid Usage
7598e5c31af7Sopenharmony_ci****
7599e5c31af7Sopenharmony_ci  * [[VUID-vkSetBufferCollectionImageConstraintsFUCHSIA-collection-06394]]
7600e5c31af7Sopenharmony_ci    fname:vkSetBufferCollectionImageConstraintsFUCHSIA or
7601e5c31af7Sopenharmony_ci    fname:vkSetBufferCollectionBufferConstraintsFUCHSIA must: not have
7602e5c31af7Sopenharmony_ci    already been called on pname:collection
7603e5c31af7Sopenharmony_ci****
7604e5c31af7Sopenharmony_ci
7605e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkSetBufferCollectionImageConstraintsFUCHSIA.txt[]
7606e5c31af7Sopenharmony_ci--
7607e5c31af7Sopenharmony_ci
7608e5c31af7Sopenharmony_ci[open,refpage='VkImageConstraintsInfoFUCHSIA',desc='Structure of image-based buffer collection constraints',type='structs']
7609e5c31af7Sopenharmony_ci--
7610e5c31af7Sopenharmony_ciThe sname:VkImageConstraintsInfoFUCHSIA structure is defined as:
7611e5c31af7Sopenharmony_ci
7612e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkImageConstraintsInfoFUCHSIA.txt[]
7613e5c31af7Sopenharmony_ci
7614e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure.
7615e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
7616e5c31af7Sopenharmony_ci    structure.
7617e5c31af7Sopenharmony_ci  * pname:formatConstraintsCount is the number of elements in
7618e5c31af7Sopenharmony_ci    pname:pFormatConstraints.
7619e5c31af7Sopenharmony_ci  * pname:pFormatConstraints is a pointer to an array of
7620e5c31af7Sopenharmony_ci    slink:VkImageFormatConstraintsInfoFUCHSIA structures of size
7621e5c31af7Sopenharmony_ci    pname:formatConstraintsCount that is used to further constrain buffer
7622e5c31af7Sopenharmony_ci    collection format selection for image-based buffer collections.
7623e5c31af7Sopenharmony_ci  * pname:bufferCollectionConstraints is a
7624e5c31af7Sopenharmony_ci    slink:VkBufferCollectionConstraintsInfoFUCHSIA structure used to supply
7625e5c31af7Sopenharmony_ci    parameters for the negotiation and allocation for buffer-based buffer
7626e5c31af7Sopenharmony_ci    collections.
7627e5c31af7Sopenharmony_ci  * pname:flags is a elink:VkImageConstraintsInfoFlagBitsFUCHSIA value
7628e5c31af7Sopenharmony_ci    specifying hints about the type of memory Sysmem should allocate for the
7629e5c31af7Sopenharmony_ci    buffer collection.
7630e5c31af7Sopenharmony_ci
7631e5c31af7Sopenharmony_ci.Valid Usage
7632e5c31af7Sopenharmony_ci****
7633e5c31af7Sopenharmony_ci  * [[VUID-VkImageConstraintsInfoFUCHSIA-pFormatConstraints-06395]]
7634e5c31af7Sopenharmony_ci    All elements of pname:pFormatConstraints must: have at least one bit set
7635e5c31af7Sopenharmony_ci    in its
7636e5c31af7Sopenharmony_ci    slink:VkImageFormatConstraintsInfoFUCHSIA::pname:requiredFormatFeatures
7637e5c31af7Sopenharmony_ci  * [[VUID-VkImageConstraintsInfoFUCHSIA-pFormatConstraints-06396]]
7638e5c31af7Sopenharmony_ci    If pname:pFormatConstraints::pname:imageCreateInfo::pname:usage contains
7639e5c31af7Sopenharmony_ci    ename:VK_IMAGE_USAGE_SAMPLED_BIT, then
7640e5c31af7Sopenharmony_ci    pname:pFormatConstraints::pname:requiredFormatFeatures must: contain
7641e5c31af7Sopenharmony_ci    ename:VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT
7642e5c31af7Sopenharmony_ci  * [[VUID-VkImageConstraintsInfoFUCHSIA-pFormatConstraints-06397]]
7643e5c31af7Sopenharmony_ci    If pname:pFormatConstraints::pname:imageCreateInfo::pname:usage contains
7644e5c31af7Sopenharmony_ci    ename:VK_IMAGE_USAGE_STORAGE_BIT, then
7645e5c31af7Sopenharmony_ci    pname:pFormatConstraints::pname:requiredFormatFeatures must: contain
7646e5c31af7Sopenharmony_ci    ename:VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT
7647e5c31af7Sopenharmony_ci  * [[VUID-VkImageConstraintsInfoFUCHSIA-pFormatConstraints-06398]]
7648e5c31af7Sopenharmony_ci    If pname:pFormatConstraints::pname:imageCreateInfo::pname:usage contains
7649e5c31af7Sopenharmony_ci    ename:VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, then
7650e5c31af7Sopenharmony_ci    pname:pFormatConstraints::pname:requiredFormatFeatures must: contain
7651e5c31af7Sopenharmony_ci    ename:VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT
7652e5c31af7Sopenharmony_ci  * [[VUID-VkImageConstraintsInfoFUCHSIA-pFormatConstraints-06399]]
7653e5c31af7Sopenharmony_ci    If pname:pFormatConstraints::pname:imageCreateInfo::pname:usage contains
7654e5c31af7Sopenharmony_ci    ename:VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT, then
7655e5c31af7Sopenharmony_ci    pname:pFormatConstraints::pname:requiredFormatFeatures must: contain
7656e5c31af7Sopenharmony_ci    ename:VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT
7657e5c31af7Sopenharmony_ci  * [[VUID-VkImageConstraintsInfoFUCHSIA-pFormatConstraints-06400]]
7658e5c31af7Sopenharmony_ci    If pname:pFormatConstraints::pname:imageCreateInfo::pname:usage contains
7659e5c31af7Sopenharmony_ci    ename:VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT, then
7660e5c31af7Sopenharmony_ci    pname:pFormatConstraints::pname:requiredFormatFeatures must: contain at
7661e5c31af7Sopenharmony_ci    least one of ename:VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT or
7662e5c31af7Sopenharmony_ci    ename:VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT
7663e5c31af7Sopenharmony_ciifdef::VK_KHR_fragment_shading_rate[]
7664e5c31af7Sopenharmony_ci  * [[VUID-VkImageConstraintsInfoFUCHSIA-attachmentFragmentShadingRate-06401]]
7665e5c31af7Sopenharmony_ci    If the <<features-attachmentFragmentShadingRate,
7666e5c31af7Sopenharmony_ci    pname:attachmentFragmentShadingRate feature>> is enabled, and
7667e5c31af7Sopenharmony_ci    pname:pFormatConstraints::pname:imageCreateInfo::pname:usage contains
7668e5c31af7Sopenharmony_ci    ename:VK_IMAGE_USAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR, then
7669e5c31af7Sopenharmony_ci    pname:pFormatConstraints::pname:requiredFormatFeatures must: contain
7670e5c31af7Sopenharmony_ci    ename:VK_FORMAT_FEATURE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR
7671e5c31af7Sopenharmony_ciendif::VK_KHR_fragment_shading_rate[]
7672e5c31af7Sopenharmony_ci****
7673e5c31af7Sopenharmony_ci
7674e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkImageConstraintsInfoFUCHSIA.txt[]
7675e5c31af7Sopenharmony_ci--
7676e5c31af7Sopenharmony_ci
7677e5c31af7Sopenharmony_ci[open,refpage='VkImageConstraintsInfoFlagsFUCHSIA',desc='Reserved for future use',type='flags']
7678e5c31af7Sopenharmony_ci--
7679e5c31af7Sopenharmony_ciinclude::{generated}/api/flags/VkImageConstraintsInfoFlagsFUCHSIA.txt[]
7680e5c31af7Sopenharmony_ci
7681e5c31af7Sopenharmony_citname:VkImageConstraintsInfoFlagsFUCHSIA is a bitmask type for setting a
7682e5c31af7Sopenharmony_cimask of zero or more elink:VkImageConstraintsInfoFlagBitsFUCHSIA bits.
7683e5c31af7Sopenharmony_ci--
7684e5c31af7Sopenharmony_ci
7685e5c31af7Sopenharmony_ci[open,refpage='VkImageConstraintsInfoFlagBitsFUCHSIA',desc='Bitmask specifying image constraints flags',type='enums']
7686e5c31af7Sopenharmony_ci--
7687e5c31af7Sopenharmony_ciBits which can: be set in
7688e5c31af7Sopenharmony_cielink:VkImageConstraintsInfoFlagBitsFUCHSIA::pname:flags include:
7689e5c31af7Sopenharmony_ci
7690e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkImageConstraintsInfoFlagBitsFUCHSIA.txt[]
7691e5c31af7Sopenharmony_ci
7692e5c31af7Sopenharmony_ciGeneral hints about the type of memory that should be allocated by Sysmem
7693e5c31af7Sopenharmony_cibased on the expected usage of the images in the buffer collection include:
7694e5c31af7Sopenharmony_ci
7695e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_CONSTRAINTS_INFO_CPU_READ_RARELY_FUCHSIA
7696e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_CONSTRAINTS_INFO_CPU_READ_OFTEN_FUCHSIA
7697e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_CONSTRAINTS_INFO_CPU_WRITE_RARELY_FUCHSIA
7698e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_CONSTRAINTS_INFO_CPU_WRITE_OFTEN_FUCHSIA
7699e5c31af7Sopenharmony_ci
7700e5c31af7Sopenharmony_ciFor protected memory:
7701e5c31af7Sopenharmony_ci
7702e5c31af7Sopenharmony_ci  * ename:VK_IMAGE_CONSTRAINTS_INFO_PROTECTED_OPTIONAL_FUCHSIA specifies
7703e5c31af7Sopenharmony_ci    that protected memory is optional for the buffer collection.
7704e5c31af7Sopenharmony_ci
7705e5c31af7Sopenharmony_ciNote that if all participants in the buffer collection (Vulkan or otherwise)
7706e5c31af7Sopenharmony_cispecify that protected memory is optional, Sysmem will not allocate
7707e5c31af7Sopenharmony_ciprotected memory.
7708e5c31af7Sopenharmony_ci--
7709e5c31af7Sopenharmony_ci
7710e5c31af7Sopenharmony_ci[open,refpage='VkImageFormatConstraintsInfoFUCHSIA',desc='Structure image-based buffer collection constraints',type='structs']
7711e5c31af7Sopenharmony_ci--
7712e5c31af7Sopenharmony_ciThe sname:VkImageFormatConstraintsInfoFUCHSIA structure is defined as:
7713e5c31af7Sopenharmony_ci
7714e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkImageFormatConstraintsInfoFUCHSIA.txt[]
7715e5c31af7Sopenharmony_ci
7716e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure
7717e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
7718e5c31af7Sopenharmony_ci    structure
7719e5c31af7Sopenharmony_ci  * pname:imageCreateInfo is the slink:VkImageCreateInfo used to create a
7720e5c31af7Sopenharmony_ci    slink:VkImage that is to use memory from the
7721e5c31af7Sopenharmony_ci    slink:VkBufferCollectionFUCHSIA
7722e5c31af7Sopenharmony_ci  * pname:requiredFormatFeatures is a bitmask of
7723e5c31af7Sopenharmony_ci    ename:VkFormatFeatureFlagBits specifying required features of the
7724e5c31af7Sopenharmony_ci    buffers in the buffer collection
7725e5c31af7Sopenharmony_ci  * pname:flags is reserved for future use
7726e5c31af7Sopenharmony_ci  * pname:sysmemPixelFormat is a code:PixelFormatType value from the
7727e5c31af7Sopenharmony_ci    `fuchsia.sysmem/image_formats.fidl` FIDL interface
7728e5c31af7Sopenharmony_ci  * pname:colorSpaceCount the element count of pname:pColorSpaces
7729e5c31af7Sopenharmony_ci  * pname:pColorSpaces is a pointer to an array of
7730e5c31af7Sopenharmony_ci    slink:VkSysmemColorSpaceFUCHSIA structs of size pname:colorSpaceCount
7731e5c31af7Sopenharmony_ci
7732e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkImageFormatConstraintsInfoFUCHSIA.txt[]
7733e5c31af7Sopenharmony_ci--
7734e5c31af7Sopenharmony_ci
7735e5c31af7Sopenharmony_ci[open,refpage='VkImageFormatConstraintsFlagsFUCHSIA',desc='Reserved for future use',type='flags']
7736e5c31af7Sopenharmony_ci--
7737e5c31af7Sopenharmony_ciinclude::{generated}/api/flags/VkImageFormatConstraintsFlagsFUCHSIA.txt[]
7738e5c31af7Sopenharmony_ci
7739e5c31af7Sopenharmony_citname:VkImageFormatConstraintsFlagsFUCHSIA is a bitmask type for setting a
7740e5c31af7Sopenharmony_cimask, but is currently reserved for future use.
7741e5c31af7Sopenharmony_ci--
7742e5c31af7Sopenharmony_ci
7743e5c31af7Sopenharmony_ci[open,refpage='VkBufferCollectionConstraintsInfoFUCHSIA',desc='Structure of general buffer collection constraints',type='structs']
7744e5c31af7Sopenharmony_ci--
7745e5c31af7Sopenharmony_ciThe sname:VkBufferCollectionConstraintsInfoFUCHSIA structure is defined as:
7746e5c31af7Sopenharmony_ci
7747e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkBufferCollectionConstraintsInfoFUCHSIA.txt[]
7748e5c31af7Sopenharmony_ci
7749e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure
7750e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
7751e5c31af7Sopenharmony_ci    structure
7752e5c31af7Sopenharmony_ci  * pname:minBufferCount is the minimum number of buffers available in the
7753e5c31af7Sopenharmony_ci    collection
7754e5c31af7Sopenharmony_ci  * pname:maxBufferCount is the maximum number of buffers allowed in the
7755e5c31af7Sopenharmony_ci    collection
7756e5c31af7Sopenharmony_ci  * pname:minBufferCountForCamping is the per-participant minimum buffers
7757e5c31af7Sopenharmony_ci    for camping
7758e5c31af7Sopenharmony_ci  * pname:minBufferCountForDedicatedSlack is the per-participant minimum
7759e5c31af7Sopenharmony_ci    buffers for dedicated slack
7760e5c31af7Sopenharmony_ci  * pname:minBufferCountForSharedSlack is the per-participant minimum
7761e5c31af7Sopenharmony_ci    buffers for shared slack
7762e5c31af7Sopenharmony_ci
7763e5c31af7Sopenharmony_ciSysmem uses all buffer count parameters in combination to determine the
7764e5c31af7Sopenharmony_cinumber of buffers it will allocate.
7765e5c31af7Sopenharmony_ciSysmem defines buffer count constraints in
7766e5c31af7Sopenharmony_ci`fuchsia.sysmem/constraints.fidl`.
7767e5c31af7Sopenharmony_ci
7768e5c31af7Sopenharmony_ci_Camping_ as referred to by pname:minBufferCountForCamping, is the number of
7769e5c31af7Sopenharmony_cibuffers that should be available for the participant that are not for
7770e5c31af7Sopenharmony_citransient use.
7771e5c31af7Sopenharmony_ciThis number of buffers is required for the participant to logically operate.
7772e5c31af7Sopenharmony_ci
7773e5c31af7Sopenharmony_ci_Slack_ as referred to by pname:minBufferCountForDedicatedSlack and
7774e5c31af7Sopenharmony_cipname:minBufferCountForSharedSlack, refers to the number of buffers desired
7775e5c31af7Sopenharmony_ciby participants for optimal performance.
7776e5c31af7Sopenharmony_cipname:minBufferCountForDedicatedSlack refers to the current participant.
7777e5c31af7Sopenharmony_cipname:minBufferCountForSharedSlack refers to buffer slack for all
7778e5c31af7Sopenharmony_ciparticipants in the collection.
7779e5c31af7Sopenharmony_ci
7780e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkBufferCollectionConstraintsInfoFUCHSIA.txt[]
7781e5c31af7Sopenharmony_ci--
7782e5c31af7Sopenharmony_ci
7783e5c31af7Sopenharmony_ci[open,refpage='VkSysmemColorSpaceFUCHSIA',desc='Structure describing the buffer collections color space',type='structs']
7784e5c31af7Sopenharmony_ci--
7785e5c31af7Sopenharmony_ci
7786e5c31af7Sopenharmony_ciThe sname:VkSysmemColorSpaceFUCHSIA structure is defined as:
7787e5c31af7Sopenharmony_ci
7788e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkSysmemColorSpaceFUCHSIA.txt[]
7789e5c31af7Sopenharmony_ci
7790e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure
7791e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
7792e5c31af7Sopenharmony_ci    structure
7793e5c31af7Sopenharmony_ci  * pname:colorSpace value of the Sysmem code:ColorSpaceType
7794e5c31af7Sopenharmony_ci
7795e5c31af7Sopenharmony_ci.Valid Usage
7796e5c31af7Sopenharmony_ci****
7797e5c31af7Sopenharmony_ci  * [[VUID-VkSysmemColorSpaceFUCHSIA-colorSpace-06402]]
7798e5c31af7Sopenharmony_ci    pname:colorSpace must: be a code:ColorSpaceType as defined in
7799e5c31af7Sopenharmony_ci    `fuchsia.sysmem/image_formats.fidl`
7800e5c31af7Sopenharmony_ci****
7801e5c31af7Sopenharmony_ci
7802e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkSysmemColorSpaceFUCHSIA.txt[]
7803e5c31af7Sopenharmony_ci--
7804e5c31af7Sopenharmony_ci
7805e5c31af7Sopenharmony_ci
7806e5c31af7Sopenharmony_ci==== Set buffer-based buffer collection constraints
7807e5c31af7Sopenharmony_ci
7808e5c31af7Sopenharmony_ci[open,refpage='vkSetBufferCollectionBufferConstraintsFUCHSIA',desc='Set buffer-based constraints for a buffer collection',type='protos']
7809e5c31af7Sopenharmony_ci--
7810e5c31af7Sopenharmony_ciTo set the constraints on a slink:VkBuffer buffer collection, call:
7811e5c31af7Sopenharmony_ci
7812e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkSetBufferCollectionBufferConstraintsFUCHSIA.txt[]
7813e5c31af7Sopenharmony_ci
7814e5c31af7Sopenharmony_ci  * pname:device is the logical device
7815e5c31af7Sopenharmony_ci  * pname:collection is the slink:VkBufferCollectionFUCHSIA handle
7816e5c31af7Sopenharmony_ci  * pname:pBufferConstraintsInfo is a pointer to a
7817e5c31af7Sopenharmony_ci    slink:VkBufferConstraintsInfoFUCHSIA structure
7818e5c31af7Sopenharmony_ci
7819e5c31af7Sopenharmony_cifname:vkSetBufferCollectionBufferConstraintsFUCHSIA may: fail if the
7820e5c31af7Sopenharmony_ciimplementation does not support the constraints specified in the
7821e5c31af7Sopenharmony_cipname:bufferCollectionConstraints structure.
7822e5c31af7Sopenharmony_ciIf that occurs, flink:vkSetBufferCollectionBufferConstraintsFUCHSIA will
7823e5c31af7Sopenharmony_cireturn ename:VK_ERROR_FORMAT_NOT_SUPPORTED.
7824e5c31af7Sopenharmony_ci
7825e5c31af7Sopenharmony_ci.Valid Usage
7826e5c31af7Sopenharmony_ci****
7827e5c31af7Sopenharmony_ci  * [[VUID-vkSetBufferCollectionBufferConstraintsFUCHSIA-collection-06403]]
7828e5c31af7Sopenharmony_ci    fname:vkSetBufferCollectionImageConstraintsFUCHSIA or
7829e5c31af7Sopenharmony_ci    fname:vkSetBufferCollectionBufferConstraintsFUCHSIA must: not have
7830e5c31af7Sopenharmony_ci    already been called on pname:collection
7831e5c31af7Sopenharmony_ci****
7832e5c31af7Sopenharmony_ci
7833e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkSetBufferCollectionBufferConstraintsFUCHSIA.txt[]
7834e5c31af7Sopenharmony_ci--
7835e5c31af7Sopenharmony_ci
7836e5c31af7Sopenharmony_ci[open,refpage='VkBufferConstraintsInfoFUCHSIA',desc='Structure buffer-based buffer collection constraints',type='structs']
7837e5c31af7Sopenharmony_ci--
7838e5c31af7Sopenharmony_ciThe sname:VkBufferConstraintsInfoFUCHSIA structure is defined as:
7839e5c31af7Sopenharmony_ci
7840e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkBufferConstraintsInfoFUCHSIA.txt[]
7841e5c31af7Sopenharmony_ci
7842e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure
7843e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
7844e5c31af7Sopenharmony_ci    structure
7845e5c31af7Sopenharmony_ci  * pname:pBufferCreateInfo a pointer to a slink:VkBufferCreateInfo struct
7846e5c31af7Sopenharmony_ci    describing the buffer attributes for the buffer collection
7847e5c31af7Sopenharmony_ci  * pname:requiredFormatFeatures bitmask of ename:VkFormatFeatureFlagBits
7848e5c31af7Sopenharmony_ci    required features of the buffers in the buffer collection
7849e5c31af7Sopenharmony_ci  * pname:bufferCollectionConstraints is used to supply parameters for the
7850e5c31af7Sopenharmony_ci    negotiation and allocation of the buffer collection
7851e5c31af7Sopenharmony_ci
7852e5c31af7Sopenharmony_ci.Valid Usage
7853e5c31af7Sopenharmony_ci****
7854e5c31af7Sopenharmony_ci  * [[VUID-VkBufferConstraintsInfoFUCHSIA-requiredFormatFeatures-06404]]
7855e5c31af7Sopenharmony_ci    The pname:requiredFormatFeatures bitmask of
7856e5c31af7Sopenharmony_ci    ename:VkFormatFeatureFlagBits must: be chosen from among the buffer
7857e5c31af7Sopenharmony_ci    compatible format features listed in
7858e5c31af7Sopenharmony_ci    <<buffer-compatible-format-features,buffer compatible format features>>
7859e5c31af7Sopenharmony_ci****
7860e5c31af7Sopenharmony_ci
7861e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkBufferConstraintsInfoFUCHSIA.txt[]
7862e5c31af7Sopenharmony_ci--
7863e5c31af7Sopenharmony_ci
7864e5c31af7Sopenharmony_ci
7865e5c31af7Sopenharmony_ci=== Retrieve buffer collection properties
7866e5c31af7Sopenharmony_ci
7867e5c31af7Sopenharmony_ci[open,refpage='vkGetBufferCollectionPropertiesFUCHSIA',desc='Retrieve properties from a buffer collection',type='protos']
7868e5c31af7Sopenharmony_ci--
7869e5c31af7Sopenharmony_ciAfter constraints have been set on the buffer collection by calling
7870e5c31af7Sopenharmony_ciflink:vkSetBufferCollectionImageConstraintsFUCHSIA or
7871e5c31af7Sopenharmony_ciflink:vkSetBufferCollectionBufferConstraintsFUCHSIA, call
7872e5c31af7Sopenharmony_cifname:vkGetBufferCollectionPropertiesFUCHSIA to retrieve the negotiated and
7873e5c31af7Sopenharmony_cifinalized properties of the buffer collection.
7874e5c31af7Sopenharmony_ci
7875e5c31af7Sopenharmony_ciThe call to fname:vkGetBufferCollectionPropertiesFUCHSIA is synchronous.
7876e5c31af7Sopenharmony_ciIt waits for the Sysmem format negotiation and buffer collection allocation
7877e5c31af7Sopenharmony_cito complete before returning.
7878e5c31af7Sopenharmony_ci
7879e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkGetBufferCollectionPropertiesFUCHSIA.txt[]
7880e5c31af7Sopenharmony_ci
7881e5c31af7Sopenharmony_ci  * pname:device is the logical device handle
7882e5c31af7Sopenharmony_ci  * pname:collection is the slink:VkBufferCollectionFUCHSIA handle
7883e5c31af7Sopenharmony_ci  * pname:pProperties is a pointer to the retrieved
7884e5c31af7Sopenharmony_ci    slink:VkBufferCollectionPropertiesFUCHSIA struct
7885e5c31af7Sopenharmony_ci
7886e5c31af7Sopenharmony_ci[[sysmem-chosen-create-infos]]
7887e5c31af7Sopenharmony_ciFor image-based buffer collections, upon calling
7888e5c31af7Sopenharmony_cifname:vkGetBufferCollectionPropertiesFUCHSIA, Sysmem will choose an element
7889e5c31af7Sopenharmony_ciof the slink:VkImageConstraintsInfoFUCHSIA::pname:pImageCreateInfos
7890e5c31af7Sopenharmony_ciestablished by the preceding call to
7891e5c31af7Sopenharmony_ciflink:vkSetBufferCollectionImageConstraintsFUCHSIA.
7892e5c31af7Sopenharmony_ciThe index of the element chosen is stored in and can be retrieved from
7893e5c31af7Sopenharmony_cislink:VkBufferCollectionPropertiesFUCHSIA::pname:createInfoIndex.
7894e5c31af7Sopenharmony_ci
7895e5c31af7Sopenharmony_ciFor buffer-based buffer collections, a single slink:VkBufferCreateInfo is
7896e5c31af7Sopenharmony_cispecified as slink:VkBufferConstraintsInfoFUCHSIA::pname:createInfo.
7897e5c31af7Sopenharmony_cislink:VkBufferCollectionPropertiesFUCHSIA::pname:createInfoIndex will
7898e5c31af7Sopenharmony_citherefore always be zero.
7899e5c31af7Sopenharmony_ci
7900e5c31af7Sopenharmony_cifname:vkGetBufferCollectionPropertiesFUCHSIA may: fail if Sysmem is unable
7901e5c31af7Sopenharmony_cito resolve the constraints of all of the participants in the buffer
7902e5c31af7Sopenharmony_cicollection.
7903e5c31af7Sopenharmony_ciIf that occurs, fname:vkGetBufferCollectionPropertiesFUCHSIA will return
7904e5c31af7Sopenharmony_ciename:VK_ERROR_INITIALIZATION_FAILED.
7905e5c31af7Sopenharmony_ci
7906e5c31af7Sopenharmony_ci.Valid Usage
7907e5c31af7Sopenharmony_ci****
7908e5c31af7Sopenharmony_ci  * [[VUID-vkGetBufferCollectionPropertiesFUCHSIA-None-06405]]
7909e5c31af7Sopenharmony_ci    Prior to calling flink:vkGetBufferCollectionPropertiesFUCHSIA, the
7910e5c31af7Sopenharmony_ci    constraints on the buffer collection must: have been set by either
7911e5c31af7Sopenharmony_ci    flink:vkSetBufferCollectionImageConstraintsFUCHSIA or
7912e5c31af7Sopenharmony_ci    flink:vkSetBufferCollectionBufferConstraintsFUCHSIA.
7913e5c31af7Sopenharmony_ci****
7914e5c31af7Sopenharmony_ci
7915e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkGetBufferCollectionPropertiesFUCHSIA.txt[]
7916e5c31af7Sopenharmony_ci--
7917e5c31af7Sopenharmony_ci
7918e5c31af7Sopenharmony_ci[open,refpage='VkBufferCollectionPropertiesFUCHSIA',desc='Structure specifying the negotiated format chosen by Sysmem',type='structs']
7919e5c31af7Sopenharmony_ci--
7920e5c31af7Sopenharmony_ci
7921e5c31af7Sopenharmony_ciThe sname:VkBufferCollectionPropertiesFUCHSIA structure is defined as:
7922e5c31af7Sopenharmony_ci
7923e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkBufferCollectionPropertiesFUCHSIA.txt[]
7924e5c31af7Sopenharmony_ci
7925e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure
7926e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
7927e5c31af7Sopenharmony_ci    structure
7928e5c31af7Sopenharmony_ci  * pname:memoryTypeBits is a bitmask containing one bit set for every
7929e5c31af7Sopenharmony_ci    memory type which the buffer collection can be imported as buffer
7930e5c31af7Sopenharmony_ci    collection
7931e5c31af7Sopenharmony_ci  * pname:bufferCount is the number of buffers in the collection
7932e5c31af7Sopenharmony_ci  * pname:createInfoIndex as described in <<sysmem-chosen-create-infos,
7933e5c31af7Sopenharmony_ci    Sysmem chosen create infos>>
7934e5c31af7Sopenharmony_ci  * pname:sysmemPixelFormat is the Sysmem code:PixelFormatType as defined in
7935e5c31af7Sopenharmony_ci    `fuchsia.sysmem/image_formats.fidl`
7936e5c31af7Sopenharmony_ci  * pname:formatFeatures is a bitmask of elink:VkFormatFeatureFlagBits
7937e5c31af7Sopenharmony_ci    shared by the buffer collection
7938e5c31af7Sopenharmony_ci  * pname:sysmemColorSpaceIndex is a slink:VkSysmemColorSpaceFUCHSIA struct
7939e5c31af7Sopenharmony_ci    specifying the color space
7940e5c31af7Sopenharmony_ci  * pname:samplerYcbcrConversionComponents is a slink:VkComponentMapping
7941e5c31af7Sopenharmony_ci    struct specifying the component mapping
7942e5c31af7Sopenharmony_ci  * pname:suggestedYcbcrModel is a elink:VkSamplerYcbcrModelConversion value
7943e5c31af7Sopenharmony_ci    specifying the suggested {YCbCr} model
7944e5c31af7Sopenharmony_ci  * pname:suggestedYcbcrRange is a elink:VkSamplerYcbcrRange value
7945e5c31af7Sopenharmony_ci    specifying the suggested {YCbCr} range
7946e5c31af7Sopenharmony_ci  * pname:suggestedXChromaOffset is a elink:VkChromaLocation value
7947e5c31af7Sopenharmony_ci    specifying the suggested X chroma offset
7948e5c31af7Sopenharmony_ci  * pname:suggestedYChromaOffset is a elink:VkChromaLocation value
7949e5c31af7Sopenharmony_ci    specifying the suggested Y chroma offset
7950e5c31af7Sopenharmony_ci
7951e5c31af7Sopenharmony_cipname:sysmemColorSpace is only set for image-based buffer collections where
7952e5c31af7Sopenharmony_cithe constraints were specified using slink:VkImageConstraintsInfoFUCHSIA in
7953e5c31af7Sopenharmony_cia call to flink:vkSetBufferCollectionImageConstraintsFUCHSIA.
7954e5c31af7Sopenharmony_ci
7955e5c31af7Sopenharmony_ciFor image-based buffer collections, pname:createInfoIndex will identify both
7956e5c31af7Sopenharmony_cithe slink:VkImageConstraintsInfoFUCHSIA::pname:pImageCreateInfos element and
7957e5c31af7Sopenharmony_cithe slink:VkImageConstraintsInfoFUCHSIA::pname:pFormatConstraints element
7958e5c31af7Sopenharmony_cichosen by Sysmem when flink:vkSetBufferCollectionImageConstraintsFUCHSIA was
7959e5c31af7Sopenharmony_cicalled.
7960e5c31af7Sopenharmony_ciThe value of pname:sysmemColorSpaceIndex will be an index to one of the
7961e5c31af7Sopenharmony_cicolor spaces provided in the
7962e5c31af7Sopenharmony_cislink:VkImageFormatConstraintsInfoFUCHSIA::pname:pColorSpaces array.
7963e5c31af7Sopenharmony_ci
7964e5c31af7Sopenharmony_ciThe implementation must have pname:formatFeatures with all bits set that
7965e5c31af7Sopenharmony_ciwere set in
7966e5c31af7Sopenharmony_cislink:VkImageFormatConstraintsInfoFUCHSIA::pname:requiredFormatFeatures, by
7967e5c31af7Sopenharmony_cithe call to flink:vkSetBufferCollectionImageConstraintsFUCHSIA, at
7968e5c31af7Sopenharmony_cipname:createInfoIndex (other bits could be set as well).
7969e5c31af7Sopenharmony_ci
7970e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkBufferCollectionPropertiesFUCHSIA.txt[]
7971e5c31af7Sopenharmony_ci--
7972e5c31af7Sopenharmony_ci
7973e5c31af7Sopenharmony_ci
7974e5c31af7Sopenharmony_ci=== Memory allocation
7975e5c31af7Sopenharmony_ci
7976e5c31af7Sopenharmony_ciTo import memory from a buffer collection into a slink:VkImage or a
7977e5c31af7Sopenharmony_cislink:VkBuffer, chain a slink:VkImportMemoryBufferCollectionFUCHSIA
7978e5c31af7Sopenharmony_cistructure to the pname:pNext member of the slink:VkMemoryAllocateInfo in the
7979e5c31af7Sopenharmony_cicall to flink:vkAllocateMemory.
7980e5c31af7Sopenharmony_ci
7981e5c31af7Sopenharmony_ci[open,refpage='VkImportMemoryBufferCollectionFUCHSIA',desc='Structure to specify the Sysmem buffer to import',type='structs']
7982e5c31af7Sopenharmony_ci--
7983e5c31af7Sopenharmony_ciThe sname:VkImportMemoryBufferCollectionFUCHSIA structure is defined as:
7984e5c31af7Sopenharmony_ci
7985e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkImportMemoryBufferCollectionFUCHSIA.txt[]
7986e5c31af7Sopenharmony_ci
7987e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure
7988e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
7989e5c31af7Sopenharmony_ci    structure
7990e5c31af7Sopenharmony_ci  * pname:collection is the slink:VkBufferCollectionFUCHSIA handle
7991e5c31af7Sopenharmony_ci  * pname:index the index of the buffer to import from pname:collection
7992e5c31af7Sopenharmony_ci
7993e5c31af7Sopenharmony_ci.Valid Usage
7994e5c31af7Sopenharmony_ci****
7995e5c31af7Sopenharmony_ci  * [[VUID-VkImportMemoryBufferCollectionFUCHSIA-index-06406]]
7996e5c31af7Sopenharmony_ci    pname:index must: be less than the value retrieved as
7997e5c31af7Sopenharmony_ci    slink:VkBufferCollectionPropertiesFUCHSIA:bufferCount
7998e5c31af7Sopenharmony_ci****
7999e5c31af7Sopenharmony_ci
8000e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkImportMemoryBufferCollectionFUCHSIA.txt[]
8001e5c31af7Sopenharmony_ci--
8002e5c31af7Sopenharmony_ci
8003e5c31af7Sopenharmony_ci[open,refpage='vkDestroyBufferCollectionFUCHSIA',desc='Destroy a buffer collection',type='protos']
8004e5c31af7Sopenharmony_ci--
8005e5c31af7Sopenharmony_ciTo release a slink:VkBufferCollectionFUCHSIA:
8006e5c31af7Sopenharmony_ci
8007e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkDestroyBufferCollectionFUCHSIA.txt[]
8008e5c31af7Sopenharmony_ci
8009e5c31af7Sopenharmony_ci  * pname:device is the logical device that creates the
8010e5c31af7Sopenharmony_ci    sname:VkBufferCollectionFUCHSIA
8011e5c31af7Sopenharmony_ci  * pname:collection is the slink:VkBufferCollectionFUCHSIA handle
8012e5c31af7Sopenharmony_ci  * pname:pAllocator is a pointer to a slink:VkAllocationCallbacks structure
8013e5c31af7Sopenharmony_ci    controlling host memory allocation as described in the
8014e5c31af7Sopenharmony_ci    <<memory-allocation, Memory Allocation>> chapter
8015e5c31af7Sopenharmony_ci
8016e5c31af7Sopenharmony_ci.Valid Usage
8017e5c31af7Sopenharmony_ci****
8018e5c31af7Sopenharmony_ci  * [[VUID-vkDestroyBufferCollectionFUCHSIA-collection-06407]]
8019e5c31af7Sopenharmony_ci    slink:VkImage and slink:VkBuffer objects that referenced
8020e5c31af7Sopenharmony_ci    pname:collection upon creation by inclusion of a
8021e5c31af7Sopenharmony_ci    slink:VkBufferCollectionImageCreateInfoFUCHSIA or
8022e5c31af7Sopenharmony_ci    slink:VkBufferCollectionBufferCreateInfoFUCHSIA chained to their
8023e5c31af7Sopenharmony_ci    slink:VkImageCreateInfo or slink:VkBufferCreateInfo structures
8024e5c31af7Sopenharmony_ci    respectively, may: outlive pname:collection.
8025e5c31af7Sopenharmony_ci****
8026e5c31af7Sopenharmony_ci
8027e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkDestroyBufferCollectionFUCHSIA.txt[]
8028e5c31af7Sopenharmony_ci--
8029e5c31af7Sopenharmony_ciendif::VK_FUCHSIA_buffer_collection[]
8030