1e5c31af7Sopenharmony_ci// Copyright 2015-2021 The Khronos Group, Inc. 2e5c31af7Sopenharmony_ci// 3e5c31af7Sopenharmony_ci// SPDX-License-Identifier: CC-BY-4.0 4e5c31af7Sopenharmony_ci 5e5c31af7Sopenharmony_ci[[descriptorsets]] 6e5c31af7Sopenharmony_ci= Resource Descriptors 7e5c31af7Sopenharmony_ci 8e5c31af7Sopenharmony_ciA _descriptor_ is an opaque data structure representing a shader resource 9e5c31af7Sopenharmony_cisuch as a buffer, buffer view, image view, sampler, or combined image 10e5c31af7Sopenharmony_cisampler. 11e5c31af7Sopenharmony_ciDescriptors are organised into _descriptor sets_, which are bound during 12e5c31af7Sopenharmony_cicommand recording for use in subsequent drawing commands. 13e5c31af7Sopenharmony_ciThe arrangement of content in each descriptor set is determined by a 14e5c31af7Sopenharmony_ci_descriptor set layout_, which determines what descriptors can be stored 15e5c31af7Sopenharmony_ciwithin it. 16e5c31af7Sopenharmony_ciThe sequence of descriptor set layouts that can: be used by a pipeline is 17e5c31af7Sopenharmony_cispecified in a _pipeline layout_. 18e5c31af7Sopenharmony_ciEach pipeline object can: use up to pname:maxBoundDescriptorSets (see 19e5c31af7Sopenharmony_ci<<limits, Limits>>) descriptor sets. 20e5c31af7Sopenharmony_ci 21e5c31af7Sopenharmony_ciShaders access resources via variables decorated with a descriptor set and 22e5c31af7Sopenharmony_cibinding number that link them to a descriptor in a descriptor set. 23e5c31af7Sopenharmony_ciThe shader interface mapping to bound descriptor sets is described in the 24e5c31af7Sopenharmony_ci<<interfaces-resources, Shader Resource Interface>> section. 25e5c31af7Sopenharmony_ci 26e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_EXT_buffer_device_address,VK_KHR_buffer_device_address[] 27e5c31af7Sopenharmony_ciShaders can: also access buffers without going through descriptors by using 28e5c31af7Sopenharmony_ci<<descriptorsets-physical-storage-buffer,Physical Storage Buffer Access>> to 29e5c31af7Sopenharmony_ciaccess them through 64-bit addresses. 30e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_EXT_buffer_device_address,VK_KHR_buffer_device_address[] 31e5c31af7Sopenharmony_ci 32e5c31af7Sopenharmony_ci 33e5c31af7Sopenharmony_ci[[descriptorsets-types]] 34e5c31af7Sopenharmony_ci== Descriptor Types 35e5c31af7Sopenharmony_ci 36e5c31af7Sopenharmony_ciThere are a number of different types of descriptor supported by Vulkan, 37e5c31af7Sopenharmony_cicorresponding to different resources or usage. 38e5c31af7Sopenharmony_ciThe following sections describe the API definitions of each descriptor type. 39e5c31af7Sopenharmony_ciThe mapping of each type to SPIR-V is listed in the 40e5c31af7Sopenharmony_ci<<interfaces-resources-correspondence, Shader Resource and Descriptor Type 41e5c31af7Sopenharmony_ciCorrespondence>> and <<interfaces-resources-storage-class-correspondence, 42e5c31af7Sopenharmony_ciShader Resource and Storage Class Correspondence>> tables in the 43e5c31af7Sopenharmony_ci<<interfaces, Shader Interfaces>> chapter. 44e5c31af7Sopenharmony_ci 45e5c31af7Sopenharmony_ci 46e5c31af7Sopenharmony_ci[[descriptorsets-storageimage]] 47e5c31af7Sopenharmony_ci=== Storage Image 48e5c31af7Sopenharmony_ci 49e5c31af7Sopenharmony_ciA _storage image_ (ename:VK_DESCRIPTOR_TYPE_STORAGE_IMAGE) is a descriptor 50e5c31af7Sopenharmony_citype associated with an <<resources-images, image resource>> via an 51e5c31af7Sopenharmony_ci<<resources-image-views, image view>> that load, store, and atomic 52e5c31af7Sopenharmony_cioperations can: be performed on. 53e5c31af7Sopenharmony_ci 54e5c31af7Sopenharmony_ciStorage image loads are supported in all shader stages for image views whose 55e5c31af7Sopenharmony_ci<<resources-image-view-format-features,format features>> contain 56e5c31af7Sopenharmony_ci<<formats-properties,ename:VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT>>. 57e5c31af7Sopenharmony_ci 58e5c31af7Sopenharmony_ciStores to storage images are supported in compute shaders for image views 59e5c31af7Sopenharmony_ciwhose <<resources-image-view-format-features,format features>> contain 60e5c31af7Sopenharmony_ci<<formats-properties,ename:VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT>>. 61e5c31af7Sopenharmony_ci 62e5c31af7Sopenharmony_ciAtomic operations on storage images are supported in compute shaders for 63e5c31af7Sopenharmony_ciimage views whose <<resources-image-view-format-features,format features>> 64e5c31af7Sopenharmony_cicontain 65e5c31af7Sopenharmony_ci<<formats-properties,ename:VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT>>. 66e5c31af7Sopenharmony_ci 67e5c31af7Sopenharmony_ciWhen the <<features-fragmentStoresAndAtomics, 68e5c31af7Sopenharmony_cipname:fragmentStoresAndAtomics>> feature is enabled, stores and atomic 69e5c31af7Sopenharmony_cioperations are also supported for storage images in fragment shaders with 70e5c31af7Sopenharmony_cithe same set of image formats as supported in compute shaders. 71e5c31af7Sopenharmony_ciWhen the <<features-vertexPipelineStoresAndAtomics, 72e5c31af7Sopenharmony_cipname:vertexPipelineStoresAndAtomics>> feature is enabled, stores and atomic 73e5c31af7Sopenharmony_cioperations are also supported in vertex, tessellation, and geometry shaders 74e5c31af7Sopenharmony_ciwith the same set of image formats as supported in compute shaders. 75e5c31af7Sopenharmony_ci 76e5c31af7Sopenharmony_ciThe image subresources for a storage image must: be in the 77e5c31af7Sopenharmony_ciifdef::VK_KHR_shared_presentable_image[] 78e5c31af7Sopenharmony_ciename:VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR or 79e5c31af7Sopenharmony_ciendif::VK_KHR_shared_presentable_image[] 80e5c31af7Sopenharmony_ciename:VK_IMAGE_LAYOUT_GENERAL layout in order to access its data in a 81e5c31af7Sopenharmony_cishader. 82e5c31af7Sopenharmony_ci 83e5c31af7Sopenharmony_ci 84e5c31af7Sopenharmony_ci[[descriptorsets-sampler]] 85e5c31af7Sopenharmony_ci=== Sampler 86e5c31af7Sopenharmony_ci 87e5c31af7Sopenharmony_ciA _sampler descriptor_ (ename:VK_DESCRIPTOR_TYPE_SAMPLER) is a descriptor 88e5c31af7Sopenharmony_citype associated with a <<samplers,sampler>> object, used to control the 89e5c31af7Sopenharmony_cibehavior of <<textures,sampling operations>> performed on a 90e5c31af7Sopenharmony_ci<<descriptorsets-sampledimage, sampled image>>. 91e5c31af7Sopenharmony_ci 92e5c31af7Sopenharmony_ci 93e5c31af7Sopenharmony_ci[[descriptorsets-sampledimage]] 94e5c31af7Sopenharmony_ci=== Sampled Image 95e5c31af7Sopenharmony_ci 96e5c31af7Sopenharmony_ciA _sampled image_ (ename:VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE) is a descriptor 97e5c31af7Sopenharmony_citype associated with an <<resources-images, image resource>> via an 98e5c31af7Sopenharmony_ci<<resources-image-views, image view>> that <<textures,sampling operations>> 99e5c31af7Sopenharmony_cican: be performed on. 100e5c31af7Sopenharmony_ci 101e5c31af7Sopenharmony_ciShaders combine a sampled image variable and a sampler variable to perform 102e5c31af7Sopenharmony_cisampling operations. 103e5c31af7Sopenharmony_ci 104e5c31af7Sopenharmony_ciSampled images are supported in all shader stages for image views whose 105e5c31af7Sopenharmony_ci<<resources-image-view-format-features,format features>> contain 106e5c31af7Sopenharmony_ci<<formats-properties,ename:VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT>>. 107e5c31af7Sopenharmony_ci 108e5c31af7Sopenharmony_ciThe image subresources for a sampled image must: be in the 109e5c31af7Sopenharmony_ciifdef::VK_KHR_shared_presentable_image[] 110e5c31af7Sopenharmony_ciename:VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR, 111e5c31af7Sopenharmony_ciendif::VK_KHR_shared_presentable_image[] 112e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_maintenance2[] 113e5c31af7Sopenharmony_ciename:VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL, 114e5c31af7Sopenharmony_ciename:VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL, 115e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_maintenance2[] 116e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_KHR_separate_depth_stencil_layouts[] 117e5c31af7Sopenharmony_ciename:VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL, 118e5c31af7Sopenharmony_ciename:VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL, 119e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_KHR_separate_depth_stencil_layouts[] 120e5c31af7Sopenharmony_ciename:VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL, 121e5c31af7Sopenharmony_ciename:VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, or 122e5c31af7Sopenharmony_ciename:VK_IMAGE_LAYOUT_GENERAL layout in order to access its data in a 123e5c31af7Sopenharmony_cishader. 124e5c31af7Sopenharmony_ci 125e5c31af7Sopenharmony_ci 126e5c31af7Sopenharmony_ci[[descriptorsets-combinedimagesampler]] 127e5c31af7Sopenharmony_ci=== Combined Image Sampler 128e5c31af7Sopenharmony_ci 129e5c31af7Sopenharmony_ciA _combined image sampler_ (ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER) 130e5c31af7Sopenharmony_ciis a single descriptor type associated with both a <<samplers,sampler>> and 131e5c31af7Sopenharmony_cian <<resources-images,image resource>>, combining both a 132e5c31af7Sopenharmony_ci<<descriptorsets-sampler,sampler>> and <<descriptorsets-sampledimage, 133e5c31af7Sopenharmony_cisampled image>> descriptor into a single descriptor. 134e5c31af7Sopenharmony_ci 135e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[] 136e5c31af7Sopenharmony_ciIf the descriptor refers to a sampler that performs 137e5c31af7Sopenharmony_ciifndef::VK_EXT_fragment_density_map[] 138e5c31af7Sopenharmony_ci<<samplers-YCbCr-conversion,{YCbCr} conversion>>, 139e5c31af7Sopenharmony_ciendif::VK_EXT_fragment_density_map[] 140e5c31af7Sopenharmony_ciifdef::VK_EXT_fragment_density_map[] 141e5c31af7Sopenharmony_ci<<samplers-YCbCr-conversion,{YCbCr} conversion>> or samples a 142e5c31af7Sopenharmony_ci<<samplers-subsamplesampler,subsampled image>>, 143e5c31af7Sopenharmony_ciendif::VK_EXT_fragment_density_map[] 144e5c31af7Sopenharmony_cithe sampler must: only be used to sample the image in the same descriptor. 145e5c31af7Sopenharmony_ciOtherwise, the 146e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[] 147e5c31af7Sopenharmony_ciifndef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[] 148e5c31af7Sopenharmony_ciifndef::VK_EXT_fragment_density_map[] 149e5c31af7Sopenharmony_ciThe 150e5c31af7Sopenharmony_ciendif::VK_EXT_fragment_density_map[] 151e5c31af7Sopenharmony_ciifdef::VK_EXT_fragment_density_map[] 152e5c31af7Sopenharmony_ciIf the descriptor refers to a sampler that samples a 153e5c31af7Sopenharmony_ci<<samplers-subsamplesampler,subsampled image>>, the sampler must: only be 154e5c31af7Sopenharmony_ciused to sample the image in the same descriptor. 155e5c31af7Sopenharmony_ciOtherwise, the 156e5c31af7Sopenharmony_ciendif::VK_EXT_fragment_density_map[] 157e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[] 158e5c31af7Sopenharmony_cisampler and image in this type of descriptor can: be used freely with any 159e5c31af7Sopenharmony_ciother samplers and images. 160e5c31af7Sopenharmony_ci 161e5c31af7Sopenharmony_ciThe image subresources for a combined image sampler must: be in the 162e5c31af7Sopenharmony_ciifdef::VK_KHR_shared_presentable_image[] 163e5c31af7Sopenharmony_ciename:VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR, 164e5c31af7Sopenharmony_ciendif::VK_KHR_shared_presentable_image[] 165e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_maintenance2[] 166e5c31af7Sopenharmony_ciename:VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL, 167e5c31af7Sopenharmony_ciename:VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL, 168e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_maintenance2[] 169e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_KHR_separate_depth_stencil_layouts[] 170e5c31af7Sopenharmony_ciename:VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL, 171e5c31af7Sopenharmony_ciename:VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL, 172e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_KHR_separate_depth_stencil_layouts[] 173e5c31af7Sopenharmony_ciename:VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL, 174e5c31af7Sopenharmony_ciename:VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, or 175e5c31af7Sopenharmony_ciename:VK_IMAGE_LAYOUT_GENERAL layout in order to access its data in a 176e5c31af7Sopenharmony_cishader. 177e5c31af7Sopenharmony_ci 178e5c31af7Sopenharmony_ci[NOTE] 179e5c31af7Sopenharmony_ci.Note 180e5c31af7Sopenharmony_ci==== 181e5c31af7Sopenharmony_ciOn some implementations, it may: be more efficient to sample from an image 182e5c31af7Sopenharmony_ciusing a combination of sampler and sampled image that are stored together in 183e5c31af7Sopenharmony_cithe descriptor set in a combined descriptor. 184e5c31af7Sopenharmony_ci==== 185e5c31af7Sopenharmony_ci 186e5c31af7Sopenharmony_ci 187e5c31af7Sopenharmony_ci[[descriptorsets-uniformtexelbuffer]] 188e5c31af7Sopenharmony_ci=== Uniform Texel Buffer 189e5c31af7Sopenharmony_ci 190e5c31af7Sopenharmony_ciA _uniform texel buffer_ (ename:VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER) is 191e5c31af7Sopenharmony_cia descriptor type associated with a <<resources-buffers,buffer resource>> 192e5c31af7Sopenharmony_civia a <<resources-buffer-views, buffer view>> that <<textures,formatted load 193e5c31af7Sopenharmony_cioperations>> can: be performed on. 194e5c31af7Sopenharmony_ci 195e5c31af7Sopenharmony_ciUniform texel buffers define a tightly-packed 1-dimensional linear array of 196e5c31af7Sopenharmony_citexels, with texels going through format conversion when read in a shader in 197e5c31af7Sopenharmony_cithe same way as they are for an image. 198e5c31af7Sopenharmony_ci 199e5c31af7Sopenharmony_ciLoad operations from uniform texel buffers are supported in all shader 200e5c31af7Sopenharmony_cistages for image formats which report support for the 201e5c31af7Sopenharmony_ci<<formats-properties,ename:VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT>> 202e5c31af7Sopenharmony_cifeature bit via flink:vkGetPhysicalDeviceFormatProperties in 203e5c31af7Sopenharmony_cislink:VkFormatProperties::pname:bufferFeatures. 204e5c31af7Sopenharmony_ci 205e5c31af7Sopenharmony_ci 206e5c31af7Sopenharmony_ci[[descriptorsets-storagetexelbuffer]] 207e5c31af7Sopenharmony_ci=== Storage Texel Buffer 208e5c31af7Sopenharmony_ci 209e5c31af7Sopenharmony_ciA _storage texel buffer_ (ename:VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER) is 210e5c31af7Sopenharmony_cia descriptor type associated with a <<resources-buffers,buffer resource>> 211e5c31af7Sopenharmony_civia a <<resources-buffer-views, buffer view>> that <<textures,formatted 212e5c31af7Sopenharmony_ciload, store, and atomic operations>> can: be performed on. 213e5c31af7Sopenharmony_ci 214e5c31af7Sopenharmony_ciStorage texel buffers define a tightly-packed 1-dimensional linear array of 215e5c31af7Sopenharmony_citexels, with texels going through format conversion when read in a shader in 216e5c31af7Sopenharmony_cithe same way as they are for an image. 217e5c31af7Sopenharmony_ciUnlike <<descriptorsets-uniformtexelbuffer,uniform texel buffers>>, these 218e5c31af7Sopenharmony_cibuffers can also be written to in the same way as for 219e5c31af7Sopenharmony_ci<<descriptorsets-storageimage, storage images>>. 220e5c31af7Sopenharmony_ci 221e5c31af7Sopenharmony_ciStorage texel buffer loads are supported in all shader stages for texel 222e5c31af7Sopenharmony_cibuffer formats which report support for the 223e5c31af7Sopenharmony_ci<<formats-properties,ename:VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT>> 224e5c31af7Sopenharmony_cifeature bit via flink:vkGetPhysicalDeviceFormatProperties in 225e5c31af7Sopenharmony_cislink:VkFormatProperties::pname:bufferFeatures. 226e5c31af7Sopenharmony_ci 227e5c31af7Sopenharmony_ciStores to storage texel buffers are supported in compute shaders for texel 228e5c31af7Sopenharmony_cibuffer formats which report support for the 229e5c31af7Sopenharmony_ciename:VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT feature via 230e5c31af7Sopenharmony_ciflink:vkGetPhysicalDeviceFormatProperties in 231e5c31af7Sopenharmony_cislink:VkFormatProperties::pname:bufferFeatures. 232e5c31af7Sopenharmony_ci 233e5c31af7Sopenharmony_ciAtomic operations on storage texel buffers are supported in compute shaders 234e5c31af7Sopenharmony_cifor texel buffer formats which report support for the 235e5c31af7Sopenharmony_ci<<formats-properties,ename:VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT>> 236e5c31af7Sopenharmony_cifeature via flink:vkGetPhysicalDeviceFormatProperties in 237e5c31af7Sopenharmony_cislink:VkFormatProperties::pname:bufferFeatures. 238e5c31af7Sopenharmony_ci 239e5c31af7Sopenharmony_ciWhen the <<features-fragmentStoresAndAtomics, 240e5c31af7Sopenharmony_cipname:fragmentStoresAndAtomics>> feature is enabled, stores and atomic 241e5c31af7Sopenharmony_cioperations are also supported for storage texel buffers in fragment shaders 242e5c31af7Sopenharmony_ciwith the same set of texel buffer formats as supported in compute shaders. 243e5c31af7Sopenharmony_ciWhen the <<features-vertexPipelineStoresAndAtomics, 244e5c31af7Sopenharmony_cipname:vertexPipelineStoresAndAtomics>> feature is enabled, stores and atomic 245e5c31af7Sopenharmony_cioperations are also supported in vertex, tessellation, and geometry shaders 246e5c31af7Sopenharmony_ciwith the same set of texel buffer formats as supported in compute shaders. 247e5c31af7Sopenharmony_ci 248e5c31af7Sopenharmony_ci 249e5c31af7Sopenharmony_ci[[descriptorsets-storagebuffer]] 250e5c31af7Sopenharmony_ci=== Storage Buffer 251e5c31af7Sopenharmony_ci 252e5c31af7Sopenharmony_ciA _storage buffer_ (ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER) is a descriptor 253e5c31af7Sopenharmony_citype associated with a <<resources-buffers,buffer resource>> directly, 254e5c31af7Sopenharmony_cidescribed in a shader as a structure with various members that load, store, 255e5c31af7Sopenharmony_ciand atomic operations can: be performed on. 256e5c31af7Sopenharmony_ci 257e5c31af7Sopenharmony_ci[NOTE] 258e5c31af7Sopenharmony_ci.Note 259e5c31af7Sopenharmony_ci==== 260e5c31af7Sopenharmony_ciAtomic operations can: only be performed on members of certain types as 261e5c31af7Sopenharmony_cidefined in the <<spirvenv, SPIR-V environment appendix>>. 262e5c31af7Sopenharmony_ci==== 263e5c31af7Sopenharmony_ci 264e5c31af7Sopenharmony_ci 265e5c31af7Sopenharmony_ci[[descriptorsets-uniformbuffer]] 266e5c31af7Sopenharmony_ci=== Uniform Buffer 267e5c31af7Sopenharmony_ci 268e5c31af7Sopenharmony_ciA _uniform buffer_ (ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER) is a descriptor 269e5c31af7Sopenharmony_citype associated with a <<resources-buffers,buffer resource>> directly, 270e5c31af7Sopenharmony_cidescribed in a shader as a structure with various members that load 271e5c31af7Sopenharmony_cioperations can: be performed on. 272e5c31af7Sopenharmony_ci 273e5c31af7Sopenharmony_ci 274e5c31af7Sopenharmony_ci[[descriptorsets-uniformbufferdynamic]] 275e5c31af7Sopenharmony_ci=== Dynamic Uniform Buffer 276e5c31af7Sopenharmony_ci 277e5c31af7Sopenharmony_ciA _dynamic uniform buffer_ (ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC) 278e5c31af7Sopenharmony_ciis almost identical to a <<descriptorsets-uniformbuffer, uniform buffer>>, 279e5c31af7Sopenharmony_ciand differs only in how the offset into the buffer is specified. 280e5c31af7Sopenharmony_ciThe base offset calculated by the slink:VkDescriptorBufferInfo when 281e5c31af7Sopenharmony_ciinitially <<descriptorsets-updates, updating the descriptor set>> is added 282e5c31af7Sopenharmony_cito a <<descriptorsets-binding-dynamicoffsets, dynamic offset>> when binding 283e5c31af7Sopenharmony_cithe descriptor set. 284e5c31af7Sopenharmony_ci 285e5c31af7Sopenharmony_ci 286e5c31af7Sopenharmony_ci[[descriptorsets-storagebufferdynamic]] 287e5c31af7Sopenharmony_ci=== Dynamic Storage Buffer 288e5c31af7Sopenharmony_ci 289e5c31af7Sopenharmony_ciA _dynamic storage buffer_ (ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC) 290e5c31af7Sopenharmony_ciis almost identical to a <<descriptorsets-storagebuffer, storage buffer>>, 291e5c31af7Sopenharmony_ciand differs only in how the offset into the buffer is specified. 292e5c31af7Sopenharmony_ciThe base offset calculated by the slink:VkDescriptorBufferInfo when 293e5c31af7Sopenharmony_ciinitially <<descriptorsets-updates, updating the descriptor set>> is added 294e5c31af7Sopenharmony_cito a <<descriptorsets-binding-dynamicoffsets, dynamic offset>> when binding 295e5c31af7Sopenharmony_cithe descriptor set. 296e5c31af7Sopenharmony_ci 297e5c31af7Sopenharmony_ci 298e5c31af7Sopenharmony_ciifdef::VK_EXT_inline_uniform_block[] 299e5c31af7Sopenharmony_ci 300e5c31af7Sopenharmony_ci[[descriptorsets-inlineuniformblock]] 301e5c31af7Sopenharmony_ci=== Inline Uniform Block 302e5c31af7Sopenharmony_ci 303e5c31af7Sopenharmony_ciAn _inline uniform block_ 304e5c31af7Sopenharmony_ci(ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT) is almost identical to a 305e5c31af7Sopenharmony_ci<<descriptorsets-uniformbuffer, uniform buffer>>, and differs only in taking 306e5c31af7Sopenharmony_ciits storage directly from the encompassing descriptor set instead of being 307e5c31af7Sopenharmony_cibacked by buffer memory. 308e5c31af7Sopenharmony_ciIt is typically used to access a small set of constant data that does not 309e5c31af7Sopenharmony_cirequire the additional flexibility provided by the indirection enabled when 310e5c31af7Sopenharmony_ciusing a uniform buffer where the descriptor and the referenced buffer memory 311e5c31af7Sopenharmony_ciare decoupled. 312e5c31af7Sopenharmony_ciCompared to push constants, they allow reusing the same set of constant data 313e5c31af7Sopenharmony_ciacross multiple disjoint sets of drawing and dispatching commands. 314e5c31af7Sopenharmony_ci 315e5c31af7Sopenharmony_ciInline uniform block descriptors cannot: be aggregated into arrays. 316e5c31af7Sopenharmony_ciInstead, the array size specified for an inline uniform block descriptor 317e5c31af7Sopenharmony_cibinding specifies the binding's capacity in bytes. 318e5c31af7Sopenharmony_ci 319e5c31af7Sopenharmony_ciendif::VK_EXT_inline_uniform_block[] 320e5c31af7Sopenharmony_ci 321e5c31af7Sopenharmony_ci 322e5c31af7Sopenharmony_ci[[descriptorsets-inputattachment]] 323e5c31af7Sopenharmony_ci=== Input Attachment 324e5c31af7Sopenharmony_ci 325e5c31af7Sopenharmony_ciAn _input attachment_ (ename:VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT) is a 326e5c31af7Sopenharmony_cidescriptor type associated with an <<resources-images, image resource>> via 327e5c31af7Sopenharmony_cian <<resources-image-views, image view>> that can: be used for 328e5c31af7Sopenharmony_ci<<synchronization-framebuffer-regions,framebuffer local>> load operations in 329e5c31af7Sopenharmony_cifragment shaders. 330e5c31af7Sopenharmony_ci 331e5c31af7Sopenharmony_ciAll image formats that are supported for color attachments 332e5c31af7Sopenharmony_ci(ename:VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT) or depth/stencil attachments 333e5c31af7Sopenharmony_ci(ename:VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT) for a given image 334e5c31af7Sopenharmony_citiling mode are also supported for input attachments. 335e5c31af7Sopenharmony_ci 336e5c31af7Sopenharmony_ciThe image subresources for an input attachment must: be in a 337e5c31af7Sopenharmony_ci<<attachment-type-imagelayout, valid image layout>> in order to access its 338e5c31af7Sopenharmony_cidata in a shader. 339e5c31af7Sopenharmony_ci 340e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing,VK_KHR_acceleration_structure[] 341e5c31af7Sopenharmony_ci[[descriptorsets-accelerationstructure]] 342e5c31af7Sopenharmony_ci=== Acceleration Structure 343e5c31af7Sopenharmony_ci 344e5c31af7Sopenharmony_ciAn _acceleration structure_ ( 345e5c31af7Sopenharmony_ciifdef::VK_KHR_acceleration_structure[ename:VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_KHR] 346e5c31af7Sopenharmony_ciifdef::VK_KHR_acceleration_structure+VK_NV_ray_tracing[or] 347e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing[ename:VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_NV] 348e5c31af7Sopenharmony_ci) is a descriptor type that is used to retrieve scene geometry from within 349e5c31af7Sopenharmony_cishaders that are used for ray traversal. 350e5c31af7Sopenharmony_ciShaders have read-only access to the memory. 351e5c31af7Sopenharmony_ciendif::VK_NV_ray_tracing,VK_KHR_acceleration_structure[] 352e5c31af7Sopenharmony_ci 353e5c31af7Sopenharmony_ciifdef::VK_VALVE_mutable_descriptor_type[] 354e5c31af7Sopenharmony_ci[[descriptorsets-mutable]] 355e5c31af7Sopenharmony_ci=== Mutable 356e5c31af7Sopenharmony_ci 357e5c31af7Sopenharmony_ciA descriptor of _mutable_ (ename:VK_DESCRIPTOR_TYPE_MUTABLE_VALVE) type 358e5c31af7Sopenharmony_ciindicates that this descriptor can: mutate to any of the descriptor types 359e5c31af7Sopenharmony_cigiven in the 360e5c31af7Sopenharmony_cislink:VkMutableDescriptorTypeCreateInfoVALVE::pname:pDescriptorTypes list of 361e5c31af7Sopenharmony_cidescriptor types in the pname:pNext chain of 362e5c31af7Sopenharmony_cislink:VkDescriptorSetLayoutCreateInfo for this binding. 363e5c31af7Sopenharmony_ciAt any point, each individual descriptor of mutable type has an active 364e5c31af7Sopenharmony_cidescriptor type. 365e5c31af7Sopenharmony_ciThe active descriptor type can: be any one of the declared types in 366e5c31af7Sopenharmony_cipname:pDescriptorTypes. 367e5c31af7Sopenharmony_ciAdditionally, a mutable descriptor's active descriptor type can: be of the 368e5c31af7Sopenharmony_ciename:VK_DESCRIPTOR_TYPE_MUTABLE_VALVE type, which is the initial active 369e5c31af7Sopenharmony_cidescriptor type. 370e5c31af7Sopenharmony_ciThe active descriptor type can: change when the descriptor is updated. 371e5c31af7Sopenharmony_ciWhen a descriptor is consumed by binding a descriptor set, the active 372e5c31af7Sopenharmony_cidescriptor type is considered, not ename:VK_DESCRIPTOR_TYPE_MUTABLE_VALVE. 373e5c31af7Sopenharmony_ci 374e5c31af7Sopenharmony_ciAn active descriptor type of ename:VK_DESCRIPTOR_TYPE_MUTABLE_VALVE is 375e5c31af7Sopenharmony_ciconsidered an undefined: descriptor. 376e5c31af7Sopenharmony_ciIf a descriptor is consumed where the active descriptor type does not match 377e5c31af7Sopenharmony_ciwhat the shader expects, the descriptor is considered an undefined: 378e5c31af7Sopenharmony_cidescriptor. 379e5c31af7Sopenharmony_ci 380e5c31af7Sopenharmony_ci[NOTE] 381e5c31af7Sopenharmony_ci.Note 382e5c31af7Sopenharmony_ci==== 383e5c31af7Sopenharmony_ciTo find which descriptor types are supported as 384e5c31af7Sopenharmony_ciename:VK_DESCRIPTOR_TYPE_MUTABLE_VALVE, the application can: use 385e5c31af7Sopenharmony_ciflink:vkGetDescriptorSetLayoutSupport with an 386e5c31af7Sopenharmony_ciename:VK_DESCRIPTOR_TYPE_MUTABLE_VALVE binding, with the list of descriptor 387e5c31af7Sopenharmony_citypes to query in the 388e5c31af7Sopenharmony_cislink:VkMutableDescriptorTypeCreateInfoVALVE::pname:pDescriptorTypes array 389e5c31af7Sopenharmony_cifor that binding. 390e5c31af7Sopenharmony_ci==== 391e5c31af7Sopenharmony_ci 392e5c31af7Sopenharmony_ci[NOTE] 393e5c31af7Sopenharmony_ci.Note 394e5c31af7Sopenharmony_ci==== 395e5c31af7Sopenharmony_ciThe intention of a mutable descriptor type is that implementations allocate 396e5c31af7Sopenharmony_ciN bytes per descriptor, where N is determined by the maximum descriptor size 397e5c31af7Sopenharmony_cifor a given descriptor binding. 398e5c31af7Sopenharmony_ciImplementations are not expected to keep track of the active descriptor 399e5c31af7Sopenharmony_citype, and it should be considered a C-like union type. 400e5c31af7Sopenharmony_ci 401e5c31af7Sopenharmony_ciA mutable descriptor type is not considered as efficient in terms of 402e5c31af7Sopenharmony_cirun-time performance as using a non-mutable descriptor type, and 403e5c31af7Sopenharmony_ciapplications are not encouraged to use them outside API layering efforts. 404e5c31af7Sopenharmony_ciMutable descriptor types can be more efficient if the alternative is using 405e5c31af7Sopenharmony_cimany different descriptors to emulate mutable descriptor types. 406e5c31af7Sopenharmony_ci==== 407e5c31af7Sopenharmony_ci 408e5c31af7Sopenharmony_ciendif::VK_VALVE_mutable_descriptor_type[] 409e5c31af7Sopenharmony_ci 410e5c31af7Sopenharmony_ci[[descriptorsets-sets]] 411e5c31af7Sopenharmony_ci== Descriptor Sets 412e5c31af7Sopenharmony_ci 413e5c31af7Sopenharmony_ciDescriptors are grouped together into descriptor set objects. 414e5c31af7Sopenharmony_ciA descriptor set object is an opaque object containing storage for a set of 415e5c31af7Sopenharmony_cidescriptors, where the types and number of descriptors is defined by a 416e5c31af7Sopenharmony_cidescriptor set layout. 417e5c31af7Sopenharmony_ciThe layout object may: be used to define the association of each descriptor 418e5c31af7Sopenharmony_cibinding with memory or other implementation resources. 419e5c31af7Sopenharmony_ciThe layout is used both for determining the resources that need to be 420e5c31af7Sopenharmony_ciassociated with the descriptor set, and determining the interface between 421e5c31af7Sopenharmony_cishader stages and shader resources. 422e5c31af7Sopenharmony_ci 423e5c31af7Sopenharmony_ci 424e5c31af7Sopenharmony_ci[[descriptorsets-setlayout]] 425e5c31af7Sopenharmony_ci=== Descriptor Set Layout 426e5c31af7Sopenharmony_ci 427e5c31af7Sopenharmony_ci[open,refpage='VkDescriptorSetLayout',desc='Opaque handle to a descriptor set layout object',type='handles'] 428e5c31af7Sopenharmony_ci-- 429e5c31af7Sopenharmony_ciA descriptor set layout object is defined by an array of zero or more 430e5c31af7Sopenharmony_cidescriptor bindings. 431e5c31af7Sopenharmony_ciEach individual descriptor binding is specified by a descriptor type, a 432e5c31af7Sopenharmony_cicount (array size) of the number of descriptors in the binding, a set of 433e5c31af7Sopenharmony_cishader stages that can: access the binding, and (if using immutable 434e5c31af7Sopenharmony_cisamplers) an array of sampler descriptors. 435e5c31af7Sopenharmony_ci 436e5c31af7Sopenharmony_ciDescriptor set layout objects are represented by sname:VkDescriptorSetLayout 437e5c31af7Sopenharmony_cihandles: 438e5c31af7Sopenharmony_ci 439e5c31af7Sopenharmony_ciinclude::{generated}/api/handles/VkDescriptorSetLayout.txt[] 440e5c31af7Sopenharmony_ci-- 441e5c31af7Sopenharmony_ci 442e5c31af7Sopenharmony_ci[open,refpage='vkCreateDescriptorSetLayout',desc='Create a new descriptor set layout',type='protos'] 443e5c31af7Sopenharmony_ci-- 444e5c31af7Sopenharmony_ciTo create descriptor set layout objects, call: 445e5c31af7Sopenharmony_ci 446e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCreateDescriptorSetLayout.txt[] 447e5c31af7Sopenharmony_ci 448e5c31af7Sopenharmony_ci * pname:device is the logical device that creates the descriptor set 449e5c31af7Sopenharmony_ci layout. 450e5c31af7Sopenharmony_ci * pname:pCreateInfo is a pointer to a 451e5c31af7Sopenharmony_ci slink:VkDescriptorSetLayoutCreateInfo structure specifying the state of 452e5c31af7Sopenharmony_ci the descriptor set layout object. 453e5c31af7Sopenharmony_ci * pname:pAllocator controls host memory allocation as described in the 454e5c31af7Sopenharmony_ci <<memory-allocation, Memory Allocation>> chapter. 455e5c31af7Sopenharmony_ci * pname:pSetLayout is a pointer to a slink:VkDescriptorSetLayout handle in 456e5c31af7Sopenharmony_ci which the resulting descriptor set layout object is returned. 457e5c31af7Sopenharmony_ci 458e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCreateDescriptorSetLayout.txt[] 459e5c31af7Sopenharmony_ci-- 460e5c31af7Sopenharmony_ci 461e5c31af7Sopenharmony_ci[open,refpage='VkDescriptorSetLayoutCreateInfo',desc='Structure specifying parameters of a newly created descriptor set layout',type='structs'] 462e5c31af7Sopenharmony_ci-- 463e5c31af7Sopenharmony_ciInformation about the descriptor set layout is passed in a 464e5c31af7Sopenharmony_cisname:VkDescriptorSetLayoutCreateInfo structure: 465e5c31af7Sopenharmony_ci 466e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkDescriptorSetLayoutCreateInfo.txt[] 467e5c31af7Sopenharmony_ci 468e5c31af7Sopenharmony_ci * pname:sType is the type of this structure. 469e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 470e5c31af7Sopenharmony_ci structure. 471e5c31af7Sopenharmony_ci * pname:flags is a bitmask 472e5c31af7Sopenharmony_ciifdef::VK_KHR_push_descriptor[] 473e5c31af7Sopenharmony_ci of elink:VkDescriptorSetLayoutCreateFlagBits 474e5c31af7Sopenharmony_ciendif::VK_KHR_push_descriptor[] 475e5c31af7Sopenharmony_ci specifying options for descriptor set layout creation. 476e5c31af7Sopenharmony_ci * pname:bindingCount is the number of elements in pname:pBindings. 477e5c31af7Sopenharmony_ci * pname:pBindings is a pointer to an array of 478e5c31af7Sopenharmony_ci slink:VkDescriptorSetLayoutBinding structures. 479e5c31af7Sopenharmony_ci 480e5c31af7Sopenharmony_ci.Valid Usage 481e5c31af7Sopenharmony_ci**** 482e5c31af7Sopenharmony_ci * [[VUID-VkDescriptorSetLayoutCreateInfo-binding-00279]] 483e5c31af7Sopenharmony_ci The slink:VkDescriptorSetLayoutBinding::pname:binding members of the 484e5c31af7Sopenharmony_ci elements of the pname:pBindings array must: each have different values 485e5c31af7Sopenharmony_ciifdef::VK_KHR_push_descriptor[] 486e5c31af7Sopenharmony_ci * [[VUID-VkDescriptorSetLayoutCreateInfo-flags-00280]] 487e5c31af7Sopenharmony_ci If pname:flags contains 488e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR, then all 489e5c31af7Sopenharmony_ci elements of pname:pBindings must: not have a pname:descriptorType of 490e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC or 491e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC 492e5c31af7Sopenharmony_ciifdef::VK_EXT_inline_uniform_block[] 493e5c31af7Sopenharmony_ci * [[VUID-VkDescriptorSetLayoutCreateInfo-flags-02208]] 494e5c31af7Sopenharmony_ci If pname:flags contains 495e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR, then all 496e5c31af7Sopenharmony_ci elements of pname:pBindings must: not have a pname:descriptorType of 497e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT 498e5c31af7Sopenharmony_ciendif::VK_EXT_inline_uniform_block[] 499e5c31af7Sopenharmony_ci * [[VUID-VkDescriptorSetLayoutCreateInfo-flags-00281]] 500e5c31af7Sopenharmony_ci If pname:flags contains 501e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR, then the 502e5c31af7Sopenharmony_ci total number of elements of all bindings must: be less than or equal to 503e5c31af7Sopenharmony_ci slink:VkPhysicalDevicePushDescriptorPropertiesKHR::pname:maxPushDescriptors 504e5c31af7Sopenharmony_ciifdef::VK_VALVE_mutable_descriptor_type[] 505e5c31af7Sopenharmony_ci * [[VUID-VkDescriptorSetLayoutCreateInfo-flags-04590]] 506e5c31af7Sopenharmony_ci If pname:flags contains 507e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR, 508e5c31af7Sopenharmony_ci pname:flags must: not contain 509e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_HOST_ONLY_POOL_BIT_VALVE 510e5c31af7Sopenharmony_ci * [[VUID-VkDescriptorSetLayoutCreateInfo-flags-04591]] 511e5c31af7Sopenharmony_ci If pname:flags contains 512e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR, 513e5c31af7Sopenharmony_ci pname:pBindings must: not have a pname:descriptorType of 514e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_MUTABLE_VALVE 515e5c31af7Sopenharmony_ciendif::VK_VALVE_mutable_descriptor_type[] 516e5c31af7Sopenharmony_ciendif::VK_KHR_push_descriptor[] 517e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[] 518e5c31af7Sopenharmony_ci * [[VUID-VkDescriptorSetLayoutCreateInfo-flags-03000]] 519e5c31af7Sopenharmony_ci If any binding has the ename:VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT 520e5c31af7Sopenharmony_ci bit set, pname:flags must: include 521e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT 522e5c31af7Sopenharmony_ci * [[VUID-VkDescriptorSetLayoutCreateInfo-descriptorType-03001]] 523e5c31af7Sopenharmony_ci If any binding has the ename:VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT 524e5c31af7Sopenharmony_ci bit set, then all bindings must: not have pname:descriptorType of 525e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC or 526e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC 527e5c31af7Sopenharmony_ciifdef::VK_VALVE_mutable_descriptor_type[] 528e5c31af7Sopenharmony_ci * [[VUID-VkDescriptorSetLayoutCreateInfo-flags-04592]] 529e5c31af7Sopenharmony_ci If pname:flags contains 530e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT, 531e5c31af7Sopenharmony_ci pname:flags must: not contain 532e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_HOST_ONLY_POOL_BIT_VALVE 533e5c31af7Sopenharmony_ciendif::VK_VALVE_mutable_descriptor_type[] 534e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[] 535e5c31af7Sopenharmony_ciifdef::VK_VALVE_mutable_descriptor_type[] 536e5c31af7Sopenharmony_ci * [[VUID-VkDescriptorSetLayoutCreateInfo-descriptorType-04593]] 537e5c31af7Sopenharmony_ci If any binding has a pname:descriptorType of 538e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_MUTABLE_VALVE, then a 539e5c31af7Sopenharmony_ci slink:VkMutableDescriptorTypeCreateInfoVALVE must: be present in the 540e5c31af7Sopenharmony_ci pname:pNext chain 541e5c31af7Sopenharmony_ci * [[VUID-VkDescriptorSetLayoutCreateInfo-descriptorType-04594]] 542e5c31af7Sopenharmony_ci If a binding has a pname:descriptorType value of 543e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_MUTABLE_VALVE, then sname:pImmutableSamplers 544e5c31af7Sopenharmony_ci must: be `NULL` 545e5c31af7Sopenharmony_ci * [[VUID-VkDescriptorSetLayoutCreateInfo-mutableDescriptorType-04595]] 546e5c31af7Sopenharmony_ci If 547e5c31af7Sopenharmony_ci slink:VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE::pname:mutableDescriptorType 548e5c31af7Sopenharmony_ci is not enabled, pname:pBindings must: not contain a pname:descriptorType 549e5c31af7Sopenharmony_ci of ename:VK_DESCRIPTOR_TYPE_MUTABLE_VALVE 550e5c31af7Sopenharmony_ci * [[VUID-VkDescriptorSetLayoutCreateInfo-flags-04596]] 551e5c31af7Sopenharmony_ci If pname:flags contains 552e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_HOST_ONLY_POOL_BIT_VALVE, 553e5c31af7Sopenharmony_ci slink:VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE::pname:mutableDescriptorType 554e5c31af7Sopenharmony_ci must: be enabled 555e5c31af7Sopenharmony_ciendif::VK_VALVE_mutable_descriptor_type[] 556e5c31af7Sopenharmony_ci**** 557e5c31af7Sopenharmony_ci 558e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkDescriptorSetLayoutCreateInfo.txt[] 559e5c31af7Sopenharmony_ci-- 560e5c31af7Sopenharmony_ci 561e5c31af7Sopenharmony_ciifdef::VK_VALVE_mutable_descriptor_type[] 562e5c31af7Sopenharmony_ci 563e5c31af7Sopenharmony_ci[open,refpage='VkMutableDescriptorTypeCreateInfoVALVE',desc='Structure describing the list of possible active descriptor types for mutable type descriptors',type='structs'] 564e5c31af7Sopenharmony_ci-- 565e5c31af7Sopenharmony_ciInformation about the possible descriptor types for mutable descriptor types 566e5c31af7Sopenharmony_ciis passed in a sname:VkMutableDescriptorTypeCreateInfoVALVE structure as a 567e5c31af7Sopenharmony_cipname:pNext to a slink:VkDescriptorSetLayoutCreateInfo structure or a 568e5c31af7Sopenharmony_cislink:VkDescriptorPoolCreateInfo structure. 569e5c31af7Sopenharmony_ci 570e5c31af7Sopenharmony_ciThe sname:VkMutableDescriptorTypeCreateInfoVALVE structure is defined as: 571e5c31af7Sopenharmony_ci 572e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkMutableDescriptorTypeCreateInfoVALVE.txt[] 573e5c31af7Sopenharmony_ci 574e5c31af7Sopenharmony_ci * pname:sType is the type of this structure. 575e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 576e5c31af7Sopenharmony_ci structure. 577e5c31af7Sopenharmony_ci * pname:mutableDescriptorTypeListCount is the number of elements in 578e5c31af7Sopenharmony_ci pname:pMutableDescriptorTypeLists. 579e5c31af7Sopenharmony_ci * pname:pMutableDescriptorTypeLists is a pointer to an array of 580e5c31af7Sopenharmony_ci sname:VkMutableDescriptorTypeListVALVE structures. 581e5c31af7Sopenharmony_ci 582e5c31af7Sopenharmony_ciIf pname:mutableDescriptorTypeListCount is zero or if this structure is not 583e5c31af7Sopenharmony_ciincluded in the pname:pNext chain, the 584e5c31af7Sopenharmony_cislink:VkMutableDescriptorTypeListVALVE for each element is considered to be 585e5c31af7Sopenharmony_cizero or `NULL` for each member. 586e5c31af7Sopenharmony_ciOtherwise, the descriptor set layout binding at 587e5c31af7Sopenharmony_cislink:VkDescriptorSetLayoutCreateInfo::pname:pBindings[i] uses the 588e5c31af7Sopenharmony_cidescriptor type lists in 589e5c31af7Sopenharmony_cislink:VkMutableDescriptorTypeCreateInfoVALVE::pname:pMutableDescriptorTypeLists[i]. 590e5c31af7Sopenharmony_ci 591e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkMutableDescriptorTypeCreateInfoVALVE.txt[] 592e5c31af7Sopenharmony_ci-- 593e5c31af7Sopenharmony_ci 594e5c31af7Sopenharmony_ci[open,refpage='VkMutableDescriptorTypeListVALVE',desc='Structure describing descriptor types that a given descriptor may mutate to',type='structs'] 595e5c31af7Sopenharmony_ci-- 596e5c31af7Sopenharmony_ciThe list of potential descriptor types a given mutable descriptor can: 597e5c31af7Sopenharmony_cimutate to is passed in a sname:VkMutableDescriptorTypeListVALVE structure. 598e5c31af7Sopenharmony_ci 599e5c31af7Sopenharmony_ciThe sname:VkMutableDescriptorTypeListVALVE structure is defined as: 600e5c31af7Sopenharmony_ci 601e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkMutableDescriptorTypeListVALVE.txt[] 602e5c31af7Sopenharmony_ci 603e5c31af7Sopenharmony_ci * pname:descriptorTypeCount is the number of elements in 604e5c31af7Sopenharmony_ci pname:pDescriptorTypes. 605e5c31af7Sopenharmony_ci * pname:pDescriptorTypes is `NULL` or a pointer to an array of 606e5c31af7Sopenharmony_ci pname:descriptorTypeCount elink:VkDescriptorType values defining which 607e5c31af7Sopenharmony_ci descriptor types a given binding may mutate to. 608e5c31af7Sopenharmony_ci 609e5c31af7Sopenharmony_ci.Valid Usage 610e5c31af7Sopenharmony_ci**** 611e5c31af7Sopenharmony_ci * [[VUID-VkMutableDescriptorTypeListVALVE-descriptorTypeCount-04597]] 612e5c31af7Sopenharmony_ci pname:descriptorTypeCount must: not be `0` if the corresponding binding 613e5c31af7Sopenharmony_ci is of ename:VK_DESCRIPTOR_TYPE_MUTABLE_VALVE 614e5c31af7Sopenharmony_ci * [[VUID-VkMutableDescriptorTypeListVALVE-pDescriptorTypes-04598]] 615e5c31af7Sopenharmony_ci pname:pDescriptorTypes must: be a valid pointer to an array of 616e5c31af7Sopenharmony_ci pname:descriptorTypeCount valid, unique elink:VkDescriptorType values if 617e5c31af7Sopenharmony_ci the given binding is of ename:VK_DESCRIPTOR_TYPE_MUTABLE_VALVE type 618e5c31af7Sopenharmony_ci * [[VUID-VkMutableDescriptorTypeListVALVE-descriptorTypeCount-04599]] 619e5c31af7Sopenharmony_ci pname:descriptorTypeCount must: be `0` if the corresponding binding is 620e5c31af7Sopenharmony_ci not of ename:VK_DESCRIPTOR_TYPE_MUTABLE_VALVE 621e5c31af7Sopenharmony_ci * [[VUID-VkMutableDescriptorTypeListVALVE-pDescriptorTypes-04600]] 622e5c31af7Sopenharmony_ci pname:pDescriptorTypes must: not contain 623e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_MUTABLE_VALVE 624e5c31af7Sopenharmony_ci * [[VUID-VkMutableDescriptorTypeListVALVE-pDescriptorTypes-04601]] 625e5c31af7Sopenharmony_ci pname:pDescriptorTypes must: not contain 626e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC 627e5c31af7Sopenharmony_ci * [[VUID-VkMutableDescriptorTypeListVALVE-pDescriptorTypes-04602]] 628e5c31af7Sopenharmony_ci pname:pDescriptorTypes must: not contain 629e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC 630e5c31af7Sopenharmony_ciifdef::VK_EXT_inline_uniform_block[] 631e5c31af7Sopenharmony_ci * [[VUID-VkMutableDescriptorTypeListVALVE-pDescriptorTypes-04603]] 632e5c31af7Sopenharmony_ci pname:pDescriptorTypes must: not contain 633e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT 634e5c31af7Sopenharmony_ciendif::VK_EXT_inline_uniform_block[] 635e5c31af7Sopenharmony_ci**** 636e5c31af7Sopenharmony_ci 637e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkMutableDescriptorTypeListVALVE.txt[] 638e5c31af7Sopenharmony_ci-- 639e5c31af7Sopenharmony_ci 640e5c31af7Sopenharmony_ciendif::VK_VALVE_mutable_descriptor_type[] 641e5c31af7Sopenharmony_ci 642e5c31af7Sopenharmony_ci[open,refpage='VkDescriptorSetLayoutCreateFlagBits',desc='Bitmask specifying descriptor set layout properties',type='enums'] 643e5c31af7Sopenharmony_ci-- 644e5c31af7Sopenharmony_ciBits which can: be set in slink:VkDescriptorSetLayoutCreateInfo::pname:flags 645e5c31af7Sopenharmony_cito specify options for descriptor set layout are: 646e5c31af7Sopenharmony_ci 647e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkDescriptorSetLayoutCreateFlagBits.txt[] 648e5c31af7Sopenharmony_ci 649e5c31af7Sopenharmony_ciifdef::VK_KHR_push_descriptor[] 650e5c31af7Sopenharmony_ci * ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR specifies 651e5c31af7Sopenharmony_ci that descriptor sets must: not be allocated using this layout, and 652e5c31af7Sopenharmony_ci descriptors are instead pushed by flink:vkCmdPushDescriptorSetKHR. 653e5c31af7Sopenharmony_ciendif::VK_KHR_push_descriptor[] 654e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[] 655e5c31af7Sopenharmony_ci// Jon - "UpdateAfterBind" is a vague reference, should be more precise / 656e5c31af7Sopenharmony_ci// link to the right specification area 657e5c31af7Sopenharmony_ci * ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT 658e5c31af7Sopenharmony_ci specifies that descriptor sets using this layout must: be allocated from 659e5c31af7Sopenharmony_ci a descriptor pool created with the 660e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT bit set. 661e5c31af7Sopenharmony_ci Descriptor set layouts created with this bit set have alternate limits 662e5c31af7Sopenharmony_ci for the maximum number of descriptors per-stage and per-pipeline layout. 663e5c31af7Sopenharmony_ci The non-UpdateAfterBind limits only count descriptors in sets created 664e5c31af7Sopenharmony_ci without this flag. 665e5c31af7Sopenharmony_ci The UpdateAfterBind limits count all descriptors, but the limits may: be 666e5c31af7Sopenharmony_ci higher than the non-UpdateAfterBind limits. 667e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[] 668e5c31af7Sopenharmony_ciifdef::VK_VALVE_mutable_descriptor_type[] 669e5c31af7Sopenharmony_ci * ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_HOST_ONLY_POOL_BIT_VALVE specifies 670e5c31af7Sopenharmony_ci that descriptor sets using this layout must: be allocated from a 671e5c31af7Sopenharmony_ci descriptor pool created with the 672e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_POOL_CREATE_HOST_ONLY_BIT_VALVE bit set. 673e5c31af7Sopenharmony_ci Descriptor set layouts created with this bit have no expressable limit 674e5c31af7Sopenharmony_ci for maximum number of descriptors per-stage. 675e5c31af7Sopenharmony_ci Host descriptor sets are limited only by available host memory, but may: 676e5c31af7Sopenharmony_ci be limited for implementation specific reasons. 677e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[] 678e5c31af7Sopenharmony_ci Implementations may: limit the number of supported descriptors to 679e5c31af7Sopenharmony_ci UpdateAfterBind limits or non-UpdateAfterBind limits, whichever is 680e5c31af7Sopenharmony_ci larger. 681e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[] 682e5c31af7Sopenharmony_ciifndef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[] 683e5c31af7Sopenharmony_ci Implementations may: limit the number of supported descriptors to 684e5c31af7Sopenharmony_ci non-UpdateAfterBind limits. 685e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[] 686e5c31af7Sopenharmony_ciendif::VK_VALVE_mutable_descriptor_type[] 687e5c31af7Sopenharmony_ci 688e5c31af7Sopenharmony_ciifndef::VK_KHR_push_descriptor[] 689e5c31af7Sopenharmony_ci[NOTE] 690e5c31af7Sopenharmony_ci.Note 691e5c31af7Sopenharmony_ci==== 692e5c31af7Sopenharmony_ciAll bits for this type are defined by extensions, and none of those 693e5c31af7Sopenharmony_ciextensions are enabled in this build of the specification. 694e5c31af7Sopenharmony_ci==== 695e5c31af7Sopenharmony_ciendif::VK_KHR_push_descriptor[] 696e5c31af7Sopenharmony_ci-- 697e5c31af7Sopenharmony_ci 698e5c31af7Sopenharmony_ci[open,refpage='VkDescriptorSetLayoutCreateFlags',desc='Bitmask of VkDescriptorSetLayoutCreateFlagBits',type='flags'] 699e5c31af7Sopenharmony_ci-- 700e5c31af7Sopenharmony_ciinclude::{generated}/api/flags/VkDescriptorSetLayoutCreateFlags.txt[] 701e5c31af7Sopenharmony_ci 702e5c31af7Sopenharmony_citname:VkDescriptorSetLayoutCreateFlags is a bitmask type for setting a mask 703e5c31af7Sopenharmony_ciof zero or more elink:VkDescriptorSetLayoutCreateFlagBits. 704e5c31af7Sopenharmony_ci-- 705e5c31af7Sopenharmony_ci 706e5c31af7Sopenharmony_ci[open,refpage='VkDescriptorSetLayoutBinding',desc='Structure specifying a descriptor set layout binding',type='structs'] 707e5c31af7Sopenharmony_ci-- 708e5c31af7Sopenharmony_ciThe sname:VkDescriptorSetLayoutBinding structure is defined as: 709e5c31af7Sopenharmony_ci 710e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkDescriptorSetLayoutBinding.txt[] 711e5c31af7Sopenharmony_ci 712e5c31af7Sopenharmony_ci * pname:binding is the binding number of this entry and corresponds to a 713e5c31af7Sopenharmony_ci resource of the same binding number in the shader stages. 714e5c31af7Sopenharmony_ci * pname:descriptorType is a elink:VkDescriptorType specifying which type 715e5c31af7Sopenharmony_ci of resource descriptors are used for this binding. 716e5c31af7Sopenharmony_ci * pname:descriptorCount is the number of descriptors contained in the 717e5c31af7Sopenharmony_ci binding, accessed in a shader as an 718e5c31af7Sopenharmony_ciifndef::VK_EXT_inline_uniform_block[array.] 719e5c31af7Sopenharmony_ciifdef::VK_EXT_inline_uniform_block[] 720e5c31af7Sopenharmony_ci array, except if pname:descriptorType is 721e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT in which case 722e5c31af7Sopenharmony_ci pname:descriptorCount is the size in bytes of the inline uniform block. 723e5c31af7Sopenharmony_ciendif::VK_EXT_inline_uniform_block[] 724e5c31af7Sopenharmony_ci If pname:descriptorCount is zero this binding entry is reserved and the 725e5c31af7Sopenharmony_ci resource must: not be accessed from any stage via this binding within 726e5c31af7Sopenharmony_ci any pipeline using the set layout. 727e5c31af7Sopenharmony_ci * pname:stageFlags member is a bitmask of elink:VkShaderStageFlagBits 728e5c31af7Sopenharmony_ci specifying which pipeline shader stages can: access a resource for this 729e5c31af7Sopenharmony_ci binding. 730e5c31af7Sopenharmony_ci ename:VK_SHADER_STAGE_ALL is a shorthand specifying that all defined 731e5c31af7Sopenharmony_ci shader stages, including any additional stages defined by extensions, 732e5c31af7Sopenharmony_ci can: access the resource. 733e5c31af7Sopenharmony_ci+ 734e5c31af7Sopenharmony_ciIf a shader stage is not included in pname:stageFlags, then a resource must: 735e5c31af7Sopenharmony_cinot be accessed from that stage via this binding within any pipeline using 736e5c31af7Sopenharmony_cithe set layout. 737e5c31af7Sopenharmony_ciOther than input attachments which are limited to the fragment shader, there 738e5c31af7Sopenharmony_ciare no limitations on what combinations of stages can: use a descriptor 739e5c31af7Sopenharmony_cibinding, and in particular a binding can: be used by both graphics stages 740e5c31af7Sopenharmony_ciand the compute stage. 741e5c31af7Sopenharmony_ci 742e5c31af7Sopenharmony_ci * pname:pImmutableSamplers affects initialization of samplers. 743e5c31af7Sopenharmony_ci If pname:descriptorType specifies a ename:VK_DESCRIPTOR_TYPE_SAMPLER or 744e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER type descriptor, then 745e5c31af7Sopenharmony_ci pname:pImmutableSamplers can: be used to initialize a set of _immutable 746e5c31af7Sopenharmony_ci samplers_. 747e5c31af7Sopenharmony_ci Immutable samplers are permanently bound into the set layout and must: 748e5c31af7Sopenharmony_ci not be changed; updating a ename:VK_DESCRIPTOR_TYPE_SAMPLER descriptor 749e5c31af7Sopenharmony_ci with immutable samplers is not allowed and updates to a 750e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER descriptor with 751e5c31af7Sopenharmony_ci immutable samplers does not modify the samplers (the image views are 752e5c31af7Sopenharmony_ci updated, but the sampler updates are ignored). 753e5c31af7Sopenharmony_ci If pname:pImmutableSamplers is not `NULL`, then it is a pointer to an 754e5c31af7Sopenharmony_ci array of sampler handles that will be copied into the set layout and 755e5c31af7Sopenharmony_ci used for the corresponding binding. 756e5c31af7Sopenharmony_ci Only the sampler handles are copied; the sampler objects must: not be 757e5c31af7Sopenharmony_ci destroyed before the final use of the set layout and any descriptor 758e5c31af7Sopenharmony_ci pools and sets created using it. 759e5c31af7Sopenharmony_ci If pname:pImmutableSamplers is `NULL`, then the sampler slots are 760e5c31af7Sopenharmony_ci dynamic and sampler handles must: be bound into descriptor sets using 761e5c31af7Sopenharmony_ci this layout. 762e5c31af7Sopenharmony_ci If pname:descriptorType is not one of these descriptor types, then 763e5c31af7Sopenharmony_ci pname:pImmutableSamplers is ignored. 764e5c31af7Sopenharmony_ci 765e5c31af7Sopenharmony_ciThe above layout definition allows the descriptor bindings to be specified 766e5c31af7Sopenharmony_cisparsely such that not all binding numbers between 0 and the maximum binding 767e5c31af7Sopenharmony_cinumber need to be specified in the pname:pBindings array. 768e5c31af7Sopenharmony_ciBindings that are not specified have a pname:descriptorCount and 769e5c31af7Sopenharmony_cipname:stageFlags of zero, and the value of pname:descriptorType is 770e5c31af7Sopenharmony_ciundefined:. 771e5c31af7Sopenharmony_ciHowever, all binding numbers between 0 and the maximum binding number in the 772e5c31af7Sopenharmony_cislink:VkDescriptorSetLayoutCreateInfo::pname:pBindings array may: consume 773e5c31af7Sopenharmony_cimemory in the descriptor set layout even if not all descriptor bindings are 774e5c31af7Sopenharmony_ciused, though it should: not consume additional memory from the descriptor 775e5c31af7Sopenharmony_cipool. 776e5c31af7Sopenharmony_ci 777e5c31af7Sopenharmony_ci[NOTE] 778e5c31af7Sopenharmony_ci.Note 779e5c31af7Sopenharmony_ci==== 780e5c31af7Sopenharmony_ciThe maximum binding number specified should: be as compact as possible to 781e5c31af7Sopenharmony_ciavoid wasted memory. 782e5c31af7Sopenharmony_ci==== 783e5c31af7Sopenharmony_ci 784e5c31af7Sopenharmony_ci.Valid Usage 785e5c31af7Sopenharmony_ci**** 786e5c31af7Sopenharmony_ci * [[VUID-VkDescriptorSetLayoutBinding-descriptorType-00282]] 787e5c31af7Sopenharmony_ci If pname:descriptorType is ename:VK_DESCRIPTOR_TYPE_SAMPLER or 788e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, and 789e5c31af7Sopenharmony_ci pname:descriptorCount is not `0` and pname:pImmutableSamplers is not 790e5c31af7Sopenharmony_ci `NULL`, pname:pImmutableSamplers must: be a valid pointer to an array of 791e5c31af7Sopenharmony_ci pname:descriptorCount valid sname:VkSampler handles 792e5c31af7Sopenharmony_ciifdef::VK_EXT_inline_uniform_block[] 793e5c31af7Sopenharmony_ci * [[VUID-VkDescriptorSetLayoutBinding-descriptorType-04604]] 794e5c31af7Sopenharmony_ci If the <<features-inlineUniformBlock,inlineUniformBlock>> feature is not 795e5c31af7Sopenharmony_ci enabled, pname:descriptorType must: not be 796e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT 797e5c31af7Sopenharmony_ci * [[VUID-VkDescriptorSetLayoutBinding-descriptorType-02209]] 798e5c31af7Sopenharmony_ci If pname:descriptorType is 799e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT then 800e5c31af7Sopenharmony_ci pname:descriptorCount must: be a multiple of `4` 801e5c31af7Sopenharmony_ci * [[VUID-VkDescriptorSetLayoutBinding-descriptorType-02210]] 802e5c31af7Sopenharmony_ci If pname:descriptorType is 803e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT then 804e5c31af7Sopenharmony_ci pname:descriptorCount must: be less than or equal to 805e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceInlineUniformBlockPropertiesEXT::pname:maxInlineUniformBlockSize 806e5c31af7Sopenharmony_ciendif::VK_EXT_inline_uniform_block[] 807e5c31af7Sopenharmony_ci * [[VUID-VkDescriptorSetLayoutBinding-descriptorCount-00283]] 808e5c31af7Sopenharmony_ci If pname:descriptorCount is not `0`, pname:stageFlags must: be a valid 809e5c31af7Sopenharmony_ci combination of elink:VkShaderStageFlagBits values 810e5c31af7Sopenharmony_ci * [[VUID-VkDescriptorSetLayoutBinding-descriptorType-01510]] 811e5c31af7Sopenharmony_ci If pname:descriptorType is ename:VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT and 812e5c31af7Sopenharmony_ci pname:descriptorCount is not `0`, then pname:stageFlags must: be `0` or 813e5c31af7Sopenharmony_ci ename:VK_SHADER_STAGE_FRAGMENT_BIT 814e5c31af7Sopenharmony_ciifdef::VK_EXT_custom_border_color[] 815e5c31af7Sopenharmony_ci * [[VUID-VkDescriptorSetLayoutBinding-pImmutableSamplers-04009]] 816e5c31af7Sopenharmony_ci The sampler objects indicated by pname:pImmutableSamplers must: not have 817e5c31af7Sopenharmony_ci a pname:borderColor with one of the values 818e5c31af7Sopenharmony_ci ename:VK_BORDER_COLOR_FLOAT_CUSTOM_EXT or 819e5c31af7Sopenharmony_ci ename:VK_BORDER_COLOR_INT_CUSTOM_EXT 820e5c31af7Sopenharmony_ciendif::VK_EXT_custom_border_color[] 821e5c31af7Sopenharmony_ciifdef::VK_VALVE_mutable_descriptor_type[] 822e5c31af7Sopenharmony_ci * [[VUID-VkDescriptorSetLayoutBinding-descriptorType-04605]] 823e5c31af7Sopenharmony_ci If pname:descriptorType is ename:VK_DESCRIPTOR_TYPE_MUTABLE_VALVE, then 824e5c31af7Sopenharmony_ci sname:pImmutableSamplers must: be `NULL` 825e5c31af7Sopenharmony_ciendif::VK_VALVE_mutable_descriptor_type[] 826e5c31af7Sopenharmony_ci**** 827e5c31af7Sopenharmony_ci 828e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkDescriptorSetLayoutBinding.txt[] 829e5c31af7Sopenharmony_ci-- 830e5c31af7Sopenharmony_ci 831e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[] 832e5c31af7Sopenharmony_ci[open,refpage='VkDescriptorSetLayoutBindingFlagsCreateInfo',desc='Structure specifying creation flags for descriptor set layout bindings',type='structs',alias='VkDescriptorSetLayoutBindingFlagsCreateInfoEXT'] 833e5c31af7Sopenharmony_ci-- 834e5c31af7Sopenharmony_ciIf the pname:pNext chain of a slink:VkDescriptorSetLayoutCreateInfo 835e5c31af7Sopenharmony_cistructure includes a slink:VkDescriptorSetLayoutBindingFlagsCreateInfo 836e5c31af7Sopenharmony_cistructure, then that structure includes an array of flags, one for each 837e5c31af7Sopenharmony_cidescriptor set layout binding. 838e5c31af7Sopenharmony_ci 839e5c31af7Sopenharmony_ciThe slink:VkDescriptorSetLayoutBindingFlagsCreateInfo structure is defined 840e5c31af7Sopenharmony_cias: 841e5c31af7Sopenharmony_ci 842e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkDescriptorSetLayoutBindingFlagsCreateInfo.txt[] 843e5c31af7Sopenharmony_ci 844e5c31af7Sopenharmony_ciifdef::VK_EXT_descriptor_indexing[] 845e5c31af7Sopenharmony_cior the equivalent 846e5c31af7Sopenharmony_ci 847e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkDescriptorSetLayoutBindingFlagsCreateInfoEXT.txt[] 848e5c31af7Sopenharmony_ciendif::VK_EXT_descriptor_indexing[] 849e5c31af7Sopenharmony_ci 850e5c31af7Sopenharmony_ci * pname:sType is the type of this structure. 851e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 852e5c31af7Sopenharmony_ci structure. 853e5c31af7Sopenharmony_ci * pname:bindingCount is zero or the number of elements in 854e5c31af7Sopenharmony_ci pname:pBindingFlags. 855e5c31af7Sopenharmony_ci * pname:pBindingFlags is a pointer to an array of 856e5c31af7Sopenharmony_ci tlink:VkDescriptorBindingFlags bitfields, one for each descriptor set 857e5c31af7Sopenharmony_ci layout binding. 858e5c31af7Sopenharmony_ci 859e5c31af7Sopenharmony_ciIf pname:bindingCount is zero or if this structure is not included in the 860e5c31af7Sopenharmony_cipname:pNext chain, the tlink:VkDescriptorBindingFlags for each descriptor 861e5c31af7Sopenharmony_ciset layout binding is considered to be zero. 862e5c31af7Sopenharmony_ciOtherwise, the descriptor set layout binding at 863e5c31af7Sopenharmony_cislink:VkDescriptorSetLayoutCreateInfo::pname:pBindings[i] uses the flags in 864e5c31af7Sopenharmony_cipname:pBindingFlags[i]. 865e5c31af7Sopenharmony_ci 866e5c31af7Sopenharmony_ci.Valid Usage 867e5c31af7Sopenharmony_ci**** 868e5c31af7Sopenharmony_ci * [[VUID-VkDescriptorSetLayoutBindingFlagsCreateInfo-bindingCount-03002]] 869e5c31af7Sopenharmony_ci If pname:bindingCount is not zero, pname:bindingCount must: equal 870e5c31af7Sopenharmony_ci slink:VkDescriptorSetLayoutCreateInfo::pname:bindingCount 871e5c31af7Sopenharmony_ciifdef::VK_KHR_push_descriptor[] 872e5c31af7Sopenharmony_ci * [[VUID-VkDescriptorSetLayoutBindingFlagsCreateInfo-flags-03003]] 873e5c31af7Sopenharmony_ci If slink:VkDescriptorSetLayoutCreateInfo::pname:flags includes 874e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR, then all 875e5c31af7Sopenharmony_ci elements of pname:pBindingFlags must: not include 876e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT, 877e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_BINDING_UPDATE_UNUSED_WHILE_PENDING_BIT, or 878e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT 879e5c31af7Sopenharmony_ciendif::VK_KHR_push_descriptor[] 880e5c31af7Sopenharmony_ci * [[VUID-VkDescriptorSetLayoutBindingFlagsCreateInfo-pBindingFlags-03004]] 881e5c31af7Sopenharmony_ci If an element of pname:pBindingFlags includes 882e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT, then all 883e5c31af7Sopenharmony_ci other elements of slink:VkDescriptorSetLayoutCreateInfo::pname:pBindings 884e5c31af7Sopenharmony_ci must: have a smaller value of pname:binding 885e5c31af7Sopenharmony_ci * [[VUID-VkDescriptorSetLayoutBindingFlagsCreateInfo-descriptorBindingUniformBufferUpdateAfterBind-03005]] 886e5c31af7Sopenharmony_ci If 887e5c31af7Sopenharmony_ci slink:VkPhysicalDeviceDescriptorIndexingFeatures::pname:descriptorBindingUniformBufferUpdateAfterBind 888e5c31af7Sopenharmony_ci is not enabled, all bindings with descriptor type 889e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER must: not use 890e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT 891e5c31af7Sopenharmony_ci * [[VUID-VkDescriptorSetLayoutBindingFlagsCreateInfo-descriptorBindingSampledImageUpdateAfterBind-03006]] 892e5c31af7Sopenharmony_ci If 893e5c31af7Sopenharmony_ci slink:VkPhysicalDeviceDescriptorIndexingFeatures::pname:descriptorBindingSampledImageUpdateAfterBind 894e5c31af7Sopenharmony_ci is not enabled, all bindings with descriptor type 895e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_SAMPLER, 896e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, or 897e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE must: not use 898e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT 899e5c31af7Sopenharmony_ci * [[VUID-VkDescriptorSetLayoutBindingFlagsCreateInfo-descriptorBindingStorageImageUpdateAfterBind-03007]] 900e5c31af7Sopenharmony_ci If 901e5c31af7Sopenharmony_ci slink:VkPhysicalDeviceDescriptorIndexingFeatures::pname:descriptorBindingStorageImageUpdateAfterBind 902e5c31af7Sopenharmony_ci is not enabled, all bindings with descriptor type 903e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_STORAGE_IMAGE must: not use 904e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT 905e5c31af7Sopenharmony_ci * [[VUID-VkDescriptorSetLayoutBindingFlagsCreateInfo-descriptorBindingStorageBufferUpdateAfterBind-03008]] 906e5c31af7Sopenharmony_ci If 907e5c31af7Sopenharmony_ci slink:VkPhysicalDeviceDescriptorIndexingFeatures::pname:descriptorBindingStorageBufferUpdateAfterBind 908e5c31af7Sopenharmony_ci is not enabled, all bindings with descriptor type 909e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER must: not use 910e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT 911e5c31af7Sopenharmony_ci * [[VUID-VkDescriptorSetLayoutBindingFlagsCreateInfo-descriptorBindingUniformTexelBufferUpdateAfterBind-03009]] 912e5c31af7Sopenharmony_ci If 913e5c31af7Sopenharmony_ci slink:VkPhysicalDeviceDescriptorIndexingFeatures::pname:descriptorBindingUniformTexelBufferUpdateAfterBind 914e5c31af7Sopenharmony_ci is not enabled, all bindings with descriptor type 915e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER must: not use 916e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT 917e5c31af7Sopenharmony_ci * [[VUID-VkDescriptorSetLayoutBindingFlagsCreateInfo-descriptorBindingStorageTexelBufferUpdateAfterBind-03010]] 918e5c31af7Sopenharmony_ci If 919e5c31af7Sopenharmony_ci slink:VkPhysicalDeviceDescriptorIndexingFeatures::pname:descriptorBindingStorageTexelBufferUpdateAfterBind 920e5c31af7Sopenharmony_ci is not enabled, all bindings with descriptor type 921e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER must: not use 922e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT 923e5c31af7Sopenharmony_ciifdef::VK_EXT_inline_uniform_block[] 924e5c31af7Sopenharmony_ci * [[VUID-VkDescriptorSetLayoutBindingFlagsCreateInfo-descriptorBindingInlineUniformBlockUpdateAfterBind-02211]] 925e5c31af7Sopenharmony_ci If 926e5c31af7Sopenharmony_ci slink:VkPhysicalDeviceInlineUniformBlockFeaturesEXT::pname:descriptorBindingInlineUniformBlockUpdateAfterBind 927e5c31af7Sopenharmony_ci is not enabled, all bindings with descriptor type 928e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT must: not use 929e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT 930e5c31af7Sopenharmony_ciendif::VK_EXT_inline_uniform_block[] 931e5c31af7Sopenharmony_ciifdef::VK_KHR_acceleration_structure[] 932e5c31af7Sopenharmony_ci * [[VUID-VkDescriptorSetLayoutBindingFlagsCreateInfo-descriptorBindingAccelerationStructureUpdateAfterBind-03570]] 933e5c31af7Sopenharmony_ci If 934e5c31af7Sopenharmony_ci slink:VkPhysicalDeviceAccelerationStructureFeaturesKHR::pname:descriptorBindingAccelerationStructureUpdateAfterBind 935e5c31af7Sopenharmony_ci is not enabled, all bindings with descriptor type 936e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_KHR or 937e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_NV must: not use 938e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT 939e5c31af7Sopenharmony_ciendif::VK_KHR_acceleration_structure[] 940e5c31af7Sopenharmony_ci * [[VUID-VkDescriptorSetLayoutBindingFlagsCreateInfo-None-03011]] 941e5c31af7Sopenharmony_ci All bindings with descriptor type 942e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT, 943e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, or 944e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC must: not use 945e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT 946e5c31af7Sopenharmony_ci * [[VUID-VkDescriptorSetLayoutBindingFlagsCreateInfo-descriptorBindingUpdateUnusedWhilePending-03012]] 947e5c31af7Sopenharmony_ci If 948e5c31af7Sopenharmony_ci slink:VkPhysicalDeviceDescriptorIndexingFeatures::pname:descriptorBindingUpdateUnusedWhilePending 949e5c31af7Sopenharmony_ci is not enabled, all elements of pname:pBindingFlags must: not include 950e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_BINDING_UPDATE_UNUSED_WHILE_PENDING_BIT 951e5c31af7Sopenharmony_ci * [[VUID-VkDescriptorSetLayoutBindingFlagsCreateInfo-descriptorBindingPartiallyBound-03013]] 952e5c31af7Sopenharmony_ci If 953e5c31af7Sopenharmony_ci slink:VkPhysicalDeviceDescriptorIndexingFeatures::pname:descriptorBindingPartiallyBound 954e5c31af7Sopenharmony_ci is not enabled, all elements of pname:pBindingFlags must: not include 955e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT 956e5c31af7Sopenharmony_ci * [[VUID-VkDescriptorSetLayoutBindingFlagsCreateInfo-descriptorBindingVariableDescriptorCount-03014]] 957e5c31af7Sopenharmony_ci If 958e5c31af7Sopenharmony_ci slink:VkPhysicalDeviceDescriptorIndexingFeatures::pname:descriptorBindingVariableDescriptorCount 959e5c31af7Sopenharmony_ci is not enabled, all elements of pname:pBindingFlags must: not include 960e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT 961e5c31af7Sopenharmony_ci * [[VUID-VkDescriptorSetLayoutBindingFlagsCreateInfo-pBindingFlags-03015]] 962e5c31af7Sopenharmony_ci If an element of pname:pBindingFlags includes 963e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT, that 964e5c31af7Sopenharmony_ci element's pname:descriptorType must: not be 965e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC or 966e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC 967e5c31af7Sopenharmony_ci**** 968e5c31af7Sopenharmony_ci 969e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkDescriptorSetLayoutBindingFlagsCreateInfo.txt[] 970e5c31af7Sopenharmony_ci-- 971e5c31af7Sopenharmony_ci 972e5c31af7Sopenharmony_ci[open,refpage='VkDescriptorBindingFlagBits',desc='Bitmask specifying descriptor set layout binding properties',type='enums',alias='VkDescriptorBindingFlagBitsEXT'] 973e5c31af7Sopenharmony_ci-- 974e5c31af7Sopenharmony_ciBits which can: be set in each element of 975e5c31af7Sopenharmony_cislink:VkDescriptorSetLayoutBindingFlagsCreateInfo::pname:pBindingFlags to 976e5c31af7Sopenharmony_cispecify options for the corresponding descriptor set layout binding are: 977e5c31af7Sopenharmony_ci 978e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkDescriptorBindingFlagBits.txt[] 979e5c31af7Sopenharmony_ci 980e5c31af7Sopenharmony_ciifdef::VK_EXT_descriptor_indexing[] 981e5c31af7Sopenharmony_cior the equivalent 982e5c31af7Sopenharmony_ci 983e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkDescriptorBindingFlagBitsEXT.txt[] 984e5c31af7Sopenharmony_ciendif::VK_EXT_descriptor_indexing[] 985e5c31af7Sopenharmony_ci 986e5c31af7Sopenharmony_ci * ename:VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT indicates that if 987e5c31af7Sopenharmony_ci descriptors in this binding are updated between when the descriptor set 988e5c31af7Sopenharmony_ci is bound in a command buffer and when that command buffer is submitted 989e5c31af7Sopenharmony_ci to a queue, then the submission will use the most recently set 990e5c31af7Sopenharmony_ci descriptors for this binding and the updates do not invalidate the 991e5c31af7Sopenharmony_ci command buffer. 992e5c31af7Sopenharmony_ci Descriptor bindings created with this flag are also partially exempt 993e5c31af7Sopenharmony_ci from the external synchronization requirement in 994e5c31af7Sopenharmony_ciifdef::VK_KHR_descriptor_update_template[] 995e5c31af7Sopenharmony_ci flink:vkUpdateDescriptorSetWithTemplateKHR and 996e5c31af7Sopenharmony_ciendif::VK_KHR_descriptor_update_template[] 997e5c31af7Sopenharmony_ci flink:vkUpdateDescriptorSets. 998e5c31af7Sopenharmony_ci Multiple descriptors with this flag set can: be updated concurrently in 999e5c31af7Sopenharmony_ci different threads, though the same descriptor must: not be updated 1000e5c31af7Sopenharmony_ci concurrently by two threads. 1001e5c31af7Sopenharmony_ci Descriptors with this flag set can: be updated concurrently with the set 1002e5c31af7Sopenharmony_ci being bound to a command buffer in another thread, but not concurrently 1003e5c31af7Sopenharmony_ci with the set being reset or freed. 1004e5c31af7Sopenharmony_ci * ename:VK_DESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT indicates that 1005e5c31af7Sopenharmony_ci descriptors in this binding that are not _dynamically used_ need not 1006e5c31af7Sopenharmony_ci contain valid descriptors at the time the descriptors are consumed. 1007e5c31af7Sopenharmony_ci A descriptor is dynamically used if any shader invocation executes an 1008e5c31af7Sopenharmony_ci instruction that performs any memory access using the descriptor. 1009e5c31af7Sopenharmony_ci * ename:VK_DESCRIPTOR_BINDING_UPDATE_UNUSED_WHILE_PENDING_BIT indicates 1010e5c31af7Sopenharmony_ci that descriptors in this binding can: be updated after a command buffer 1011e5c31af7Sopenharmony_ci has bound this descriptor set, or while a command buffer that uses this 1012e5c31af7Sopenharmony_ci descriptor set is pending execution, as long as the descriptors that are 1013e5c31af7Sopenharmony_ci updated are not used by those command buffers. 1014e5c31af7Sopenharmony_ci If ename:VK_DESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT is also set, then 1015e5c31af7Sopenharmony_ci descriptors can: be updated as long as they are not dynamically used by 1016e5c31af7Sopenharmony_ci any shader invocations. 1017e5c31af7Sopenharmony_ci If ename:VK_DESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT is not set, then 1018e5c31af7Sopenharmony_ci descriptors can: be updated as long as they are not statically used by 1019e5c31af7Sopenharmony_ci any shader invocations. 1020e5c31af7Sopenharmony_ci * ename:VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT indicates that 1021e5c31af7Sopenharmony_ci this descriptor binding has a variable size that will be specified when 1022e5c31af7Sopenharmony_ci a descriptor set is allocated using this layout. 1023e5c31af7Sopenharmony_ci The value of pname:descriptorCount is treated as an upper bound on the 1024e5c31af7Sopenharmony_ci size of the binding. 1025e5c31af7Sopenharmony_ci This must: only be used for the last binding in the descriptor set 1026e5c31af7Sopenharmony_ci layout (i.e. the binding with the largest value of pname:binding). 1027e5c31af7Sopenharmony_ci For the purposes of counting against limits such as 1028e5c31af7Sopenharmony_ci pname:maxDescriptorSet* and pname:maxPerStageDescriptor*, the full value 1029e5c31af7Sopenharmony_ci of pname:descriptorCount is 1030e5c31af7Sopenharmony_ciifndef::VK_EXT_inline_uniform_block[counted.] 1031e5c31af7Sopenharmony_ciifdef::VK_EXT_inline_uniform_block[] 1032e5c31af7Sopenharmony_ci counted, except for descriptor bindings with a descriptor type of 1033e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT where 1034e5c31af7Sopenharmony_ci pname:descriptorCount specifies the upper bound on the byte size of the 1035e5c31af7Sopenharmony_ci binding, thus it counts against the <<limits-maxInlineUniformBlockSize, 1036e5c31af7Sopenharmony_ci pname:maxInlineUniformBlockSize>> limit instead. 1037e5c31af7Sopenharmony_ciendif::VK_EXT_inline_uniform_block[] 1038e5c31af7Sopenharmony_ci 1039e5c31af7Sopenharmony_ci[NOTE] 1040e5c31af7Sopenharmony_ci.Note 1041e5c31af7Sopenharmony_ci==== 1042e5c31af7Sopenharmony_ciNote that while ename:VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT and 1043e5c31af7Sopenharmony_ciename:VK_DESCRIPTOR_BINDING_UPDATE_UNUSED_WHILE_PENDING_BIT both involve 1044e5c31af7Sopenharmony_ciupdates to descriptor sets after they are bound, 1045e5c31af7Sopenharmony_ciename:VK_DESCRIPTOR_BINDING_UPDATE_UNUSED_WHILE_PENDING_BIT is a weaker 1046e5c31af7Sopenharmony_cirequirement since it is only about descriptors that are not used, whereas 1047e5c31af7Sopenharmony_ciename:VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT requires the 1048e5c31af7Sopenharmony_ciimplementation to observe updates to descriptors that are used. 1049e5c31af7Sopenharmony_ci==== 1050e5c31af7Sopenharmony_ci-- 1051e5c31af7Sopenharmony_ci 1052e5c31af7Sopenharmony_ci[open,refpage='VkDescriptorBindingFlags',desc='Bitmask of VkDescriptorBindingFlagBits',type='flags',alias='VkDescriptorBindingFlagsEXT'] 1053e5c31af7Sopenharmony_ci-- 1054e5c31af7Sopenharmony_ciinclude::{generated}/api/flags/VkDescriptorBindingFlags.txt[] 1055e5c31af7Sopenharmony_ci 1056e5c31af7Sopenharmony_ciifdef::VK_EXT_descriptor_indexing[] 1057e5c31af7Sopenharmony_cior the equivalent 1058e5c31af7Sopenharmony_ci 1059e5c31af7Sopenharmony_ciinclude::{generated}/api/flags/VkDescriptorBindingFlagsEXT.txt[] 1060e5c31af7Sopenharmony_ciendif::VK_EXT_descriptor_indexing[] 1061e5c31af7Sopenharmony_ci 1062e5c31af7Sopenharmony_citname:VkDescriptorBindingFlags is a bitmask type for setting a mask of zero 1063e5c31af7Sopenharmony_cior more elink:VkDescriptorBindingFlagBits. 1064e5c31af7Sopenharmony_ci-- 1065e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[] 1066e5c31af7Sopenharmony_ci 1067e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_maintenance3[] 1068e5c31af7Sopenharmony_ci[open,refpage='vkGetDescriptorSetLayoutSupport',desc='Query whether a descriptor set layout can be created',type='protos'] 1069e5c31af7Sopenharmony_ci-- 1070e5c31af7Sopenharmony_ciTo query information about whether a descriptor set layout can: be created, 1071e5c31af7Sopenharmony_cicall: 1072e5c31af7Sopenharmony_ci 1073e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1[] 1074e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkGetDescriptorSetLayoutSupport.txt[] 1075e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1[] 1076e5c31af7Sopenharmony_ci 1077e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1+VK_KHR_maintenance3[or the equivalent command] 1078e5c31af7Sopenharmony_ci 1079e5c31af7Sopenharmony_ciifdef::VK_KHR_maintenance3[] 1080e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkGetDescriptorSetLayoutSupportKHR.txt[] 1081e5c31af7Sopenharmony_ciendif::VK_KHR_maintenance3[] 1082e5c31af7Sopenharmony_ci 1083e5c31af7Sopenharmony_ci * pname:device is the logical device that would create the descriptor set 1084e5c31af7Sopenharmony_ci layout. 1085e5c31af7Sopenharmony_ci * pname:pCreateInfo is a pointer to a 1086e5c31af7Sopenharmony_ci slink:VkDescriptorSetLayoutCreateInfo structure specifying the state of 1087e5c31af7Sopenharmony_ci the descriptor set layout object. 1088e5c31af7Sopenharmony_ci * pname:pSupport is a pointer to a slink:VkDescriptorSetLayoutSupport 1089e5c31af7Sopenharmony_ci structure, in which information about support for the descriptor set 1090e5c31af7Sopenharmony_ci layout object is returned. 1091e5c31af7Sopenharmony_ci 1092e5c31af7Sopenharmony_ciSome implementations have limitations on what fits in a descriptor set which 1093e5c31af7Sopenharmony_ciare not easily expressible in terms of existing limits like 1094e5c31af7Sopenharmony_cipname:maxDescriptorSet*, for example if all descriptor types share a limited 1095e5c31af7Sopenharmony_cispace in memory but each descriptor is a different size or alignment. 1096e5c31af7Sopenharmony_ciThis command returns information about whether a descriptor set satisfies 1097e5c31af7Sopenharmony_cithis limit. 1098e5c31af7Sopenharmony_ciIf the descriptor set layout satisfies the 1099e5c31af7Sopenharmony_cislink:VkPhysicalDeviceMaintenance3Properties::pname:maxPerSetDescriptors 1100e5c31af7Sopenharmony_cilimit, this command is guaranteed to return ename:VK_TRUE in 1101e5c31af7Sopenharmony_cislink:VkDescriptorSetLayoutSupport::pname:supported. 1102e5c31af7Sopenharmony_ciIf the descriptor set layout exceeds the 1103e5c31af7Sopenharmony_cislink:VkPhysicalDeviceMaintenance3Properties::pname:maxPerSetDescriptors 1104e5c31af7Sopenharmony_cilimit, whether the descriptor set layout is supported is 1105e5c31af7Sopenharmony_ciimplementation-dependent and may: depend on whether the descriptor sizes and 1106e5c31af7Sopenharmony_cialignments cause the layout to exceed an internal limit. 1107e5c31af7Sopenharmony_ci 1108e5c31af7Sopenharmony_ciThis command does not consider other limits such as 1109e5c31af7Sopenharmony_cipname:maxPerStageDescriptor*, and so a descriptor set layout that is 1110e5c31af7Sopenharmony_cisupported according to this command must: still satisfy the pipeline layout 1111e5c31af7Sopenharmony_cilimits such as pname:maxPerStageDescriptor* in order to be used in a 1112e5c31af7Sopenharmony_cipipeline layout. 1113e5c31af7Sopenharmony_ci 1114e5c31af7Sopenharmony_ci[NOTE] 1115e5c31af7Sopenharmony_ci.Note 1116e5c31af7Sopenharmony_ci==== 1117e5c31af7Sopenharmony_ciThis is a sname:VkDevice query rather than sname:VkPhysicalDevice because 1118e5c31af7Sopenharmony_cithe answer may: depend on enabled features. 1119e5c31af7Sopenharmony_ci==== 1120e5c31af7Sopenharmony_ci 1121e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkGetDescriptorSetLayoutSupport.txt[] 1122e5c31af7Sopenharmony_ci-- 1123e5c31af7Sopenharmony_ci 1124e5c31af7Sopenharmony_ci[open,refpage='VkDescriptorSetLayoutSupport',desc='Structure returning information about whether a descriptor set layout can be supported',type='structs'] 1125e5c31af7Sopenharmony_ci-- 1126e5c31af7Sopenharmony_ciInformation about support for the descriptor set layout is returned in a 1127e5c31af7Sopenharmony_cisname:VkDescriptorSetLayoutSupport structure: 1128e5c31af7Sopenharmony_ci 1129e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkDescriptorSetLayoutSupport.txt[] 1130e5c31af7Sopenharmony_ci 1131e5c31af7Sopenharmony_ciifdef::VK_KHR_maintenance3[] 1132e5c31af7Sopenharmony_cior the equivalent 1133e5c31af7Sopenharmony_ci 1134e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkDescriptorSetLayoutSupportKHR.txt[] 1135e5c31af7Sopenharmony_ciendif::VK_KHR_maintenance3[] 1136e5c31af7Sopenharmony_ci 1137e5c31af7Sopenharmony_ci * pname:sType is the type of this structure. 1138e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 1139e5c31af7Sopenharmony_ci structure. 1140e5c31af7Sopenharmony_ci * pname:supported specifies whether the descriptor set layout can: be 1141e5c31af7Sopenharmony_ci created. 1142e5c31af7Sopenharmony_ci 1143e5c31af7Sopenharmony_cipname:supported is set to ename:VK_TRUE if the descriptor set can: be 1144e5c31af7Sopenharmony_cicreated, or else is set to ename:VK_FALSE. 1145e5c31af7Sopenharmony_ci 1146e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkDescriptorSetLayoutSupport.txt[] 1147e5c31af7Sopenharmony_ci-- 1148e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_maintenance3[] 1149e5c31af7Sopenharmony_ci 1150e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[] 1151e5c31af7Sopenharmony_ci[open,refpage='VkDescriptorSetVariableDescriptorCountLayoutSupport',desc='Structure returning information about whether a descriptor set layout can be supported',type='structs',alias='VkDescriptorSetVariableDescriptorCountLayoutSupportEXT'] 1152e5c31af7Sopenharmony_ci-- 1153e5c31af7Sopenharmony_ciIf the pname:pNext chain of a slink:VkDescriptorSetLayoutSupport structure 1154e5c31af7Sopenharmony_ciincludes a sname:VkDescriptorSetVariableDescriptorCountLayoutSupport 1155e5c31af7Sopenharmony_cistructure, then that structure returns additional information about whether 1156e5c31af7Sopenharmony_cithe descriptor set layout is supported. 1157e5c31af7Sopenharmony_ci 1158e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkDescriptorSetVariableDescriptorCountLayoutSupport.txt[] 1159e5c31af7Sopenharmony_ci 1160e5c31af7Sopenharmony_ciifdef::VK_EXT_descriptor_indexing[] 1161e5c31af7Sopenharmony_cior the equivalent 1162e5c31af7Sopenharmony_ci 1163e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkDescriptorSetVariableDescriptorCountLayoutSupportEXT.txt[] 1164e5c31af7Sopenharmony_ciendif::VK_EXT_descriptor_indexing[] 1165e5c31af7Sopenharmony_ci 1166e5c31af7Sopenharmony_ci * pname:sType is the type of this structure. 1167e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 1168e5c31af7Sopenharmony_ci structure. 1169e5c31af7Sopenharmony_ci * pname:maxVariableDescriptorCount indicates the maximum number of 1170e5c31af7Sopenharmony_ci descriptors supported in the highest numbered binding of the layout, if 1171e5c31af7Sopenharmony_ci that binding is variable-sized. 1172e5c31af7Sopenharmony_ciifdef::VK_EXT_inline_uniform_block[] 1173e5c31af7Sopenharmony_ci If the highest numbered binding of the layout has a descriptor type of 1174e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT then 1175e5c31af7Sopenharmony_ci pname:maxVariableDescriptorCount indicates the maximum byte size 1176e5c31af7Sopenharmony_ci supported for the binding, if that binding is variable-sized. 1177e5c31af7Sopenharmony_ciendif::VK_EXT_inline_uniform_block[] 1178e5c31af7Sopenharmony_ci 1179e5c31af7Sopenharmony_ciIf the slink:VkDescriptorSetLayoutCreateInfo structure specified in 1180e5c31af7Sopenharmony_ciflink:vkGetDescriptorSetLayoutSupport::pname:pCreateInfo includes a 1181e5c31af7Sopenharmony_civariable-sized descriptor, then pname:supported is determined assuming the 1182e5c31af7Sopenharmony_cirequested size of the variable-sized descriptor, and 1183e5c31af7Sopenharmony_cipname:maxVariableDescriptorCount is set to the maximum size of that 1184e5c31af7Sopenharmony_cidescriptor that can: be successfully created (which is greater than or equal 1185e5c31af7Sopenharmony_cito the requested size passed in). 1186e5c31af7Sopenharmony_ciIf the slink:VkDescriptorSetLayoutCreateInfo structure does not include a 1187e5c31af7Sopenharmony_civariable-sized descriptor, or if the 1188e5c31af7Sopenharmony_cislink:VkPhysicalDeviceDescriptorIndexingFeatures::pname:descriptorBindingVariableDescriptorCount 1189e5c31af7Sopenharmony_cifeature is not enabled, then pname:maxVariableDescriptorCount is set to 1190e5c31af7Sopenharmony_cizero. 1191e5c31af7Sopenharmony_ciFor the purposes of this command, a variable-sized descriptor binding with a 1192e5c31af7Sopenharmony_cipname:descriptorCount of zero is treated as if the pname:descriptorCount is 1193e5c31af7Sopenharmony_cione, and thus the binding is not ignored and the maximum descriptor count 1194e5c31af7Sopenharmony_ciwill be returned. 1195e5c31af7Sopenharmony_ciIf the layout is not supported, then the value written to 1196e5c31af7Sopenharmony_cipname:maxVariableDescriptorCount is undefined:. 1197e5c31af7Sopenharmony_ci 1198e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkDescriptorSetVariableDescriptorCountLayoutSupport.txt[] 1199e5c31af7Sopenharmony_ci-- 1200e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[] 1201e5c31af7Sopenharmony_ci 1202e5c31af7Sopenharmony_ciThe following examples show a shader snippet using two descriptor sets, and 1203e5c31af7Sopenharmony_ciapplication code that creates corresponding descriptor set layouts. 1204e5c31af7Sopenharmony_ci 1205e5c31af7Sopenharmony_ci.GLSL example 1206e5c31af7Sopenharmony_ci[source,glsl] 1207e5c31af7Sopenharmony_ci--------------------------------------------------- 1208e5c31af7Sopenharmony_ci// 1209e5c31af7Sopenharmony_ci// binding to a single sampled image descriptor in set 0 1210e5c31af7Sopenharmony_ci// 1211e5c31af7Sopenharmony_cilayout (set=0, binding=0) uniform texture2D mySampledImage; 1212e5c31af7Sopenharmony_ci 1213e5c31af7Sopenharmony_ci// 1214e5c31af7Sopenharmony_ci// binding to an array of sampled image descriptors in set 0 1215e5c31af7Sopenharmony_ci// 1216e5c31af7Sopenharmony_cilayout (set=0, binding=1) uniform texture2D myArrayOfSampledImages[12]; 1217e5c31af7Sopenharmony_ci 1218e5c31af7Sopenharmony_ci// 1219e5c31af7Sopenharmony_ci// binding to a single uniform buffer descriptor in set 1 1220e5c31af7Sopenharmony_ci// 1221e5c31af7Sopenharmony_cilayout (set=1, binding=0) uniform myUniformBuffer 1222e5c31af7Sopenharmony_ci{ 1223e5c31af7Sopenharmony_ci vec4 myElement[32]; 1224e5c31af7Sopenharmony_ci}; 1225e5c31af7Sopenharmony_ci--------------------------------------------------- 1226e5c31af7Sopenharmony_ci 1227e5c31af7Sopenharmony_ci.SPIR-V example 1228e5c31af7Sopenharmony_ci[source,spirv] 1229e5c31af7Sopenharmony_ci--------------------------------------------------- 1230e5c31af7Sopenharmony_ci ... 1231e5c31af7Sopenharmony_ci %1 = OpExtInstImport "GLSL.std.450" 1232e5c31af7Sopenharmony_ci ... 1233e5c31af7Sopenharmony_ci OpName %9 "mySampledImage" 1234e5c31af7Sopenharmony_ci OpName %14 "myArrayOfSampledImages" 1235e5c31af7Sopenharmony_ci OpName %18 "myUniformBuffer" 1236e5c31af7Sopenharmony_ci OpMemberName %18 0 "myElement" 1237e5c31af7Sopenharmony_ci OpName %20 "" 1238e5c31af7Sopenharmony_ci OpDecorate %9 DescriptorSet 0 1239e5c31af7Sopenharmony_ci OpDecorate %9 Binding 0 1240e5c31af7Sopenharmony_ci OpDecorate %14 DescriptorSet 0 1241e5c31af7Sopenharmony_ci OpDecorate %14 Binding 1 1242e5c31af7Sopenharmony_ci OpDecorate %17 ArrayStride 16 1243e5c31af7Sopenharmony_ci OpMemberDecorate %18 0 Offset 0 1244e5c31af7Sopenharmony_ci OpDecorate %18 Block 1245e5c31af7Sopenharmony_ci OpDecorate %20 DescriptorSet 1 1246e5c31af7Sopenharmony_ci OpDecorate %20 Binding 0 1247e5c31af7Sopenharmony_ci %2 = OpTypeVoid 1248e5c31af7Sopenharmony_ci %3 = OpTypeFunction %2 1249e5c31af7Sopenharmony_ci %6 = OpTypeFloat 32 1250e5c31af7Sopenharmony_ci %7 = OpTypeImage %6 2D 0 0 0 1 Unknown 1251e5c31af7Sopenharmony_ci %8 = OpTypePointer UniformConstant %7 1252e5c31af7Sopenharmony_ci %9 = OpVariable %8 UniformConstant 1253e5c31af7Sopenharmony_ci %10 = OpTypeInt 32 0 1254e5c31af7Sopenharmony_ci %11 = OpConstant %10 12 1255e5c31af7Sopenharmony_ci %12 = OpTypeArray %7 %11 1256e5c31af7Sopenharmony_ci %13 = OpTypePointer UniformConstant %12 1257e5c31af7Sopenharmony_ci %14 = OpVariable %13 UniformConstant 1258e5c31af7Sopenharmony_ci %15 = OpTypeVector %6 4 1259e5c31af7Sopenharmony_ci %16 = OpConstant %10 32 1260e5c31af7Sopenharmony_ci %17 = OpTypeArray %15 %16 1261e5c31af7Sopenharmony_ci %18 = OpTypeStruct %17 1262e5c31af7Sopenharmony_ci %19 = OpTypePointer Uniform %18 1263e5c31af7Sopenharmony_ci %20 = OpVariable %19 Uniform 1264e5c31af7Sopenharmony_ci ... 1265e5c31af7Sopenharmony_ci--------------------------------------------------- 1266e5c31af7Sopenharmony_ci 1267e5c31af7Sopenharmony_ci.API example 1268e5c31af7Sopenharmony_ci[source,c++] 1269e5c31af7Sopenharmony_ci--------------------------------------------------- 1270e5c31af7Sopenharmony_ciVkResult myResult; 1271e5c31af7Sopenharmony_ci 1272e5c31af7Sopenharmony_ciconst VkDescriptorSetLayoutBinding myDescriptorSetLayoutBinding[] = 1273e5c31af7Sopenharmony_ci{ 1274e5c31af7Sopenharmony_ci // binding to a single image descriptor 1275e5c31af7Sopenharmony_ci { 1276e5c31af7Sopenharmony_ci 0, // binding 1277e5c31af7Sopenharmony_ci VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, // descriptorType 1278e5c31af7Sopenharmony_ci 1, // descriptorCount 1279e5c31af7Sopenharmony_ci VK_SHADER_STAGE_FRAGMENT_BIT, // stageFlags 1280e5c31af7Sopenharmony_ci NULL // pImmutableSamplers 1281e5c31af7Sopenharmony_ci }, 1282e5c31af7Sopenharmony_ci 1283e5c31af7Sopenharmony_ci // binding to an array of image descriptors 1284e5c31af7Sopenharmony_ci { 1285e5c31af7Sopenharmony_ci 1, // binding 1286e5c31af7Sopenharmony_ci VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, // descriptorType 1287e5c31af7Sopenharmony_ci 12, // descriptorCount 1288e5c31af7Sopenharmony_ci VK_SHADER_STAGE_FRAGMENT_BIT, // stageFlags 1289e5c31af7Sopenharmony_ci NULL // pImmutableSamplers 1290e5c31af7Sopenharmony_ci }, 1291e5c31af7Sopenharmony_ci 1292e5c31af7Sopenharmony_ci // binding to a single uniform buffer descriptor 1293e5c31af7Sopenharmony_ci { 1294e5c31af7Sopenharmony_ci 0, // binding 1295e5c31af7Sopenharmony_ci VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, // descriptorType 1296e5c31af7Sopenharmony_ci 1, // descriptorCount 1297e5c31af7Sopenharmony_ci VK_SHADER_STAGE_FRAGMENT_BIT, // stageFlags 1298e5c31af7Sopenharmony_ci NULL // pImmutableSamplers 1299e5c31af7Sopenharmony_ci } 1300e5c31af7Sopenharmony_ci}; 1301e5c31af7Sopenharmony_ci 1302e5c31af7Sopenharmony_ciconst VkDescriptorSetLayoutCreateInfo myDescriptorSetLayoutCreateInfo[] = 1303e5c31af7Sopenharmony_ci{ 1304e5c31af7Sopenharmony_ci // Information for first descriptor set with two descriptor bindings 1305e5c31af7Sopenharmony_ci { 1306e5c31af7Sopenharmony_ci VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO, // sType 1307e5c31af7Sopenharmony_ci NULL, // pNext 1308e5c31af7Sopenharmony_ci 0, // flags 1309e5c31af7Sopenharmony_ci 2, // bindingCount 1310e5c31af7Sopenharmony_ci &myDescriptorSetLayoutBinding[0] // pBindings 1311e5c31af7Sopenharmony_ci }, 1312e5c31af7Sopenharmony_ci 1313e5c31af7Sopenharmony_ci // Information for second descriptor set with one descriptor binding 1314e5c31af7Sopenharmony_ci { 1315e5c31af7Sopenharmony_ci VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO, // sType 1316e5c31af7Sopenharmony_ci NULL, // pNext 1317e5c31af7Sopenharmony_ci 0, // flags 1318e5c31af7Sopenharmony_ci 1, // bindingCount 1319e5c31af7Sopenharmony_ci &myDescriptorSetLayoutBinding[2] // pBindings 1320e5c31af7Sopenharmony_ci } 1321e5c31af7Sopenharmony_ci}; 1322e5c31af7Sopenharmony_ci 1323e5c31af7Sopenharmony_ciVkDescriptorSetLayout myDescriptorSetLayout[2]; 1324e5c31af7Sopenharmony_ci 1325e5c31af7Sopenharmony_ci// 1326e5c31af7Sopenharmony_ci// Create first descriptor set layout 1327e5c31af7Sopenharmony_ci// 1328e5c31af7Sopenharmony_cimyResult = vkCreateDescriptorSetLayout( 1329e5c31af7Sopenharmony_ci myDevice, 1330e5c31af7Sopenharmony_ci &myDescriptorSetLayoutCreateInfo[0], 1331e5c31af7Sopenharmony_ci NULL, 1332e5c31af7Sopenharmony_ci &myDescriptorSetLayout[0]); 1333e5c31af7Sopenharmony_ci 1334e5c31af7Sopenharmony_ci// 1335e5c31af7Sopenharmony_ci// Create second descriptor set layout 1336e5c31af7Sopenharmony_ci// 1337e5c31af7Sopenharmony_cimyResult = vkCreateDescriptorSetLayout( 1338e5c31af7Sopenharmony_ci myDevice, 1339e5c31af7Sopenharmony_ci &myDescriptorSetLayoutCreateInfo[1], 1340e5c31af7Sopenharmony_ci NULL, 1341e5c31af7Sopenharmony_ci &myDescriptorSetLayout[1]); 1342e5c31af7Sopenharmony_ci--------------------------------------------------- 1343e5c31af7Sopenharmony_ci 1344e5c31af7Sopenharmony_ci[open,refpage='vkDestroyDescriptorSetLayout',desc='Destroy a descriptor set layout object',type='protos'] 1345e5c31af7Sopenharmony_ci-- 1346e5c31af7Sopenharmony_ciTo destroy a descriptor set layout, call: 1347e5c31af7Sopenharmony_ci 1348e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkDestroyDescriptorSetLayout.txt[] 1349e5c31af7Sopenharmony_ci 1350e5c31af7Sopenharmony_ci * pname:device is the logical device that destroys the descriptor set 1351e5c31af7Sopenharmony_ci layout. 1352e5c31af7Sopenharmony_ci * pname:descriptorSetLayout is the descriptor set layout to destroy. 1353e5c31af7Sopenharmony_ci * pname:pAllocator controls host memory allocation as described in the 1354e5c31af7Sopenharmony_ci <<memory-allocation, Memory Allocation>> chapter. 1355e5c31af7Sopenharmony_ci 1356e5c31af7Sopenharmony_ci.Valid Usage 1357e5c31af7Sopenharmony_ci**** 1358e5c31af7Sopenharmony_ci * [[VUID-vkDestroyDescriptorSetLayout-descriptorSetLayout-00284]] 1359e5c31af7Sopenharmony_ci If sname:VkAllocationCallbacks were provided when 1360e5c31af7Sopenharmony_ci pname:descriptorSetLayout was created, a compatible set of callbacks 1361e5c31af7Sopenharmony_ci must: be provided here 1362e5c31af7Sopenharmony_ci * [[VUID-vkDestroyDescriptorSetLayout-descriptorSetLayout-00285]] 1363e5c31af7Sopenharmony_ci If no sname:VkAllocationCallbacks were provided when 1364e5c31af7Sopenharmony_ci pname:descriptorSetLayout was created, pname:pAllocator must: be `NULL` 1365e5c31af7Sopenharmony_ci**** 1366e5c31af7Sopenharmony_ci 1367e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkDestroyDescriptorSetLayout.txt[] 1368e5c31af7Sopenharmony_ci-- 1369e5c31af7Sopenharmony_ci 1370e5c31af7Sopenharmony_ci 1371e5c31af7Sopenharmony_ci[[descriptorsets-pipelinelayout]] 1372e5c31af7Sopenharmony_ci=== Pipeline Layouts 1373e5c31af7Sopenharmony_ci 1374e5c31af7Sopenharmony_ci[open,refpage='VkPipelineLayout',desc='Opaque handle to a pipeline layout object',type='handles'] 1375e5c31af7Sopenharmony_ci-- 1376e5c31af7Sopenharmony_ciAccess to descriptor sets from a pipeline is accomplished through a 1377e5c31af7Sopenharmony_ci_pipeline layout_. 1378e5c31af7Sopenharmony_ciZero or more descriptor set layouts and zero or more push constant ranges 1379e5c31af7Sopenharmony_ciare combined to form a pipeline layout object describing the complete set of 1380e5c31af7Sopenharmony_ciresources that can: be accessed by a pipeline. 1381e5c31af7Sopenharmony_ciThe pipeline layout represents a sequence of descriptor sets with each 1382e5c31af7Sopenharmony_cihaving a specific layout. 1383e5c31af7Sopenharmony_ciThis sequence of layouts is used to determine the interface between shader 1384e5c31af7Sopenharmony_cistages and shader resources. 1385e5c31af7Sopenharmony_ciEach pipeline is created using a pipeline layout. 1386e5c31af7Sopenharmony_ci 1387e5c31af7Sopenharmony_ciPipeline layout objects are represented by sname:VkPipelineLayout handles: 1388e5c31af7Sopenharmony_ci 1389e5c31af7Sopenharmony_ciinclude::{generated}/api/handles/VkPipelineLayout.txt[] 1390e5c31af7Sopenharmony_ci-- 1391e5c31af7Sopenharmony_ci 1392e5c31af7Sopenharmony_ci[open,refpage='vkCreatePipelineLayout',desc='Creates a new pipeline layout object',type='protos'] 1393e5c31af7Sopenharmony_ci-- 1394e5c31af7Sopenharmony_ciTo create a pipeline layout, call: 1395e5c31af7Sopenharmony_ci 1396e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCreatePipelineLayout.txt[] 1397e5c31af7Sopenharmony_ci 1398e5c31af7Sopenharmony_ci * pname:device is the logical device that creates the pipeline layout. 1399e5c31af7Sopenharmony_ci * pname:pCreateInfo is a pointer to a slink:VkPipelineLayoutCreateInfo 1400e5c31af7Sopenharmony_ci structure specifying the state of the pipeline layout object. 1401e5c31af7Sopenharmony_ci * pname:pAllocator controls host memory allocation as described in the 1402e5c31af7Sopenharmony_ci <<memory-allocation, Memory Allocation>> chapter. 1403e5c31af7Sopenharmony_ci * pname:pPipelineLayout is a pointer to a slink:VkPipelineLayout handle in 1404e5c31af7Sopenharmony_ci which the resulting pipeline layout object is returned. 1405e5c31af7Sopenharmony_ci 1406e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCreatePipelineLayout.txt[] 1407e5c31af7Sopenharmony_ci-- 1408e5c31af7Sopenharmony_ci 1409e5c31af7Sopenharmony_ci[open,refpage='VkPipelineLayoutCreateInfo',desc='Structure specifying the parameters of a newly created pipeline layout object',type='structs'] 1410e5c31af7Sopenharmony_ci-- 1411e5c31af7Sopenharmony_ciThe slink:VkPipelineLayoutCreateInfo structure is defined as: 1412e5c31af7Sopenharmony_ci 1413e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkPipelineLayoutCreateInfo.txt[] 1414e5c31af7Sopenharmony_ci 1415e5c31af7Sopenharmony_ci * pname:sType is the type of this structure. 1416e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 1417e5c31af7Sopenharmony_ci structure. 1418e5c31af7Sopenharmony_ci * pname:flags is reserved for future use. 1419e5c31af7Sopenharmony_ci * pname:setLayoutCount is the number of descriptor sets included in the 1420e5c31af7Sopenharmony_ci pipeline layout. 1421e5c31af7Sopenharmony_ci * pname:pSetLayouts is a pointer to an array of 1422e5c31af7Sopenharmony_ci sname:VkDescriptorSetLayout objects. 1423e5c31af7Sopenharmony_ci * pname:pushConstantRangeCount is the number of push constant ranges 1424e5c31af7Sopenharmony_ci included in the pipeline layout. 1425e5c31af7Sopenharmony_ci * pname:pPushConstantRanges is a pointer to an array of 1426e5c31af7Sopenharmony_ci sname:VkPushConstantRange structures defining a set of push constant 1427e5c31af7Sopenharmony_ci ranges for use in a single pipeline layout. 1428e5c31af7Sopenharmony_ci In addition to descriptor set layouts, a pipeline layout also describes 1429e5c31af7Sopenharmony_ci how many push constants can: be accessed by each stage of the pipeline. 1430e5c31af7Sopenharmony_ci+ 1431e5c31af7Sopenharmony_ci[NOTE] 1432e5c31af7Sopenharmony_ci.Note 1433e5c31af7Sopenharmony_ci==== 1434e5c31af7Sopenharmony_ciPush constants represent a high speed path to modify constant data in 1435e5c31af7Sopenharmony_cipipelines that is expected to outperform memory-backed resource updates. 1436e5c31af7Sopenharmony_ci==== 1437e5c31af7Sopenharmony_ci 1438e5c31af7Sopenharmony_ci.Valid Usage 1439e5c31af7Sopenharmony_ci**** 1440e5c31af7Sopenharmony_ci * [[VUID-VkPipelineLayoutCreateInfo-setLayoutCount-00286]] 1441e5c31af7Sopenharmony_ci pname:setLayoutCount must: be less than or equal to 1442e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceLimits::pname:maxBoundDescriptorSets 1443e5c31af7Sopenharmony_ciifndef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[] 1444e5c31af7Sopenharmony_ci * [[VUID-VkPipelineLayoutCreateInfo-pSetLayouts-00287]] 1445e5c31af7Sopenharmony_ci The total number of descriptors of the type 1446e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_SAMPLER and 1447e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER accessible to any shader 1448e5c31af7Sopenharmony_ci stage across all elements of pname:pSetLayouts must: be less than or 1449e5c31af7Sopenharmony_ci equal to 1450e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceLimits::pname:maxPerStageDescriptorSamplers 1451e5c31af7Sopenharmony_ci * [[VUID-VkPipelineLayoutCreateInfo-pSetLayouts-00288]] 1452e5c31af7Sopenharmony_ci The total number of descriptors of the type 1453e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER and 1454e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC accessible to any shader 1455e5c31af7Sopenharmony_ci stage across all elements of pname:pSetLayouts must: be less than or 1456e5c31af7Sopenharmony_ci equal to 1457e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceLimits::pname:maxPerStageDescriptorUniformBuffers 1458e5c31af7Sopenharmony_ci * [[VUID-VkPipelineLayoutCreateInfo-pSetLayouts-00289]] 1459e5c31af7Sopenharmony_ci The total number of descriptors of the type 1460e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER and 1461e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC accessible to any shader 1462e5c31af7Sopenharmony_ci stage across all elements of pname:pSetLayouts must: be less than or 1463e5c31af7Sopenharmony_ci equal to 1464e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceLimits::pname:maxPerStageDescriptorStorageBuffers 1465e5c31af7Sopenharmony_ci * [[VUID-VkPipelineLayoutCreateInfo-pSetLayouts-00290]] 1466e5c31af7Sopenharmony_ci The total number of descriptors of the type 1467e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, 1468e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, and 1469e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER accessible to any shader 1470e5c31af7Sopenharmony_ci stage across all elements of pname:pSetLayouts must: be less than or 1471e5c31af7Sopenharmony_ci equal to 1472e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceLimits::pname:maxPerStageDescriptorSampledImages 1473e5c31af7Sopenharmony_ci * [[VUID-VkPipelineLayoutCreateInfo-pSetLayouts-00291]] 1474e5c31af7Sopenharmony_ci The total number of descriptors of the type 1475e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, and 1476e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER accessible to any shader 1477e5c31af7Sopenharmony_ci stage across all elements of pname:pSetLayouts must: be less than or 1478e5c31af7Sopenharmony_ci equal to 1479e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceLimits::pname:maxPerStageDescriptorStorageImages 1480e5c31af7Sopenharmony_ci * [[VUID-VkPipelineLayoutCreateInfo-pSetLayouts-01676]] 1481e5c31af7Sopenharmony_ci The total number of descriptors of the type 1482e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT accessible to any given shader 1483e5c31af7Sopenharmony_ci stage across all elements of pname:pSetLayouts must: be less than or 1484e5c31af7Sopenharmony_ci equal to 1485e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceLimits::pname:maxPerStageDescriptorInputAttachments 1486e5c31af7Sopenharmony_ciifdef::VK_EXT_inline_uniform_block[] 1487e5c31af7Sopenharmony_ci * [[VUID-VkPipelineLayoutCreateInfo-descriptorType-02212]] 1488e5c31af7Sopenharmony_ci The total number of bindings with a pname:descriptorType of 1489e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT accessible to any 1490e5c31af7Sopenharmony_ci given shader stage across all elements of pname:pSetLayouts must: be 1491e5c31af7Sopenharmony_ci less than or equal to 1492e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceInlineUniformBlockPropertiesEXT::pname:maxPerStageDescriptorInlineUniformBlocks 1493e5c31af7Sopenharmony_ciendif::VK_EXT_inline_uniform_block[] 1494e5c31af7Sopenharmony_ci * [[VUID-VkPipelineLayoutCreateInfo-pSetLayouts-01677]] 1495e5c31af7Sopenharmony_ci The total number of descriptors of the type 1496e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_SAMPLER and 1497e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER accessible across all 1498e5c31af7Sopenharmony_ci shader stages and across all elements of pname:pSetLayouts must: be less 1499e5c31af7Sopenharmony_ci than or equal to 1500e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceLimits::pname:maxDescriptorSetSamplers 1501e5c31af7Sopenharmony_ci * [[VUID-VkPipelineLayoutCreateInfo-pSetLayouts-01678]] 1502e5c31af7Sopenharmony_ci The total number of descriptors of the type 1503e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER accessible across all shader 1504e5c31af7Sopenharmony_ci stages and across all elements of pname:pSetLayouts must: be less than 1505e5c31af7Sopenharmony_ci or equal to 1506e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceLimits::pname:maxDescriptorSetUniformBuffers 1507e5c31af7Sopenharmony_ci * [[VUID-VkPipelineLayoutCreateInfo-pSetLayouts-01679]] 1508e5c31af7Sopenharmony_ci The total number of descriptors of the type 1509e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC accessible across all 1510e5c31af7Sopenharmony_ci shader stages and across all elements of pname:pSetLayouts must: be less 1511e5c31af7Sopenharmony_ci than or equal to 1512e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceLimits::pname:maxDescriptorSetUniformBuffersDynamic 1513e5c31af7Sopenharmony_ci * [[VUID-VkPipelineLayoutCreateInfo-pSetLayouts-01680]] 1514e5c31af7Sopenharmony_ci The total number of descriptors of the type 1515e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER accessible across all shader 1516e5c31af7Sopenharmony_ci stages and across all elements of pname:pSetLayouts must: be less than 1517e5c31af7Sopenharmony_ci or equal to 1518e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceLimits::pname:maxDescriptorSetStorageBuffers 1519e5c31af7Sopenharmony_ci * [[VUID-VkPipelineLayoutCreateInfo-pSetLayouts-01681]] 1520e5c31af7Sopenharmony_ci The total number of descriptors of the type 1521e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC accessible across all 1522e5c31af7Sopenharmony_ci shader stages and across all elements of pname:pSetLayouts must: be less 1523e5c31af7Sopenharmony_ci than or equal to 1524e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceLimits::pname:maxDescriptorSetStorageBuffersDynamic 1525e5c31af7Sopenharmony_ci * [[VUID-VkPipelineLayoutCreateInfo-pSetLayouts-01682]] 1526e5c31af7Sopenharmony_ci The total number of descriptors of the type 1527e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, 1528e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, and 1529e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER accessible across all 1530e5c31af7Sopenharmony_ci shader stages and across all elements of pname:pSetLayouts must: be less 1531e5c31af7Sopenharmony_ci than or equal to 1532e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceLimits::pname:maxDescriptorSetSampledImages 1533e5c31af7Sopenharmony_ci * [[VUID-VkPipelineLayoutCreateInfo-pSetLayouts-01683]] 1534e5c31af7Sopenharmony_ci The total number of descriptors of the type 1535e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, and 1536e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER accessible across all 1537e5c31af7Sopenharmony_ci shader stages and across all elements of pname:pSetLayouts must: be less 1538e5c31af7Sopenharmony_ci than or equal to 1539e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceLimits::pname:maxDescriptorSetStorageImages 1540e5c31af7Sopenharmony_ci * [[VUID-VkPipelineLayoutCreateInfo-pSetLayouts-01684]] 1541e5c31af7Sopenharmony_ci The total number of descriptors of the type 1542e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT accessible across all shader 1543e5c31af7Sopenharmony_ci stages and across all elements of pname:pSetLayouts must: be less than 1544e5c31af7Sopenharmony_ci or equal to 1545e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceLimits::pname:maxDescriptorSetInputAttachments 1546e5c31af7Sopenharmony_ciifdef::VK_EXT_inline_uniform_block[] 1547e5c31af7Sopenharmony_ci * [[VUID-VkPipelineLayoutCreateInfo-descriptorType-02213]] 1548e5c31af7Sopenharmony_ci The total number of bindings with a pname:descriptorType of 1549e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT accessible across all 1550e5c31af7Sopenharmony_ci shader stages and across all elements of pname:pSetLayouts must: be less 1551e5c31af7Sopenharmony_ci than or equal to 1552e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceInlineUniformBlockPropertiesEXT::pname:maxDescriptorSetInlineUniformBlocks 1553e5c31af7Sopenharmony_ciendif::VK_EXT_inline_uniform_block[] 1554e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[] 1555e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[] 1556e5c31af7Sopenharmony_ci * [[VUID-VkPipelineLayoutCreateInfo-descriptorType-03016]] 1557e5c31af7Sopenharmony_ci The total number of descriptors in descriptor set layouts created 1558e5c31af7Sopenharmony_ci without the 1559e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT bit set 1560e5c31af7Sopenharmony_ci with a pname:descriptorType of ename:VK_DESCRIPTOR_TYPE_SAMPLER and 1561e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER accessible to any given 1562e5c31af7Sopenharmony_ci shader stage across all elements of pname:pSetLayouts must: be less than 1563e5c31af7Sopenharmony_ci or equal to 1564e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceLimits::pname:maxPerStageDescriptorSamplers 1565e5c31af7Sopenharmony_ci * [[VUID-VkPipelineLayoutCreateInfo-descriptorType-03017]] 1566e5c31af7Sopenharmony_ci The total number of descriptors in descriptor set layouts created 1567e5c31af7Sopenharmony_ci without the 1568e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT bit set 1569e5c31af7Sopenharmony_ci with a pname:descriptorType of ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER 1570e5c31af7Sopenharmony_ci and ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC accessible to any 1571e5c31af7Sopenharmony_ci given shader stage across all elements of pname:pSetLayouts must: be 1572e5c31af7Sopenharmony_ci less than or equal to 1573e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceLimits::pname:maxPerStageDescriptorUniformBuffers 1574e5c31af7Sopenharmony_ci * [[VUID-VkPipelineLayoutCreateInfo-descriptorType-03018]] 1575e5c31af7Sopenharmony_ci The total number of descriptors in descriptor set layouts created 1576e5c31af7Sopenharmony_ci without the 1577e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT bit set 1578e5c31af7Sopenharmony_ci with a pname:descriptorType of ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER 1579e5c31af7Sopenharmony_ci and ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC accessible to any 1580e5c31af7Sopenharmony_ci given shader stage across all elements of pname:pSetLayouts must: be 1581e5c31af7Sopenharmony_ci less than or equal to 1582e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceLimits::pname:maxPerStageDescriptorStorageBuffers 1583e5c31af7Sopenharmony_ci * [[VUID-VkPipelineLayoutCreateInfo-descriptorType-03019]] 1584e5c31af7Sopenharmony_ci The total number of descriptors in descriptor set layouts created 1585e5c31af7Sopenharmony_ci without the 1586e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT bit set 1587e5c31af7Sopenharmony_ci with a pname:descriptorType of 1588e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, 1589e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, and 1590e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER accessible to any given 1591e5c31af7Sopenharmony_ci shader stage across all elements of pname:pSetLayouts must: be less than 1592e5c31af7Sopenharmony_ci or equal to 1593e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceLimits::pname:maxPerStageDescriptorSampledImages 1594e5c31af7Sopenharmony_ci * [[VUID-VkPipelineLayoutCreateInfo-descriptorType-03020]] 1595e5c31af7Sopenharmony_ci The total number of descriptors in descriptor set layouts created 1596e5c31af7Sopenharmony_ci without the 1597e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT bit set 1598e5c31af7Sopenharmony_ci with a pname:descriptorType of ename:VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, 1599e5c31af7Sopenharmony_ci and ename:VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER accessible to any 1600e5c31af7Sopenharmony_ci given shader stage across all elements of pname:pSetLayouts must: be 1601e5c31af7Sopenharmony_ci less than or equal to 1602e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceLimits::pname:maxPerStageDescriptorStorageImages 1603e5c31af7Sopenharmony_ci * [[VUID-VkPipelineLayoutCreateInfo-descriptorType-03021]] 1604e5c31af7Sopenharmony_ci The total number of descriptors in descriptor set layouts created 1605e5c31af7Sopenharmony_ci without the 1606e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT bit set 1607e5c31af7Sopenharmony_ci with a pname:descriptorType of ename:VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT 1608e5c31af7Sopenharmony_ci accessible to any given shader stage across all elements of 1609e5c31af7Sopenharmony_ci pname:pSetLayouts must: be less than or equal to 1610e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceLimits::pname:maxPerStageDescriptorInputAttachments 1611e5c31af7Sopenharmony_ciifdef::VK_EXT_inline_uniform_block[] 1612e5c31af7Sopenharmony_ci * [[VUID-VkPipelineLayoutCreateInfo-descriptorType-02214]] 1613e5c31af7Sopenharmony_ci The total number of bindings in descriptor set layouts created without 1614e5c31af7Sopenharmony_ci the ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT bit 1615e5c31af7Sopenharmony_ci set with a pname:descriptorType of 1616e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT accessible to any 1617e5c31af7Sopenharmony_ci given shader stage across all elements of pname:pSetLayouts must: be 1618e5c31af7Sopenharmony_ci less than or equal to 1619e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceInlineUniformBlockPropertiesEXT::pname:maxPerStageDescriptorInlineUniformBlocks 1620e5c31af7Sopenharmony_ciendif::VK_EXT_inline_uniform_block[] 1621e5c31af7Sopenharmony_ci * [[VUID-VkPipelineLayoutCreateInfo-descriptorType-03022]] 1622e5c31af7Sopenharmony_ci The total number of descriptors with a pname:descriptorType of 1623e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_SAMPLER and 1624e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER accessible to any given 1625e5c31af7Sopenharmony_ci shader stage across all elements of pname:pSetLayouts must: be less than 1626e5c31af7Sopenharmony_ci or equal to 1627e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceDescriptorIndexingProperties::pname:maxPerStageDescriptorUpdateAfterBindSamplers 1628e5c31af7Sopenharmony_ci * [[VUID-VkPipelineLayoutCreateInfo-descriptorType-03023]] 1629e5c31af7Sopenharmony_ci The total number of descriptors with a pname:descriptorType of 1630e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER and 1631e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC accessible to any given 1632e5c31af7Sopenharmony_ci shader stage across all elements of pname:pSetLayouts must: be less than 1633e5c31af7Sopenharmony_ci or equal to 1634e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceDescriptorIndexingProperties::pname:maxPerStageDescriptorUpdateAfterBindUniformBuffers 1635e5c31af7Sopenharmony_ci * [[VUID-VkPipelineLayoutCreateInfo-descriptorType-03024]] 1636e5c31af7Sopenharmony_ci The total number of descriptors with a pname:descriptorType of 1637e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER and 1638e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC accessible to any given 1639e5c31af7Sopenharmony_ci shader stage across all elements of pname:pSetLayouts must: be less than 1640e5c31af7Sopenharmony_ci or equal to 1641e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceDescriptorIndexingProperties::pname:maxPerStageDescriptorUpdateAfterBindStorageBuffers 1642e5c31af7Sopenharmony_ci * [[VUID-VkPipelineLayoutCreateInfo-descriptorType-03025]] 1643e5c31af7Sopenharmony_ci The total number of descriptors with a pname:descriptorType of 1644e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, 1645e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, and 1646e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER accessible to any given 1647e5c31af7Sopenharmony_ci shader stage across all elements of pname:pSetLayouts must: be less than 1648e5c31af7Sopenharmony_ci or equal to 1649e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceDescriptorIndexingProperties::pname:maxPerStageDescriptorUpdateAfterBindSampledImages 1650e5c31af7Sopenharmony_ci * [[VUID-VkPipelineLayoutCreateInfo-descriptorType-03026]] 1651e5c31af7Sopenharmony_ci The total number of descriptors with a pname:descriptorType of 1652e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, and 1653e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER accessible to any given 1654e5c31af7Sopenharmony_ci shader stage across all elements of pname:pSetLayouts must: be less than 1655e5c31af7Sopenharmony_ci or equal to 1656e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceDescriptorIndexingProperties::pname:maxPerStageDescriptorUpdateAfterBindStorageImages 1657e5c31af7Sopenharmony_ci * [[VUID-VkPipelineLayoutCreateInfo-descriptorType-03027]] 1658e5c31af7Sopenharmony_ci The total number of descriptors with a pname:descriptorType of 1659e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT accessible to any given shader 1660e5c31af7Sopenharmony_ci stage across all elements of pname:pSetLayouts must: be less than or 1661e5c31af7Sopenharmony_ci equal to 1662e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceDescriptorIndexingProperties::pname:maxPerStageDescriptorUpdateAfterBindInputAttachments 1663e5c31af7Sopenharmony_ciifdef::VK_EXT_inline_uniform_block[] 1664e5c31af7Sopenharmony_ci * [[VUID-VkPipelineLayoutCreateInfo-descriptorType-02215]] 1665e5c31af7Sopenharmony_ci The total number of bindings with a pname:descriptorType of 1666e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT accessible to any 1667e5c31af7Sopenharmony_ci given shader stage across all elements of pname:pSetLayouts must: be 1668e5c31af7Sopenharmony_ci less than or equal to 1669e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceInlineUniformBlockPropertiesEXT::pname:maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks 1670e5c31af7Sopenharmony_ciendif::VK_EXT_inline_uniform_block[] 1671e5c31af7Sopenharmony_ci * [[VUID-VkPipelineLayoutCreateInfo-descriptorType-03028]] 1672e5c31af7Sopenharmony_ci The total number of descriptors in descriptor set layouts created 1673e5c31af7Sopenharmony_ci without the 1674e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT bit set 1675e5c31af7Sopenharmony_ci with a pname:descriptorType of ename:VK_DESCRIPTOR_TYPE_SAMPLER and 1676e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER accessible across all 1677e5c31af7Sopenharmony_ci shader stages and across all elements of pname:pSetLayouts must: be less 1678e5c31af7Sopenharmony_ci than or equal to 1679e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceLimits::pname:maxDescriptorSetSamplers 1680e5c31af7Sopenharmony_ci * [[VUID-VkPipelineLayoutCreateInfo-descriptorType-03029]] 1681e5c31af7Sopenharmony_ci The total number of descriptors in descriptor set layouts created 1682e5c31af7Sopenharmony_ci without the 1683e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT bit set 1684e5c31af7Sopenharmony_ci with a pname:descriptorType of ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER 1685e5c31af7Sopenharmony_ci accessible across all shader stages and across all elements of 1686e5c31af7Sopenharmony_ci pname:pSetLayouts must: be less than or equal to 1687e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceLimits::pname:maxDescriptorSetUniformBuffers 1688e5c31af7Sopenharmony_ci * [[VUID-VkPipelineLayoutCreateInfo-descriptorType-03030]] 1689e5c31af7Sopenharmony_ci The total number of descriptors in descriptor set layouts created 1690e5c31af7Sopenharmony_ci without the 1691e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT bit set 1692e5c31af7Sopenharmony_ci with a pname:descriptorType of 1693e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC accessible across all 1694e5c31af7Sopenharmony_ci shader stages and across all elements of pname:pSetLayouts must: be less 1695e5c31af7Sopenharmony_ci than or equal to 1696e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceLimits::pname:maxDescriptorSetUniformBuffersDynamic 1697e5c31af7Sopenharmony_ci * [[VUID-VkPipelineLayoutCreateInfo-descriptorType-03031]] 1698e5c31af7Sopenharmony_ci The total number of descriptors in descriptor set layouts created 1699e5c31af7Sopenharmony_ci without the 1700e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT bit set 1701e5c31af7Sopenharmony_ci with a pname:descriptorType of ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER 1702e5c31af7Sopenharmony_ci accessible across all shader stages and across all elements of 1703e5c31af7Sopenharmony_ci pname:pSetLayouts must: be less than or equal to 1704e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceLimits::pname:maxDescriptorSetStorageBuffers 1705e5c31af7Sopenharmony_ci * [[VUID-VkPipelineLayoutCreateInfo-descriptorType-03032]] 1706e5c31af7Sopenharmony_ci The total number of descriptors in descriptor set layouts created 1707e5c31af7Sopenharmony_ci without the 1708e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT bit set 1709e5c31af7Sopenharmony_ci with a pname:descriptorType of 1710e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC accessible across all 1711e5c31af7Sopenharmony_ci shader stages and across all elements of pname:pSetLayouts must: be less 1712e5c31af7Sopenharmony_ci than or equal to 1713e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceLimits::pname:maxDescriptorSetStorageBuffersDynamic 1714e5c31af7Sopenharmony_ci * [[VUID-VkPipelineLayoutCreateInfo-descriptorType-03033]] 1715e5c31af7Sopenharmony_ci The total number of descriptors in descriptor set layouts created 1716e5c31af7Sopenharmony_ci without the 1717e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT bit set 1718e5c31af7Sopenharmony_ci with a pname:descriptorType of 1719e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, 1720e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, and 1721e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER accessible across all 1722e5c31af7Sopenharmony_ci shader stages and across all elements of pname:pSetLayouts must: be less 1723e5c31af7Sopenharmony_ci than or equal to 1724e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceLimits::pname:maxDescriptorSetSampledImages 1725e5c31af7Sopenharmony_ci * [[VUID-VkPipelineLayoutCreateInfo-descriptorType-03034]] 1726e5c31af7Sopenharmony_ci The total number of descriptors in descriptor set layouts created 1727e5c31af7Sopenharmony_ci without the 1728e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT bit set 1729e5c31af7Sopenharmony_ci with a pname:descriptorType of ename:VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, 1730e5c31af7Sopenharmony_ci and ename:VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER accessible across all 1731e5c31af7Sopenharmony_ci shader stages and across all elements of pname:pSetLayouts must: be less 1732e5c31af7Sopenharmony_ci than or equal to 1733e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceLimits::pname:maxDescriptorSetStorageImages 1734e5c31af7Sopenharmony_ci * [[VUID-VkPipelineLayoutCreateInfo-descriptorType-03035]] 1735e5c31af7Sopenharmony_ci The total number of descriptors in descriptor set layouts created 1736e5c31af7Sopenharmony_ci without the 1737e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT bit set 1738e5c31af7Sopenharmony_ci with a pname:descriptorType of ename:VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT 1739e5c31af7Sopenharmony_ci accessible across all shader stages and across all elements of 1740e5c31af7Sopenharmony_ci pname:pSetLayouts must: be less than or equal to 1741e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceLimits::pname:maxDescriptorSetInputAttachments 1742e5c31af7Sopenharmony_ciifdef::VK_EXT_inline_uniform_block[] 1743e5c31af7Sopenharmony_ci * [[VUID-VkPipelineLayoutCreateInfo-descriptorType-02216]] 1744e5c31af7Sopenharmony_ci The total number of bindings in descriptor set layouts created without 1745e5c31af7Sopenharmony_ci the ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT bit 1746e5c31af7Sopenharmony_ci set with a pname:descriptorType of 1747e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT accessible across all 1748e5c31af7Sopenharmony_ci shader stages and across all elements of pname:pSetLayouts must: be less 1749e5c31af7Sopenharmony_ci than or equal to 1750e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceInlineUniformBlockPropertiesEXT::pname:maxDescriptorSetInlineUniformBlocks 1751e5c31af7Sopenharmony_ciendif::VK_EXT_inline_uniform_block[] 1752e5c31af7Sopenharmony_ci * [[VUID-VkPipelineLayoutCreateInfo-pSetLayouts-03036]] 1753e5c31af7Sopenharmony_ci The total number of descriptors of the type 1754e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_SAMPLER and 1755e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER accessible across all 1756e5c31af7Sopenharmony_ci shader stages and across all elements of pname:pSetLayouts must: be less 1757e5c31af7Sopenharmony_ci than or equal to 1758e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceDescriptorIndexingProperties::pname:maxDescriptorSetUpdateAfterBindSamplers 1759e5c31af7Sopenharmony_ci * [[VUID-VkPipelineLayoutCreateInfo-pSetLayouts-03037]] 1760e5c31af7Sopenharmony_ci The total number of descriptors of the type 1761e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER accessible across all shader 1762e5c31af7Sopenharmony_ci stages and across all elements of pname:pSetLayouts must: be less than 1763e5c31af7Sopenharmony_ci or equal to 1764e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceDescriptorIndexingProperties::pname:maxDescriptorSetUpdateAfterBindUniformBuffers 1765e5c31af7Sopenharmony_ci * [[VUID-VkPipelineLayoutCreateInfo-pSetLayouts-03038]] 1766e5c31af7Sopenharmony_ci The total number of descriptors of the type 1767e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC accessible across all 1768e5c31af7Sopenharmony_ci shader stages and across all elements of pname:pSetLayouts must: be less 1769e5c31af7Sopenharmony_ci than or equal to 1770e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceDescriptorIndexingProperties::pname:maxDescriptorSetUpdateAfterBindUniformBuffersDynamic 1771e5c31af7Sopenharmony_ci * [[VUID-VkPipelineLayoutCreateInfo-pSetLayouts-03039]] 1772e5c31af7Sopenharmony_ci The total number of descriptors of the type 1773e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER accessible across all shader 1774e5c31af7Sopenharmony_ci stages and across all elements of pname:pSetLayouts must: be less than 1775e5c31af7Sopenharmony_ci or equal to 1776e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceDescriptorIndexingProperties::pname:maxDescriptorSetUpdateAfterBindStorageBuffers 1777e5c31af7Sopenharmony_ci * [[VUID-VkPipelineLayoutCreateInfo-pSetLayouts-03040]] 1778e5c31af7Sopenharmony_ci The total number of descriptors of the type 1779e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC accessible across all 1780e5c31af7Sopenharmony_ci shader stages and across all elements of pname:pSetLayouts must: be less 1781e5c31af7Sopenharmony_ci than or equal to 1782e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceDescriptorIndexingProperties::pname:maxDescriptorSetUpdateAfterBindStorageBuffersDynamic 1783e5c31af7Sopenharmony_ci * [[VUID-VkPipelineLayoutCreateInfo-pSetLayouts-03041]] 1784e5c31af7Sopenharmony_ci The total number of descriptors of the type 1785e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, 1786e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, and 1787e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER accessible across all 1788e5c31af7Sopenharmony_ci shader stages and across all elements of pname:pSetLayouts must: be less 1789e5c31af7Sopenharmony_ci than or equal to 1790e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceDescriptorIndexingProperties::pname:maxDescriptorSetUpdateAfterBindSampledImages 1791e5c31af7Sopenharmony_ci * [[VUID-VkPipelineLayoutCreateInfo-pSetLayouts-03042]] 1792e5c31af7Sopenharmony_ci The total number of descriptors of the type 1793e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, and 1794e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER accessible across all 1795e5c31af7Sopenharmony_ci shader stages and across all elements of pname:pSetLayouts must: be less 1796e5c31af7Sopenharmony_ci than or equal to 1797e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceDescriptorIndexingProperties::pname:maxDescriptorSetUpdateAfterBindStorageImages 1798e5c31af7Sopenharmony_ci * [[VUID-VkPipelineLayoutCreateInfo-pSetLayouts-03043]] 1799e5c31af7Sopenharmony_ci The total number of descriptors of the type 1800e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT accessible across all shader 1801e5c31af7Sopenharmony_ci stages and across all elements of pname:pSetLayouts must: be less than 1802e5c31af7Sopenharmony_ci or equal to 1803e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceDescriptorIndexingProperties::pname:maxDescriptorSetUpdateAfterBindInputAttachments 1804e5c31af7Sopenharmony_ciifdef::VK_EXT_inline_uniform_block[] 1805e5c31af7Sopenharmony_ci * [[VUID-VkPipelineLayoutCreateInfo-descriptorType-02217]] 1806e5c31af7Sopenharmony_ci The total number of bindings with a pname:descriptorType of 1807e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT accessible across all 1808e5c31af7Sopenharmony_ci shader stages and across all elements of pname:pSetLayouts must: be less 1809e5c31af7Sopenharmony_ci than or equal to 1810e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceInlineUniformBlockPropertiesEXT::pname:maxDescriptorSetUpdateAfterBindInlineUniformBlocks 1811e5c31af7Sopenharmony_ciendif::VK_EXT_inline_uniform_block[] 1812e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[] 1813e5c31af7Sopenharmony_ci * [[VUID-VkPipelineLayoutCreateInfo-pPushConstantRanges-00292]] 1814e5c31af7Sopenharmony_ci Any two elements of pname:pPushConstantRanges must: not include the same 1815e5c31af7Sopenharmony_ci stage in pname:stageFlags 1816e5c31af7Sopenharmony_ciifdef::VK_KHR_push_descriptor[] 1817e5c31af7Sopenharmony_ci * [[VUID-VkPipelineLayoutCreateInfo-pSetLayouts-00293]] 1818e5c31af7Sopenharmony_ci pname:pSetLayouts must: not contain more than one descriptor set layout 1819e5c31af7Sopenharmony_ci that was created with 1820e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR set 1821e5c31af7Sopenharmony_ciendif::VK_KHR_push_descriptor[] 1822e5c31af7Sopenharmony_ciifdef::VK_KHR_acceleration_structure[] 1823e5c31af7Sopenharmony_ci * [[VUID-VkPipelineLayoutCreateInfo-descriptorType-03571]] 1824e5c31af7Sopenharmony_ci The total number of bindings in descriptor set layouts created without 1825e5c31af7Sopenharmony_ci the ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT bit 1826e5c31af7Sopenharmony_ci set with a pname:descriptorType of 1827e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_KHR accessible to any 1828e5c31af7Sopenharmony_ci given shader stage across all elements of pname:pSetLayouts must: be 1829e5c31af7Sopenharmony_ci less than or equal to 1830e5c31af7Sopenharmony_ci slink:VkPhysicalDeviceAccelerationStructurePropertiesKHR::pname:maxPerStageDescriptorAccelerationStructures 1831e5c31af7Sopenharmony_ci * [[VUID-VkPipelineLayoutCreateInfo-descriptorType-03572]] 1832e5c31af7Sopenharmony_ci The total number of bindings with a pname:descriptorType of 1833e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_KHR accessible to any 1834e5c31af7Sopenharmony_ci given shader stage across all elements of pname:pSetLayouts must: be 1835e5c31af7Sopenharmony_ci less than or equal to 1836e5c31af7Sopenharmony_ci slink:VkPhysicalDeviceAccelerationStructurePropertiesKHR::pname:maxPerStageDescriptorUpdateAfterBindAccelerationStructures 1837e5c31af7Sopenharmony_ci * [[VUID-VkPipelineLayoutCreateInfo-descriptorType-03573]] 1838e5c31af7Sopenharmony_ci The total number of bindings in descriptor set layouts created without 1839e5c31af7Sopenharmony_ci the ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT bit 1840e5c31af7Sopenharmony_ci set with a pname:descriptorType of 1841e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_KHR accessible across 1842e5c31af7Sopenharmony_ci all shader stages and across all elements of pname:pSetLayouts must: be 1843e5c31af7Sopenharmony_ci less than or equal to 1844e5c31af7Sopenharmony_ci slink:VkPhysicalDeviceAccelerationStructurePropertiesKHR::pname:maxDescriptorSetAccelerationStructures 1845e5c31af7Sopenharmony_ci * [[VUID-VkPipelineLayoutCreateInfo-descriptorType-03574]] 1846e5c31af7Sopenharmony_ci The total number of bindings with a pname:descriptorType of 1847e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_KHR accessible across 1848e5c31af7Sopenharmony_ci all shader stages and across all elements of pname:pSetLayouts must: be 1849e5c31af7Sopenharmony_ci less than or equal to 1850e5c31af7Sopenharmony_ci slink:VkPhysicalDeviceAccelerationStructurePropertiesKHR::pname:maxDescriptorSetUpdateAfterBindAccelerationStructures 1851e5c31af7Sopenharmony_ciendif::VK_KHR_acceleration_structure[] 1852e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing[] 1853e5c31af7Sopenharmony_ci * [[VUID-VkPipelineLayoutCreateInfo-descriptorType-02381]] 1854e5c31af7Sopenharmony_ci The total number of bindings with a pname:descriptorType of 1855e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_NV accessible across all 1856e5c31af7Sopenharmony_ci shader stages and across all elements of pname:pSetLayouts must: be less 1857e5c31af7Sopenharmony_ci than or equal to 1858e5c31af7Sopenharmony_ci slink:VkPhysicalDeviceRayTracingPropertiesNV::pname:maxDescriptorSetAccelerationStructures 1859e5c31af7Sopenharmony_ciendif::VK_NV_ray_tracing[] 1860e5c31af7Sopenharmony_ciifdef::VK_EXT_fragment_density_map2[] 1861e5c31af7Sopenharmony_ci * [[VUID-VkPipelineLayoutCreateInfo-pImmutableSamplers-03566]] 1862e5c31af7Sopenharmony_ci The total number of pname:pImmutableSamplers created with pname:flags 1863e5c31af7Sopenharmony_ci containing ename:VK_SAMPLER_CREATE_SUBSAMPLED_BIT_EXT or 1864e5c31af7Sopenharmony_ci ename:VK_SAMPLER_CREATE_SUBSAMPLED_COARSE_RECONSTRUCTION_BIT_EXT across 1865e5c31af7Sopenharmony_ci all shader stages and across all elements of pname:pSetLayouts must: be 1866e5c31af7Sopenharmony_ci less than or equal to 1867e5c31af7Sopenharmony_ci <<limits-maxDescriptorSetSubsampledSamplers,sname:VkPhysicalDeviceFragmentDensityMap2PropertiesEXT::pname:maxDescriptorSetSubsampledSamplers>> 1868e5c31af7Sopenharmony_ciendif::VK_EXT_fragment_density_map2[] 1869e5c31af7Sopenharmony_ciifdef::VK_VALVE_mutable_descriptor_type[] 1870e5c31af7Sopenharmony_ci * [[VUID-VkPipelineLayoutCreateInfo-pSetLayouts-04606]] 1871e5c31af7Sopenharmony_ci Any element of pname:pSetLayouts must: not have been created with the 1872e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_HOST_ONLY_POOL_BIT_VALVE bit set 1873e5c31af7Sopenharmony_ciendif::VK_VALVE_mutable_descriptor_type[] 1874e5c31af7Sopenharmony_ci**** 1875e5c31af7Sopenharmony_ci 1876e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkPipelineLayoutCreateInfo.txt[] 1877e5c31af7Sopenharmony_ci-- 1878e5c31af7Sopenharmony_ci 1879e5c31af7Sopenharmony_ci[open,refpage='VkPipelineLayoutCreateFlags',desc='Reserved for future use',type='flags'] 1880e5c31af7Sopenharmony_ci-- 1881e5c31af7Sopenharmony_ciinclude::{generated}/api/flags/VkPipelineLayoutCreateFlags.txt[] 1882e5c31af7Sopenharmony_ci 1883e5c31af7Sopenharmony_citname:VkPipelineLayoutCreateFlags is a bitmask type for setting a mask, but 1884e5c31af7Sopenharmony_ciis currently reserved for future use. 1885e5c31af7Sopenharmony_ci-- 1886e5c31af7Sopenharmony_ci 1887e5c31af7Sopenharmony_ci[open,refpage='VkPushConstantRange',desc='Structure specifying a push constant range',type='structs'] 1888e5c31af7Sopenharmony_ci-- 1889e5c31af7Sopenharmony_ciThe sname:VkPushConstantRange structure is defined as: 1890e5c31af7Sopenharmony_ci 1891e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkPushConstantRange.txt[] 1892e5c31af7Sopenharmony_ci 1893e5c31af7Sopenharmony_ci * pname:stageFlags is a set of stage flags describing the shader stages 1894e5c31af7Sopenharmony_ci that will access a range of push constants. 1895e5c31af7Sopenharmony_ci If a particular stage is not included in the range, then accessing 1896e5c31af7Sopenharmony_ci members of that range of push constants from the corresponding shader 1897e5c31af7Sopenharmony_ci stage will return undefined: values. 1898e5c31af7Sopenharmony_ci * pname:offset and pname:size are the start offset and size, respectively, 1899e5c31af7Sopenharmony_ci consumed by the range. 1900e5c31af7Sopenharmony_ci Both pname:offset and pname:size are in units of bytes and must: be a 1901e5c31af7Sopenharmony_ci multiple of 4. 1902e5c31af7Sopenharmony_ci The layout of the push constant variables is specified in the shader. 1903e5c31af7Sopenharmony_ci 1904e5c31af7Sopenharmony_ci.Valid Usage 1905e5c31af7Sopenharmony_ci**** 1906e5c31af7Sopenharmony_ci * [[VUID-VkPushConstantRange-offset-00294]] 1907e5c31af7Sopenharmony_ci pname:offset must: be less than 1908e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceLimits::pname:maxPushConstantsSize 1909e5c31af7Sopenharmony_ci * [[VUID-VkPushConstantRange-offset-00295]] 1910e5c31af7Sopenharmony_ci pname:offset must: be a multiple of `4` 1911e5c31af7Sopenharmony_ci * [[VUID-VkPushConstantRange-size-00296]] 1912e5c31af7Sopenharmony_ci pname:size must: be greater than `0` 1913e5c31af7Sopenharmony_ci * [[VUID-VkPushConstantRange-size-00297]] 1914e5c31af7Sopenharmony_ci pname:size must: be a multiple of `4` 1915e5c31af7Sopenharmony_ci * [[VUID-VkPushConstantRange-size-00298]] 1916e5c31af7Sopenharmony_ci pname:size must: be less than or equal to 1917e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceLimits::pname:maxPushConstantsSize minus 1918e5c31af7Sopenharmony_ci pname:offset 1919e5c31af7Sopenharmony_ci**** 1920e5c31af7Sopenharmony_ci 1921e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkPushConstantRange.txt[] 1922e5c31af7Sopenharmony_ci-- 1923e5c31af7Sopenharmony_ci 1924e5c31af7Sopenharmony_ciOnce created, pipeline layouts are used as part of pipeline creation (see 1925e5c31af7Sopenharmony_ci<<pipelines, Pipelines>>), as part of binding descriptor sets (see 1926e5c31af7Sopenharmony_ci<<descriptorsets-binding, Descriptor Set Binding>>), and as part of setting 1927e5c31af7Sopenharmony_cipush constants (see <<descriptorsets-push-constants, Push Constant 1928e5c31af7Sopenharmony_ciUpdates>>). 1929e5c31af7Sopenharmony_ciPipeline creation accepts a pipeline layout as input, and the layout may: be 1930e5c31af7Sopenharmony_ciused to map (set, binding, arrayElement) tuples to implementation resources 1931e5c31af7Sopenharmony_cior memory locations within a descriptor set. 1932e5c31af7Sopenharmony_ciThe assignment of implementation resources depends only on the bindings 1933e5c31af7Sopenharmony_cidefined in the descriptor sets that comprise the pipeline layout, and not on 1934e5c31af7Sopenharmony_ciany shader source. 1935e5c31af7Sopenharmony_ci 1936e5c31af7Sopenharmony_ci[[descriptorsets-pipelinelayout-consistency]] 1937e5c31af7Sopenharmony_ciAll resource variables <<shaders-staticuse,statically used>> in all shaders 1938e5c31af7Sopenharmony_ciin a pipeline must: be declared with a (set,binding,arrayElement) that 1939e5c31af7Sopenharmony_ciexists in the corresponding descriptor set layout and is of an appropriate 1940e5c31af7Sopenharmony_cidescriptor type and includes the set of shader stages it is used by in 1941e5c31af7Sopenharmony_cipname:stageFlags. 1942e5c31af7Sopenharmony_ciThe pipeline layout can: include entries that are not used by a particular 1943e5c31af7Sopenharmony_cipipeline, or that are dead-code eliminated from any of the shaders. 1944e5c31af7Sopenharmony_ciThe pipeline layout allows the application to provide a consistent set of 1945e5c31af7Sopenharmony_cibindings across multiple pipeline compiles, which enables those pipelines to 1946e5c31af7Sopenharmony_cibe compiled in a way that the implementation may: cheaply switch pipelines 1947e5c31af7Sopenharmony_ciwithout reprogramming the bindings. 1948e5c31af7Sopenharmony_ci 1949e5c31af7Sopenharmony_ciSimilarly, the push constant block declared in each shader (if present) 1950e5c31af7Sopenharmony_cimust: only place variables at offsets that are each included in a push 1951e5c31af7Sopenharmony_ciconstant range with pname:stageFlags including the bit corresponding to the 1952e5c31af7Sopenharmony_cishader stage that uses it. 1953e5c31af7Sopenharmony_ciThe pipeline layout can: include ranges or portions of ranges that are not 1954e5c31af7Sopenharmony_ciused by a particular pipeline, or for which the variables have been 1955e5c31af7Sopenharmony_cidead-code eliminated from any of the shaders. 1956e5c31af7Sopenharmony_ci 1957e5c31af7Sopenharmony_ciThere is a limit on the total number of resources of each type that can: be 1958e5c31af7Sopenharmony_ciincluded in bindings in all descriptor set layouts in a pipeline layout as 1959e5c31af7Sopenharmony_cishown in <<descriptorsets-pipelinelayout-limits,Pipeline Layout Resource 1960e5c31af7Sopenharmony_ciLimits>>. 1961e5c31af7Sopenharmony_ciThe "`Total Resources Available`" column gives the limit on the number of 1962e5c31af7Sopenharmony_cieach type of resource that can: be included in bindings in all descriptor 1963e5c31af7Sopenharmony_cisets in the pipeline layout. 1964e5c31af7Sopenharmony_ciSome resource types count against multiple limits. 1965e5c31af7Sopenharmony_ciAdditionally, there are limits on the total number of each type of resource 1966e5c31af7Sopenharmony_cithat can: be used in any pipeline stage as described in 1967e5c31af7Sopenharmony_ci<<interfaces-resources-limits,Shader Resource Limits>>. 1968e5c31af7Sopenharmony_ci 1969e5c31af7Sopenharmony_ci[[descriptorsets-pipelinelayout-limits]] 1970e5c31af7Sopenharmony_ci.Pipeline Layout Resource Limits 1971e5c31af7Sopenharmony_ci[width="80%",cols="<37,<22",options="header"] 1972e5c31af7Sopenharmony_ci|==== 1973e5c31af7Sopenharmony_ci| Total Resources Available | Resource Types 1974e5c31af7Sopenharmony_ci.2+<.^| pname:maxDescriptorSetSamplers 1975e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[] 1976e5c31af7Sopenharmony_cior pname:maxDescriptorSetUpdateAfterBindSamplers 1977e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[] 1978e5c31af7Sopenharmony_ci | sampler | combined image sampler 1979e5c31af7Sopenharmony_ci.3+<.^| pname:maxDescriptorSetSampledImages 1980e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[] 1981e5c31af7Sopenharmony_cior pname:maxDescriptorSetUpdateAfterBindSampledImages 1982e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[] 1983e5c31af7Sopenharmony_ci | sampled image | combined image sampler | uniform texel buffer 1984e5c31af7Sopenharmony_ci.2+<.^| pname:maxDescriptorSetStorageImages 1985e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[] 1986e5c31af7Sopenharmony_cior pname:maxDescriptorSetUpdateAfterBindStorageImages 1987e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[] 1988e5c31af7Sopenharmony_ci | storage image | storage texel buffer 1989e5c31af7Sopenharmony_ci.2+<.^| pname:maxDescriptorSetUniformBuffers 1990e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[] 1991e5c31af7Sopenharmony_cior pname:maxDescriptorSetUpdateAfterBindUniformBuffers 1992e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[] 1993e5c31af7Sopenharmony_ci | uniform buffer | uniform buffer dynamic 1994e5c31af7Sopenharmony_ci| pname:maxDescriptorSetUniformBuffersDynamic 1995e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[] 1996e5c31af7Sopenharmony_cior pname:maxDescriptorSetUpdateAfterBindUniformBuffersDynamic 1997e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[] 1998e5c31af7Sopenharmony_ci | uniform buffer dynamic 1999e5c31af7Sopenharmony_ci.2+<.^| pname:maxDescriptorSetStorageBuffers 2000e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[] 2001e5c31af7Sopenharmony_cior pname:maxDescriptorSetUpdateAfterBindStorageBuffers 2002e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[] 2003e5c31af7Sopenharmony_ci | storage buffer | storage buffer dynamic 2004e5c31af7Sopenharmony_ci| pname:maxDescriptorSetStorageBuffersDynamic 2005e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[] 2006e5c31af7Sopenharmony_cior pname:maxDescriptorSetUpdateAfterBindStorageBuffersDynamic 2007e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[] 2008e5c31af7Sopenharmony_ci | storage buffer dynamic 2009e5c31af7Sopenharmony_ci| pname:maxDescriptorSetInputAttachments 2010e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[] 2011e5c31af7Sopenharmony_cior pname:maxDescriptorSetUpdateAfterBindInputAttachments 2012e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[] 2013e5c31af7Sopenharmony_ci | input attachment 2014e5c31af7Sopenharmony_ciifdef::VK_EXT_inline_uniform_block[] 2015e5c31af7Sopenharmony_ci| pname:maxDescriptorSetInlineUniformBlocks 2016e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[] 2017e5c31af7Sopenharmony_cior pname:maxDescriptorSetUpdateAfterBindInlineUniformBlocks 2018e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[] 2019e5c31af7Sopenharmony_ci | inline uniform block 2020e5c31af7Sopenharmony_ciendif::VK_EXT_inline_uniform_block[] 2021e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing,VK_KHR_acceleration_structure[] 2022e5c31af7Sopenharmony_ci| pname:maxDescriptorSetAccelerationStructures 2023e5c31af7Sopenharmony_ciifdef::VK_KHR_acceleration_structure[] 2024e5c31af7Sopenharmony_cior pname:maxDescriptorSetUpdateAfterBindAccelerationStructures 2025e5c31af7Sopenharmony_ciendif::VK_KHR_acceleration_structure[] 2026e5c31af7Sopenharmony_ci | acceleration structure 2027e5c31af7Sopenharmony_ciendif::VK_NV_ray_tracing,VK_KHR_acceleration_structure[] 2028e5c31af7Sopenharmony_ci|==== 2029e5c31af7Sopenharmony_ci 2030e5c31af7Sopenharmony_ci 2031e5c31af7Sopenharmony_ci[open,refpage='vkDestroyPipelineLayout',desc='Destroy a pipeline layout object',type='protos'] 2032e5c31af7Sopenharmony_ci-- 2033e5c31af7Sopenharmony_ciTo destroy a pipeline layout, call: 2034e5c31af7Sopenharmony_ci 2035e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkDestroyPipelineLayout.txt[] 2036e5c31af7Sopenharmony_ci 2037e5c31af7Sopenharmony_ci * pname:device is the logical device that destroys the pipeline layout. 2038e5c31af7Sopenharmony_ci * pname:pipelineLayout is the pipeline layout to destroy. 2039e5c31af7Sopenharmony_ci * pname:pAllocator controls host memory allocation as described in the 2040e5c31af7Sopenharmony_ci <<memory-allocation, Memory Allocation>> chapter. 2041e5c31af7Sopenharmony_ci 2042e5c31af7Sopenharmony_ci.Valid Usage 2043e5c31af7Sopenharmony_ci**** 2044e5c31af7Sopenharmony_ci * [[VUID-vkDestroyPipelineLayout-pipelineLayout-00299]] 2045e5c31af7Sopenharmony_ci If sname:VkAllocationCallbacks were provided when pname:pipelineLayout 2046e5c31af7Sopenharmony_ci was created, a compatible set of callbacks must: be provided here 2047e5c31af7Sopenharmony_ci * [[VUID-vkDestroyPipelineLayout-pipelineLayout-00300]] 2048e5c31af7Sopenharmony_ci If no sname:VkAllocationCallbacks were provided when 2049e5c31af7Sopenharmony_ci pname:pipelineLayout was created, pname:pAllocator must: be `NULL` 2050e5c31af7Sopenharmony_ci * [[VUID-vkDestroyPipelineLayout-pipelineLayout-02004]] 2051e5c31af7Sopenharmony_ci pname:pipelineLayout must: not have been passed to any ftext:vkCmd* 2052e5c31af7Sopenharmony_ci command for any command buffers that are still in the 2053e5c31af7Sopenharmony_ci <<commandbuffers-lifecycle, recording state>> when 2054e5c31af7Sopenharmony_ci fname:vkDestroyPipelineLayout is called 2055e5c31af7Sopenharmony_ci**** 2056e5c31af7Sopenharmony_ci 2057e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkDestroyPipelineLayout.txt[] 2058e5c31af7Sopenharmony_ci-- 2059e5c31af7Sopenharmony_ci 2060e5c31af7Sopenharmony_ci 2061e5c31af7Sopenharmony_ci[[descriptorsets-compatibility]] 2062e5c31af7Sopenharmony_ci==== Pipeline Layout Compatibility 2063e5c31af7Sopenharmony_ci 2064e5c31af7Sopenharmony_ciTwo pipeline layouts are defined to be "`compatible for 2065e5c31af7Sopenharmony_ci<<descriptorsets-push-constants, push constants>>`" if they were created 2066e5c31af7Sopenharmony_ciwith identical push constant ranges. 2067e5c31af7Sopenharmony_ciTwo pipeline layouts are defined to be "`compatible for set N`" if they were 2068e5c31af7Sopenharmony_cicreated with _identically defined_ descriptor set layouts for sets zero 2069e5c31af7Sopenharmony_cithrough N, and if they were created with identical push constant ranges. 2070e5c31af7Sopenharmony_ci 2071e5c31af7Sopenharmony_ciWhen binding a descriptor set (see <<descriptorsets-binding, Descriptor Set 2072e5c31af7Sopenharmony_ciBinding>>) to set number N, if the previously bound descriptor sets for sets 2073e5c31af7Sopenharmony_cizero through N-1 were all bound using compatible pipeline layouts, then 2074e5c31af7Sopenharmony_ciperforming this binding does not disturb any of the lower numbered sets. 2075e5c31af7Sopenharmony_ciIf, additionally, the previously bound descriptor set for set N was bound 2076e5c31af7Sopenharmony_ciusing a pipeline layout compatible for set N, then the bindings in sets 2077e5c31af7Sopenharmony_cinumbered greater than N are also not disturbed. 2078e5c31af7Sopenharmony_ci 2079e5c31af7Sopenharmony_ciSimilarly, when binding a pipeline, the pipeline can: correctly access any 2080e5c31af7Sopenharmony_cipreviously bound descriptor sets which were bound with compatible pipeline 2081e5c31af7Sopenharmony_cilayouts, as long as all lower numbered sets were also bound with compatible 2082e5c31af7Sopenharmony_cilayouts. 2083e5c31af7Sopenharmony_ci 2084e5c31af7Sopenharmony_ciLayout compatibility means that descriptor sets can: be bound to a command 2085e5c31af7Sopenharmony_cibuffer for use by any pipeline created with a compatible pipeline layout, 2086e5c31af7Sopenharmony_ciand without having bound a particular pipeline first. 2087e5c31af7Sopenharmony_ciIt also means that descriptor sets can: remain valid across a pipeline 2088e5c31af7Sopenharmony_cichange, and the same resources will be accessible to the newly bound 2089e5c31af7Sopenharmony_cipipeline. 2090e5c31af7Sopenharmony_ci 2091e5c31af7Sopenharmony_ciifdef::implementation-guide[] 2092e5c31af7Sopenharmony_ci.Implementor's Note 2093e5c31af7Sopenharmony_ci**** 2094e5c31af7Sopenharmony_ciA consequence of layout compatibility is that when the implementation 2095e5c31af7Sopenharmony_cicompiles a pipeline layout and maps pipeline resources to implementation 2096e5c31af7Sopenharmony_ciresources, the mechanism for set N should: only be a function of sets 2097e5c31af7Sopenharmony_ci[0..N]. 2098e5c31af7Sopenharmony_ci**** 2099e5c31af7Sopenharmony_ciendif::implementation-guide[] 2100e5c31af7Sopenharmony_ci 2101e5c31af7Sopenharmony_ci 2102e5c31af7Sopenharmony_ci[NOTE] 2103e5c31af7Sopenharmony_ci.Note 2104e5c31af7Sopenharmony_ci==== 2105e5c31af7Sopenharmony_ciPlace the least frequently changing descriptor sets near the start of the 2106e5c31af7Sopenharmony_cipipeline layout, and place the descriptor sets representing the most 2107e5c31af7Sopenharmony_cifrequently changing resources near the end. 2108e5c31af7Sopenharmony_ciWhen pipelines are switched, only the descriptor set bindings that have been 2109e5c31af7Sopenharmony_ciinvalidated will need to be updated and the remainder of the descriptor set 2110e5c31af7Sopenharmony_cibindings will remain in place. 2111e5c31af7Sopenharmony_ci==== 2112e5c31af7Sopenharmony_ci 2113e5c31af7Sopenharmony_ciThe maximum number of descriptor sets that can: be bound to a pipeline 2114e5c31af7Sopenharmony_cilayout is queried from physical device properties (see 2115e5c31af7Sopenharmony_cipname:maxBoundDescriptorSets in <<limits, Limits>>). 2116e5c31af7Sopenharmony_ci 2117e5c31af7Sopenharmony_ci.API example 2118e5c31af7Sopenharmony_ci[source,c++] 2119e5c31af7Sopenharmony_ci--------------------------------------------------- 2120e5c31af7Sopenharmony_ciconst VkDescriptorSetLayout layouts[] = { layout1, layout2 }; 2121e5c31af7Sopenharmony_ci 2122e5c31af7Sopenharmony_ciconst VkPushConstantRange ranges[] = 2123e5c31af7Sopenharmony_ci{ 2124e5c31af7Sopenharmony_ci { 2125e5c31af7Sopenharmony_ci VK_SHADER_STAGE_VERTEX_BIT, // stageFlags 2126e5c31af7Sopenharmony_ci 0, // offset 2127e5c31af7Sopenharmony_ci 4 // size 2128e5c31af7Sopenharmony_ci }, 2129e5c31af7Sopenharmony_ci 2130e5c31af7Sopenharmony_ci { 2131e5c31af7Sopenharmony_ci VK_SHADER_STAGE_FRAGMENT_BIT, // stageFlags 2132e5c31af7Sopenharmony_ci 4, // offset 2133e5c31af7Sopenharmony_ci 4 // size 2134e5c31af7Sopenharmony_ci }, 2135e5c31af7Sopenharmony_ci}; 2136e5c31af7Sopenharmony_ci 2137e5c31af7Sopenharmony_ciconst VkPipelineLayoutCreateInfo createInfo = 2138e5c31af7Sopenharmony_ci{ 2139e5c31af7Sopenharmony_ci VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO, // sType 2140e5c31af7Sopenharmony_ci NULL, // pNext 2141e5c31af7Sopenharmony_ci 0, // flags 2142e5c31af7Sopenharmony_ci 2, // setLayoutCount 2143e5c31af7Sopenharmony_ci layouts, // pSetLayouts 2144e5c31af7Sopenharmony_ci 2, // pushConstantRangeCount 2145e5c31af7Sopenharmony_ci ranges // pPushConstantRanges 2146e5c31af7Sopenharmony_ci}; 2147e5c31af7Sopenharmony_ci 2148e5c31af7Sopenharmony_ciVkPipelineLayout myPipelineLayout; 2149e5c31af7Sopenharmony_cimyResult = vkCreatePipelineLayout( 2150e5c31af7Sopenharmony_ci myDevice, 2151e5c31af7Sopenharmony_ci &createInfo, 2152e5c31af7Sopenharmony_ci NULL, 2153e5c31af7Sopenharmony_ci &myPipelineLayout); 2154e5c31af7Sopenharmony_ci--------------------------------------------------- 2155e5c31af7Sopenharmony_ci 2156e5c31af7Sopenharmony_ci 2157e5c31af7Sopenharmony_ci[[descriptorsets-allocation]] 2158e5c31af7Sopenharmony_ci=== Allocation of Descriptor Sets 2159e5c31af7Sopenharmony_ci 2160e5c31af7Sopenharmony_ci[open,refpage='VkDescriptorPool',desc='Opaque handle to a descriptor pool object',type='handles'] 2161e5c31af7Sopenharmony_ci-- 2162e5c31af7Sopenharmony_ciA _descriptor pool_ maintains a pool of descriptors, from which descriptor 2163e5c31af7Sopenharmony_cisets are allocated. 2164e5c31af7Sopenharmony_ciDescriptor pools are externally synchronized, meaning that the application 2165e5c31af7Sopenharmony_cimust: not allocate and/or free descriptor sets from the same pool in 2166e5c31af7Sopenharmony_cimultiple threads simultaneously. 2167e5c31af7Sopenharmony_ci 2168e5c31af7Sopenharmony_ciDescriptor pools are represented by sname:VkDescriptorPool handles: 2169e5c31af7Sopenharmony_ci 2170e5c31af7Sopenharmony_ciinclude::{generated}/api/handles/VkDescriptorPool.txt[] 2171e5c31af7Sopenharmony_ci 2172e5c31af7Sopenharmony_ci-- 2173e5c31af7Sopenharmony_ci 2174e5c31af7Sopenharmony_ci[open,refpage='vkCreateDescriptorPool',desc='Creates a descriptor pool object',type='protos'] 2175e5c31af7Sopenharmony_ci-- 2176e5c31af7Sopenharmony_ciTo create a descriptor pool object, call: 2177e5c31af7Sopenharmony_ci 2178e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCreateDescriptorPool.txt[] 2179e5c31af7Sopenharmony_ci 2180e5c31af7Sopenharmony_ci * pname:device is the logical device that creates the descriptor pool. 2181e5c31af7Sopenharmony_ci * pname:pCreateInfo is a pointer to a slink:VkDescriptorPoolCreateInfo 2182e5c31af7Sopenharmony_ci structure specifying the state of the descriptor pool object. 2183e5c31af7Sopenharmony_ci * pname:pAllocator controls host memory allocation as described in the 2184e5c31af7Sopenharmony_ci <<memory-allocation, Memory Allocation>> chapter. 2185e5c31af7Sopenharmony_ci * pname:pDescriptorPool is a pointer to a slink:VkDescriptorPool handle in 2186e5c31af7Sopenharmony_ci which the resulting descriptor pool object is returned. 2187e5c31af7Sopenharmony_ci 2188e5c31af7Sopenharmony_ciThe created descriptor pool is returned in pname:pDescriptorPool. 2189e5c31af7Sopenharmony_ci 2190e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCreateDescriptorPool.txt[] 2191e5c31af7Sopenharmony_ci-- 2192e5c31af7Sopenharmony_ci 2193e5c31af7Sopenharmony_ci[open,refpage='VkDescriptorPoolCreateInfo',desc='Structure specifying parameters of a newly created descriptor pool',type='structs'] 2194e5c31af7Sopenharmony_ci-- 2195e5c31af7Sopenharmony_ciAdditional information about the pool is passed in a 2196e5c31af7Sopenharmony_cisname:VkDescriptorPoolCreateInfo structure: 2197e5c31af7Sopenharmony_ci 2198e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkDescriptorPoolCreateInfo.txt[] 2199e5c31af7Sopenharmony_ci 2200e5c31af7Sopenharmony_ci * pname:sType is the type of this structure. 2201e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 2202e5c31af7Sopenharmony_ci structure. 2203e5c31af7Sopenharmony_ci * pname:flags is a bitmask of elink:VkDescriptorPoolCreateFlagBits 2204e5c31af7Sopenharmony_ci specifying certain supported operations on the pool. 2205e5c31af7Sopenharmony_ci * pname:maxSets is the maximum number of descriptor sets that can: be 2206e5c31af7Sopenharmony_ci allocated from the pool. 2207e5c31af7Sopenharmony_ci * pname:poolSizeCount is the number of elements in pname:pPoolSizes. 2208e5c31af7Sopenharmony_ci * pname:pPoolSizes is a pointer to an array of slink:VkDescriptorPoolSize 2209e5c31af7Sopenharmony_ci structures, each containing a descriptor type and number of descriptors 2210e5c31af7Sopenharmony_ci of that type to be allocated in the pool. 2211e5c31af7Sopenharmony_ci 2212e5c31af7Sopenharmony_ciIf multiple sname:VkDescriptorPoolSize structures containing the same 2213e5c31af7Sopenharmony_cidescriptor type appear in the pname:pPoolSizes array then the pool will be 2214e5c31af7Sopenharmony_cicreated with enough storage for the total number of descriptors of each 2215e5c31af7Sopenharmony_citype. 2216e5c31af7Sopenharmony_ci 2217e5c31af7Sopenharmony_ciFragmentation of a descriptor pool is possible and may: lead to descriptor 2218e5c31af7Sopenharmony_ciset allocation failures. 2219e5c31af7Sopenharmony_ciA failure due to fragmentation is defined as failing a descriptor set 2220e5c31af7Sopenharmony_ciallocation despite the sum of all outstanding descriptor set allocations 2221e5c31af7Sopenharmony_cifrom the pool plus the requested allocation requiring no more than the total 2222e5c31af7Sopenharmony_cinumber of descriptors requested at pool creation. 2223e5c31af7Sopenharmony_ciImplementations provide certain guarantees of when fragmentation must: not 2224e5c31af7Sopenharmony_cicause allocation failure, as described below. 2225e5c31af7Sopenharmony_ci 2226e5c31af7Sopenharmony_ciIf a descriptor pool has not had any descriptor sets freed since it was 2227e5c31af7Sopenharmony_cicreated or most recently reset then fragmentation must: not cause an 2228e5c31af7Sopenharmony_ciallocation failure (note that this is always the case for a pool created 2229e5c31af7Sopenharmony_ciwithout the ename:VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT bit 2230e5c31af7Sopenharmony_ciset). 2231e5c31af7Sopenharmony_ciAdditionally, if all sets allocated from the pool since it was created or 2232e5c31af7Sopenharmony_cimost recently reset use the same number of descriptors (of each type) and 2233e5c31af7Sopenharmony_cithe requested allocation also uses that same number of descriptors (of each 2234e5c31af7Sopenharmony_citype), then fragmentation must: not cause an allocation failure. 2235e5c31af7Sopenharmony_ci 2236e5c31af7Sopenharmony_ciIf an allocation failure occurs due to fragmentation, an application can: 2237e5c31af7Sopenharmony_cicreate an additional descriptor pool to perform further descriptor set 2238e5c31af7Sopenharmony_ciallocations. 2239e5c31af7Sopenharmony_ci 2240e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[] 2241e5c31af7Sopenharmony_ciIf pname:flags has the ename:VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT 2242e5c31af7Sopenharmony_cibit set, descriptor pool creation may: fail with the error 2243e5c31af7Sopenharmony_ciename:VK_ERROR_FRAGMENTATION if the total number of descriptors across all 2244e5c31af7Sopenharmony_cipools (including this one) created with this bit set exceeds 2245e5c31af7Sopenharmony_cipname:maxUpdateAfterBindDescriptorsInAllPools, or if fragmentation of the 2246e5c31af7Sopenharmony_ciunderlying hardware resources occurs. 2247e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[] 2248e5c31af7Sopenharmony_ci 2249e5c31af7Sopenharmony_ciifdef::VK_VALVE_mutable_descriptor_type[] 2250e5c31af7Sopenharmony_ciIf a pname:pPoolSizes[i]::pname:type is 2251e5c31af7Sopenharmony_ciename:VK_DESCRIPTOR_TYPE_MUTABLE_VALVE, a 2252e5c31af7Sopenharmony_cislink:VkMutableDescriptorTypeCreateInfoVALVE struct in the pname:pNext chain 2253e5c31af7Sopenharmony_cican: be used to specify which mutable descriptor types can: be allocated 2254e5c31af7Sopenharmony_cifrom the pool. 2255e5c31af7Sopenharmony_ciIf present in the pname:pNext chain, 2256e5c31af7Sopenharmony_cislink:VkMutableDescriptorTypeCreateInfoVALVE::pname:pMutableDescriptorTypeLists[i] 2257e5c31af7Sopenharmony_cispecifies which kind of ename:VK_DESCRIPTOR_TYPE_MUTABLE_VALVE descriptors 2258e5c31af7Sopenharmony_cican: be allocated from this pool entry. 2259e5c31af7Sopenharmony_ciIf slink:VkMutableDescriptorTypeCreateInfoVALVE does not exist in the 2260e5c31af7Sopenharmony_cipname:pNext chain, or 2261e5c31af7Sopenharmony_cislink:VkMutableDescriptorTypeCreateInfoVALVE::pname:pMutableDescriptorTypeLists[i] 2262e5c31af7Sopenharmony_ciis out of range, the descriptor pool allocates enough memory to be able to 2263e5c31af7Sopenharmony_ciallocate a ename:VK_DESCRIPTOR_TYPE_MUTABLE_VALVE descriptor with any 2264e5c31af7Sopenharmony_cisupported elink:VkDescriptorType as a mutable descriptor. 2265e5c31af7Sopenharmony_ciA mutable descriptor can: be allocated from a pool entry if the type list in 2266e5c31af7Sopenharmony_cislink:VkDescriptorSetLayoutCreateInfo is a subset of the type list declared 2267e5c31af7Sopenharmony_ciin the descriptor pool, or if the pool entry is created without a descriptor 2268e5c31af7Sopenharmony_citype list. 2269e5c31af7Sopenharmony_ciMultiple pname:pPoolSizes entries with 2270e5c31af7Sopenharmony_ciename:VK_DESCRIPTOR_TYPE_MUTABLE_VALVE can: be declared. 2271e5c31af7Sopenharmony_ciWhen multiple such pool entries are present in pname:pPoolSizes, they 2272e5c31af7Sopenharmony_cispecify sets of supported descriptor types which either fully overlap, 2273e5c31af7Sopenharmony_cipartially overlap, or are disjoint. 2274e5c31af7Sopenharmony_ciTwo sets fully overlap if the sets of supported descriptor types are equal. 2275e5c31af7Sopenharmony_ciIf the sets are not disjoint they partially overlap. 2276e5c31af7Sopenharmony_ciA pool entry without a sname:VkMutableDescriptorTypeListVALVE assigned to it 2277e5c31af7Sopenharmony_ciis considered to partially overlap any other pool entry which has a 2278e5c31af7Sopenharmony_cisname:VkMutableDescriptorTypeListVALVE assigned to it. 2279e5c31af7Sopenharmony_ciThe application must: ensure that partial overlap does not exist in 2280e5c31af7Sopenharmony_cipname:pPoolSizes. 2281e5c31af7Sopenharmony_ci 2282e5c31af7Sopenharmony_ci[NOTE] 2283e5c31af7Sopenharmony_ci.Note 2284e5c31af7Sopenharmony_ci==== 2285e5c31af7Sopenharmony_ciThe requirement of no partial overlap is intended to resolve ambiguity for 2286e5c31af7Sopenharmony_civalidation as there is no confusion which pname:pPoolSizes entries will be 2287e5c31af7Sopenharmony_ciallocated from. 2288e5c31af7Sopenharmony_ciAn implementation is not expected to depend on this requirement. 2289e5c31af7Sopenharmony_ci==== 2290e5c31af7Sopenharmony_ciendif::VK_VALVE_mutable_descriptor_type[] 2291e5c31af7Sopenharmony_ci 2292e5c31af7Sopenharmony_ci.Valid Usage 2293e5c31af7Sopenharmony_ci**** 2294e5c31af7Sopenharmony_ci * [[VUID-VkDescriptorPoolCreateInfo-maxSets-00301]] 2295e5c31af7Sopenharmony_ci pname:maxSets must: be greater than `0` 2296e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[] 2297e5c31af7Sopenharmony_ciifdef::VK_VALVE_mutable_descriptor_type[] 2298e5c31af7Sopenharmony_ci * [[VUID-VkDescriptorPoolCreateInfo-flags-04607]] 2299e5c31af7Sopenharmony_ci If pname:flags has the 2300e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_POOL_CREATE_HOST_ONLY_BIT_VALVE bit set, then the 2301e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT bit must: not be 2302e5c31af7Sopenharmony_ci set 2303e5c31af7Sopenharmony_ciendif::VK_VALVE_mutable_descriptor_type[] 2304e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[] 2305e5c31af7Sopenharmony_ciifdef::VK_VALVE_mutable_descriptor_type[] 2306e5c31af7Sopenharmony_ci * [[VUID-VkDescriptorPoolCreateInfo-mutableDescriptorType-04608]] 2307e5c31af7Sopenharmony_ci If 2308e5c31af7Sopenharmony_ci slink:VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE::pname:mutableDescriptorType 2309e5c31af7Sopenharmony_ci is not enabled, pname:pPoolSizes must: not contain a 2310e5c31af7Sopenharmony_ci pname:descriptorType of ename:VK_DESCRIPTOR_TYPE_MUTABLE_VALVE 2311e5c31af7Sopenharmony_ci * [[VUID-VkDescriptorPoolCreateInfo-flags-04609]] 2312e5c31af7Sopenharmony_ci If pname:flags has the 2313e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_POOL_CREATE_HOST_ONLY_BIT_VALVE bit set, 2314e5c31af7Sopenharmony_ci slink:VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE::pname:mutableDescriptorType 2315e5c31af7Sopenharmony_ci must: be enabled 2316e5c31af7Sopenharmony_ci * [[VUID-VkDescriptorPoolCreateInfo-pPoolSizes-04787]] 2317e5c31af7Sopenharmony_ci If pname:pPoolSizes contains a pname:descriptorType of 2318e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_MUTABLE_VALVE, any other 2319e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_MUTABLE_VALVE element in pname:pPoolSizes must: 2320e5c31af7Sopenharmony_ci not have sets of supported descriptor types which partially overlap 2321e5c31af7Sopenharmony_ciendif::VK_VALVE_mutable_descriptor_type[] 2322e5c31af7Sopenharmony_ci**** 2323e5c31af7Sopenharmony_ci 2324e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkDescriptorPoolCreateInfo.txt[] 2325e5c31af7Sopenharmony_ci-- 2326e5c31af7Sopenharmony_ci 2327e5c31af7Sopenharmony_ciifdef::VK_EXT_inline_uniform_block[] 2328e5c31af7Sopenharmony_ci[open,refpage='VkDescriptorPoolInlineUniformBlockCreateInfoEXT',desc='Structure specifying the maximum number of inline uniform block bindings of a newly created descriptor pool',type='structs'] 2329e5c31af7Sopenharmony_ci-- 2330e5c31af7Sopenharmony_ciIn order to be able to allocate descriptor sets having 2331e5c31af7Sopenharmony_ci<<descriptorsets-inlineuniformblock, inline uniform block>> bindings the 2332e5c31af7Sopenharmony_cidescriptor pool must: be created with specifying the inline uniform block 2333e5c31af7Sopenharmony_cibinding capacity of the descriptor pool, in addition to the total inline 2334e5c31af7Sopenharmony_ciuniform data capacity in bytes which is specified through a 2335e5c31af7Sopenharmony_cislink:VkDescriptorPoolSize structure with a pname:descriptorType value of 2336e5c31af7Sopenharmony_ciename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT. 2337e5c31af7Sopenharmony_ciThis can: be done by adding a 2338e5c31af7Sopenharmony_cisname:VkDescriptorPoolInlineUniformBlockCreateInfoEXT structure to the 2339e5c31af7Sopenharmony_cipname:pNext chain of slink:VkDescriptorPoolCreateInfo. 2340e5c31af7Sopenharmony_ci 2341e5c31af7Sopenharmony_ciThe sname:VkDescriptorPoolInlineUniformBlockCreateInfoEXT structure is 2342e5c31af7Sopenharmony_cidefined as: 2343e5c31af7Sopenharmony_ci 2344e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkDescriptorPoolInlineUniformBlockCreateInfoEXT.txt[] 2345e5c31af7Sopenharmony_ci 2346e5c31af7Sopenharmony_ci * pname:sType is the type of this structure. 2347e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 2348e5c31af7Sopenharmony_ci structure. 2349e5c31af7Sopenharmony_ci * pname:maxInlineUniformBlockBindings is the number of inline uniform 2350e5c31af7Sopenharmony_ci block bindings to allocate. 2351e5c31af7Sopenharmony_ci 2352e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkDescriptorPoolInlineUniformBlockCreateInfoEXT.txt[] 2353e5c31af7Sopenharmony_ci-- 2354e5c31af7Sopenharmony_ciendif::VK_EXT_inline_uniform_block[] 2355e5c31af7Sopenharmony_ci 2356e5c31af7Sopenharmony_ci[open,refpage='VkDescriptorPoolCreateFlagBits',desc='Bitmask specifying certain supported operations on a descriptor pool',type='enums'] 2357e5c31af7Sopenharmony_ci-- 2358e5c31af7Sopenharmony_ciBits which can: be set in slink:VkDescriptorPoolCreateInfo::pname:flags to 2359e5c31af7Sopenharmony_cienable operations on a descriptor pool are: 2360e5c31af7Sopenharmony_ci 2361e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkDescriptorPoolCreateFlagBits.txt[] 2362e5c31af7Sopenharmony_ci 2363e5c31af7Sopenharmony_ci * ename:VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT specifies that 2364e5c31af7Sopenharmony_ci descriptor sets can: return their individual allocations to the pool, 2365e5c31af7Sopenharmony_ci i.e. all of flink:vkAllocateDescriptorSets, flink:vkFreeDescriptorSets, 2366e5c31af7Sopenharmony_ci and flink:vkResetDescriptorPool are allowed. 2367e5c31af7Sopenharmony_ci Otherwise, descriptor sets allocated from the pool must: not be 2368e5c31af7Sopenharmony_ci individually freed back to the pool, i.e. only 2369e5c31af7Sopenharmony_ci flink:vkAllocateDescriptorSets and flink:vkResetDescriptorPool are 2370e5c31af7Sopenharmony_ci allowed. 2371e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[] 2372e5c31af7Sopenharmony_ci * ename:VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT specifies that 2373e5c31af7Sopenharmony_ci descriptor sets allocated from this pool can: include bindings with the 2374e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT bit set. 2375e5c31af7Sopenharmony_ci It is valid to allocate descriptor sets that have bindings that do not 2376e5c31af7Sopenharmony_ci set the ename:VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT bit from a 2377e5c31af7Sopenharmony_ci pool that has ename:VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT set. 2378e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[] 2379e5c31af7Sopenharmony_ciifdef::VK_VALVE_mutable_descriptor_type[] 2380e5c31af7Sopenharmony_ci * ename:VK_DESCRIPTOR_POOL_CREATE_HOST_ONLY_BIT_VALVE specifies that this 2381e5c31af7Sopenharmony_ci descriptor pool and the descriptor sets allocated from it reside 2382e5c31af7Sopenharmony_ci entirely in host memory and cannot be bound. 2383e5c31af7Sopenharmony_ci Descriptor sets allocated from this pool are partially exempt from the 2384e5c31af7Sopenharmony_ci external synchronization requirement in 2385e5c31af7Sopenharmony_ciifdef::VK_KHR_descriptor_update_template[] 2386e5c31af7Sopenharmony_ci flink:vkUpdateDescriptorSetWithTemplateKHR and 2387e5c31af7Sopenharmony_ciendif::VK_KHR_descriptor_update_template[] 2388e5c31af7Sopenharmony_ci flink:vkUpdateDescriptorSets. 2389e5c31af7Sopenharmony_ci Descriptor sets and their descriptors can be updated concurrently in 2390e5c31af7Sopenharmony_ci different threads, though the same descriptor must: not be updated 2391e5c31af7Sopenharmony_ci concurrently by two threads. 2392e5c31af7Sopenharmony_ciendif::VK_VALVE_mutable_descriptor_type[] 2393e5c31af7Sopenharmony_ci-- 2394e5c31af7Sopenharmony_ci 2395e5c31af7Sopenharmony_ci[open,refpage='VkDescriptorPoolCreateFlags',desc='Bitmask of VkDescriptorPoolCreateFlagBits',type='flags'] 2396e5c31af7Sopenharmony_ci-- 2397e5c31af7Sopenharmony_ciinclude::{generated}/api/flags/VkDescriptorPoolCreateFlags.txt[] 2398e5c31af7Sopenharmony_ci 2399e5c31af7Sopenharmony_citname:VkDescriptorPoolCreateFlags is a bitmask type for setting a mask of 2400e5c31af7Sopenharmony_cizero or more elink:VkDescriptorPoolCreateFlagBits. 2401e5c31af7Sopenharmony_ci-- 2402e5c31af7Sopenharmony_ci 2403e5c31af7Sopenharmony_ci[open,refpage='VkDescriptorPoolSize',desc='Structure specifying descriptor pool size',type='structs'] 2404e5c31af7Sopenharmony_ci-- 2405e5c31af7Sopenharmony_ciThe sname:VkDescriptorPoolSize structure is defined as: 2406e5c31af7Sopenharmony_ci 2407e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkDescriptorPoolSize.txt[] 2408e5c31af7Sopenharmony_ci 2409e5c31af7Sopenharmony_ci * pname:type is the type of descriptor. 2410e5c31af7Sopenharmony_ci * pname:descriptorCount is the number of descriptors of that type to 2411e5c31af7Sopenharmony_ci allocate. 2412e5c31af7Sopenharmony_ciifdef::VK_EXT_inline_uniform_block[] 2413e5c31af7Sopenharmony_ci If pname:type is ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT then 2414e5c31af7Sopenharmony_ci pname:descriptorCount is the number of bytes to allocate for descriptors 2415e5c31af7Sopenharmony_ci of this type. 2416e5c31af7Sopenharmony_ciendif::VK_EXT_inline_uniform_block[] 2417e5c31af7Sopenharmony_ci 2418e5c31af7Sopenharmony_ciifdef::VK_VULKAN_1_1,VK_KHR_sampler_ycbcr_conversion[] 2419e5c31af7Sopenharmony_ci[NOTE] 2420e5c31af7Sopenharmony_ci.Note 2421e5c31af7Sopenharmony_ci==== 2422e5c31af7Sopenharmony_ciWhen creating a descriptor pool that will contain descriptors for combined 2423e5c31af7Sopenharmony_ciimage samplers of multi-planar formats, an application needs to account for 2424e5c31af7Sopenharmony_cinon-trivial descriptor consumption when choosing the pname:descriptorCount 2425e5c31af7Sopenharmony_civalue, as indicated by 2426e5c31af7Sopenharmony_cislink:VkSamplerYcbcrConversionImageFormatProperties::pname:combinedImageSamplerDescriptorCount. 2427e5c31af7Sopenharmony_ci==== 2428e5c31af7Sopenharmony_ciendif::VK_VULKAN_1_1,VK_KHR_sampler_ycbcr_conversion[] 2429e5c31af7Sopenharmony_ci 2430e5c31af7Sopenharmony_ci.Valid Usage 2431e5c31af7Sopenharmony_ci**** 2432e5c31af7Sopenharmony_ci * [[VUID-VkDescriptorPoolSize-descriptorCount-00302]] 2433e5c31af7Sopenharmony_ci pname:descriptorCount must: be greater than `0` 2434e5c31af7Sopenharmony_ciifdef::VK_EXT_inline_uniform_block[] 2435e5c31af7Sopenharmony_ci * [[VUID-VkDescriptorPoolSize-type-02218]] 2436e5c31af7Sopenharmony_ci If pname:type is ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT then 2437e5c31af7Sopenharmony_ci pname:descriptorCount must: be a multiple of `4` 2438e5c31af7Sopenharmony_ciendif::VK_EXT_inline_uniform_block[] 2439e5c31af7Sopenharmony_ci**** 2440e5c31af7Sopenharmony_ci 2441e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkDescriptorPoolSize.txt[] 2442e5c31af7Sopenharmony_ci-- 2443e5c31af7Sopenharmony_ci 2444e5c31af7Sopenharmony_ci[open,refpage='vkDestroyDescriptorPool',desc='Destroy a descriptor pool object',type='protos'] 2445e5c31af7Sopenharmony_ci-- 2446e5c31af7Sopenharmony_ciTo destroy a descriptor pool, call: 2447e5c31af7Sopenharmony_ci 2448e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkDestroyDescriptorPool.txt[] 2449e5c31af7Sopenharmony_ci 2450e5c31af7Sopenharmony_ci * pname:device is the logical device that destroys the descriptor pool. 2451e5c31af7Sopenharmony_ci * pname:descriptorPool is the descriptor pool to destroy. 2452e5c31af7Sopenharmony_ci * pname:pAllocator controls host memory allocation as described in the 2453e5c31af7Sopenharmony_ci <<memory-allocation, Memory Allocation>> chapter. 2454e5c31af7Sopenharmony_ci 2455e5c31af7Sopenharmony_ciWhen a pool is destroyed, all descriptor sets allocated from the pool are 2456e5c31af7Sopenharmony_ciimplicitly freed and become invalid. 2457e5c31af7Sopenharmony_ciDescriptor sets allocated from a given pool do not need to be freed before 2458e5c31af7Sopenharmony_cidestroying that descriptor pool. 2459e5c31af7Sopenharmony_ci 2460e5c31af7Sopenharmony_ci.Valid Usage 2461e5c31af7Sopenharmony_ci**** 2462e5c31af7Sopenharmony_ci * [[VUID-vkDestroyDescriptorPool-descriptorPool-00303]] 2463e5c31af7Sopenharmony_ci All submitted commands that refer to pname:descriptorPool (via any 2464e5c31af7Sopenharmony_ci allocated descriptor sets) must: have completed execution 2465e5c31af7Sopenharmony_ci * [[VUID-vkDestroyDescriptorPool-descriptorPool-00304]] 2466e5c31af7Sopenharmony_ci If sname:VkAllocationCallbacks were provided when pname:descriptorPool 2467e5c31af7Sopenharmony_ci was created, a compatible set of callbacks must: be provided here 2468e5c31af7Sopenharmony_ci * [[VUID-vkDestroyDescriptorPool-descriptorPool-00305]] 2469e5c31af7Sopenharmony_ci If no sname:VkAllocationCallbacks were provided when 2470e5c31af7Sopenharmony_ci pname:descriptorPool was created, pname:pAllocator must: be `NULL` 2471e5c31af7Sopenharmony_ci**** 2472e5c31af7Sopenharmony_ci 2473e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkDestroyDescriptorPool.txt[] 2474e5c31af7Sopenharmony_ci-- 2475e5c31af7Sopenharmony_ci 2476e5c31af7Sopenharmony_ci[open,refpage='VkDescriptorSet',desc='Opaque handle to a descriptor set object',type='handles'] 2477e5c31af7Sopenharmony_ci-- 2478e5c31af7Sopenharmony_ciDescriptor sets are allocated from descriptor pool objects, and are 2479e5c31af7Sopenharmony_cirepresented by sname:VkDescriptorSet handles: 2480e5c31af7Sopenharmony_ci 2481e5c31af7Sopenharmony_ciinclude::{generated}/api/handles/VkDescriptorSet.txt[] 2482e5c31af7Sopenharmony_ci-- 2483e5c31af7Sopenharmony_ci 2484e5c31af7Sopenharmony_ci[open,refpage='vkAllocateDescriptorSets',desc='Allocate one or more descriptor sets',type='protos'] 2485e5c31af7Sopenharmony_ci-- 2486e5c31af7Sopenharmony_ciTo allocate descriptor sets from a descriptor pool, call: 2487e5c31af7Sopenharmony_ci 2488e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkAllocateDescriptorSets.txt[] 2489e5c31af7Sopenharmony_ci 2490e5c31af7Sopenharmony_ci * pname:device is the logical device that owns the descriptor pool. 2491e5c31af7Sopenharmony_ci * pname:pAllocateInfo is a pointer to a slink:VkDescriptorSetAllocateInfo 2492e5c31af7Sopenharmony_ci structure describing parameters of the allocation. 2493e5c31af7Sopenharmony_ci * pname:pDescriptorSets is a pointer to an array of slink:VkDescriptorSet 2494e5c31af7Sopenharmony_ci handles in which the resulting descriptor set objects are returned. 2495e5c31af7Sopenharmony_ci 2496e5c31af7Sopenharmony_ciThe allocated descriptor sets are returned in pname:pDescriptorSets. 2497e5c31af7Sopenharmony_ci 2498e5c31af7Sopenharmony_ciWhen a descriptor set is allocated, the initial state is largely 2499e5c31af7Sopenharmony_ciuninitialized and all descriptors are undefined:. 2500e5c31af7Sopenharmony_ciDescriptors also become undefined: if the underlying resource is destroyed. 2501e5c31af7Sopenharmony_ciDescriptor sets containing undefined: descriptors can: still be bound and 2502e5c31af7Sopenharmony_ciused, subject to the following conditions: 2503e5c31af7Sopenharmony_ci 2504e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[] 2505e5c31af7Sopenharmony_ci * For descriptor set bindings created with the 2506e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT bit set, all descriptors 2507e5c31af7Sopenharmony_ci in that binding that are dynamically used must: have been populated 2508e5c31af7Sopenharmony_ci before the descriptor set is <<descriptorsets-binding,consumed>>. 2509e5c31af7Sopenharmony_ci * For descriptor set bindings created without the 2510e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT bit set, all descriptors 2511e5c31af7Sopenharmony_ci in that binding that are statically used must: have been populated 2512e5c31af7Sopenharmony_ci before the descriptor set is <<descriptorsets-binding,consumed>>. 2513e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[] 2514e5c31af7Sopenharmony_ciifndef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[] 2515e5c31af7Sopenharmony_ci * Descriptors that are <<shaders-staticuse,statically used>> must: have 2516e5c31af7Sopenharmony_ci been populated before the descriptor set is 2517e5c31af7Sopenharmony_ci <<descriptorsets-binding,consumed>>. 2518e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[] 2519e5c31af7Sopenharmony_ciifdef::VK_EXT_inline_uniform_block[] 2520e5c31af7Sopenharmony_ci * Descriptor bindings with descriptor type of 2521e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT can: be undefined: 2522e5c31af7Sopenharmony_ci when the descriptor set is <<descriptorsets-binding,consumed>>; though 2523e5c31af7Sopenharmony_ci values in that block will be undefined:. 2524e5c31af7Sopenharmony_ciendif::VK_EXT_inline_uniform_block[] 2525e5c31af7Sopenharmony_ci * Entries that are not used by a pipeline can: have undefined: 2526e5c31af7Sopenharmony_ci descriptors. 2527e5c31af7Sopenharmony_ci 2528e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_maintenance1[] 2529e5c31af7Sopenharmony_ciIf a call to fname:vkAllocateDescriptorSets would cause the total number of 2530e5c31af7Sopenharmony_cidescriptor sets allocated from the pool to exceed the value of 2531e5c31af7Sopenharmony_cislink:VkDescriptorPoolCreateInfo::pname:maxSets used to create 2532e5c31af7Sopenharmony_cipname:pAllocateInfo->descriptorPool, then the allocation may: fail due to 2533e5c31af7Sopenharmony_cilack of space in the descriptor pool. 2534e5c31af7Sopenharmony_ciSimilarly, the allocation may: fail due to lack of space if the call to 2535e5c31af7Sopenharmony_cifname:vkAllocateDescriptorSets would cause the number of any given 2536e5c31af7Sopenharmony_cidescriptor type to exceed the sum of all the pname:descriptorCount members 2537e5c31af7Sopenharmony_ciof each element of slink:VkDescriptorPoolCreateInfo::pname:pPoolSizes with a 2538e5c31af7Sopenharmony_cipname:type equal to that type. 2539e5c31af7Sopenharmony_ci 2540e5c31af7Sopenharmony_ciifdef::VK_EXT_inline_uniform_block[] 2541e5c31af7Sopenharmony_ciAdditionally, the allocation may: also fail if a call to 2542e5c31af7Sopenharmony_cifname:vkAllocateDescriptorSets would cause the total number of inline 2543e5c31af7Sopenharmony_ciuniform block bindings allocated from the pool to exceed the value of 2544e5c31af7Sopenharmony_cislink:VkDescriptorPoolInlineUniformBlockCreateInfoEXT::pname:maxInlineUniformBlockBindings 2545e5c31af7Sopenharmony_ciused to create the descriptor pool. 2546e5c31af7Sopenharmony_ciendif::VK_EXT_inline_uniform_block[] 2547e5c31af7Sopenharmony_ci 2548e5c31af7Sopenharmony_ciIf the allocation fails due to no more space in the descriptor pool, and not 2549e5c31af7Sopenharmony_cibecause of system or device memory exhaustion, then 2550e5c31af7Sopenharmony_ciename:VK_ERROR_OUT_OF_POOL_MEMORY must: be returned. 2551e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_maintenance1[] 2552e5c31af7Sopenharmony_ci 2553e5c31af7Sopenharmony_ciifndef::VK_VERSION_1_1,VK_KHR_maintenance2[] 2554e5c31af7Sopenharmony_ciIf an allocation fails due to fragmentation, an indeterminate error is 2555e5c31af7Sopenharmony_cireturned with an unspecified error code. 2556e5c31af7Sopenharmony_ciAny returned error other than 2557e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_maintenance1[] 2558e5c31af7Sopenharmony_ciename:VK_ERROR_OUT_OF_POOL_MEMORY or 2559e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_maintenance1[] 2560e5c31af7Sopenharmony_ciename:VK_ERROR_FRAGMENTED_POOL does not imply its usual meaning: 2561e5c31af7Sopenharmony_ciapplications should: assume that the allocation failed due to fragmentation, 2562e5c31af7Sopenharmony_ciand create a new descriptor pool. 2563e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_maintenance2[] 2564e5c31af7Sopenharmony_ci 2565e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_maintenance1[] 2566e5c31af7Sopenharmony_cifname:vkAllocateDescriptorSets can: be used to create multiple descriptor 2567e5c31af7Sopenharmony_cisets. 2568e5c31af7Sopenharmony_ciIf the creation of any of those descriptor sets fails, then the 2569e5c31af7Sopenharmony_ciimplementation must: destroy all successfully created descriptor set objects 2570e5c31af7Sopenharmony_cifrom this command, set all entries of the pname:pDescriptorSets array to 2571e5c31af7Sopenharmony_cidlink:VK_NULL_HANDLE and return the error. 2572e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_maintenance1[] 2573e5c31af7Sopenharmony_ci 2574e5c31af7Sopenharmony_ciifndef::VK_VERSION_1_1,VK_KHR_maintenance2[] 2575e5c31af7Sopenharmony_ci[NOTE] 2576e5c31af7Sopenharmony_ci.Note 2577e5c31af7Sopenharmony_ci==== 2578e5c31af7Sopenharmony_ciApplications should: check for a negative return value when allocating new 2579e5c31af7Sopenharmony_cidescriptor sets, assume that any error 2580e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_maintenance1[] 2581e5c31af7Sopenharmony_ciother than ename:VK_ERROR_OUT_OF_POOL_MEMORY 2582e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_maintenance1[] 2583e5c31af7Sopenharmony_cieffectively means ename:VK_ERROR_FRAGMENTED_POOL, and try to create a new 2584e5c31af7Sopenharmony_cidescriptor pool. 2585e5c31af7Sopenharmony_ciIf ename:VK_ERROR_FRAGMENTED_POOL is the actual return value, it adds 2586e5c31af7Sopenharmony_cicertainty to that decision. 2587e5c31af7Sopenharmony_ci 2588e5c31af7Sopenharmony_ciThe reason for this is that ename:VK_ERROR_FRAGMENTED_POOL was only added in 2589e5c31af7Sopenharmony_cia later version of the 1.0 specification, and so drivers may: return other 2590e5c31af7Sopenharmony_cierrors if they were written against earlier versions. 2591e5c31af7Sopenharmony_ciTo ensure full compatibility with earlier patch versions, these other errors 2592e5c31af7Sopenharmony_ciare allowed. 2593e5c31af7Sopenharmony_ci==== 2594e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_maintenance2[] 2595e5c31af7Sopenharmony_ci 2596e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkAllocateDescriptorSets.txt[] 2597e5c31af7Sopenharmony_ci-- 2598e5c31af7Sopenharmony_ci 2599e5c31af7Sopenharmony_ci[open,refpage='VkDescriptorSetAllocateInfo',desc='Structure specifying the allocation parameters for descriptor sets',type='structs'] 2600e5c31af7Sopenharmony_ci-- 2601e5c31af7Sopenharmony_ciThe sname:VkDescriptorSetAllocateInfo structure is defined as: 2602e5c31af7Sopenharmony_ci 2603e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkDescriptorSetAllocateInfo.txt[] 2604e5c31af7Sopenharmony_ci 2605e5c31af7Sopenharmony_ci * pname:sType is the type of this structure. 2606e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 2607e5c31af7Sopenharmony_ci structure. 2608e5c31af7Sopenharmony_ci * pname:descriptorPool is the pool which the sets will be allocated from. 2609e5c31af7Sopenharmony_ci * pname:descriptorSetCount determines the number of descriptor sets to be 2610e5c31af7Sopenharmony_ci allocated from the pool. 2611e5c31af7Sopenharmony_ci * pname:pSetLayouts is a pointer to an array of descriptor set layouts, 2612e5c31af7Sopenharmony_ci with each member specifying how the corresponding descriptor set is 2613e5c31af7Sopenharmony_ci allocated. 2614e5c31af7Sopenharmony_ci 2615e5c31af7Sopenharmony_ci.Valid Usage 2616e5c31af7Sopenharmony_ci**** 2617e5c31af7Sopenharmony_ciifndef::VK_VERSION_1_1,VK_KHR_maintenance1[] 2618e5c31af7Sopenharmony_ci * [[VUID-VkDescriptorSetAllocateInfo-descriptorSetCount-00306]] 2619e5c31af7Sopenharmony_ci pname:descriptorSetCount must: not be greater than the number of sets 2620e5c31af7Sopenharmony_ci that are currently available for allocation in pname:descriptorPool 2621e5c31af7Sopenharmony_ci * [[VUID-VkDescriptorSetAllocateInfo-descriptorPool-00307]] 2622e5c31af7Sopenharmony_ci pname:descriptorPool must: have enough free descriptor capacity 2623e5c31af7Sopenharmony_ci remaining to allocate the descriptor sets of the specified layouts 2624e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_maintenance1[] 2625e5c31af7Sopenharmony_ciifdef::VK_KHR_push_descriptor[] 2626e5c31af7Sopenharmony_ci * [[VUID-VkDescriptorSetAllocateInfo-pSetLayouts-00308]] 2627e5c31af7Sopenharmony_ci Each element of pname:pSetLayouts must: not have been created with 2628e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR set 2629e5c31af7Sopenharmony_ciendif::VK_KHR_push_descriptor[] 2630e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[] 2631e5c31af7Sopenharmony_ci * [[VUID-VkDescriptorSetAllocateInfo-pSetLayouts-03044]] 2632e5c31af7Sopenharmony_ci If any element of pname:pSetLayouts was created with the 2633e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT bit 2634e5c31af7Sopenharmony_ci set, pname:descriptorPool must: have been created with the 2635e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT flag set 2636e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[] 2637e5c31af7Sopenharmony_ciifdef::VK_VALVE_mutable_descriptor_type[] 2638e5c31af7Sopenharmony_ci * [[VUID-VkDescriptorSetAllocateInfo-pSetLayouts-04610]] 2639e5c31af7Sopenharmony_ci If any element of pname:pSetLayouts was created with the 2640e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_HOST_ONLY_POOL_BIT_VALVE bit set, 2641e5c31af7Sopenharmony_ci pname:descriptorPool must: have been created with the 2642e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_POOL_CREATE_HOST_ONLY_BIT_VALVE flag set 2643e5c31af7Sopenharmony_ciendif::VK_VALVE_mutable_descriptor_type[] 2644e5c31af7Sopenharmony_ci**** 2645e5c31af7Sopenharmony_ci 2646e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkDescriptorSetAllocateInfo.txt[] 2647e5c31af7Sopenharmony_ci-- 2648e5c31af7Sopenharmony_ci 2649e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[] 2650e5c31af7Sopenharmony_ci[open,refpage='VkDescriptorSetVariableDescriptorCountAllocateInfo',desc='Structure specifying additional allocation parameters for descriptor sets',type='structs',alias='VkDescriptorSetVariableDescriptorCountAllocateInfoEXT'] 2651e5c31af7Sopenharmony_ci-- 2652e5c31af7Sopenharmony_ciIf the pname:pNext chain of a slink:VkDescriptorSetAllocateInfo structure 2653e5c31af7Sopenharmony_ciincludes a sname:VkDescriptorSetVariableDescriptorCountAllocateInfo 2654e5c31af7Sopenharmony_cistructure, then that structure includes an array of descriptor counts for 2655e5c31af7Sopenharmony_civariable descriptor count bindings, one for each descriptor set being 2656e5c31af7Sopenharmony_ciallocated. 2657e5c31af7Sopenharmony_ci 2658e5c31af7Sopenharmony_ciThe sname:VkDescriptorSetVariableDescriptorCountAllocateInfo structure is 2659e5c31af7Sopenharmony_cidefined as: 2660e5c31af7Sopenharmony_ci 2661e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkDescriptorSetVariableDescriptorCountAllocateInfo.txt[] 2662e5c31af7Sopenharmony_ci 2663e5c31af7Sopenharmony_ciifdef::VK_EXT_descriptor_indexing[] 2664e5c31af7Sopenharmony_cior the equivalent 2665e5c31af7Sopenharmony_ci 2666e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkDescriptorSetVariableDescriptorCountAllocateInfoEXT.txt[] 2667e5c31af7Sopenharmony_ciendif::VK_EXT_descriptor_indexing[] 2668e5c31af7Sopenharmony_ci 2669e5c31af7Sopenharmony_ci * pname:sType is the type of this structure. 2670e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 2671e5c31af7Sopenharmony_ci structure. 2672e5c31af7Sopenharmony_ci * pname:descriptorSetCount is zero or the number of elements in 2673e5c31af7Sopenharmony_ci pname:pDescriptorCounts. 2674e5c31af7Sopenharmony_ci * pname:pDescriptorCounts is a pointer to an array of descriptor counts, 2675e5c31af7Sopenharmony_ci with each member specifying the number of descriptors in a variable 2676e5c31af7Sopenharmony_ci descriptor count binding in the corresponding descriptor set being 2677e5c31af7Sopenharmony_ci allocated. 2678e5c31af7Sopenharmony_ci 2679e5c31af7Sopenharmony_ciIf pname:descriptorSetCount is zero or this structure is not included in the 2680e5c31af7Sopenharmony_cipname:pNext chain, then the variable lengths are considered to be zero. 2681e5c31af7Sopenharmony_ciOtherwise, pname:pDescriptorCounts[i] is the number of descriptors in the 2682e5c31af7Sopenharmony_civariable count descriptor binding in the corresponding descriptor set 2683e5c31af7Sopenharmony_cilayout. 2684e5c31af7Sopenharmony_ciifdef::VK_EXT_inline_uniform_block[] 2685e5c31af7Sopenharmony_ciIf the variable count descriptor binding in the corresponding descriptor set 2686e5c31af7Sopenharmony_cilayout has a descriptor type of 2687e5c31af7Sopenharmony_ciename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT then 2688e5c31af7Sopenharmony_cipname:pDescriptorCounts[i] specifies the binding's capacity in bytes. 2689e5c31af7Sopenharmony_ciendif::VK_EXT_inline_uniform_block[] 2690e5c31af7Sopenharmony_ciIf slink:VkDescriptorSetAllocateInfo::pname:pSetLayouts[i] does not include 2691e5c31af7Sopenharmony_cia variable count descriptor binding, then pname:pDescriptorCounts[i] is 2692e5c31af7Sopenharmony_ciignored. 2693e5c31af7Sopenharmony_ci 2694e5c31af7Sopenharmony_ci.Valid Usage 2695e5c31af7Sopenharmony_ci**** 2696e5c31af7Sopenharmony_ci * [[VUID-VkDescriptorSetVariableDescriptorCountAllocateInfo-descriptorSetCount-03045]] 2697e5c31af7Sopenharmony_ci If pname:descriptorSetCount is not zero, pname:descriptorSetCount must: 2698e5c31af7Sopenharmony_ci equal slink:VkDescriptorSetAllocateInfo::pname:descriptorSetCount 2699e5c31af7Sopenharmony_ci * [[VUID-VkDescriptorSetVariableDescriptorCountAllocateInfo-pSetLayouts-03046]] 2700e5c31af7Sopenharmony_ci If slink:VkDescriptorSetAllocateInfo::pname:pSetLayouts[i] has a 2701e5c31af7Sopenharmony_ci variable descriptor count binding, then pname:pDescriptorCounts[i] must: 2702e5c31af7Sopenharmony_ci be less than or equal to the descriptor count specified for that binding 2703e5c31af7Sopenharmony_ci when the descriptor set layout was created 2704e5c31af7Sopenharmony_ci**** 2705e5c31af7Sopenharmony_ci 2706e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkDescriptorSetVariableDescriptorCountAllocateInfo.txt[] 2707e5c31af7Sopenharmony_ci-- 2708e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[] 2709e5c31af7Sopenharmony_ci 2710e5c31af7Sopenharmony_ci[open,refpage='vkFreeDescriptorSets',desc='Free one or more descriptor sets',type='protos'] 2711e5c31af7Sopenharmony_ci-- 2712e5c31af7Sopenharmony_ciTo free allocated descriptor sets, call: 2713e5c31af7Sopenharmony_ci 2714e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkFreeDescriptorSets.txt[] 2715e5c31af7Sopenharmony_ci 2716e5c31af7Sopenharmony_ci * pname:device is the logical device that owns the descriptor pool. 2717e5c31af7Sopenharmony_ci * pname:descriptorPool is the descriptor pool from which the descriptor 2718e5c31af7Sopenharmony_ci sets were allocated. 2719e5c31af7Sopenharmony_ci * pname:descriptorSetCount is the number of elements in the 2720e5c31af7Sopenharmony_ci pname:pDescriptorSets array. 2721e5c31af7Sopenharmony_ci * pname:pDescriptorSets is a pointer to an array of handles to 2722e5c31af7Sopenharmony_ci slink:VkDescriptorSet objects. 2723e5c31af7Sopenharmony_ci 2724e5c31af7Sopenharmony_ciAfter calling fname:vkFreeDescriptorSets, all descriptor sets in 2725e5c31af7Sopenharmony_cipname:pDescriptorSets are invalid. 2726e5c31af7Sopenharmony_ci 2727e5c31af7Sopenharmony_ci.Valid Usage 2728e5c31af7Sopenharmony_ci**** 2729e5c31af7Sopenharmony_ci * [[VUID-vkFreeDescriptorSets-pDescriptorSets-00309]] 2730e5c31af7Sopenharmony_ci All submitted commands that refer to any element of 2731e5c31af7Sopenharmony_ci pname:pDescriptorSets must: have completed execution 2732e5c31af7Sopenharmony_ci * [[VUID-vkFreeDescriptorSets-pDescriptorSets-00310]] 2733e5c31af7Sopenharmony_ci pname:pDescriptorSets must: be a valid pointer to an array of 2734e5c31af7Sopenharmony_ci pname:descriptorSetCount sname:VkDescriptorSet handles, each element of 2735e5c31af7Sopenharmony_ci which must: either be a valid handle or dlink:VK_NULL_HANDLE 2736e5c31af7Sopenharmony_ci * [[VUID-vkFreeDescriptorSets-descriptorPool-00312]] 2737e5c31af7Sopenharmony_ci pname:descriptorPool must: have been created with the 2738e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT flag 2739e5c31af7Sopenharmony_ci**** 2740e5c31af7Sopenharmony_ci 2741e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkFreeDescriptorSets.txt[] 2742e5c31af7Sopenharmony_ci-- 2743e5c31af7Sopenharmony_ci 2744e5c31af7Sopenharmony_ci[open,refpage='vkResetDescriptorPool',desc='Resets a descriptor pool object',type='protos'] 2745e5c31af7Sopenharmony_ci-- 2746e5c31af7Sopenharmony_ciTo return all descriptor sets allocated from a given pool to the pool, 2747e5c31af7Sopenharmony_cirather than freeing individual descriptor sets, call: 2748e5c31af7Sopenharmony_ci 2749e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkResetDescriptorPool.txt[] 2750e5c31af7Sopenharmony_ci 2751e5c31af7Sopenharmony_ci * pname:device is the logical device that owns the descriptor pool. 2752e5c31af7Sopenharmony_ci * pname:descriptorPool is the descriptor pool to be reset. 2753e5c31af7Sopenharmony_ci * pname:flags is reserved for future use. 2754e5c31af7Sopenharmony_ci 2755e5c31af7Sopenharmony_ciResetting a descriptor pool recycles all of the resources from all of the 2756e5c31af7Sopenharmony_cidescriptor sets allocated from the descriptor pool back to the descriptor 2757e5c31af7Sopenharmony_cipool, and the descriptor sets are implicitly freed. 2758e5c31af7Sopenharmony_ci 2759e5c31af7Sopenharmony_ci.Valid Usage 2760e5c31af7Sopenharmony_ci**** 2761e5c31af7Sopenharmony_ci * [[VUID-vkResetDescriptorPool-descriptorPool-00313]] 2762e5c31af7Sopenharmony_ci All uses of pname:descriptorPool (via any allocated descriptor sets) 2763e5c31af7Sopenharmony_ci must: have completed execution 2764e5c31af7Sopenharmony_ci**** 2765e5c31af7Sopenharmony_ci 2766e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkResetDescriptorPool.txt[] 2767e5c31af7Sopenharmony_ci-- 2768e5c31af7Sopenharmony_ci 2769e5c31af7Sopenharmony_ci[open,refpage='VkDescriptorPoolResetFlags',desc='Reserved for future use',type='flags'] 2770e5c31af7Sopenharmony_ci-- 2771e5c31af7Sopenharmony_ciinclude::{generated}/api/flags/VkDescriptorPoolResetFlags.txt[] 2772e5c31af7Sopenharmony_ci 2773e5c31af7Sopenharmony_citname:VkDescriptorPoolResetFlags is a bitmask type for setting a mask, but 2774e5c31af7Sopenharmony_ciis currently reserved for future use. 2775e5c31af7Sopenharmony_ci-- 2776e5c31af7Sopenharmony_ci 2777e5c31af7Sopenharmony_ci 2778e5c31af7Sopenharmony_ci[[descriptorsets-updates]] 2779e5c31af7Sopenharmony_ci=== Descriptor Set Updates 2780e5c31af7Sopenharmony_ci 2781e5c31af7Sopenharmony_ci[open,refpage='vkUpdateDescriptorSets',desc='Update the contents of a descriptor set object',type='protos'] 2782e5c31af7Sopenharmony_ci-- 2783e5c31af7Sopenharmony_ciOnce allocated, descriptor sets can: be updated with a combination of write 2784e5c31af7Sopenharmony_ciand copy operations. 2785e5c31af7Sopenharmony_ciTo update descriptor sets, call: 2786e5c31af7Sopenharmony_ci 2787e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkUpdateDescriptorSets.txt[] 2788e5c31af7Sopenharmony_ci 2789e5c31af7Sopenharmony_ci * pname:device is the logical device that updates the descriptor sets. 2790e5c31af7Sopenharmony_ci * pname:descriptorWriteCount is the number of elements in the 2791e5c31af7Sopenharmony_ci pname:pDescriptorWrites array. 2792e5c31af7Sopenharmony_ci * pname:pDescriptorWrites is a pointer to an array of 2793e5c31af7Sopenharmony_ci slink:VkWriteDescriptorSet structures describing the descriptor sets to 2794e5c31af7Sopenharmony_ci write to. 2795e5c31af7Sopenharmony_ci * pname:descriptorCopyCount is the number of elements in the 2796e5c31af7Sopenharmony_ci pname:pDescriptorCopies array. 2797e5c31af7Sopenharmony_ci * pname:pDescriptorCopies is a pointer to an array of 2798e5c31af7Sopenharmony_ci slink:VkCopyDescriptorSet structures describing the descriptor sets to 2799e5c31af7Sopenharmony_ci copy between. 2800e5c31af7Sopenharmony_ci 2801e5c31af7Sopenharmony_ciThe operations described by pname:pDescriptorWrites are performed first, 2802e5c31af7Sopenharmony_cifollowed by the operations described by pname:pDescriptorCopies. 2803e5c31af7Sopenharmony_ciWithin each array, the operations are performed in the order they appear in 2804e5c31af7Sopenharmony_cithe array. 2805e5c31af7Sopenharmony_ci 2806e5c31af7Sopenharmony_ciEach element in the pname:pDescriptorWrites array describes an operation 2807e5c31af7Sopenharmony_ciupdating the descriptor set using descriptors for resources specified in the 2808e5c31af7Sopenharmony_cistructure. 2809e5c31af7Sopenharmony_ci 2810e5c31af7Sopenharmony_ciEach element in the pname:pDescriptorCopies array is a 2811e5c31af7Sopenharmony_cislink:VkCopyDescriptorSet structure describing an operation copying 2812e5c31af7Sopenharmony_cidescriptors between sets. 2813e5c31af7Sopenharmony_ci 2814e5c31af7Sopenharmony_ciIf the pname:dstSet member of any element of pname:pDescriptorWrites or 2815e5c31af7Sopenharmony_cipname:pDescriptorCopies is bound, accessed, or modified by any command that 2816e5c31af7Sopenharmony_ciwas recorded to a command buffer which is currently in the 2817e5c31af7Sopenharmony_ci<<commandbuffers-lifecycle, recording or executable state>>, 2818e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[] 2819e5c31af7Sopenharmony_ciand any of the descriptor bindings that are updated were not created with 2820e5c31af7Sopenharmony_cithe ename:VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT or 2821e5c31af7Sopenharmony_ciename:VK_DESCRIPTOR_BINDING_UPDATE_UNUSED_WHILE_PENDING_BIT bits set, 2822e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[] 2823e5c31af7Sopenharmony_cithat command buffer becomes <<commandbuffers-lifecycle, invalid>>. 2824e5c31af7Sopenharmony_ci 2825e5c31af7Sopenharmony_ci.Valid Usage 2826e5c31af7Sopenharmony_ci**** 2827e5c31af7Sopenharmony_ci * [[VUID-vkUpdateDescriptorSets-pDescriptorWrites-06236]] 2828e5c31af7Sopenharmony_ci For each element [eq]#i# where 2829e5c31af7Sopenharmony_ci pname:pDescriptorWrites[i].pname:descriptorType is 2830e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER or 2831e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER, elements of the 2832e5c31af7Sopenharmony_ci pname:pTexelBufferView member of pname:pDescriptorWrites[i] must: have 2833e5c31af7Sopenharmony_ci been created on pname:device 2834e5c31af7Sopenharmony_ci * [[VUID-vkUpdateDescriptorSets-pDescriptorWrites-06237]] 2835e5c31af7Sopenharmony_ci For each element [eq]#i# where 2836e5c31af7Sopenharmony_ci pname:pDescriptorWrites[i].pname:descriptorType is 2837e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, 2838e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, 2839e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, or 2840e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC, the pname:buffer member 2841e5c31af7Sopenharmony_ci of any element of the pname:pBufferInfo member of 2842e5c31af7Sopenharmony_ci pname:pDescriptorWrites[i] must: have been created on pname:device 2843e5c31af7Sopenharmony_ci * [[VUID-vkUpdateDescriptorSets-pDescriptorWrites-06238]] 2844e5c31af7Sopenharmony_ci For each element [eq]#i# where 2845e5c31af7Sopenharmony_ci pname:pDescriptorWrites[i].pname:descriptorType is 2846e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_SAMPLER or 2847e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, and pname:dstSet was 2848e5c31af7Sopenharmony_ci not allocated with a layout that included immutable samplers for 2849e5c31af7Sopenharmony_ci pname:dstBinding with pname:descriptorType, the pname:sampler member of 2850e5c31af7Sopenharmony_ci any element of the pname:pImageInfo member of pname:pDescriptorWrites[i] 2851e5c31af7Sopenharmony_ci must: have been created on pname:device 2852e5c31af7Sopenharmony_ci * [[VUID-vkUpdateDescriptorSets-pDescriptorWrites-06239]] 2853e5c31af7Sopenharmony_ci For each element [eq]#i# where 2854e5c31af7Sopenharmony_ci pname:pDescriptorWrites[i].pname:descriptorType is 2855e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, 2856e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, 2857e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT, or 2858e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER the pname:imageView 2859e5c31af7Sopenharmony_ci member of any element of pname:pDescriptorWrites[i] must: have been 2860e5c31af7Sopenharmony_ci created on pname:device 2861e5c31af7Sopenharmony_ciifdef::VK_KHR_acceleration_structure[] 2862e5c31af7Sopenharmony_ci * [[VUID-vkUpdateDescriptorSets-pDescriptorWrites-06240]] 2863e5c31af7Sopenharmony_ci For each element [eq]#i# where 2864e5c31af7Sopenharmony_ci pname:pDescriptorWrites[i].pname:descriptorType is 2865e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_KHR, elements of the 2866e5c31af7Sopenharmony_ci pname:pAccelerationStructures member of a 2867e5c31af7Sopenharmony_ci slink:VkWriteDescriptorSetAccelerationStructureKHR structure in the 2868e5c31af7Sopenharmony_ci pname:pNext chain of pname:pDescriptorWrites[i] must: have been created 2869e5c31af7Sopenharmony_ci on pname:device 2870e5c31af7Sopenharmony_ciendif::VK_KHR_acceleration_structure[] 2871e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing[] 2872e5c31af7Sopenharmony_ci * [[VUID-vkUpdateDescriptorSets-pDescriptorWrites-06241]] 2873e5c31af7Sopenharmony_ci For each element [eq]#i# where 2874e5c31af7Sopenharmony_ci pname:pDescriptorWrites[i].pname:descriptorType is 2875e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_NV, elements of the 2876e5c31af7Sopenharmony_ci pname:pAccelerationStructures member of a 2877e5c31af7Sopenharmony_ci slink:VkWriteDescriptorSetAccelerationStructureNV structure in the 2878e5c31af7Sopenharmony_ci pname:pNext chain of pname:pDescriptorWrites[i] must: have been created 2879e5c31af7Sopenharmony_ci on pname:device 2880e5c31af7Sopenharmony_ciendif::VK_NV_ray_tracing[] 2881e5c31af7Sopenharmony_ciifndef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[] 2882e5c31af7Sopenharmony_ci * [[VUID-vkUpdateDescriptorSets-dstSet-00314]] 2883e5c31af7Sopenharmony_ci The pname:dstSet member of each element of pname:pDescriptorWrites or 2884e5c31af7Sopenharmony_ci pname:pDescriptorCopies must: not be used by any command that was 2885e5c31af7Sopenharmony_ci recorded to a command buffer which is in the <<commandbuffers-lifecycle, 2886e5c31af7Sopenharmony_ci pending state>> 2887e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[] 2888e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[] 2889e5c31af7Sopenharmony_ci * [[VUID-vkUpdateDescriptorSets-None-03047]] 2890e5c31af7Sopenharmony_ci Descriptor bindings updated by this command which were created without 2891e5c31af7Sopenharmony_ci the ename:VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT or 2892e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_BINDING_UPDATE_UNUSED_WHILE_PENDING_BIT bits set 2893e5c31af7Sopenharmony_ci must: not be used by any command that was recorded to a command buffer 2894e5c31af7Sopenharmony_ci which is in the <<commandbuffers-lifecycle,pending state>> 2895e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[] 2896e5c31af7Sopenharmony_ci**** 2897e5c31af7Sopenharmony_ci 2898e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkUpdateDescriptorSets.txt[] 2899e5c31af7Sopenharmony_ci-- 2900e5c31af7Sopenharmony_ci 2901e5c31af7Sopenharmony_ci[open,refpage='VkWriteDescriptorSet',desc='Structure specifying the parameters of a descriptor set write operation',type='structs'] 2902e5c31af7Sopenharmony_ci-- 2903e5c31af7Sopenharmony_ciThe sname:VkWriteDescriptorSet structure is defined as: 2904e5c31af7Sopenharmony_ci 2905e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkWriteDescriptorSet.txt[] 2906e5c31af7Sopenharmony_ci 2907e5c31af7Sopenharmony_ci * pname:sType is the type of this structure. 2908e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 2909e5c31af7Sopenharmony_ci structure. 2910e5c31af7Sopenharmony_ci * pname:dstSet is the destination descriptor set to update. 2911e5c31af7Sopenharmony_ci * pname:dstBinding is the descriptor binding within that set. 2912e5c31af7Sopenharmony_ci * pname:dstArrayElement is the starting element in that array. 2913e5c31af7Sopenharmony_ciifdef::VK_EXT_inline_uniform_block[] 2914e5c31af7Sopenharmony_ci If the descriptor binding identified by pname:dstSet and 2915e5c31af7Sopenharmony_ci pname:dstBinding has a descriptor type of 2916e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT then 2917e5c31af7Sopenharmony_ci pname:dstArrayElement specifies the starting byte offset within the 2918e5c31af7Sopenharmony_ci binding. 2919e5c31af7Sopenharmony_ciendif::VK_EXT_inline_uniform_block[] 2920e5c31af7Sopenharmony_ci * pname:descriptorCount is the number of descriptors to update. 2921e5c31af7Sopenharmony_ciifdef::VK_EXT_inline_uniform_block[] 2922e5c31af7Sopenharmony_ci If the descriptor binding identified by pname:dstSet and 2923e5c31af7Sopenharmony_ci pname:dstBinding has a descriptor type of 2924e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT, then 2925e5c31af7Sopenharmony_ci pname:descriptorCount specifies the number of bytes to update. 2926e5c31af7Sopenharmony_ci Otherwise, 2927e5c31af7Sopenharmony_ciendif::VK_EXT_inline_uniform_block[] 2928e5c31af7Sopenharmony_ci pname:descriptorCount is one of 2929e5c31af7Sopenharmony_ci ** the number of elements in pname:pImageInfo 2930e5c31af7Sopenharmony_ci ** the number of elements in pname:pBufferInfo 2931e5c31af7Sopenharmony_ci ** the number of elements in pname:pTexelBufferView 2932e5c31af7Sopenharmony_ciifdef::VK_EXT_inline_uniform_block[] 2933e5c31af7Sopenharmony_ci ** a value matching the pname:dataSize member of a 2934e5c31af7Sopenharmony_ci slink:VkWriteDescriptorSetInlineUniformBlockEXT structure in the 2935e5c31af7Sopenharmony_ci pname:pNext chain 2936e5c31af7Sopenharmony_ciendif::VK_EXT_inline_uniform_block[] 2937e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing,VK_KHR_acceleration_structure[] 2938e5c31af7Sopenharmony_ci ** a value matching the pname:accelerationStructureCount of a 2939e5c31af7Sopenharmony_ci slink:VkWriteDescriptorSetAccelerationStructureKHR structure in the 2940e5c31af7Sopenharmony_ci pname:pNext chain 2941e5c31af7Sopenharmony_ciendif::VK_NV_ray_tracing,VK_KHR_acceleration_structure[] 2942e5c31af7Sopenharmony_ci * pname:descriptorType is a elink:VkDescriptorType specifying the type of 2943e5c31af7Sopenharmony_ci each descriptor in pname:pImageInfo, pname:pBufferInfo, or 2944e5c31af7Sopenharmony_ci pname:pTexelBufferView, as described below. 2945e5c31af7Sopenharmony_ciifdef::VK_VALVE_mutable_descriptor_type[] 2946e5c31af7Sopenharmony_ci If sname:VkDescriptorSetLayoutBinding for pname:dstSet at 2947e5c31af7Sopenharmony_ci pname:dstBinding is not equal to ename:VK_DESCRIPTOR_TYPE_MUTABLE_VALVE, 2948e5c31af7Sopenharmony_ci pname:descriptorType must: 2949e5c31af7Sopenharmony_ciendif::VK_VALVE_mutable_descriptor_type[] 2950e5c31af7Sopenharmony_ciifndef::VK_VALVE_mutable_descriptor_type[] 2951e5c31af7Sopenharmony_ci It must: 2952e5c31af7Sopenharmony_ciendif::VK_VALVE_mutable_descriptor_type[] 2953e5c31af7Sopenharmony_ci be the same type as the pname:descriptorType specified in 2954e5c31af7Sopenharmony_ci sname:VkDescriptorSetLayoutBinding for pname:dstSet at pname:dstBinding. 2955e5c31af7Sopenharmony_ci The type of the descriptor also controls which array the descriptors are 2956e5c31af7Sopenharmony_ci taken from. 2957e5c31af7Sopenharmony_ci * pname:pImageInfo is a pointer to an array of slink:VkDescriptorImageInfo 2958e5c31af7Sopenharmony_ci structures or is ignored, as described below. 2959e5c31af7Sopenharmony_ci * pname:pBufferInfo is a pointer to an array of 2960e5c31af7Sopenharmony_ci slink:VkDescriptorBufferInfo structures or is ignored, as described 2961e5c31af7Sopenharmony_ci below. 2962e5c31af7Sopenharmony_ci * pname:pTexelBufferView is a pointer to an array of slink:VkBufferView 2963e5c31af7Sopenharmony_ci handles as described in the <<resources-buffer-views,Buffer Views>> 2964e5c31af7Sopenharmony_ci section or is ignored, as described below. 2965e5c31af7Sopenharmony_ci 2966e5c31af7Sopenharmony_ciOnly one of pname:pImageInfo, pname:pBufferInfo, or pname:pTexelBufferView 2967e5c31af7Sopenharmony_cimembers is used according to the descriptor type specified in the 2968e5c31af7Sopenharmony_cipname:descriptorType member of the containing sname:VkWriteDescriptorSet 2969e5c31af7Sopenharmony_cistructure, 2970e5c31af7Sopenharmony_ciifdef::VK_EXT_inline_uniform_block[] 2971e5c31af7Sopenharmony_cior none of them in case pname:descriptorType is 2972e5c31af7Sopenharmony_ciename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT, in which case the source 2973e5c31af7Sopenharmony_cidata for the descriptor writes is taken from the 2974e5c31af7Sopenharmony_cislink:VkWriteDescriptorSetInlineUniformBlockEXT structure included in the 2975e5c31af7Sopenharmony_cipname:pNext chain of sname:VkWriteDescriptorSet, 2976e5c31af7Sopenharmony_ciendif::VK_EXT_inline_uniform_block[] 2977e5c31af7Sopenharmony_ciifdef::VK_KHR_acceleration_structure[] 2978e5c31af7Sopenharmony_cior if pname:descriptorType is 2979e5c31af7Sopenharmony_ciename:VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_KHR, in which case the 2980e5c31af7Sopenharmony_cisource data for the descriptor writes is taken from the 2981e5c31af7Sopenharmony_cislink:VkWriteDescriptorSetAccelerationStructureKHR structure in the 2982e5c31af7Sopenharmony_cipname:pNext chain of sname:VkWriteDescriptorSet, 2983e5c31af7Sopenharmony_ciendif::VK_KHR_acceleration_structure[] 2984e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing[] 2985e5c31af7Sopenharmony_cior if pname:descriptorType is 2986e5c31af7Sopenharmony_ciename:VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_NV, in which case the source 2987e5c31af7Sopenharmony_cidata for the descriptor writes is taken from the 2988e5c31af7Sopenharmony_cislink:VkWriteDescriptorSetAccelerationStructureNV structure in the 2989e5c31af7Sopenharmony_cipname:pNext chain of sname:VkWriteDescriptorSet, 2990e5c31af7Sopenharmony_ciendif::VK_NV_ray_tracing[] 2991e5c31af7Sopenharmony_cias specified below. 2992e5c31af7Sopenharmony_ci 2993e5c31af7Sopenharmony_ciifdef::VK_EXT_robustness2[] 2994e5c31af7Sopenharmony_ciIf the <<features-nullDescriptor,nullDescriptor>> feature is enabled, the 2995e5c31af7Sopenharmony_cibuffer, 2996e5c31af7Sopenharmony_ciifdef::VK_KHR_acceleration_structure[] 2997e5c31af7Sopenharmony_ciacceleration structure, 2998e5c31af7Sopenharmony_ciendif::VK_KHR_acceleration_structure[] 2999e5c31af7Sopenharmony_ciimageView, or bufferView can: be dlink:VK_NULL_HANDLE. 3000e5c31af7Sopenharmony_ciLoads from a null descriptor return zero values and stores and atomics to a 3001e5c31af7Sopenharmony_cinull descriptor are discarded. 3002e5c31af7Sopenharmony_ciifdef::VK_KHR_acceleration_structure[] 3003e5c31af7Sopenharmony_ciA null acceleration structure descriptor results in the miss shader being 3004e5c31af7Sopenharmony_ciinvoked. 3005e5c31af7Sopenharmony_ciendif::VK_KHR_acceleration_structure[] 3006e5c31af7Sopenharmony_ciendif::VK_EXT_robustness2[] 3007e5c31af7Sopenharmony_ci 3008e5c31af7Sopenharmony_ciifdef::VK_VALVE_mutable_descriptor_type[] 3009e5c31af7Sopenharmony_ciIf the destination descriptor is a mutable descriptor, the active descriptor 3010e5c31af7Sopenharmony_citype for the destination descriptor becomes pname:descriptorType. 3011e5c31af7Sopenharmony_ciendif::VK_VALVE_mutable_descriptor_type[] 3012e5c31af7Sopenharmony_ci 3013e5c31af7Sopenharmony_ci[[descriptorsets-updates-consecutive, consecutive binding updates]] 3014e5c31af7Sopenharmony_ciIf the pname:dstBinding has fewer than pname:descriptorCount array elements 3015e5c31af7Sopenharmony_ciremaining starting from pname:dstArrayElement, then the remainder will be 3016e5c31af7Sopenharmony_ciused to update the subsequent binding - [eq]#pname:dstBinding+1# starting at 3017e5c31af7Sopenharmony_ciarray element zero. 3018e5c31af7Sopenharmony_ciIf a binding has a pname:descriptorCount of zero, it is skipped. 3019e5c31af7Sopenharmony_ciThis behavior applies recursively, with the update affecting consecutive 3020e5c31af7Sopenharmony_cibindings as needed to update all pname:descriptorCount descriptors. 3021e5c31af7Sopenharmony_ciConsecutive bindings must: have identical elink:VkDescriptorType, 3022e5c31af7Sopenharmony_citlink:VkShaderStageFlags, 3023e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[] 3024e5c31af7Sopenharmony_cielink:VkDescriptorBindingFlagBits, 3025e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[] 3026e5c31af7Sopenharmony_ciand immutable samplers references. 3027e5c31af7Sopenharmony_ci 3028e5c31af7Sopenharmony_ciifdef::VK_EXT_inline_uniform_block[] 3029e5c31af7Sopenharmony_ci[NOTE] 3030e5c31af7Sopenharmony_ci.Note 3031e5c31af7Sopenharmony_ci==== 3032e5c31af7Sopenharmony_ciThe same behavior applies to bindings with a descriptor type of 3033e5c31af7Sopenharmony_ciename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT where 3034e5c31af7Sopenharmony_cipname:descriptorCount specifies the number of bytes to update while 3035e5c31af7Sopenharmony_cipname:dstArrayElement specifies the starting byte offset, thus in this case 3036e5c31af7Sopenharmony_ciif the pname:dstBinding has a smaller byte size than the sum of 3037e5c31af7Sopenharmony_cipname:dstArrayElement and pname:descriptorCount, then the remainder will be 3038e5c31af7Sopenharmony_ciused to update the subsequent binding - [eq]#pname:dstBinding+1# starting at 3039e5c31af7Sopenharmony_cioffset zero. 3040e5c31af7Sopenharmony_ciThis falls out as a special case of the above rule. 3041e5c31af7Sopenharmony_ci==== 3042e5c31af7Sopenharmony_ciendif::VK_EXT_inline_uniform_block[] 3043e5c31af7Sopenharmony_ci 3044e5c31af7Sopenharmony_ci.Valid Usage 3045e5c31af7Sopenharmony_ci**** 3046e5c31af7Sopenharmony_ci * [[VUID-VkWriteDescriptorSet-dstBinding-00315]] 3047e5c31af7Sopenharmony_ci pname:dstBinding must: be less than or equal to the maximum value of 3048e5c31af7Sopenharmony_ci pname:binding of all slink:VkDescriptorSetLayoutBinding structures 3049e5c31af7Sopenharmony_ci specified when pname:dstSet's descriptor set layout was created 3050e5c31af7Sopenharmony_ci * [[VUID-VkWriteDescriptorSet-dstBinding-00316]] 3051e5c31af7Sopenharmony_ci pname:dstBinding must: be a binding with a non-zero 3052e5c31af7Sopenharmony_ci pname:descriptorCount 3053e5c31af7Sopenharmony_ci * [[VUID-VkWriteDescriptorSet-descriptorCount-00317]] 3054e5c31af7Sopenharmony_ci All consecutive bindings updated via a single sname:VkWriteDescriptorSet 3055e5c31af7Sopenharmony_ci structure, except those with a pname:descriptorCount of zero, must: have 3056e5c31af7Sopenharmony_ci identical pname:descriptorType and pname:stageFlags 3057e5c31af7Sopenharmony_ci * [[VUID-VkWriteDescriptorSet-descriptorCount-00318]] 3058e5c31af7Sopenharmony_ci All consecutive bindings updated via a single sname:VkWriteDescriptorSet 3059e5c31af7Sopenharmony_ci structure, except those with a pname:descriptorCount of zero, must: all 3060e5c31af7Sopenharmony_ci either use immutable samplers or must: all not use immutable samplers 3061e5c31af7Sopenharmony_ci * [[VUID-VkWriteDescriptorSet-descriptorType-00319]] 3062e5c31af7Sopenharmony_ci pname:descriptorType must: match the type of pname:dstBinding within 3063e5c31af7Sopenharmony_ci pname:dstSet 3064e5c31af7Sopenharmony_ci * [[VUID-VkWriteDescriptorSet-dstSet-00320]] 3065e5c31af7Sopenharmony_ci pname:dstSet must: be a valid slink:VkDescriptorSet handle 3066e5c31af7Sopenharmony_ci * [[VUID-VkWriteDescriptorSet-dstArrayElement-00321]] 3067e5c31af7Sopenharmony_ci The sum of pname:dstArrayElement and pname:descriptorCount must: be less 3068e5c31af7Sopenharmony_ci than or equal to the number of array elements in the descriptor set 3069e5c31af7Sopenharmony_ci binding specified by pname:dstBinding, and all applicable consecutive 3070e5c31af7Sopenharmony_ci bindings, as described by <<descriptorsets-updates-consecutive>> 3071e5c31af7Sopenharmony_ciifdef::VK_EXT_inline_uniform_block[] 3072e5c31af7Sopenharmony_ci * [[VUID-VkWriteDescriptorSet-descriptorType-02219]] 3073e5c31af7Sopenharmony_ci If pname:descriptorType is 3074e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT, pname:dstArrayElement 3075e5c31af7Sopenharmony_ci must: be an integer multiple of `4` 3076e5c31af7Sopenharmony_ci * [[VUID-VkWriteDescriptorSet-descriptorType-02220]] 3077e5c31af7Sopenharmony_ci If pname:descriptorType is 3078e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT, pname:descriptorCount 3079e5c31af7Sopenharmony_ci must: be an integer multiple of `4` 3080e5c31af7Sopenharmony_ciendif::VK_EXT_inline_uniform_block[] 3081e5c31af7Sopenharmony_ci * [[VUID-VkWriteDescriptorSet-descriptorType-00322]] 3082e5c31af7Sopenharmony_ci If pname:descriptorType is ename:VK_DESCRIPTOR_TYPE_SAMPLER, 3083e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, 3084e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, 3085e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, or 3086e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT, pname:pImageInfo must: be a 3087e5c31af7Sopenharmony_ci valid pointer to an array of pname:descriptorCount valid 3088e5c31af7Sopenharmony_ci sname:VkDescriptorImageInfo structures 3089e5c31af7Sopenharmony_ci * [[VUID-VkWriteDescriptorSet-descriptorType-02994]] 3090e5c31af7Sopenharmony_ci If pname:descriptorType is ename:VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER 3091e5c31af7Sopenharmony_ci or ename:VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER, each element of 3092e5c31af7Sopenharmony_ci pname:pTexelBufferView must: be either a valid sname:VkBufferView handle 3093e5c31af7Sopenharmony_ci or dlink:VK_NULL_HANDLE 3094e5c31af7Sopenharmony_ci * [[VUID-VkWriteDescriptorSet-descriptorType-02995]] 3095e5c31af7Sopenharmony_ci If pname:descriptorType is ename:VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER 3096e5c31af7Sopenharmony_ci or ename:VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER and the 3097e5c31af7Sopenharmony_ci <<features-nullDescriptor,nullDescriptor>> feature is not enabled, each 3098e5c31af7Sopenharmony_ci element of pname:pTexelBufferView must: not be dlink:VK_NULL_HANDLE 3099e5c31af7Sopenharmony_ci * [[VUID-VkWriteDescriptorSet-descriptorType-00324]] 3100e5c31af7Sopenharmony_ci If pname:descriptorType is ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, 3101e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, 3102e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, or 3103e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC, pname:pBufferInfo must: 3104e5c31af7Sopenharmony_ci be a valid pointer to an array of pname:descriptorCount valid 3105e5c31af7Sopenharmony_ci sname:VkDescriptorBufferInfo structures 3106e5c31af7Sopenharmony_ci * [[VUID-VkWriteDescriptorSet-descriptorType-00325]] 3107e5c31af7Sopenharmony_ci If pname:descriptorType is ename:VK_DESCRIPTOR_TYPE_SAMPLER or 3108e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, and pname:dstSet was 3109e5c31af7Sopenharmony_ci not allocated with a layout that included immutable samplers for 3110e5c31af7Sopenharmony_ci pname:dstBinding with pname:descriptorType, the pname:sampler member of 3111e5c31af7Sopenharmony_ci each element of pname:pImageInfo must: be a valid sname:VkSampler object 3112e5c31af7Sopenharmony_ci * [[VUID-VkWriteDescriptorSet-descriptorType-02996]] 3113e5c31af7Sopenharmony_ci If pname:descriptorType is 3114e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, 3115e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, 3116e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, or 3117e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT, the pname:imageView member of 3118e5c31af7Sopenharmony_ci each element of pname:pImageInfo must: be either a valid 3119e5c31af7Sopenharmony_ci sname:VkImageView handle or dlink:VK_NULL_HANDLE 3120e5c31af7Sopenharmony_ci * [[VUID-VkWriteDescriptorSet-descriptorType-02997]] 3121e5c31af7Sopenharmony_ci If pname:descriptorType is 3122e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, 3123e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, 3124e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, or 3125e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT and the 3126e5c31af7Sopenharmony_ci <<features-nullDescriptor,nullDescriptor>> feature is not enabled, the 3127e5c31af7Sopenharmony_ci pname:imageView member of each element of pname:pImageInfo must: not be 3128e5c31af7Sopenharmony_ci dlink:VK_NULL_HANDLE 3129e5c31af7Sopenharmony_ciifdef::VK_EXT_inline_uniform_block[] 3130e5c31af7Sopenharmony_ci * [[VUID-VkWriteDescriptorSet-descriptorType-02221]] 3131e5c31af7Sopenharmony_ci If pname:descriptorType is 3132e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT, the pname:pNext chain 3133e5c31af7Sopenharmony_ci must: include a slink:VkWriteDescriptorSetInlineUniformBlockEXT 3134e5c31af7Sopenharmony_ci structure whose pname:dataSize member equals pname:descriptorCount 3135e5c31af7Sopenharmony_ciendif::VK_EXT_inline_uniform_block[] 3136e5c31af7Sopenharmony_ciifdef::VK_KHR_acceleration_structure[] 3137e5c31af7Sopenharmony_ci * [[VUID-VkWriteDescriptorSet-descriptorType-02382]] 3138e5c31af7Sopenharmony_ci If pname:descriptorType is 3139e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_KHR, the pname:pNext 3140e5c31af7Sopenharmony_ci chain must: include a slink:VkWriteDescriptorSetAccelerationStructureKHR 3141e5c31af7Sopenharmony_ci structure whose pname:accelerationStructureCount member equals 3142e5c31af7Sopenharmony_ci pname:descriptorCount 3143e5c31af7Sopenharmony_ciendif::VK_KHR_acceleration_structure[] 3144e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing[] 3145e5c31af7Sopenharmony_ci * [[VUID-VkWriteDescriptorSet-descriptorType-03817]] 3146e5c31af7Sopenharmony_ci If pname:descriptorType is 3147e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_NV, the pname:pNext 3148e5c31af7Sopenharmony_ci chain must: include a slink:VkWriteDescriptorSetAccelerationStructureNV 3149e5c31af7Sopenharmony_ci structure whose pname:accelerationStructureCount member equals 3150e5c31af7Sopenharmony_ci pname:descriptorCount 3151e5c31af7Sopenharmony_ciendif::VK_NV_ray_tracing[] 3152e5c31af7Sopenharmony_ciifdef::VK_VULKAN_1_1,VK_KHR_sampler_ycbcr_conversion[] 3153e5c31af7Sopenharmony_ci * [[VUID-VkWriteDescriptorSet-descriptorType-01946]] 3154e5c31af7Sopenharmony_ci If pname:descriptorType is ename:VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, then 3155e5c31af7Sopenharmony_ci the pname:imageView member of each pname:pImageInfo element must: have 3156e5c31af7Sopenharmony_ci been created without a sname:VkSamplerYcbcrConversionInfo structure in 3157e5c31af7Sopenharmony_ci its pname:pNext chain 3158e5c31af7Sopenharmony_ci * [[VUID-VkWriteDescriptorSet-descriptorType-02738]] 3159e5c31af7Sopenharmony_ci If pname:descriptorType is 3160e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, and if any element of 3161e5c31af7Sopenharmony_ci pname:pImageInfo has a pname:imageView member that was created with a 3162e5c31af7Sopenharmony_ci sname:VkSamplerYcbcrConversionInfo structure in its pname:pNext chain, 3163e5c31af7Sopenharmony_ci then pname:dstSet must: have been allocated with a layout that included 3164e5c31af7Sopenharmony_ci immutable samplers for pname:dstBinding, and the corresponding immutable 3165e5c31af7Sopenharmony_ci sampler must: have been created with an _identically defined_ 3166e5c31af7Sopenharmony_ci sname:VkSamplerYcbcrConversionInfo object 3167e5c31af7Sopenharmony_ci * [[VUID-VkWriteDescriptorSet-descriptorType-01948]] 3168e5c31af7Sopenharmony_ci If pname:descriptorType is 3169e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, and pname:dstSet was 3170e5c31af7Sopenharmony_ci allocated with a layout that included immutable samplers for 3171e5c31af7Sopenharmony_ci pname:dstBinding, then the pname:imageView member of each element of 3172e5c31af7Sopenharmony_ci pname:pImageInfo which corresponds to an immutable sampler that enables 3173e5c31af7Sopenharmony_ci <<samplers-YCbCr-conversion,sampler {YCbCr} conversion>> must: have been 3174e5c31af7Sopenharmony_ci created with a sname:VkSamplerYcbcrConversionInfo structure in its 3175e5c31af7Sopenharmony_ci pname:pNext chain with an _identically defined_ 3176e5c31af7Sopenharmony_ci sname:VkSamplerYcbcrConversionInfo to the corresponding immutable 3177e5c31af7Sopenharmony_ci sampler 3178e5c31af7Sopenharmony_ciendif::VK_VULKAN_1_1,VK_KHR_sampler_ycbcr_conversion[] 3179e5c31af7Sopenharmony_ci * [[VUID-VkWriteDescriptorSet-descriptorType-00327]] 3180e5c31af7Sopenharmony_ci If pname:descriptorType is ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER or 3181e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, the pname:offset member 3182e5c31af7Sopenharmony_ci of each element of pname:pBufferInfo must: be a multiple of 3183e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceLimits::pname:minUniformBufferOffsetAlignment 3184e5c31af7Sopenharmony_ci * [[VUID-VkWriteDescriptorSet-descriptorType-00328]] 3185e5c31af7Sopenharmony_ci If pname:descriptorType is ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER or 3186e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC, the pname:offset member 3187e5c31af7Sopenharmony_ci of each element of pname:pBufferInfo must: be a multiple of 3188e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceLimits::pname:minStorageBufferOffsetAlignment 3189e5c31af7Sopenharmony_ci * [[VUID-VkWriteDescriptorSet-descriptorType-00329]] 3190e5c31af7Sopenharmony_ci If pname:descriptorType is ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, 3191e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, 3192e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, or 3193e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC, and the pname:buffer 3194e5c31af7Sopenharmony_ci member of any element of pname:pBufferInfo is the handle of a non-sparse 3195e5c31af7Sopenharmony_ci buffer, then that buffer must: be bound completely and contiguously to a 3196e5c31af7Sopenharmony_ci single sname:VkDeviceMemory object 3197e5c31af7Sopenharmony_ci * [[VUID-VkWriteDescriptorSet-descriptorType-00330]] 3198e5c31af7Sopenharmony_ci If pname:descriptorType is ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER or 3199e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, the pname:buffer member 3200e5c31af7Sopenharmony_ci of each element of pname:pBufferInfo must: have been created with 3201e5c31af7Sopenharmony_ci ename:VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT set 3202e5c31af7Sopenharmony_ci * [[VUID-VkWriteDescriptorSet-descriptorType-00331]] 3203e5c31af7Sopenharmony_ci If pname:descriptorType is ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER or 3204e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC, the pname:buffer member 3205e5c31af7Sopenharmony_ci of each element of pname:pBufferInfo must: have been created with 3206e5c31af7Sopenharmony_ci ename:VK_BUFFER_USAGE_STORAGE_BUFFER_BIT set 3207e5c31af7Sopenharmony_ci * [[VUID-VkWriteDescriptorSet-descriptorType-00332]] 3208e5c31af7Sopenharmony_ci If pname:descriptorType is ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER or 3209e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, the pname:range member 3210e5c31af7Sopenharmony_ci of each element of pname:pBufferInfo, or the effective range if 3211e5c31af7Sopenharmony_ci pname:range is ename:VK_WHOLE_SIZE, must: be less than or equal to 3212e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceLimits::pname:maxUniformBufferRange 3213e5c31af7Sopenharmony_ci * [[VUID-VkWriteDescriptorSet-descriptorType-00333]] 3214e5c31af7Sopenharmony_ci If pname:descriptorType is ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER or 3215e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC, the pname:range member 3216e5c31af7Sopenharmony_ci of each element of pname:pBufferInfo, or the effective range if 3217e5c31af7Sopenharmony_ci pname:range is ename:VK_WHOLE_SIZE, must: be less than or equal to 3218e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceLimits::pname:maxStorageBufferRange 3219e5c31af7Sopenharmony_ci * [[VUID-VkWriteDescriptorSet-descriptorType-00334]] 3220e5c31af7Sopenharmony_ci If pname:descriptorType is 3221e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER, the sname:VkBuffer that 3222e5c31af7Sopenharmony_ci each element of pname:pTexelBufferView was created from must: have been 3223e5c31af7Sopenharmony_ci created with ename:VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT set 3224e5c31af7Sopenharmony_ci * [[VUID-VkWriteDescriptorSet-descriptorType-00335]] 3225e5c31af7Sopenharmony_ci If pname:descriptorType is 3226e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER, the sname:VkBuffer that 3227e5c31af7Sopenharmony_ci each element of pname:pTexelBufferView was created from must: have been 3228e5c31af7Sopenharmony_ci created with ename:VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT set 3229e5c31af7Sopenharmony_ci * [[VUID-VkWriteDescriptorSet-descriptorType-00336]] 3230e5c31af7Sopenharmony_ci If pname:descriptorType is ename:VK_DESCRIPTOR_TYPE_STORAGE_IMAGE or 3231e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT, the pname:imageView member of 3232e5c31af7Sopenharmony_ci each element of pname:pImageInfo must: have been created with the 3233e5c31af7Sopenharmony_ci identity swizzle 3234e5c31af7Sopenharmony_ci * [[VUID-VkWriteDescriptorSet-descriptorType-00337]] 3235e5c31af7Sopenharmony_ci If pname:descriptorType is ename:VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE or 3236e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, the pname:imageView 3237e5c31af7Sopenharmony_ci member of each element of pname:pImageInfo must: have been created with 3238e5c31af7Sopenharmony_ci ename:VK_IMAGE_USAGE_SAMPLED_BIT set 3239e5c31af7Sopenharmony_ci * [[VUID-VkWriteDescriptorSet-descriptorType-04149]] 3240e5c31af7Sopenharmony_ci If pname:descriptorType is ename:VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE the 3241e5c31af7Sopenharmony_ci pname:imageLayout member of each element of pname:pImageInfo must: be a 3242e5c31af7Sopenharmony_ci member of the list given in <<descriptorsets-sampledimage, Sampled 3243e5c31af7Sopenharmony_ci Image>> 3244e5c31af7Sopenharmony_ci * [[VUID-VkWriteDescriptorSet-descriptorType-04150]] 3245e5c31af7Sopenharmony_ci If pname:descriptorType is 3246e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER the pname:imageLayout 3247e5c31af7Sopenharmony_ci member of each element of pname:pImageInfo must: be a member of the list 3248e5c31af7Sopenharmony_ci given in <<descriptorsets-combinedimagesampler, Combined Image Sampler>> 3249e5c31af7Sopenharmony_ci * [[VUID-VkWriteDescriptorSet-descriptorType-04151]] 3250e5c31af7Sopenharmony_ci If pname:descriptorType is ename:VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT the 3251e5c31af7Sopenharmony_ci pname:imageLayout member of each element of pname:pImageInfo must: be a 3252e5c31af7Sopenharmony_ci member of the list given in <<descriptorsets-inputattachment, Input 3253e5c31af7Sopenharmony_ci Attachment>> 3254e5c31af7Sopenharmony_ci * [[VUID-VkWriteDescriptorSet-descriptorType-04152]] 3255e5c31af7Sopenharmony_ci If pname:descriptorType is ename:VK_DESCRIPTOR_TYPE_STORAGE_IMAGE the 3256e5c31af7Sopenharmony_ci pname:imageLayout member of each element of pname:pImageInfo must: be a 3257e5c31af7Sopenharmony_ci member of the list given in <<descriptorsets-storageimage, Storage 3258e5c31af7Sopenharmony_ci Image>> 3259e5c31af7Sopenharmony_ci * [[VUID-VkWriteDescriptorSet-descriptorType-00338]] 3260e5c31af7Sopenharmony_ci If pname:descriptorType is ename:VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT, 3261e5c31af7Sopenharmony_ci the pname:imageView member of each element of pname:pImageInfo must: 3262e5c31af7Sopenharmony_ci have been created with ename:VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT set 3263e5c31af7Sopenharmony_ci * [[VUID-VkWriteDescriptorSet-descriptorType-00339]] 3264e5c31af7Sopenharmony_ci If pname:descriptorType is ename:VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, the 3265e5c31af7Sopenharmony_ci pname:imageView member of each element of pname:pImageInfo must: have 3266e5c31af7Sopenharmony_ci been created with ename:VK_IMAGE_USAGE_STORAGE_BIT set 3267e5c31af7Sopenharmony_ci * [[VUID-VkWriteDescriptorSet-descriptorType-02752]] 3268e5c31af7Sopenharmony_ci If pname:descriptorType is ename:VK_DESCRIPTOR_TYPE_SAMPLER, then 3269e5c31af7Sopenharmony_ci pname:dstSet must: not have been allocated with a layout that included 3270e5c31af7Sopenharmony_ci immutable samplers for pname:dstBinding 3271e5c31af7Sopenharmony_ciifdef::VK_VALVE_mutable_descriptor_type[] 3272e5c31af7Sopenharmony_ci * [[VUID-VkWriteDescriptorSet-dstSet-04611]] 3273e5c31af7Sopenharmony_ci If the sname:VkDescriptorSetLayoutBinding for pname:dstSet at 3274e5c31af7Sopenharmony_ci pname:dstBinding is ename:VK_DESCRIPTOR_TYPE_MUTABLE_VALVE, the new 3275e5c31af7Sopenharmony_ci active descriptor type pname:descriptorType must: exist in the 3276e5c31af7Sopenharmony_ci corresponding pname:pMutableDescriptorTypeLists list for 3277e5c31af7Sopenharmony_ci pname:dstBinding 3278e5c31af7Sopenharmony_ciendif::VK_VALVE_mutable_descriptor_type[] 3279e5c31af7Sopenharmony_ciifdef::VK_EXT_image_view_min_lod[] 3280e5c31af7Sopenharmony_ci * [[VUID-VkWriteDescriptorSet-descriptorType-06450]] 3281e5c31af7Sopenharmony_ci If pname:descriptorType is ename:VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT, 3282e5c31af7Sopenharmony_ci the pname:imageView member of each element of pname:pImageInfo must: 3283e5c31af7Sopenharmony_ci have either been created without a slink:VkImageViewMinLodCreateInfoEXT 3284e5c31af7Sopenharmony_ci present in the pname:pNext chain or with a 3285e5c31af7Sopenharmony_ci slink:VkImageViewMinLodCreateInfoEXT::pname:minLod of `0.0` 3286e5c31af7Sopenharmony_ciendif::VK_EXT_image_view_min_lod[] 3287e5c31af7Sopenharmony_ci**** 3288e5c31af7Sopenharmony_ci 3289e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkWriteDescriptorSet.txt[] 3290e5c31af7Sopenharmony_ci-- 3291e5c31af7Sopenharmony_ci 3292e5c31af7Sopenharmony_ci[open,refpage='VkDescriptorType',desc='Specifies the type of a descriptor in a descriptor set',type='enums'] 3293e5c31af7Sopenharmony_ci-- 3294e5c31af7Sopenharmony_ciThe type of descriptors in a descriptor set is specified by 3295e5c31af7Sopenharmony_cislink:VkWriteDescriptorSet::pname:descriptorType, which must: be one of the 3296e5c31af7Sopenharmony_civalues: 3297e5c31af7Sopenharmony_ci 3298e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkDescriptorType.txt[] 3299e5c31af7Sopenharmony_ci 3300e5c31af7Sopenharmony_ci * ename:VK_DESCRIPTOR_TYPE_SAMPLER specifies a <<descriptorsets-sampler, 3301e5c31af7Sopenharmony_ci sampler descriptor>>. 3302e5c31af7Sopenharmony_ci * ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER specifies a 3303e5c31af7Sopenharmony_ci <<descriptorsets-combinedimagesampler, combined image sampler 3304e5c31af7Sopenharmony_ci descriptor>>. 3305e5c31af7Sopenharmony_ci * ename:VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE specifies a 3306e5c31af7Sopenharmony_ci <<descriptorsets-sampledimage, sampled image descriptor>>. 3307e5c31af7Sopenharmony_ci * ename:VK_DESCRIPTOR_TYPE_STORAGE_IMAGE specifies a 3308e5c31af7Sopenharmony_ci <<descriptorsets-storageimage, storage image descriptor>>. 3309e5c31af7Sopenharmony_ci * ename:VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER specifies a 3310e5c31af7Sopenharmony_ci <<descriptorsets-uniformtexelbuffer, uniform texel buffer descriptor>>. 3311e5c31af7Sopenharmony_ci * ename:VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER specifies a 3312e5c31af7Sopenharmony_ci <<descriptorsets-storagetexelbuffer, storage texel buffer descriptor>>. 3313e5c31af7Sopenharmony_ci * ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER specifies a 3314e5c31af7Sopenharmony_ci <<descriptorsets-uniformbuffer, uniform buffer descriptor>>. 3315e5c31af7Sopenharmony_ci * ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER specifies a 3316e5c31af7Sopenharmony_ci <<descriptorsets-storagebuffer, storage buffer descriptor>>. 3317e5c31af7Sopenharmony_ci * ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC specifies a 3318e5c31af7Sopenharmony_ci <<descriptorsets-uniformbufferdynamic, dynamic uniform buffer 3319e5c31af7Sopenharmony_ci descriptor>>. 3320e5c31af7Sopenharmony_ci * ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC specifies a 3321e5c31af7Sopenharmony_ci <<descriptorsets-storagebufferdynamic, dynamic storage buffer 3322e5c31af7Sopenharmony_ci descriptor>>. 3323e5c31af7Sopenharmony_ci * ename:VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT specifies an 3324e5c31af7Sopenharmony_ci <<descriptorsets-inputattachment, input attachment descriptor>>. 3325e5c31af7Sopenharmony_ciifdef::VK_EXT_inline_uniform_block[] 3326e5c31af7Sopenharmony_ci * ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT specifies an 3327e5c31af7Sopenharmony_ci <<descriptorsets-inlineuniformblock, inline uniform block>>. 3328e5c31af7Sopenharmony_ciendif::VK_EXT_inline_uniform_block[] 3329e5c31af7Sopenharmony_ciifdef::VK_VALVE_mutable_descriptor_type[] 3330e5c31af7Sopenharmony_ci * ename:VK_DESCRIPTOR_TYPE_MUTABLE_VALVE specifies a 3331e5c31af7Sopenharmony_ci <<descriptorsets-mutable, descriptor of mutable type>>. 3332e5c31af7Sopenharmony_ciendif::VK_VALVE_mutable_descriptor_type[] 3333e5c31af7Sopenharmony_ci 3334e5c31af7Sopenharmony_ciWhen a descriptor set is updated via elements of slink:VkWriteDescriptorSet, 3335e5c31af7Sopenharmony_cimembers of pname:pImageInfo, pname:pBufferInfo and pname:pTexelBufferView 3336e5c31af7Sopenharmony_ciare only accessed by the implementation when they correspond to descriptor 3337e5c31af7Sopenharmony_citype being defined - otherwise they are ignored. 3338e5c31af7Sopenharmony_ciThe members accessed are as follows for each descriptor type: 3339e5c31af7Sopenharmony_ci 3340e5c31af7Sopenharmony_ci * For ename:VK_DESCRIPTOR_TYPE_SAMPLER, only the pname:sampler member of 3341e5c31af7Sopenharmony_ci each element of slink:VkWriteDescriptorSet::pname:pImageInfo is 3342e5c31af7Sopenharmony_ci accessed. 3343e5c31af7Sopenharmony_ci * For ename:VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, 3344e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, or 3345e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT, only the pname:imageView and 3346e5c31af7Sopenharmony_ci pname:imageLayout members of each element of 3347e5c31af7Sopenharmony_ci slink:VkWriteDescriptorSet::pname:pImageInfo are accessed. 3348e5c31af7Sopenharmony_ci * For ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, all members of each 3349e5c31af7Sopenharmony_ci element of slink:VkWriteDescriptorSet::pname:pImageInfo are accessed. 3350e5c31af7Sopenharmony_ci * For ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, 3351e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, 3352e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, or 3353e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC, all members of each 3354e5c31af7Sopenharmony_ci element of slink:VkWriteDescriptorSet::pname:pBufferInfo are accessed. 3355e5c31af7Sopenharmony_ci * For ename:VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER or 3356e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER, each element of 3357e5c31af7Sopenharmony_ci slink:VkWriteDescriptorSet::pname:pTexelBufferView is accessed. 3358e5c31af7Sopenharmony_ci 3359e5c31af7Sopenharmony_ciifdef::VK_EXT_inline_uniform_block[] 3360e5c31af7Sopenharmony_ciWhen updating descriptors with a pname:descriptorType of 3361e5c31af7Sopenharmony_ciename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT, none of the 3362e5c31af7Sopenharmony_cipname:pImageInfo, pname:pBufferInfo, or pname:pTexelBufferView members are 3363e5c31af7Sopenharmony_ciaccessed, instead the source data of the descriptor update operation is 3364e5c31af7Sopenharmony_citaken from the slink:VkWriteDescriptorSetInlineUniformBlockEXT structure in 3365e5c31af7Sopenharmony_cithe pname:pNext chain of sname:VkWriteDescriptorSet. 3366e5c31af7Sopenharmony_ciendif::VK_EXT_inline_uniform_block[] 3367e5c31af7Sopenharmony_ciifdef::VK_KHR_acceleration_structure[] 3368e5c31af7Sopenharmony_ciWhen updating descriptors with a pname:descriptorType of 3369e5c31af7Sopenharmony_ciename:VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_KHR, none of the 3370e5c31af7Sopenharmony_cipname:pImageInfo, pname:pBufferInfo, or pname:pTexelBufferView members are 3371e5c31af7Sopenharmony_ciaccessed, instead the source data of the descriptor update operation is 3372e5c31af7Sopenharmony_citaken from the slink:VkWriteDescriptorSetAccelerationStructureKHR structure 3373e5c31af7Sopenharmony_ciin the pname:pNext chain of sname:VkWriteDescriptorSet. 3374e5c31af7Sopenharmony_ciendif::VK_KHR_acceleration_structure[] 3375e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing[] 3376e5c31af7Sopenharmony_ciWhen updating descriptors with a pname:descriptorType of 3377e5c31af7Sopenharmony_ciename:VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_NV, none of the 3378e5c31af7Sopenharmony_cipname:pImageInfo, pname:pBufferInfo, or pname:pTexelBufferView members are 3379e5c31af7Sopenharmony_ciaccessed, instead the source data of the descriptor update operation is 3380e5c31af7Sopenharmony_citaken from the slink:VkWriteDescriptorSetAccelerationStructureNV structure 3381e5c31af7Sopenharmony_ciin the pname:pNext chain of sname:VkWriteDescriptorSet. 3382e5c31af7Sopenharmony_ciendif::VK_NV_ray_tracing[] 3383e5c31af7Sopenharmony_ci-- 3384e5c31af7Sopenharmony_ci 3385e5c31af7Sopenharmony_ci[open,refpage='VkDescriptorBufferInfo',desc='Structure specifying descriptor buffer information',type='structs'] 3386e5c31af7Sopenharmony_ci-- 3387e5c31af7Sopenharmony_ciThe sname:VkDescriptorBufferInfo structure is defined as: 3388e5c31af7Sopenharmony_ci 3389e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkDescriptorBufferInfo.txt[] 3390e5c31af7Sopenharmony_ci 3391e5c31af7Sopenharmony_ci * pname:buffer is 3392e5c31af7Sopenharmony_ciifdef::VK_EXT_robustness2[] 3393e5c31af7Sopenharmony_cidlink:VK_NULL_HANDLE or 3394e5c31af7Sopenharmony_ciendif::VK_EXT_robustness2[] 3395e5c31af7Sopenharmony_cithe buffer resource. 3396e5c31af7Sopenharmony_ci * pname:offset is the offset in bytes from the start of pname:buffer. 3397e5c31af7Sopenharmony_ci Access to buffer memory via this descriptor uses addressing that is 3398e5c31af7Sopenharmony_ci relative to this starting offset. 3399e5c31af7Sopenharmony_ci * pname:range is the size in bytes that is used for this descriptor 3400e5c31af7Sopenharmony_ci update, or ename:VK_WHOLE_SIZE to use the range from pname:offset to the 3401e5c31af7Sopenharmony_ci end of the buffer. 3402e5c31af7Sopenharmony_ci 3403e5c31af7Sopenharmony_ci[NOTE] 3404e5c31af7Sopenharmony_ci.Note 3405e5c31af7Sopenharmony_ci==== 3406e5c31af7Sopenharmony_ciWhen setting pname:range to ename:VK_WHOLE_SIZE, the effective range must: 3407e5c31af7Sopenharmony_cinot be larger than the maximum range for the descriptor type 3408e5c31af7Sopenharmony_ci(<<limits-maxUniformBufferRange, pname:maxUniformBufferRange>> or 3409e5c31af7Sopenharmony_ci<<limits-maxStorageBufferRange, pname:maxStorageBufferRange>>). 3410e5c31af7Sopenharmony_ciThis means that ename:VK_WHOLE_SIZE is not typically useful in the common 3411e5c31af7Sopenharmony_cicase where uniform buffer descriptors are suballocated from a buffer that is 3412e5c31af7Sopenharmony_cimuch larger than pname:maxUniformBufferRange. 3413e5c31af7Sopenharmony_ci==== 3414e5c31af7Sopenharmony_ci 3415e5c31af7Sopenharmony_ciFor ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC and 3416e5c31af7Sopenharmony_ciename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC descriptor types, 3417e5c31af7Sopenharmony_cipname:offset is the base offset from which the dynamic offset is applied and 3418e5c31af7Sopenharmony_cipname:range is the static size used for all dynamic offsets. 3419e5c31af7Sopenharmony_ci 3420e5c31af7Sopenharmony_ci.Valid Usage 3421e5c31af7Sopenharmony_ci**** 3422e5c31af7Sopenharmony_ci * [[VUID-VkDescriptorBufferInfo-offset-00340]] 3423e5c31af7Sopenharmony_ci pname:offset must: be less than the size of pname:buffer 3424e5c31af7Sopenharmony_ci * [[VUID-VkDescriptorBufferInfo-range-00341]] 3425e5c31af7Sopenharmony_ci If pname:range is not equal to ename:VK_WHOLE_SIZE, pname:range must: be 3426e5c31af7Sopenharmony_ci greater than `0` 3427e5c31af7Sopenharmony_ci * [[VUID-VkDescriptorBufferInfo-range-00342]] 3428e5c31af7Sopenharmony_ci If pname:range is not equal to ename:VK_WHOLE_SIZE, pname:range must: be 3429e5c31af7Sopenharmony_ci less than or equal to the size of pname:buffer minus pname:offset 3430e5c31af7Sopenharmony_ci * [[VUID-VkDescriptorBufferInfo-buffer-02998]] 3431e5c31af7Sopenharmony_ci If the <<features-nullDescriptor,nullDescriptor>> feature is not 3432e5c31af7Sopenharmony_ci enabled, pname:buffer must: not be dlink:VK_NULL_HANDLE 3433e5c31af7Sopenharmony_ciifdef::VK_EXT_robustness2[] 3434e5c31af7Sopenharmony_ci * [[VUID-VkDescriptorBufferInfo-buffer-02999]] 3435e5c31af7Sopenharmony_ci If pname:buffer is dlink:VK_NULL_HANDLE, pname:offset must: be zero and 3436e5c31af7Sopenharmony_ci pname:range must: be ename:VK_WHOLE_SIZE 3437e5c31af7Sopenharmony_ciendif::VK_EXT_robustness2[] 3438e5c31af7Sopenharmony_ci**** 3439e5c31af7Sopenharmony_ci 3440e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkDescriptorBufferInfo.txt[] 3441e5c31af7Sopenharmony_ci-- 3442e5c31af7Sopenharmony_ci 3443e5c31af7Sopenharmony_ci[open,refpage='VkDescriptorImageInfo',desc='Structure specifying descriptor image information',type='structs'] 3444e5c31af7Sopenharmony_ci-- 3445e5c31af7Sopenharmony_ciThe sname:VkDescriptorImageInfo structure is defined as: 3446e5c31af7Sopenharmony_ci 3447e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkDescriptorImageInfo.txt[] 3448e5c31af7Sopenharmony_ci 3449e5c31af7Sopenharmony_ci * pname:sampler is a sampler handle, and is used in descriptor updates for 3450e5c31af7Sopenharmony_ci types ename:VK_DESCRIPTOR_TYPE_SAMPLER and 3451e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER if the binding being 3452e5c31af7Sopenharmony_ci updated does not use immutable samplers. 3453e5c31af7Sopenharmony_ci * pname:imageView is 3454e5c31af7Sopenharmony_ciifdef::VK_EXT_robustness2[] 3455e5c31af7Sopenharmony_ci dlink:VK_NULL_HANDLE or 3456e5c31af7Sopenharmony_ciendif::VK_EXT_robustness2[] 3457e5c31af7Sopenharmony_ci an image view handle, and is used in descriptor updates for types 3458e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, 3459e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, 3460e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, and 3461e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT. 3462e5c31af7Sopenharmony_ci * pname:imageLayout is the layout that the image subresources accessible 3463e5c31af7Sopenharmony_ci from pname:imageView will be in at the time this descriptor is accessed. 3464e5c31af7Sopenharmony_ci pname:imageLayout is used in descriptor updates for types 3465e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, 3466e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, 3467e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, and 3468e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT. 3469e5c31af7Sopenharmony_ci 3470e5c31af7Sopenharmony_ciMembers of sname:VkDescriptorImageInfo that are not used in an update (as 3471e5c31af7Sopenharmony_cidescribed above) are ignored. 3472e5c31af7Sopenharmony_ci 3473e5c31af7Sopenharmony_ci.Valid Usage 3474e5c31af7Sopenharmony_ci**** 3475e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_maintenance1[] 3476e5c31af7Sopenharmony_ci * [[VUID-VkDescriptorImageInfo-imageView-00343]] 3477e5c31af7Sopenharmony_ci pname:imageView must: not be 2D or 2D array image view created from a 3D 3478e5c31af7Sopenharmony_ci image 3479e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_maintenance1[] 3480e5c31af7Sopenharmony_ci * [[VUID-VkDescriptorImageInfo-imageView-01976]] 3481e5c31af7Sopenharmony_ci If pname:imageView is created from a depth/stencil image, the 3482e5c31af7Sopenharmony_ci pname:aspectMask used to create the pname:imageView must: include either 3483e5c31af7Sopenharmony_ci ename:VK_IMAGE_ASPECT_DEPTH_BIT or ename:VK_IMAGE_ASPECT_STENCIL_BIT but 3484e5c31af7Sopenharmony_ci not both 3485e5c31af7Sopenharmony_ci * [[VUID-VkDescriptorImageInfo-imageLayout-00344]] 3486e5c31af7Sopenharmony_ci pname:imageLayout must: match the actual elink:VkImageLayout of each 3487e5c31af7Sopenharmony_ci subresource accessible from pname:imageView at the time this descriptor 3488e5c31af7Sopenharmony_ci is accessed as defined by the <<resources-image-layouts-matching-rule, 3489e5c31af7Sopenharmony_ci image layout matching rules>> 3490e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[] 3491e5c31af7Sopenharmony_ci * [[VUID-VkDescriptorImageInfo-sampler-01564]] 3492e5c31af7Sopenharmony_ci If pname:sampler is used and the elink:VkFormat of the image is a 3493e5c31af7Sopenharmony_ci <<formats-requiring-sampler-ycbcr-conversion,multi-planar format>>, the 3494e5c31af7Sopenharmony_ci image must: have been created with 3495e5c31af7Sopenharmony_ci ename:VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT, and the pname:aspectMask of 3496e5c31af7Sopenharmony_ci the pname:imageView must: be ename:VK_IMAGE_ASPECT_PLANE_0_BIT, 3497e5c31af7Sopenharmony_ci ename:VK_IMAGE_ASPECT_PLANE_1_BIT or (for three-plane formats only) 3498e5c31af7Sopenharmony_ci ename:VK_IMAGE_ASPECT_PLANE_2_BIT 3499e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[] 3500e5c31af7Sopenharmony_ciifdef::VK_KHR_portability_subset[] 3501e5c31af7Sopenharmony_ci * [[VUID-VkDescriptorImageInfo-mutableComparisonSamplers-04450]] 3502e5c31af7Sopenharmony_ci If the `apiext:VK_KHR_portability_subset` extension is enabled, and 3503e5c31af7Sopenharmony_ci slink:VkPhysicalDevicePortabilitySubsetFeaturesKHR::pname:mutableComparisonSamplers 3504e5c31af7Sopenharmony_ci is ename:VK_FALSE, then pname:sampler must: have been created with 3505e5c31af7Sopenharmony_ci slink:VkSamplerCreateInfo::pname:compareEnable set to ename:VK_FALSE 3506e5c31af7Sopenharmony_ciendif::VK_KHR_portability_subset[] 3507e5c31af7Sopenharmony_ci**** 3508e5c31af7Sopenharmony_ci 3509e5c31af7Sopenharmony_ci 3510e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkDescriptorImageInfo.txt[] 3511e5c31af7Sopenharmony_ci-- 3512e5c31af7Sopenharmony_ci 3513e5c31af7Sopenharmony_ciifdef::VK_EXT_inline_uniform_block[] 3514e5c31af7Sopenharmony_ci[open,refpage='VkWriteDescriptorSetInlineUniformBlockEXT',desc='Structure specifying inline uniform block data',type='structs'] 3515e5c31af7Sopenharmony_ci-- 3516e5c31af7Sopenharmony_ciIf the pname:descriptorType member of slink:VkWriteDescriptorSet is 3517e5c31af7Sopenharmony_ciename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT then the data to write to 3518e5c31af7Sopenharmony_cithe descriptor set is specified through a 3519e5c31af7Sopenharmony_cisname:VkWriteDescriptorSetInlineUniformBlockEXT structure included in the 3520e5c31af7Sopenharmony_cipname:pNext chain of sname:VkWriteDescriptorSet. 3521e5c31af7Sopenharmony_ci 3522e5c31af7Sopenharmony_ciThe sname:VkWriteDescriptorSetInlineUniformBlockEXT structure is defined as: 3523e5c31af7Sopenharmony_ci 3524e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkWriteDescriptorSetInlineUniformBlockEXT.txt[] 3525e5c31af7Sopenharmony_ci 3526e5c31af7Sopenharmony_ci * pname:sType is the type of this structure. 3527e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 3528e5c31af7Sopenharmony_ci structure. 3529e5c31af7Sopenharmony_ci * pname:dataSize is the number of bytes of inline uniform block data 3530e5c31af7Sopenharmony_ci pointed to by pname:pData. 3531e5c31af7Sopenharmony_ci * pname:pData is a pointer to pname:dataSize number of bytes of data to 3532e5c31af7Sopenharmony_ci write to the inline uniform block. 3533e5c31af7Sopenharmony_ci 3534e5c31af7Sopenharmony_ci.Valid Usage 3535e5c31af7Sopenharmony_ci**** 3536e5c31af7Sopenharmony_ci * [[VUID-VkWriteDescriptorSetInlineUniformBlockEXT-dataSize-02222]] 3537e5c31af7Sopenharmony_ci pname:dataSize must: be an integer multiple of `4` 3538e5c31af7Sopenharmony_ci**** 3539e5c31af7Sopenharmony_ci 3540e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkWriteDescriptorSetInlineUniformBlockEXT.txt[] 3541e5c31af7Sopenharmony_ci-- 3542e5c31af7Sopenharmony_ciendif::VK_EXT_inline_uniform_block[] 3543e5c31af7Sopenharmony_ci 3544e5c31af7Sopenharmony_ciifdef::VK_KHR_acceleration_structure[] 3545e5c31af7Sopenharmony_ci[open,refpage='VkWriteDescriptorSetAccelerationStructureKHR',desc='Structure specifying acceleration structure descriptor information',type='structs'] 3546e5c31af7Sopenharmony_ci-- 3547e5c31af7Sopenharmony_ci:refpage: VkWriteDescriptorSetAccelerationStructureKHR 3548e5c31af7Sopenharmony_ci 3549e5c31af7Sopenharmony_ciThe sname:VkWriteDescriptorSetAccelerationStructureKHR structure is defined 3550e5c31af7Sopenharmony_cias: 3551e5c31af7Sopenharmony_ci 3552e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkWriteDescriptorSetAccelerationStructureKHR.txt[] 3553e5c31af7Sopenharmony_ci 3554e5c31af7Sopenharmony_ci * pname:sType is the type of this structure. 3555e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 3556e5c31af7Sopenharmony_ci structure. 3557e5c31af7Sopenharmony_ci * pname:accelerationStructureCount is the number of elements in 3558e5c31af7Sopenharmony_ci pname:pAccelerationStructures. 3559e5c31af7Sopenharmony_ci * pname:pAccelerationStructures is a pointer to an array of 3560e5c31af7Sopenharmony_ci slink:VkAccelerationStructureKHR structures specifying the acceleration 3561e5c31af7Sopenharmony_ci structures to update. 3562e5c31af7Sopenharmony_ci 3563e5c31af7Sopenharmony_ci.Valid Usage 3564e5c31af7Sopenharmony_ci**** 3565e5c31af7Sopenharmony_ci * [[VUID-VkWriteDescriptorSetAccelerationStructureKHR-accelerationStructureCount-02236]] 3566e5c31af7Sopenharmony_ci pname:accelerationStructureCount must: be equal to pname:descriptorCount 3567e5c31af7Sopenharmony_ci in the extended structure 3568e5c31af7Sopenharmony_ci * [[VUID-VkWriteDescriptorSetAccelerationStructureKHR-pAccelerationStructures-03579]] 3569e5c31af7Sopenharmony_ci Each acceleration structure in pname:pAccelerationStructures must: have 3570e5c31af7Sopenharmony_ci been created with a pname:type of 3571e5c31af7Sopenharmony_ci ename:VK_ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR or 3572e5c31af7Sopenharmony_ci ename:VK_ACCELERATION_STRUCTURE_TYPE_GENERIC_KHR 3573e5c31af7Sopenharmony_ci * [[VUID-VkWriteDescriptorSetAccelerationStructureKHR-pAccelerationStructures-03580]] 3574e5c31af7Sopenharmony_ci If the <<features-nullDescriptor,nullDescriptor>> feature is not 3575e5c31af7Sopenharmony_ci enabled, each element of pname:pAccelerationStructures must: not be 3576e5c31af7Sopenharmony_ci dlink:VK_NULL_HANDLE 3577e5c31af7Sopenharmony_ci**** 3578e5c31af7Sopenharmony_ci 3579e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkWriteDescriptorSetAccelerationStructureKHR.txt[] 3580e5c31af7Sopenharmony_ci-- 3581e5c31af7Sopenharmony_ciendif::VK_KHR_acceleration_structure[] 3582e5c31af7Sopenharmony_ci 3583e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing[] 3584e5c31af7Sopenharmony_ci[open,refpage='VkWriteDescriptorSetAccelerationStructureNV',desc='Structure specifying acceleration structure descriptor information',type='structs'] 3585e5c31af7Sopenharmony_ci-- 3586e5c31af7Sopenharmony_ci:refpage: VkWriteDescriptorSetAccelerationStructureNV 3587e5c31af7Sopenharmony_ci 3588e5c31af7Sopenharmony_ciThe sname:VkWriteDescriptorSetAccelerationStructureNV structure is defined 3589e5c31af7Sopenharmony_cias: 3590e5c31af7Sopenharmony_ci 3591e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkWriteDescriptorSetAccelerationStructureNV.txt[] 3592e5c31af7Sopenharmony_ci 3593e5c31af7Sopenharmony_ci * pname:sType is the type of this structure. 3594e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 3595e5c31af7Sopenharmony_ci structure. 3596e5c31af7Sopenharmony_ci * pname:accelerationStructureCount is the number of elements in 3597e5c31af7Sopenharmony_ci pname:pAccelerationStructures. 3598e5c31af7Sopenharmony_ci * pname:pAccelerationStructures is a pointer to an array of 3599e5c31af7Sopenharmony_ci slink:VkAccelerationStructureNV structures specifying the acceleration 3600e5c31af7Sopenharmony_ci structures to update. 3601e5c31af7Sopenharmony_ci 3602e5c31af7Sopenharmony_ci.Valid Usage 3603e5c31af7Sopenharmony_ci**** 3604e5c31af7Sopenharmony_ci * [[VUID-VkWriteDescriptorSetAccelerationStructureNV-accelerationStructureCount-03747]] 3605e5c31af7Sopenharmony_ci pname:accelerationStructureCount must: be equal to pname:descriptorCount 3606e5c31af7Sopenharmony_ci in the extended structure 3607e5c31af7Sopenharmony_ci * [[VUID-VkWriteDescriptorSetAccelerationStructureNV-pAccelerationStructures-03748]] 3608e5c31af7Sopenharmony_ci Each acceleration structure in pname:pAccelerationStructures must: have 3609e5c31af7Sopenharmony_ci been created with ename:VK_ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR 3610e5c31af7Sopenharmony_ci * [[VUID-VkWriteDescriptorSetAccelerationStructureNV-pAccelerationStructures-03749]] 3611e5c31af7Sopenharmony_ci If the <<features-nullDescriptor,nullDescriptor>> feature is not 3612e5c31af7Sopenharmony_ci enabled, each member of pname:pAccelerationStructures must: not be 3613e5c31af7Sopenharmony_ci dlink:VK_NULL_HANDLE 3614e5c31af7Sopenharmony_ci**** 3615e5c31af7Sopenharmony_ci 3616e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkWriteDescriptorSetAccelerationStructureNV.txt[] 3617e5c31af7Sopenharmony_ci-- 3618e5c31af7Sopenharmony_ciendif::VK_NV_ray_tracing[] 3619e5c31af7Sopenharmony_ci 3620e5c31af7Sopenharmony_ci[open,refpage='VkCopyDescriptorSet',desc='Structure specifying a copy descriptor set operation',type='structs'] 3621e5c31af7Sopenharmony_ci-- 3622e5c31af7Sopenharmony_ciThe sname:VkCopyDescriptorSet structure is defined as: 3623e5c31af7Sopenharmony_ci 3624e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkCopyDescriptorSet.txt[] 3625e5c31af7Sopenharmony_ci 3626e5c31af7Sopenharmony_ci * pname:sType is the type of this structure. 3627e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 3628e5c31af7Sopenharmony_ci structure. 3629e5c31af7Sopenharmony_ci * pname:srcSet, pname:srcBinding, and pname:srcArrayElement are the source 3630e5c31af7Sopenharmony_ci set, binding, and array element, respectively. 3631e5c31af7Sopenharmony_ciifdef::VK_EXT_inline_uniform_block[] 3632e5c31af7Sopenharmony_ci If the descriptor binding identified by pname:srcSet and 3633e5c31af7Sopenharmony_ci pname:srcBinding has a descriptor type of 3634e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT then 3635e5c31af7Sopenharmony_ci pname:srcArrayElement specifies the starting byte offset within the 3636e5c31af7Sopenharmony_ci binding to copy from. 3637e5c31af7Sopenharmony_ciendif::VK_EXT_inline_uniform_block[] 3638e5c31af7Sopenharmony_ci * pname:dstSet, pname:dstBinding, and pname:dstArrayElement are the 3639e5c31af7Sopenharmony_ci destination set, binding, and array element, respectively. 3640e5c31af7Sopenharmony_ciifdef::VK_EXT_inline_uniform_block[] 3641e5c31af7Sopenharmony_ci If the descriptor binding identified by pname:dstSet and 3642e5c31af7Sopenharmony_ci pname:dstBinding has a descriptor type of 3643e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT then 3644e5c31af7Sopenharmony_ci pname:dstArrayElement specifies the starting byte offset within the 3645e5c31af7Sopenharmony_ci binding to copy to. 3646e5c31af7Sopenharmony_ciendif::VK_EXT_inline_uniform_block[] 3647e5c31af7Sopenharmony_ci * pname:descriptorCount is the number of descriptors to copy from the 3648e5c31af7Sopenharmony_ci source to destination. 3649e5c31af7Sopenharmony_ci If pname:descriptorCount is greater than the number of remaining array 3650e5c31af7Sopenharmony_ci elements in the source or destination binding, those affect consecutive 3651e5c31af7Sopenharmony_ci bindings in a manner similar to slink:VkWriteDescriptorSet above. 3652e5c31af7Sopenharmony_ciifdef::VK_EXT_inline_uniform_block[] 3653e5c31af7Sopenharmony_ci If the descriptor binding identified by pname:srcSet and 3654e5c31af7Sopenharmony_ci pname:srcBinding has a descriptor type of 3655e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT then 3656e5c31af7Sopenharmony_ci pname:descriptorCount specifies the number of bytes to copy and the 3657e5c31af7Sopenharmony_ci remaining array elements in the source or destination binding refer to 3658e5c31af7Sopenharmony_ci the remaining number of bytes in those. 3659e5c31af7Sopenharmony_ciendif::VK_EXT_inline_uniform_block[] 3660e5c31af7Sopenharmony_ci 3661e5c31af7Sopenharmony_ciifdef::VK_VALVE_mutable_descriptor_type[] 3662e5c31af7Sopenharmony_ciIf the sname:VkDescriptorSetLayoutBinding for pname:dstBinding is 3663e5c31af7Sopenharmony_ciename:VK_DESCRIPTOR_TYPE_MUTABLE_VALVE and pname:srcBinding is not 3664e5c31af7Sopenharmony_ciename:VK_DESCRIPTOR_TYPE_MUTABLE_VALVE, the new active descriptor type 3665e5c31af7Sopenharmony_cibecomes the descriptor type of pname:srcBinding. 3666e5c31af7Sopenharmony_ciIf both sname:VkDescriptorSetLayoutBinding for pname:srcBinding and 3667e5c31af7Sopenharmony_cipname:dstBinding are ename:VK_DESCRIPTOR_TYPE_MUTABLE_VALVE, the active 3668e5c31af7Sopenharmony_cidescriptor type in each source descriptor is copied into the corresponding 3669e5c31af7Sopenharmony_cidestination descriptor. 3670e5c31af7Sopenharmony_ciThe active descriptor type can: be different for each source descriptor. 3671e5c31af7Sopenharmony_ci 3672e5c31af7Sopenharmony_ci[NOTE] 3673e5c31af7Sopenharmony_ci.Note 3674e5c31af7Sopenharmony_ci==== 3675e5c31af7Sopenharmony_ciThe intention is that copies to and from mutable descriptors is a simple 3676e5c31af7Sopenharmony_cimemcpy. 3677e5c31af7Sopenharmony_ciCopies between non-mutable and mutable descriptors are expected to require 3678e5c31af7Sopenharmony_cione memcpy per descriptor to handle the difference in size, but this use 3679e5c31af7Sopenharmony_cicase with more than one pname:descriptorCount is considered rare. 3680e5c31af7Sopenharmony_ci==== 3681e5c31af7Sopenharmony_ciendif::VK_VALVE_mutable_descriptor_type[] 3682e5c31af7Sopenharmony_ci 3683e5c31af7Sopenharmony_ci.Valid Usage 3684e5c31af7Sopenharmony_ci**** 3685e5c31af7Sopenharmony_ci * [[VUID-VkCopyDescriptorSet-srcBinding-00345]] 3686e5c31af7Sopenharmony_ci pname:srcBinding must: be a valid binding within pname:srcSet 3687e5c31af7Sopenharmony_ci * [[VUID-VkCopyDescriptorSet-srcArrayElement-00346]] 3688e5c31af7Sopenharmony_ci The sum of pname:srcArrayElement and pname:descriptorCount must: be less 3689e5c31af7Sopenharmony_ci than or equal to the number of array elements in the descriptor set 3690e5c31af7Sopenharmony_ci binding specified by pname:srcBinding, and all applicable consecutive 3691e5c31af7Sopenharmony_ci bindings, as described by <<descriptorsets-updates-consecutive>> 3692e5c31af7Sopenharmony_ci * [[VUID-VkCopyDescriptorSet-dstBinding-00347]] 3693e5c31af7Sopenharmony_ci pname:dstBinding must: be a valid binding within pname:dstSet 3694e5c31af7Sopenharmony_ci * [[VUID-VkCopyDescriptorSet-dstArrayElement-00348]] 3695e5c31af7Sopenharmony_ci The sum of pname:dstArrayElement and pname:descriptorCount must: be less 3696e5c31af7Sopenharmony_ci than or equal to the number of array elements in the descriptor set 3697e5c31af7Sopenharmony_ci binding specified by pname:dstBinding, and all applicable consecutive 3698e5c31af7Sopenharmony_ci bindings, as described by <<descriptorsets-updates-consecutive>> 3699e5c31af7Sopenharmony_ci * [[VUID-VkCopyDescriptorSet-dstBinding-02632]] 3700e5c31af7Sopenharmony_ci The type of pname:dstBinding within pname:dstSet must: be equal to the 3701e5c31af7Sopenharmony_ci type of pname:srcBinding within pname:srcSet 3702e5c31af7Sopenharmony_ci * [[VUID-VkCopyDescriptorSet-srcSet-00349]] 3703e5c31af7Sopenharmony_ci If pname:srcSet is equal to pname:dstSet, then the source and 3704e5c31af7Sopenharmony_ci destination ranges of descriptors must: not overlap, where the ranges 3705e5c31af7Sopenharmony_ci may: include array elements from consecutive bindings as described by 3706e5c31af7Sopenharmony_ci <<descriptorsets-updates-consecutive>> 3707e5c31af7Sopenharmony_ciifdef::VK_EXT_inline_uniform_block[] 3708e5c31af7Sopenharmony_ci * [[VUID-VkCopyDescriptorSet-srcBinding-02223]] 3709e5c31af7Sopenharmony_ci If the descriptor type of the descriptor set binding specified by 3710e5c31af7Sopenharmony_ci pname:srcBinding is ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT, 3711e5c31af7Sopenharmony_ci pname:srcArrayElement must: be an integer multiple of `4` 3712e5c31af7Sopenharmony_ci * [[VUID-VkCopyDescriptorSet-dstBinding-02224]] 3713e5c31af7Sopenharmony_ci If the descriptor type of the descriptor set binding specified by 3714e5c31af7Sopenharmony_ci pname:dstBinding is ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT, 3715e5c31af7Sopenharmony_ci pname:dstArrayElement must: be an integer multiple of `4` 3716e5c31af7Sopenharmony_ci * [[VUID-VkCopyDescriptorSet-srcBinding-02225]] 3717e5c31af7Sopenharmony_ci If the descriptor type of the descriptor set binding specified by either 3718e5c31af7Sopenharmony_ci pname:srcBinding or pname:dstBinding is 3719e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT, pname:descriptorCount 3720e5c31af7Sopenharmony_ci must: be an integer multiple of `4` 3721e5c31af7Sopenharmony_ciendif::VK_EXT_inline_uniform_block[] 3722e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[] 3723e5c31af7Sopenharmony_ci * [[VUID-VkCopyDescriptorSet-srcSet-01918]] 3724e5c31af7Sopenharmony_ci If pname:srcSet's layout was created with the 3725e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT flag 3726e5c31af7Sopenharmony_ci set, then pname:dstSet's layout must: also have been created with the 3727e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT flag 3728e5c31af7Sopenharmony_ci set 3729e5c31af7Sopenharmony_ciifdef::VK_VALVE_mutable_descriptor_type[] 3730e5c31af7Sopenharmony_ci * [[VUID-VkCopyDescriptorSet-srcSet-04885]] 3731e5c31af7Sopenharmony_ci If pname:srcSet's layout was created with neither 3732e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT nor 3733e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_HOST_ONLY_POOL_BIT_VALVE flags 3734e5c31af7Sopenharmony_ci set, then pname:dstSet's layout must: have been created without the 3735e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT flag 3736e5c31af7Sopenharmony_ci set 3737e5c31af7Sopenharmony_ciendif::VK_VALVE_mutable_descriptor_type[] 3738e5c31af7Sopenharmony_ciifndef::VK_VALVE_mutable_descriptor_type[] 3739e5c31af7Sopenharmony_ci * [[VUID-VkCopyDescriptorSet-srcSet-04886]] 3740e5c31af7Sopenharmony_ci If pname:srcSet's layout was created without the 3741e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT flag 3742e5c31af7Sopenharmony_ci set, then pname:dstSet's layout must: also have been created without the 3743e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT flag 3744e5c31af7Sopenharmony_ci set 3745e5c31af7Sopenharmony_ciendif::VK_VALVE_mutable_descriptor_type[] 3746e5c31af7Sopenharmony_ci * [[VUID-VkCopyDescriptorSet-srcSet-01920]] 3747e5c31af7Sopenharmony_ci If the descriptor pool from which pname:srcSet was allocated was created 3748e5c31af7Sopenharmony_ci with the ename:VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT flag set, 3749e5c31af7Sopenharmony_ci then the descriptor pool from which pname:dstSet was allocated must: 3750e5c31af7Sopenharmony_ci also have been created with the 3751e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT flag set 3752e5c31af7Sopenharmony_ciifdef::VK_VALVE_mutable_descriptor_type[] 3753e5c31af7Sopenharmony_ci * [[VUID-VkCopyDescriptorSet-srcSet-04887]] 3754e5c31af7Sopenharmony_ci If the descriptor pool from which pname:srcSet was allocated was created 3755e5c31af7Sopenharmony_ci with neither ename:VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT nor 3756e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_POOL_CREATE_HOST_ONLY_BIT_VALVE flags set, then the 3757e5c31af7Sopenharmony_ci descriptor pool from which pname:dstSet was allocated must: have been 3758e5c31af7Sopenharmony_ci created without the 3759e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT flag set 3760e5c31af7Sopenharmony_ciendif::VK_VALVE_mutable_descriptor_type[] 3761e5c31af7Sopenharmony_ciifndef::VK_VALVE_mutable_descriptor_type[] 3762e5c31af7Sopenharmony_ci * [[VUID-VkCopyDescriptorSet-srcSet-04888]] 3763e5c31af7Sopenharmony_ci If the descriptor pool from which pname:srcSet was allocated was created 3764e5c31af7Sopenharmony_ci without the ename:VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT flag 3765e5c31af7Sopenharmony_ci set, then the descriptor pool from which pname:dstSet was allocated 3766e5c31af7Sopenharmony_ci must: also have been created without the 3767e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT flag set 3768e5c31af7Sopenharmony_ciendif::VK_VALVE_mutable_descriptor_type[] 3769e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[] 3770e5c31af7Sopenharmony_ci * [[VUID-VkCopyDescriptorSet-dstBinding-02753]] 3771e5c31af7Sopenharmony_ci If the descriptor type of the descriptor set binding specified by 3772e5c31af7Sopenharmony_ci pname:dstBinding is ename:VK_DESCRIPTOR_TYPE_SAMPLER, then pname:dstSet 3773e5c31af7Sopenharmony_ci must: not have been allocated with a layout that included immutable 3774e5c31af7Sopenharmony_ci samplers for pname:dstBinding 3775e5c31af7Sopenharmony_ciifdef::VK_VALVE_mutable_descriptor_type[] 3776e5c31af7Sopenharmony_ci * [[VUID-VkCopyDescriptorSet-dstSet-04612]] 3777e5c31af7Sopenharmony_ci If sname:VkDescriptorSetLayoutBinding for pname:dstSet at 3778e5c31af7Sopenharmony_ci pname:dstBinding is ename:VK_DESCRIPTOR_TYPE_MUTABLE_VALVE, the new 3779e5c31af7Sopenharmony_ci active descriptor type must: exist in the corresponding 3780e5c31af7Sopenharmony_ci pname:pMutableDescriptorTypeLists list for pname:dstBinding if the new 3781e5c31af7Sopenharmony_ci active descriptor type is not ename:VK_DESCRIPTOR_TYPE_MUTABLE_VALVE 3782e5c31af7Sopenharmony_ci * [[VUID-VkCopyDescriptorSet-srcSet-04613]] 3783e5c31af7Sopenharmony_ci If sname:VkDescriptorSetLayoutBinding for pname:srcSet at 3784e5c31af7Sopenharmony_ci pname:srcBinding is ename:VK_DESCRIPTOR_TYPE_MUTABLE_VALVE and the 3785e5c31af7Sopenharmony_ci sname:VkDescriptorSetLayoutBinding for pname:dstSet at pname:dstBinding 3786e5c31af7Sopenharmony_ci is not ename:VK_DESCRIPTOR_TYPE_MUTABLE_VALVE, the active descriptor 3787e5c31af7Sopenharmony_ci type for the source descriptor must: match the descriptor type of 3788e5c31af7Sopenharmony_ci pname:dstBinding 3789e5c31af7Sopenharmony_ci * [[VUID-VkCopyDescriptorSet-dstSet-04614]] 3790e5c31af7Sopenharmony_ci If sname:VkDescriptorSetLayoutBinding for pname:dstSet at 3791e5c31af7Sopenharmony_ci pname:dstBinding is ename:VK_DESCRIPTOR_TYPE_MUTABLE_VALVE, and the new 3792e5c31af7Sopenharmony_ci active descriptor type is ename:VK_DESCRIPTOR_TYPE_MUTABLE_VALVE, the 3793e5c31af7Sopenharmony_ci pname:pMutableDescriptorTypeLists for pname:srcBinding and 3794e5c31af7Sopenharmony_ci pname:dstBinding must: match exactly 3795e5c31af7Sopenharmony_ciendif::VK_VALVE_mutable_descriptor_type[] 3796e5c31af7Sopenharmony_ci**** 3797e5c31af7Sopenharmony_ci 3798e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkCopyDescriptorSet.txt[] 3799e5c31af7Sopenharmony_ci-- 3800e5c31af7Sopenharmony_ci 3801e5c31af7Sopenharmony_ci 3802e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_descriptor_update_template[] 3803e5c31af7Sopenharmony_ci[[descriptorsets-updates-with-template]] 3804e5c31af7Sopenharmony_ci=== Descriptor Update Templates 3805e5c31af7Sopenharmony_ci 3806e5c31af7Sopenharmony_ci[open,refpage='VkDescriptorUpdateTemplate',desc='Opaque handle to a descriptor update template',type='handles'] 3807e5c31af7Sopenharmony_ci-- 3808e5c31af7Sopenharmony_ciA descriptor update template specifies a mapping from descriptor update 3809e5c31af7Sopenharmony_ciinformation in host memory to descriptors in a descriptor set. 3810e5c31af7Sopenharmony_ciIt is designed to avoid passing redundant information to the driver when 3811e5c31af7Sopenharmony_cifrequently updating the same set of descriptors in descriptor sets. 3812e5c31af7Sopenharmony_ci 3813e5c31af7Sopenharmony_ciDescriptor update template objects are represented by 3814e5c31af7Sopenharmony_cisname:VkDescriptorUpdateTemplate handles: 3815e5c31af7Sopenharmony_ci 3816e5c31af7Sopenharmony_ciinclude::{generated}/api/handles/VkDescriptorUpdateTemplate.txt[] 3817e5c31af7Sopenharmony_ci 3818e5c31af7Sopenharmony_ciifdef::VK_KHR_descriptor_update_template[] 3819e5c31af7Sopenharmony_cior the equivalent 3820e5c31af7Sopenharmony_ci 3821e5c31af7Sopenharmony_ciinclude::{generated}/api/handles/VkDescriptorUpdateTemplateKHR.txt[] 3822e5c31af7Sopenharmony_ciendif::VK_KHR_descriptor_update_template[] 3823e5c31af7Sopenharmony_ci-- 3824e5c31af7Sopenharmony_ci 3825e5c31af7Sopenharmony_ci 3826e5c31af7Sopenharmony_ci=== Descriptor Set Updates with Templates 3827e5c31af7Sopenharmony_ci 3828e5c31af7Sopenharmony_ci[open,refpage='vkCreateDescriptorUpdateTemplate',desc='Create a new descriptor update template',type='protos'] 3829e5c31af7Sopenharmony_ci-- 3830e5c31af7Sopenharmony_ciUpdating a large sname:VkDescriptorSet array can: be an expensive operation 3831e5c31af7Sopenharmony_cisince an application must: specify one slink:VkWriteDescriptorSet structure 3832e5c31af7Sopenharmony_cifor each descriptor or descriptor array to update, each of which 3833e5c31af7Sopenharmony_cire-specifies the same state when updating the same descriptor in multiple 3834e5c31af7Sopenharmony_cidescriptor sets. 3835e5c31af7Sopenharmony_ciFor cases when an application wishes to update the same set of descriptors 3836e5c31af7Sopenharmony_ciin multiple descriptor sets allocated using the same 3837e5c31af7Sopenharmony_cisname:VkDescriptorSetLayout, flink:vkUpdateDescriptorSetWithTemplate can: be 3838e5c31af7Sopenharmony_ciused as a replacement for flink:vkUpdateDescriptorSets. 3839e5c31af7Sopenharmony_ci 3840e5c31af7Sopenharmony_cisname:VkDescriptorUpdateTemplate allows implementations to convert a set of 3841e5c31af7Sopenharmony_cidescriptor update operations on a single descriptor set to an internal 3842e5c31af7Sopenharmony_ciformat that, in conjunction with flink:vkUpdateDescriptorSetWithTemplate 3843e5c31af7Sopenharmony_ciifdef::VK_KHR_push_descriptor[] 3844e5c31af7Sopenharmony_cior flink:vkCmdPushDescriptorSetWithTemplateKHR 3845e5c31af7Sopenharmony_ciendif::VK_KHR_push_descriptor[] 3846e5c31af7Sopenharmony_ci, can: be more efficient compared to calling flink:vkUpdateDescriptorSets 3847e5c31af7Sopenharmony_ciifdef::VK_KHR_push_descriptor[] 3848e5c31af7Sopenharmony_cior flink:vkCmdPushDescriptorSetKHR 3849e5c31af7Sopenharmony_ciendif::VK_KHR_push_descriptor[] 3850e5c31af7Sopenharmony_ci. 3851e5c31af7Sopenharmony_ciThe descriptors themselves are not specified in the 3852e5c31af7Sopenharmony_cisname:VkDescriptorUpdateTemplate, rather, offsets into an application 3853e5c31af7Sopenharmony_ciprovided pointer to host memory are specified, which are combined with a 3854e5c31af7Sopenharmony_cipointer passed to flink:vkUpdateDescriptorSetWithTemplate 3855e5c31af7Sopenharmony_ciifdef::VK_KHR_push_descriptor[] 3856e5c31af7Sopenharmony_cior flink:vkCmdPushDescriptorSetWithTemplateKHR 3857e5c31af7Sopenharmony_ciendif::VK_KHR_push_descriptor[] 3858e5c31af7Sopenharmony_ci. 3859e5c31af7Sopenharmony_ciThis allows large batches of updates to be executed without having to 3860e5c31af7Sopenharmony_ciconvert application data structures into a strictly-defined Vulkan data 3861e5c31af7Sopenharmony_cistructure. 3862e5c31af7Sopenharmony_ci 3863e5c31af7Sopenharmony_ciTo create a descriptor update template, call: 3864e5c31af7Sopenharmony_ci 3865e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1[] 3866e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCreateDescriptorUpdateTemplate.txt[] 3867e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1[] 3868e5c31af7Sopenharmony_ci 3869e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1+VK_KHR_descriptor_update_template[or the equivalent command] 3870e5c31af7Sopenharmony_ci 3871e5c31af7Sopenharmony_ciifdef::VK_KHR_descriptor_update_template[] 3872e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCreateDescriptorUpdateTemplateKHR.txt[] 3873e5c31af7Sopenharmony_ciendif::VK_KHR_descriptor_update_template[] 3874e5c31af7Sopenharmony_ci 3875e5c31af7Sopenharmony_ci * pname:device is the logical device that creates the descriptor update 3876e5c31af7Sopenharmony_ci template. 3877e5c31af7Sopenharmony_ci * pname:pCreateInfo is a pointer to a 3878e5c31af7Sopenharmony_ci slink:VkDescriptorUpdateTemplateCreateInfo structure specifying the set 3879e5c31af7Sopenharmony_ci of descriptors to update with a single call to 3880e5c31af7Sopenharmony_ciifdef::VK_KHR_push_descriptor[] 3881e5c31af7Sopenharmony_ci flink:vkCmdPushDescriptorSetWithTemplateKHR or 3882e5c31af7Sopenharmony_ciendif::VK_KHR_push_descriptor[] 3883e5c31af7Sopenharmony_ci flink:vkUpdateDescriptorSetWithTemplate. 3884e5c31af7Sopenharmony_ci * pname:pAllocator controls host memory allocation as described in the 3885e5c31af7Sopenharmony_ci <<memory-allocation, Memory Allocation>> chapter. 3886e5c31af7Sopenharmony_ci * pname:pDescriptorUpdateTemplate is a pointer to a 3887e5c31af7Sopenharmony_ci sname:VkDescriptorUpdateTemplate handle in which the resulting 3888e5c31af7Sopenharmony_ci descriptor update template object is returned. 3889e5c31af7Sopenharmony_ci 3890e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCreateDescriptorUpdateTemplate.txt[] 3891e5c31af7Sopenharmony_ci-- 3892e5c31af7Sopenharmony_ci 3893e5c31af7Sopenharmony_ci[open,refpage='VkDescriptorUpdateTemplateCreateInfo',desc='Structure specifying parameters of a newly created descriptor update template',type='structs'] 3894e5c31af7Sopenharmony_ci-- 3895e5c31af7Sopenharmony_ciThe slink:VkDescriptorUpdateTemplateCreateInfo structure is defined as: 3896e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkDescriptorUpdateTemplateCreateInfo.txt[] 3897e5c31af7Sopenharmony_ci 3898e5c31af7Sopenharmony_ciifdef::VK_KHR_descriptor_update_template[] 3899e5c31af7Sopenharmony_cior the equivalent 3900e5c31af7Sopenharmony_ci 3901e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkDescriptorUpdateTemplateCreateInfoKHR.txt[] 3902e5c31af7Sopenharmony_ciendif::VK_KHR_descriptor_update_template[] 3903e5c31af7Sopenharmony_ci 3904e5c31af7Sopenharmony_ci * pname:sType is the type of this structure. 3905e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 3906e5c31af7Sopenharmony_ci structure. 3907e5c31af7Sopenharmony_ci * pname:flags is reserved for future use. 3908e5c31af7Sopenharmony_ci * pname:descriptorUpdateEntryCount is the number of elements in the 3909e5c31af7Sopenharmony_ci pname:pDescriptorUpdateEntries array. 3910e5c31af7Sopenharmony_ci * pname:pDescriptorUpdateEntries is a pointer to an array of 3911e5c31af7Sopenharmony_ci slink:VkDescriptorUpdateTemplateEntry structures describing the 3912e5c31af7Sopenharmony_ci descriptors to be updated by the descriptor update template. 3913e5c31af7Sopenharmony_ci * pname:templateType Specifies the type of the descriptor update template. 3914e5c31af7Sopenharmony_ci If set to ename:VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET it 3915e5c31af7Sopenharmony_ci can: only be used to update descriptor sets with a fixed 3916e5c31af7Sopenharmony_ci pname:descriptorSetLayout. 3917e5c31af7Sopenharmony_ciifdef::VK_KHR_push_descriptor[] 3918e5c31af7Sopenharmony_ci If set to ename:VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR 3919e5c31af7Sopenharmony_ci it can: only be used to push descriptor sets using the provided 3920e5c31af7Sopenharmony_ci pname:pipelineBindPoint, pname:pipelineLayout, and pname:set number. 3921e5c31af7Sopenharmony_ciendif::VK_KHR_push_descriptor[] 3922e5c31af7Sopenharmony_ci * pname:descriptorSetLayout is the descriptor set layout used to build the 3923e5c31af7Sopenharmony_ci descriptor update template. 3924e5c31af7Sopenharmony_ci All descriptor sets which are going to be updated through the newly 3925e5c31af7Sopenharmony_ci created descriptor update template must: be created with a layout that 3926e5c31af7Sopenharmony_ci matches (is the same as, or defined identically to) this layout. 3927e5c31af7Sopenharmony_ci This parameter is ignored if pname:templateType is not 3928e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET. 3929e5c31af7Sopenharmony_ciifdef::VK_KHR_push_descriptor[] 3930e5c31af7Sopenharmony_ci * pname:pipelineBindPoint is a elink:VkPipelineBindPoint indicating the 3931e5c31af7Sopenharmony_ci type of the pipeline that will use the descriptors. 3932e5c31af7Sopenharmony_ci This parameter is ignored if pname:templateType is not 3933e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR 3934e5c31af7Sopenharmony_ci * pname:pipelineLayout is a slink:VkPipelineLayout object used to program 3935e5c31af7Sopenharmony_ci the bindings. 3936e5c31af7Sopenharmony_ci This parameter is ignored if pname:templateType is not 3937e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR 3938e5c31af7Sopenharmony_ci * pname:set is the set number of the descriptor set in the pipeline layout 3939e5c31af7Sopenharmony_ci that will be updated. 3940e5c31af7Sopenharmony_ci This parameter is ignored if pname:templateType is not 3941e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR 3942e5c31af7Sopenharmony_ciendif::VK_KHR_push_descriptor[] 3943e5c31af7Sopenharmony_ciifndef::VK_KHR_push_descriptor[] 3944e5c31af7Sopenharmony_ci * pname:pipelineBindPoint is reserved for future use and is ignored 3945e5c31af7Sopenharmony_ci * pname:pipelineLayout is reserved for future use and is ignored 3946e5c31af7Sopenharmony_ci * pname:set is reserved for future use and is ignored 3947e5c31af7Sopenharmony_ciendif::VK_KHR_push_descriptor[] 3948e5c31af7Sopenharmony_ci 3949e5c31af7Sopenharmony_ci.Valid Usage 3950e5c31af7Sopenharmony_ci**** 3951e5c31af7Sopenharmony_ci * [[VUID-VkDescriptorUpdateTemplateCreateInfo-templateType-00350]] 3952e5c31af7Sopenharmony_ci If pname:templateType is 3953e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET, 3954e5c31af7Sopenharmony_ci pname:descriptorSetLayout must: be a valid sname:VkDescriptorSetLayout 3955e5c31af7Sopenharmony_ci handle 3956e5c31af7Sopenharmony_ciifdef::VK_KHR_push_descriptor[] 3957e5c31af7Sopenharmony_ci * [[VUID-VkDescriptorUpdateTemplateCreateInfo-templateType-00351]] 3958e5c31af7Sopenharmony_ci If pname:templateType is 3959e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR, 3960e5c31af7Sopenharmony_ci pname:pipelineBindPoint must: be a valid elink:VkPipelineBindPoint value 3961e5c31af7Sopenharmony_ci * [[VUID-VkDescriptorUpdateTemplateCreateInfo-templateType-00352]] 3962e5c31af7Sopenharmony_ci If pname:templateType is 3963e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR, 3964e5c31af7Sopenharmony_ci pname:pipelineLayout must: be a valid sname:VkPipelineLayout handle 3965e5c31af7Sopenharmony_ci * [[VUID-VkDescriptorUpdateTemplateCreateInfo-templateType-00353]] 3966e5c31af7Sopenharmony_ci If pname:templateType is 3967e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR, pname:set 3968e5c31af7Sopenharmony_ci must: be the unique set number in the pipeline layout that uses a 3969e5c31af7Sopenharmony_ci descriptor set layout that was created with 3970e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR 3971e5c31af7Sopenharmony_ciendif::VK_KHR_push_descriptor[] 3972e5c31af7Sopenharmony_ciifdef::VK_VALVE_mutable_descriptor_type[] 3973e5c31af7Sopenharmony_ci * [[VUID-VkDescriptorUpdateTemplateCreateInfo-templateType-04615]] 3974e5c31af7Sopenharmony_ci If pname:templateType is 3975e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET, 3976e5c31af7Sopenharmony_ci pname:descriptorSetLayout must: not contain a binding with type 3977e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_MUTABLE_VALVE 3978e5c31af7Sopenharmony_ciendif::VK_VALVE_mutable_descriptor_type[] 3979e5c31af7Sopenharmony_ci**** 3980e5c31af7Sopenharmony_ci 3981e5c31af7Sopenharmony_ci 3982e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkDescriptorUpdateTemplateCreateInfo.txt[] 3983e5c31af7Sopenharmony_ci-- 3984e5c31af7Sopenharmony_ci 3985e5c31af7Sopenharmony_ci[open,refpage='VkDescriptorUpdateTemplateCreateFlags',desc='Reserved for future use',type='flags'] 3986e5c31af7Sopenharmony_ci-- 3987e5c31af7Sopenharmony_ciinclude::{generated}/api/flags/VkDescriptorUpdateTemplateCreateFlags.txt[] 3988e5c31af7Sopenharmony_ci 3989e5c31af7Sopenharmony_ciifdef::VK_KHR_descriptor_update_template[] 3990e5c31af7Sopenharmony_cior the equivalent 3991e5c31af7Sopenharmony_ci 3992e5c31af7Sopenharmony_ciinclude::{generated}/api/flags/VkDescriptorUpdateTemplateCreateFlagsKHR.txt[] 3993e5c31af7Sopenharmony_ciendif::VK_KHR_descriptor_update_template[] 3994e5c31af7Sopenharmony_ci 3995e5c31af7Sopenharmony_citname:VkDescriptorUpdateTemplateCreateFlags is a bitmask type for setting a 3996e5c31af7Sopenharmony_cimask, but is currently reserved for future use. 3997e5c31af7Sopenharmony_ci-- 3998e5c31af7Sopenharmony_ci 3999e5c31af7Sopenharmony_ci[open,refpage='VkDescriptorUpdateTemplateType',desc='Indicates the valid usage of the descriptor update template',type='enums'] 4000e5c31af7Sopenharmony_ci-- 4001e5c31af7Sopenharmony_ciThe descriptor update template type is determined by the 4002e5c31af7Sopenharmony_cislink:VkDescriptorUpdateTemplateCreateInfo::pname:templateType property, 4003e5c31af7Sopenharmony_ciwhich takes the following values: 4004e5c31af7Sopenharmony_ci 4005e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkDescriptorUpdateTemplateType.txt[] 4006e5c31af7Sopenharmony_ci 4007e5c31af7Sopenharmony_ciifdef::VK_KHR_descriptor_update_template[] 4008e5c31af7Sopenharmony_cior the equivalent 4009e5c31af7Sopenharmony_ci 4010e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkDescriptorUpdateTemplateTypeKHR.txt[] 4011e5c31af7Sopenharmony_ciendif::VK_KHR_descriptor_update_template[] 4012e5c31af7Sopenharmony_ci 4013e5c31af7Sopenharmony_ci * ename:VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET specifies that 4014e5c31af7Sopenharmony_ci the descriptor update template will be used for descriptor set updates 4015e5c31af7Sopenharmony_ci only. 4016e5c31af7Sopenharmony_ciifdef::VK_KHR_push_descriptor[] 4017e5c31af7Sopenharmony_ci * ename:VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR specifies 4018e5c31af7Sopenharmony_ci that the descriptor update template will be used for push descriptor 4019e5c31af7Sopenharmony_ci updates only. 4020e5c31af7Sopenharmony_ciendif::VK_KHR_push_descriptor[] 4021e5c31af7Sopenharmony_ci-- 4022e5c31af7Sopenharmony_ci 4023e5c31af7Sopenharmony_ci 4024e5c31af7Sopenharmony_ci[open,refpage='VkDescriptorUpdateTemplateEntry',desc='Describes a single descriptor update of the descriptor update template',type='structs'] 4025e5c31af7Sopenharmony_ci-- 4026e5c31af7Sopenharmony_ciThe sname:VkDescriptorUpdateTemplateEntry structure is defined as: 4027e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkDescriptorUpdateTemplateEntry.txt[] 4028e5c31af7Sopenharmony_ci 4029e5c31af7Sopenharmony_ciifdef::VK_KHR_descriptor_update_template[] 4030e5c31af7Sopenharmony_cior the equivalent 4031e5c31af7Sopenharmony_ci 4032e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkDescriptorUpdateTemplateEntryKHR.txt[] 4033e5c31af7Sopenharmony_ciendif::VK_KHR_descriptor_update_template[] 4034e5c31af7Sopenharmony_ci 4035e5c31af7Sopenharmony_ci * pname:dstBinding is the descriptor binding to update when using this 4036e5c31af7Sopenharmony_ci descriptor update template. 4037e5c31af7Sopenharmony_ci * pname:dstArrayElement is the starting element in the array belonging to 4038e5c31af7Sopenharmony_ci pname:dstBinding. 4039e5c31af7Sopenharmony_ciifdef::VK_EXT_inline_uniform_block[] 4040e5c31af7Sopenharmony_ci If the descriptor binding identified by pname:dstBinding has a 4041e5c31af7Sopenharmony_ci descriptor type of ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT 4042e5c31af7Sopenharmony_ci then pname:dstArrayElement specifies the starting byte offset to update. 4043e5c31af7Sopenharmony_ciendif::VK_EXT_inline_uniform_block[] 4044e5c31af7Sopenharmony_ci * pname:descriptorCount is the number of descriptors to update. 4045e5c31af7Sopenharmony_ci If pname:descriptorCount is greater than the number of remaining array 4046e5c31af7Sopenharmony_ci elements in the destination binding, those affect consecutive bindings 4047e5c31af7Sopenharmony_ci in a manner similar to slink:VkWriteDescriptorSet above. 4048e5c31af7Sopenharmony_ciifdef::VK_EXT_inline_uniform_block[] 4049e5c31af7Sopenharmony_ci If the descriptor binding identified by pname:dstBinding has a 4050e5c31af7Sopenharmony_ci descriptor type of ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT 4051e5c31af7Sopenharmony_ci then pname:descriptorCount specifies the number of bytes to update and 4052e5c31af7Sopenharmony_ci the remaining array elements in the destination binding refer to the 4053e5c31af7Sopenharmony_ci remaining number of bytes in it. 4054e5c31af7Sopenharmony_ciendif::VK_EXT_inline_uniform_block[] 4055e5c31af7Sopenharmony_ci * pname:descriptorType is a elink:VkDescriptorType specifying the type of 4056e5c31af7Sopenharmony_ci the descriptor. 4057e5c31af7Sopenharmony_ci * pname:offset is the offset in bytes of the first binding in the raw data 4058e5c31af7Sopenharmony_ci structure. 4059e5c31af7Sopenharmony_ci * pname:stride is the stride in bytes between two consecutive array 4060e5c31af7Sopenharmony_ci elements of the descriptor update informations in the raw data 4061e5c31af7Sopenharmony_ci structure. 4062e5c31af7Sopenharmony_ci The actual pointer ptr for each array element j of update entry i is 4063e5c31af7Sopenharmony_ci computed using the following formula: 4064e5c31af7Sopenharmony_ci+ 4065e5c31af7Sopenharmony_ci[source,c++] 4066e5c31af7Sopenharmony_ci~~~~ 4067e5c31af7Sopenharmony_ci const char *ptr = (const char *)pData + pDescriptorUpdateEntries[i].offset + j * pDescriptorUpdateEntries[i].stride 4068e5c31af7Sopenharmony_ci~~~~ 4069e5c31af7Sopenharmony_ci+ 4070e5c31af7Sopenharmony_ciThe stride is useful in case the bindings are stored in structs along with 4071e5c31af7Sopenharmony_ciother data. 4072e5c31af7Sopenharmony_ciifdef::VK_EXT_inline_uniform_block[] 4073e5c31af7Sopenharmony_ciIf pname:descriptorType is ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT 4074e5c31af7Sopenharmony_cithen the value of pname:stride is ignored and the stride is assumed to be 4075e5c31af7Sopenharmony_ci`1`, i.e. the descriptor update information for them is always specified as 4076e5c31af7Sopenharmony_cia contiguous range. 4077e5c31af7Sopenharmony_ciendif::VK_EXT_inline_uniform_block[] 4078e5c31af7Sopenharmony_ci 4079e5c31af7Sopenharmony_ci.Valid Usage 4080e5c31af7Sopenharmony_ci**** 4081e5c31af7Sopenharmony_ci * [[VUID-VkDescriptorUpdateTemplateEntry-dstBinding-00354]] 4082e5c31af7Sopenharmony_ci pname:dstBinding must: be a valid binding in the descriptor set layout 4083e5c31af7Sopenharmony_ci implicitly specified when using a descriptor update template to update 4084e5c31af7Sopenharmony_ci descriptors 4085e5c31af7Sopenharmony_ci * [[VUID-VkDescriptorUpdateTemplateEntry-dstArrayElement-00355]] 4086e5c31af7Sopenharmony_ci pname:dstArrayElement and pname:descriptorCount must: be less than or 4087e5c31af7Sopenharmony_ci equal to the number of array elements in the descriptor set binding 4088e5c31af7Sopenharmony_ci implicitly specified when using a descriptor update template to update 4089e5c31af7Sopenharmony_ci descriptors, and all applicable consecutive bindings, as described by 4090e5c31af7Sopenharmony_ci <<descriptorsets-updates-consecutive>> 4091e5c31af7Sopenharmony_ciifdef::VK_EXT_inline_uniform_block[] 4092e5c31af7Sopenharmony_ci * [[VUID-VkDescriptorUpdateTemplateEntry-descriptor-02226]] 4093e5c31af7Sopenharmony_ci If pname:descriptor type is 4094e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT, pname:dstArrayElement 4095e5c31af7Sopenharmony_ci must: be an integer multiple of `4` 4096e5c31af7Sopenharmony_ci * [[VUID-VkDescriptorUpdateTemplateEntry-descriptor-02227]] 4097e5c31af7Sopenharmony_ci If pname:descriptor type is 4098e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT, pname:descriptorCount 4099e5c31af7Sopenharmony_ci must: be an integer multiple of `4` 4100e5c31af7Sopenharmony_ciendif::VK_EXT_inline_uniform_block[] 4101e5c31af7Sopenharmony_ci**** 4102e5c31af7Sopenharmony_ci 4103e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkDescriptorUpdateTemplateEntry.txt[] 4104e5c31af7Sopenharmony_ci-- 4105e5c31af7Sopenharmony_ci 4106e5c31af7Sopenharmony_ci[open,refpage='vkDestroyDescriptorUpdateTemplate',desc='Destroy a descriptor update template object',type='protos'] 4107e5c31af7Sopenharmony_ci-- 4108e5c31af7Sopenharmony_ciTo destroy a descriptor update template, call: 4109e5c31af7Sopenharmony_ci 4110e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1[] 4111e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkDestroyDescriptorUpdateTemplate.txt[] 4112e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1[] 4113e5c31af7Sopenharmony_ci 4114e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1+VK_KHR_descriptor_update_template[or the equivalent command] 4115e5c31af7Sopenharmony_ci 4116e5c31af7Sopenharmony_ciifdef::VK_KHR_descriptor_update_template[] 4117e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkDestroyDescriptorUpdateTemplateKHR.txt[] 4118e5c31af7Sopenharmony_ciendif::VK_KHR_descriptor_update_template[] 4119e5c31af7Sopenharmony_ci 4120e5c31af7Sopenharmony_ci * pname:device is the logical device that has been used to create the 4121e5c31af7Sopenharmony_ci descriptor update template 4122e5c31af7Sopenharmony_ci * pname:descriptorUpdateTemplate is the descriptor update template to 4123e5c31af7Sopenharmony_ci destroy. 4124e5c31af7Sopenharmony_ci * pname:pAllocator controls host memory allocation as described in the 4125e5c31af7Sopenharmony_ci <<memory-allocation, Memory Allocation>> chapter. 4126e5c31af7Sopenharmony_ci 4127e5c31af7Sopenharmony_ci.Valid Usage 4128e5c31af7Sopenharmony_ci**** 4129e5c31af7Sopenharmony_ci * [[VUID-vkDestroyDescriptorUpdateTemplate-descriptorSetLayout-00356]] 4130e5c31af7Sopenharmony_ci If sname:VkAllocationCallbacks were provided when 4131e5c31af7Sopenharmony_ci pname:descriptorUpdateTemplate was created, a compatible set of 4132e5c31af7Sopenharmony_ci callbacks must: be provided here 4133e5c31af7Sopenharmony_ci * [[VUID-vkDestroyDescriptorUpdateTemplate-descriptorSetLayout-00357]] 4134e5c31af7Sopenharmony_ci If no sname:VkAllocationCallbacks were provided when 4135e5c31af7Sopenharmony_ci pname:descriptorUpdateTemplate was created, pname:pAllocator must: be 4136e5c31af7Sopenharmony_ci `NULL` 4137e5c31af7Sopenharmony_ci**** 4138e5c31af7Sopenharmony_ci 4139e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkDestroyDescriptorUpdateTemplate.txt[] 4140e5c31af7Sopenharmony_ci-- 4141e5c31af7Sopenharmony_ci 4142e5c31af7Sopenharmony_ci[open,refpage='vkUpdateDescriptorSetWithTemplate',desc='Update the contents of a descriptor set object using an update template',type='protos'] 4143e5c31af7Sopenharmony_ci-- 4144e5c31af7Sopenharmony_ciOnce a sname:VkDescriptorUpdateTemplate has been created, descriptor sets 4145e5c31af7Sopenharmony_cican: be updated by calling: 4146e5c31af7Sopenharmony_ci 4147e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1[] 4148e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkUpdateDescriptorSetWithTemplate.txt[] 4149e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1[] 4150e5c31af7Sopenharmony_ci 4151e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1+VK_KHR_descriptor_update_template[or the equivalent command] 4152e5c31af7Sopenharmony_ci 4153e5c31af7Sopenharmony_ciifdef::VK_KHR_descriptor_update_template[] 4154e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkUpdateDescriptorSetWithTemplateKHR.txt[] 4155e5c31af7Sopenharmony_ciendif::VK_KHR_descriptor_update_template[] 4156e5c31af7Sopenharmony_ci 4157e5c31af7Sopenharmony_ci * pname:device is the logical device that updates the descriptor set. 4158e5c31af7Sopenharmony_ci * pname:descriptorSet is the descriptor set to update 4159e5c31af7Sopenharmony_ci * pname:descriptorUpdateTemplate is a slink:VkDescriptorUpdateTemplate 4160e5c31af7Sopenharmony_ci object specifying the update mapping between pname:pData and the 4161e5c31af7Sopenharmony_ci descriptor set to update. 4162e5c31af7Sopenharmony_ci * pname:pData is a pointer to memory containing one or more 4163e5c31af7Sopenharmony_ci slink:VkDescriptorImageInfo, slink:VkDescriptorBufferInfo, or 4164e5c31af7Sopenharmony_ci slink:VkBufferView structures 4165e5c31af7Sopenharmony_ciifdef::VK_KHR_acceleration_structure[or slink:VkAccelerationStructureKHR] 4166e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing[or slink:VkAccelerationStructureNV] 4167e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing,VK_KHR_acceleration_structure[handles] 4168e5c31af7Sopenharmony_ci used to write the descriptors. 4169e5c31af7Sopenharmony_ci 4170e5c31af7Sopenharmony_ci.Valid Usage 4171e5c31af7Sopenharmony_ci**** 4172e5c31af7Sopenharmony_ci * [[VUID-vkUpdateDescriptorSetWithTemplate-pData-01685]] 4173e5c31af7Sopenharmony_ci pname:pData must: be a valid pointer to a memory containing one or more 4174e5c31af7Sopenharmony_ci valid instances of slink:VkDescriptorImageInfo, 4175e5c31af7Sopenharmony_ci slink:VkDescriptorBufferInfo, or slink:VkBufferView in a layout defined 4176e5c31af7Sopenharmony_ci by pname:descriptorUpdateTemplate when it was created with 4177e5c31af7Sopenharmony_ci flink:vkCreateDescriptorUpdateTemplate 4178e5c31af7Sopenharmony_ci**** 4179e5c31af7Sopenharmony_ci 4180e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkUpdateDescriptorSetWithTemplate.txt[] 4181e5c31af7Sopenharmony_ci 4182e5c31af7Sopenharmony_ci.API example 4183e5c31af7Sopenharmony_ci[source,c++] 4184e5c31af7Sopenharmony_ci~~~~ 4185e5c31af7Sopenharmony_cistruct AppBufferView { 4186e5c31af7Sopenharmony_ci VkBufferView bufferView; 4187e5c31af7Sopenharmony_ci uint32_t applicationRelatedInformation; 4188e5c31af7Sopenharmony_ci}; 4189e5c31af7Sopenharmony_ci 4190e5c31af7Sopenharmony_cistruct AppDataStructure 4191e5c31af7Sopenharmony_ci{ 4192e5c31af7Sopenharmony_ci VkDescriptorImageInfo imageInfo; // a single image info 4193e5c31af7Sopenharmony_ci VkDescriptorBufferInfo bufferInfoArray[3]; // 3 buffer infos in an array 4194e5c31af7Sopenharmony_ci AppBufferView bufferView[2]; // An application defined structure containing a bufferView 4195e5c31af7Sopenharmony_ci // ... some more application related data 4196e5c31af7Sopenharmony_ci}; 4197e5c31af7Sopenharmony_ci 4198e5c31af7Sopenharmony_ciconst VkDescriptorUpdateTemplateEntry descriptorUpdateTemplateEntries[] = 4199e5c31af7Sopenharmony_ci{ 4200e5c31af7Sopenharmony_ci // binding to a single image descriptor 4201e5c31af7Sopenharmony_ci { 4202e5c31af7Sopenharmony_ci 0, // binding 4203e5c31af7Sopenharmony_ci 0, // dstArrayElement 4204e5c31af7Sopenharmony_ci 1, // descriptorCount 4205e5c31af7Sopenharmony_ci VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, // descriptorType 4206e5c31af7Sopenharmony_ci offsetof(AppDataStructure, imageInfo), // offset 4207e5c31af7Sopenharmony_ci 0 // stride is not required if descriptorCount is 1 4208e5c31af7Sopenharmony_ci }, 4209e5c31af7Sopenharmony_ci 4210e5c31af7Sopenharmony_ci // binding to an array of buffer descriptors 4211e5c31af7Sopenharmony_ci { 4212e5c31af7Sopenharmony_ci 1, // binding 4213e5c31af7Sopenharmony_ci 0, // dstArrayElement 4214e5c31af7Sopenharmony_ci 3, // descriptorCount 4215e5c31af7Sopenharmony_ci VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, // descriptorType 4216e5c31af7Sopenharmony_ci offsetof(AppDataStructure, bufferInfoArray), // offset 4217e5c31af7Sopenharmony_ci sizeof(VkDescriptorBufferInfo) // stride, descriptor buffer infos are compact 4218e5c31af7Sopenharmony_ci }, 4219e5c31af7Sopenharmony_ci 4220e5c31af7Sopenharmony_ci // binding to an array of buffer views 4221e5c31af7Sopenharmony_ci { 4222e5c31af7Sopenharmony_ci 2, // binding 4223e5c31af7Sopenharmony_ci 0, // dstArrayElement 4224e5c31af7Sopenharmony_ci 2, // descriptorCount 4225e5c31af7Sopenharmony_ci VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER, // descriptorType 4226e5c31af7Sopenharmony_ci offsetof(AppDataStructure, bufferView) + 4227e5c31af7Sopenharmony_ci offsetof(AppBufferView, bufferView), // offset 4228e5c31af7Sopenharmony_ci sizeof(AppBufferView) // stride, bufferViews do not have to be compact 4229e5c31af7Sopenharmony_ci }, 4230e5c31af7Sopenharmony_ci}; 4231e5c31af7Sopenharmony_ci 4232e5c31af7Sopenharmony_ci// create a descriptor update template for descriptor set updates 4233e5c31af7Sopenharmony_ciconst VkDescriptorUpdateTemplateCreateInfo createInfo = 4234e5c31af7Sopenharmony_ci{ 4235e5c31af7Sopenharmony_ci VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO, // sType 4236e5c31af7Sopenharmony_ci NULL, // pNext 4237e5c31af7Sopenharmony_ci 0, // flags 4238e5c31af7Sopenharmony_ci 3, // descriptorUpdateEntryCount 4239e5c31af7Sopenharmony_ci descriptorUpdateTemplateEntries, // pDescriptorUpdateEntries 4240e5c31af7Sopenharmony_ci VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET, // templateType 4241e5c31af7Sopenharmony_ci myLayout, // descriptorSetLayout 4242e5c31af7Sopenharmony_ci 0, // pipelineBindPoint, ignored by given templateType 4243e5c31af7Sopenharmony_ci 0, // pipelineLayout, ignored by given templateType 4244e5c31af7Sopenharmony_ci 0, // set, ignored by given templateType 4245e5c31af7Sopenharmony_ci}; 4246e5c31af7Sopenharmony_ci 4247e5c31af7Sopenharmony_ciVkDescriptorUpdateTemplate myDescriptorUpdateTemplate; 4248e5c31af7Sopenharmony_cimyResult = vkCreateDescriptorUpdateTemplate( 4249e5c31af7Sopenharmony_ci myDevice, 4250e5c31af7Sopenharmony_ci &createInfo, 4251e5c31af7Sopenharmony_ci NULL, 4252e5c31af7Sopenharmony_ci &myDescriptorUpdateTemplate); 4253e5c31af7Sopenharmony_ci 4254e5c31af7Sopenharmony_ciAppDataStructure appData; 4255e5c31af7Sopenharmony_ci 4256e5c31af7Sopenharmony_ci// fill appData here or cache it in your engine 4257e5c31af7Sopenharmony_civkUpdateDescriptorSetWithTemplate(myDevice, myDescriptorSet, myDescriptorUpdateTemplate, &appData); 4258e5c31af7Sopenharmony_ci~~~~ 4259e5c31af7Sopenharmony_ci-- 4260e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_descriptor_update_template[] 4261e5c31af7Sopenharmony_ci 4262e5c31af7Sopenharmony_ci 4263e5c31af7Sopenharmony_ci[[descriptorsets-binding]] 4264e5c31af7Sopenharmony_ci=== Descriptor Set Binding 4265e5c31af7Sopenharmony_ci 4266e5c31af7Sopenharmony_ci[open,refpage='vkCmdBindDescriptorSets',desc='Binds descriptor sets to a command buffer',type='protos'] 4267e5c31af7Sopenharmony_ci-- 4268e5c31af7Sopenharmony_ciTo bind one or more descriptor sets to a command buffer, call: 4269e5c31af7Sopenharmony_ci 4270e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCmdBindDescriptorSets.txt[] 4271e5c31af7Sopenharmony_ci 4272e5c31af7Sopenharmony_ci * pname:commandBuffer is the command buffer that the descriptor sets will 4273e5c31af7Sopenharmony_ci be bound to. 4274e5c31af7Sopenharmony_ci * pname:pipelineBindPoint is a elink:VkPipelineBindPoint indicating the 4275e5c31af7Sopenharmony_ci type of the pipeline that will use the descriptors. 4276e5c31af7Sopenharmony_ci There is a separate set of bind points for each pipeline type, so 4277e5c31af7Sopenharmony_ci binding one does not disturb the others. 4278e5c31af7Sopenharmony_ci * pname:layout is a slink:VkPipelineLayout object used to program the 4279e5c31af7Sopenharmony_ci bindings. 4280e5c31af7Sopenharmony_ci * pname:firstSet is the set number of the first descriptor set to be 4281e5c31af7Sopenharmony_ci bound. 4282e5c31af7Sopenharmony_ci * pname:descriptorSetCount is the number of elements in the 4283e5c31af7Sopenharmony_ci pname:pDescriptorSets array. 4284e5c31af7Sopenharmony_ci * pname:pDescriptorSets is a pointer to an array of handles to 4285e5c31af7Sopenharmony_ci slink:VkDescriptorSet objects describing the descriptor sets to bind to. 4286e5c31af7Sopenharmony_ci * pname:dynamicOffsetCount is the number of dynamic offsets in the 4287e5c31af7Sopenharmony_ci pname:pDynamicOffsets array. 4288e5c31af7Sopenharmony_ci * pname:pDynamicOffsets is a pointer to an array of code:uint32_t values 4289e5c31af7Sopenharmony_ci specifying dynamic offsets. 4290e5c31af7Sopenharmony_ci 4291e5c31af7Sopenharmony_cifname:vkCmdBindDescriptorSets causes the sets numbered [pname:firstSet.. 4292e5c31af7Sopenharmony_cipname:firstSet+pname:descriptorSetCount-1] to use the bindings stored in 4293e5c31af7Sopenharmony_cipname:pDescriptorSets[0..descriptorSetCount-1] for subsequent 4294e5c31af7Sopenharmony_ci<<pipeline-bindpoint-commands, bound pipeline commands>> set by 4295e5c31af7Sopenharmony_cipname:pipelineBindPoint. 4296e5c31af7Sopenharmony_ciAny bindings that were previously applied via these sets are no longer 4297e5c31af7Sopenharmony_civalid. 4298e5c31af7Sopenharmony_ci 4299e5c31af7Sopenharmony_ciOnce bound, a descriptor set affects rendering of subsequent commands that 4300e5c31af7Sopenharmony_ciinteract with the given pipeline type in the command buffer until either a 4301e5c31af7Sopenharmony_cidifferent set is bound to the same set number, or the set is disturbed as 4302e5c31af7Sopenharmony_cidescribed in <<descriptorsets-compatibility, Pipeline Layout 4303e5c31af7Sopenharmony_ciCompatibility>>. 4304e5c31af7Sopenharmony_ci 4305e5c31af7Sopenharmony_ciA compatible descriptor set must: be bound for all set numbers that any 4306e5c31af7Sopenharmony_cishaders in a pipeline access, at the time that a drawing or dispatching 4307e5c31af7Sopenharmony_cicommand is recorded to execute using that pipeline. 4308e5c31af7Sopenharmony_ciHowever, if none of the shaders in a pipeline statically use any bindings 4309e5c31af7Sopenharmony_ciwith a particular set number, then no descriptor set need be bound for that 4310e5c31af7Sopenharmony_ciset number, even if the pipeline layout includes a non-trivial descriptor 4311e5c31af7Sopenharmony_ciset layout for that set number. 4312e5c31af7Sopenharmony_ci 4313e5c31af7Sopenharmony_ci[[descriptorsets-binding-dynamicoffsets]] 4314e5c31af7Sopenharmony_ciIf any of the sets being bound include dynamic uniform or storage buffers, 4315e5c31af7Sopenharmony_cithen pname:pDynamicOffsets includes one element for each array element in 4316e5c31af7Sopenharmony_cieach dynamic descriptor type binding in each set. 4317e5c31af7Sopenharmony_ciValues are taken from pname:pDynamicOffsets in an order such that all 4318e5c31af7Sopenharmony_cientries for set N come before set N+1; within a set, entries are ordered by 4319e5c31af7Sopenharmony_cithe binding numbers in the descriptor set layouts; and within a binding 4320e5c31af7Sopenharmony_ciarray, elements are in order. 4321e5c31af7Sopenharmony_cipname:dynamicOffsetCount must: equal the total number of dynamic descriptors 4322e5c31af7Sopenharmony_ciin the sets being bound. 4323e5c31af7Sopenharmony_ci 4324e5c31af7Sopenharmony_ciThe effective offset used for dynamic uniform and storage buffer bindings is 4325e5c31af7Sopenharmony_cithe sum of the relative offset taken from pname:pDynamicOffsets, and the 4326e5c31af7Sopenharmony_cibase address of the buffer plus base offset in the descriptor set. 4327e5c31af7Sopenharmony_ciThe range of the dynamic uniform and storage buffer bindings is the buffer 4328e5c31af7Sopenharmony_cirange as specified in the descriptor set. 4329e5c31af7Sopenharmony_ci 4330e5c31af7Sopenharmony_ciEach of the pname:pDescriptorSets must: be compatible with the pipeline 4331e5c31af7Sopenharmony_cilayout specified by pname:layout. 4332e5c31af7Sopenharmony_ciThe layout used to program the bindings must: also be compatible with the 4333e5c31af7Sopenharmony_cipipeline used in subsequent <<pipeline-bindpoint-commands, bound pipeline 4334e5c31af7Sopenharmony_cicommands>> with that pipeline type, as defined in the 4335e5c31af7Sopenharmony_ci<<descriptorsets-compatibility, Pipeline Layout Compatibility>> section. 4336e5c31af7Sopenharmony_ci 4337e5c31af7Sopenharmony_ciThe descriptor set contents bound by a call to fname:vkCmdBindDescriptorSets 4338e5c31af7Sopenharmony_cimay: be consumed at the following times: 4339e5c31af7Sopenharmony_ci 4340e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[] 4341e5c31af7Sopenharmony_ci * For descriptor bindings created with the 4342e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT bit set, the contents 4343e5c31af7Sopenharmony_ci may: be consumed when the command buffer is submitted to a queue, or 4344e5c31af7Sopenharmony_ci during shader execution of the resulting draws and dispatches, or any 4345e5c31af7Sopenharmony_ci time in between. 4346e5c31af7Sopenharmony_ci Otherwise, 4347e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[] 4348e5c31af7Sopenharmony_ci * during host execution of the command, or during shader execution of the 4349e5c31af7Sopenharmony_ci resulting draws and dispatches, or any time in between. 4350e5c31af7Sopenharmony_ci 4351e5c31af7Sopenharmony_ciThus, the contents of a descriptor set binding must: not be altered 4352e5c31af7Sopenharmony_ci(overwritten by an update command, or freed) between the first point in time 4353e5c31af7Sopenharmony_cithat it may: be consumed, and when the command completes executing on the 4354e5c31af7Sopenharmony_ciqueue. 4355e5c31af7Sopenharmony_ci 4356e5c31af7Sopenharmony_ciThe contents of pname:pDynamicOffsets are consumed immediately during 4357e5c31af7Sopenharmony_ciexecution of fname:vkCmdBindDescriptorSets. 4358e5c31af7Sopenharmony_ciOnce all pending uses have completed, it is legal to update and reuse a 4359e5c31af7Sopenharmony_cidescriptor set. 4360e5c31af7Sopenharmony_ci 4361e5c31af7Sopenharmony_ci.Valid Usage 4362e5c31af7Sopenharmony_ci**** 4363e5c31af7Sopenharmony_ci * [[VUID-vkCmdBindDescriptorSets-pDescriptorSets-00358]] 4364e5c31af7Sopenharmony_ci Each element of pname:pDescriptorSets must: have been allocated with a 4365e5c31af7Sopenharmony_ci sname:VkDescriptorSetLayout that matches (is the same as, or identically 4366e5c31af7Sopenharmony_ci defined as) the sname:VkDescriptorSetLayout at set _n_ in pname:layout, 4367e5c31af7Sopenharmony_ci where _n_ is the sum of pname:firstSet and the index into 4368e5c31af7Sopenharmony_ci pname:pDescriptorSets 4369e5c31af7Sopenharmony_ci * [[VUID-vkCmdBindDescriptorSets-dynamicOffsetCount-00359]] 4370e5c31af7Sopenharmony_ci pname:dynamicOffsetCount must: be equal to the total number of dynamic 4371e5c31af7Sopenharmony_ci descriptors in pname:pDescriptorSets 4372e5c31af7Sopenharmony_ci * [[VUID-vkCmdBindDescriptorSets-firstSet-00360]] 4373e5c31af7Sopenharmony_ci The sum of pname:firstSet and pname:descriptorSetCount must: be less 4374e5c31af7Sopenharmony_ci than or equal to slink:VkPipelineLayoutCreateInfo::pname:setLayoutCount 4375e5c31af7Sopenharmony_ci provided when pname:layout was created 4376e5c31af7Sopenharmony_ci * [[VUID-vkCmdBindDescriptorSets-pipelineBindPoint-00361]] 4377e5c31af7Sopenharmony_ci pname:pipelineBindPoint must: be supported by the pname:commandBuffer's 4378e5c31af7Sopenharmony_ci parent sname:VkCommandPool's queue family 4379e5c31af7Sopenharmony_ci * [[VUID-vkCmdBindDescriptorSets-pDynamicOffsets-01971]] 4380e5c31af7Sopenharmony_ci Each element of pname:pDynamicOffsets which corresponds to a descriptor 4381e5c31af7Sopenharmony_ci binding with type ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC must: 4382e5c31af7Sopenharmony_ci be a multiple of 4383e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceLimits::pname:minUniformBufferOffsetAlignment 4384e5c31af7Sopenharmony_ci * [[VUID-vkCmdBindDescriptorSets-pDynamicOffsets-01972]] 4385e5c31af7Sopenharmony_ci Each element of pname:pDynamicOffsets which corresponds to a descriptor 4386e5c31af7Sopenharmony_ci binding with type ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC must: 4387e5c31af7Sopenharmony_ci be a multiple of 4388e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceLimits::pname:minStorageBufferOffsetAlignment 4389e5c31af7Sopenharmony_ci * [[VUID-vkCmdBindDescriptorSets-pDescriptorSets-01979]] 4390e5c31af7Sopenharmony_ci For each dynamic uniform or storage buffer binding in 4391e5c31af7Sopenharmony_ci pname:pDescriptorSets, the sum of the effective offset, as defined 4392e5c31af7Sopenharmony_ci above, and the range of the binding must: be less than or equal to the 4393e5c31af7Sopenharmony_ci size of the buffer 4394e5c31af7Sopenharmony_ciifdef::VK_VALVE_mutable_descriptor_type[] 4395e5c31af7Sopenharmony_ci * [[VUID-vkCmdBindDescriptorSets-pDescriptorSets-04616]] 4396e5c31af7Sopenharmony_ci Each element of pname:pDescriptorSets must: not have been allocated from 4397e5c31af7Sopenharmony_ci a sname:VkDescriptorPool with the 4398e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_POOL_CREATE_HOST_ONLY_BIT_VALVE flag set 4399e5c31af7Sopenharmony_ciendif::VK_VALVE_mutable_descriptor_type[] 4400e5c31af7Sopenharmony_ci**** 4401e5c31af7Sopenharmony_ci 4402e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCmdBindDescriptorSets.txt[] 4403e5c31af7Sopenharmony_ci-- 4404e5c31af7Sopenharmony_ci 4405e5c31af7Sopenharmony_ci 4406e5c31af7Sopenharmony_ciifdef::VK_KHR_push_descriptor[] 4407e5c31af7Sopenharmony_ci[[descriptorsets-push-descriptors]] 4408e5c31af7Sopenharmony_ci=== Push Descriptor Updates 4409e5c31af7Sopenharmony_ci 4410e5c31af7Sopenharmony_ci[open,refpage='vkCmdPushDescriptorSetKHR',desc='Pushes descriptor updates into a command buffer',type='protos'] 4411e5c31af7Sopenharmony_ci-- 4412e5c31af7Sopenharmony_ciIn addition to allocating descriptor sets and binding them to a command 4413e5c31af7Sopenharmony_cibuffer, an application can: record descriptor updates into the command 4414e5c31af7Sopenharmony_cibuffer. 4415e5c31af7Sopenharmony_ci 4416e5c31af7Sopenharmony_ciTo push descriptor updates into a command buffer, call: 4417e5c31af7Sopenharmony_ci 4418e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCmdPushDescriptorSetKHR.txt[] 4419e5c31af7Sopenharmony_ci 4420e5c31af7Sopenharmony_ci * pname:commandBuffer is the command buffer that the descriptors will be 4421e5c31af7Sopenharmony_ci recorded in. 4422e5c31af7Sopenharmony_ci * pname:pipelineBindPoint is a elink:VkPipelineBindPoint indicating the 4423e5c31af7Sopenharmony_ci type of the pipeline that will use the descriptors. 4424e5c31af7Sopenharmony_ci There is a separate set of push descriptor bindings for each pipeline 4425e5c31af7Sopenharmony_ci type, so binding one does not disturb the others. 4426e5c31af7Sopenharmony_ci * pname:layout is a slink:VkPipelineLayout object used to program the 4427e5c31af7Sopenharmony_ci bindings. 4428e5c31af7Sopenharmony_ci * pname:set is the set number of the descriptor set in the pipeline layout 4429e5c31af7Sopenharmony_ci that will be updated. 4430e5c31af7Sopenharmony_ci * pname:descriptorWriteCount is the number of elements in the 4431e5c31af7Sopenharmony_ci pname:pDescriptorWrites array. 4432e5c31af7Sopenharmony_ci * pname:pDescriptorWrites is a pointer to an array of 4433e5c31af7Sopenharmony_ci slink:VkWriteDescriptorSet structures describing the descriptors to be 4434e5c31af7Sopenharmony_ci updated. 4435e5c31af7Sopenharmony_ci 4436e5c31af7Sopenharmony_ci_Push descriptors_ are a small bank of descriptors whose storage is 4437e5c31af7Sopenharmony_ciinternally managed by the command buffer rather than being written into a 4438e5c31af7Sopenharmony_cidescriptor set and later bound to a command buffer. 4439e5c31af7Sopenharmony_ciPush descriptors allow for incremental updates of descriptors without 4440e5c31af7Sopenharmony_cimanaging the lifetime of descriptor sets. 4441e5c31af7Sopenharmony_ci 4442e5c31af7Sopenharmony_ciWhen a command buffer begins recording, all push descriptors are undefined:. 4443e5c31af7Sopenharmony_ciPush descriptors can: be updated incrementally and cause shaders to use the 4444e5c31af7Sopenharmony_ciupdated descriptors for subsequent <<pipeline-bindpoint-commands, bound 4445e5c31af7Sopenharmony_cipipeline commands>> with the pipeline type set by pname:pipelineBindPoint 4446e5c31af7Sopenharmony_ciuntil the descriptor is overwritten, or else until the set is disturbed as 4447e5c31af7Sopenharmony_cidescribed in <<descriptorsets-compatibility, Pipeline Layout 4448e5c31af7Sopenharmony_ciCompatibility>>. 4449e5c31af7Sopenharmony_ciWhen the set is disturbed or push descriptors with a different descriptor 4450e5c31af7Sopenharmony_ciset layout are set, all push descriptors are undefined:. 4451e5c31af7Sopenharmony_ci 4452e5c31af7Sopenharmony_ciPush descriptors that are <<shaders-staticuse,statically used>> by a 4453e5c31af7Sopenharmony_cipipeline must: not be undefined: at the time that a drawing or dispatching 4454e5c31af7Sopenharmony_cicommand is recorded to execute using that pipeline. 4455e5c31af7Sopenharmony_ciThis includes immutable sampler descriptors, which must: be pushed before 4456e5c31af7Sopenharmony_cithey are accessed by a pipeline (the immutable samplers are pushed, rather 4457e5c31af7Sopenharmony_cithan the samplers in pname:pDescriptorWrites). 4458e5c31af7Sopenharmony_ciPush descriptors that are not statically used can: remain undefined:. 4459e5c31af7Sopenharmony_ci 4460e5c31af7Sopenharmony_ciPush descriptors do not use dynamic offsets. 4461e5c31af7Sopenharmony_ciInstead, the corresponding non-dynamic descriptor types can: be used and the 4462e5c31af7Sopenharmony_cipname:offset member of slink:VkDescriptorBufferInfo can: be changed each 4463e5c31af7Sopenharmony_citime the descriptor is written. 4464e5c31af7Sopenharmony_ci 4465e5c31af7Sopenharmony_ciEach element of pname:pDescriptorWrites is interpreted as in 4466e5c31af7Sopenharmony_cislink:VkWriteDescriptorSet, except the pname:dstSet member is ignored. 4467e5c31af7Sopenharmony_ci 4468e5c31af7Sopenharmony_ciTo push an immutable sampler, use a slink:VkWriteDescriptorSet with 4469e5c31af7Sopenharmony_cipname:dstBinding and pname:dstArrayElement selecting the immutable sampler's 4470e5c31af7Sopenharmony_cibinding. 4471e5c31af7Sopenharmony_ciIf the descriptor type is ename:VK_DESCRIPTOR_TYPE_SAMPLER, the 4472e5c31af7Sopenharmony_cipname:pImageInfo parameter is ignored and the immutable sampler is taken 4473e5c31af7Sopenharmony_cifrom the push descriptor set layout in the pipeline layout. 4474e5c31af7Sopenharmony_ciIf the descriptor type is ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, 4475e5c31af7Sopenharmony_cithe pname:sampler member of the pname:pImageInfo parameter is ignored and 4476e5c31af7Sopenharmony_cithe immutable sampler is taken from the push descriptor set layout in the 4477e5c31af7Sopenharmony_cipipeline layout. 4478e5c31af7Sopenharmony_ci 4479e5c31af7Sopenharmony_ci.Valid Usage 4480e5c31af7Sopenharmony_ci**** 4481e5c31af7Sopenharmony_ci * [[VUID-vkCmdPushDescriptorSetKHR-pipelineBindPoint-00363]] 4482e5c31af7Sopenharmony_ci pname:pipelineBindPoint must: be supported by the pname:commandBuffer's 4483e5c31af7Sopenharmony_ci parent sname:VkCommandPool's queue family 4484e5c31af7Sopenharmony_ci * [[VUID-vkCmdPushDescriptorSetKHR-set-00364]] 4485e5c31af7Sopenharmony_ci pname:set must: be less than 4486e5c31af7Sopenharmony_ci slink:VkPipelineLayoutCreateInfo::pname:setLayoutCount provided when 4487e5c31af7Sopenharmony_ci pname:layout was created 4488e5c31af7Sopenharmony_ci * [[VUID-vkCmdPushDescriptorSetKHR-set-00365]] 4489e5c31af7Sopenharmony_ci pname:set must: be the unique set number in the pipeline layout that 4490e5c31af7Sopenharmony_ci uses a descriptor set layout that was created with 4491e5c31af7Sopenharmony_ci ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR 4492e5c31af7Sopenharmony_ci**** 4493e5c31af7Sopenharmony_ci 4494e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCmdPushDescriptorSetKHR.txt[] 4495e5c31af7Sopenharmony_ci 4496e5c31af7Sopenharmony_ci-- 4497e5c31af7Sopenharmony_ci 4498e5c31af7Sopenharmony_ci 4499e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_descriptor_update_template[] 4500e5c31af7Sopenharmony_ci=== Push Descriptor Updates with Descriptor Update Templates 4501e5c31af7Sopenharmony_ci 4502e5c31af7Sopenharmony_ci[open,refpage='vkCmdPushDescriptorSetWithTemplateKHR',desc='Pushes descriptor updates into a command buffer using a descriptor update template',type='protos'] 4503e5c31af7Sopenharmony_ci-- 4504e5c31af7Sopenharmony_ciIt is also possible to use a descriptor update template to specify the push 4505e5c31af7Sopenharmony_cidescriptors to update. 4506e5c31af7Sopenharmony_ciTo do so, call: 4507e5c31af7Sopenharmony_ci 4508e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCmdPushDescriptorSetWithTemplateKHR.txt[] 4509e5c31af7Sopenharmony_ci 4510e5c31af7Sopenharmony_ci * pname:commandBuffer is the command buffer that the descriptors will be 4511e5c31af7Sopenharmony_ci recorded in. 4512e5c31af7Sopenharmony_ci * pname:descriptorUpdateTemplate is a descriptor update template defining 4513e5c31af7Sopenharmony_ci how to interpret the descriptor information in pname:pData. 4514e5c31af7Sopenharmony_ci * pname:layout is a slink:VkPipelineLayout object used to program the 4515e5c31af7Sopenharmony_ci bindings. 4516e5c31af7Sopenharmony_ci It must: be compatible with the layout used to create the 4517e5c31af7Sopenharmony_ci pname:descriptorUpdateTemplate handle. 4518e5c31af7Sopenharmony_ci * pname:set is the set number of the descriptor set in the pipeline layout 4519e5c31af7Sopenharmony_ci that will be updated. 4520e5c31af7Sopenharmony_ci This must: be the same number used to create the 4521e5c31af7Sopenharmony_ci pname:descriptorUpdateTemplate handle. 4522e5c31af7Sopenharmony_ci * pname:pData is a pointer to memory containing descriptors for the 4523e5c31af7Sopenharmony_ci templated update. 4524e5c31af7Sopenharmony_ci 4525e5c31af7Sopenharmony_ci.Valid Usage 4526e5c31af7Sopenharmony_ci**** 4527e5c31af7Sopenharmony_ci * [[VUID-vkCmdPushDescriptorSetWithTemplateKHR-commandBuffer-00366]] 4528e5c31af7Sopenharmony_ci The pname:pipelineBindPoint specified during the creation of the 4529e5c31af7Sopenharmony_ci descriptor update template must: be supported by the 4530e5c31af7Sopenharmony_ci pname:commandBuffer's parent sname:VkCommandPool's queue family 4531e5c31af7Sopenharmony_ci * [[VUID-vkCmdPushDescriptorSetWithTemplateKHR-pData-01686]] 4532e5c31af7Sopenharmony_ci pname:pData must: be a valid pointer to a memory containing one or more 4533e5c31af7Sopenharmony_ci valid instances of slink:VkDescriptorImageInfo, 4534e5c31af7Sopenharmony_ci slink:VkDescriptorBufferInfo, or slink:VkBufferView in a layout defined 4535e5c31af7Sopenharmony_ci by pname:descriptorUpdateTemplate when it was created with 4536e5c31af7Sopenharmony_ci flink:vkCreateDescriptorUpdateTemplate 4537e5c31af7Sopenharmony_ci**** 4538e5c31af7Sopenharmony_ci 4539e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCmdPushDescriptorSetWithTemplateKHR.txt[] 4540e5c31af7Sopenharmony_ci 4541e5c31af7Sopenharmony_ci.API example 4542e5c31af7Sopenharmony_ci[source,c++] 4543e5c31af7Sopenharmony_ci~~~~ 4544e5c31af7Sopenharmony_ci 4545e5c31af7Sopenharmony_cistruct AppDataStructure 4546e5c31af7Sopenharmony_ci{ 4547e5c31af7Sopenharmony_ci VkDescriptorImageInfo imageInfo; // a single image info 4548e5c31af7Sopenharmony_ci // ... some more application related data 4549e5c31af7Sopenharmony_ci}; 4550e5c31af7Sopenharmony_ci 4551e5c31af7Sopenharmony_ciconst VkDescriptorUpdateTemplateEntry descriptorUpdateTemplateEntries[] = 4552e5c31af7Sopenharmony_ci{ 4553e5c31af7Sopenharmony_ci // binding to a single image descriptor 4554e5c31af7Sopenharmony_ci { 4555e5c31af7Sopenharmony_ci 0, // binding 4556e5c31af7Sopenharmony_ci 0, // dstArrayElement 4557e5c31af7Sopenharmony_ci 1, // descriptorCount 4558e5c31af7Sopenharmony_ci VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, // descriptorType 4559e5c31af7Sopenharmony_ci offsetof(AppDataStructure, imageInfo), // offset 4560e5c31af7Sopenharmony_ci 0 // stride is not required if descriptorCount is 1 4561e5c31af7Sopenharmony_ci } 4562e5c31af7Sopenharmony_ci}; 4563e5c31af7Sopenharmony_ci 4564e5c31af7Sopenharmony_ci// create a descriptor update template for push descriptor set updates 4565e5c31af7Sopenharmony_ciconst VkDescriptorUpdateTemplateCreateInfo createInfo = 4566e5c31af7Sopenharmony_ci{ 4567e5c31af7Sopenharmony_ci VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO, // sType 4568e5c31af7Sopenharmony_ci NULL, // pNext 4569e5c31af7Sopenharmony_ci 0, // flags 4570e5c31af7Sopenharmony_ci 1, // descriptorUpdateEntryCount 4571e5c31af7Sopenharmony_ci descriptorUpdateTemplateEntries, // pDescriptorUpdateEntries 4572e5c31af7Sopenharmony_ci VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR, // templateType 4573e5c31af7Sopenharmony_ci 0, // descriptorSetLayout, ignored by given templateType 4574e5c31af7Sopenharmony_ci VK_PIPELINE_BIND_POINT_GRAPHICS, // pipelineBindPoint 4575e5c31af7Sopenharmony_ci myPipelineLayout, // pipelineLayout 4576e5c31af7Sopenharmony_ci 0, // set 4577e5c31af7Sopenharmony_ci}; 4578e5c31af7Sopenharmony_ci 4579e5c31af7Sopenharmony_ciVkDescriptorUpdateTemplate myDescriptorUpdateTemplate; 4580e5c31af7Sopenharmony_cimyResult = vkCreateDescriptorUpdateTemplate( 4581e5c31af7Sopenharmony_ci myDevice, 4582e5c31af7Sopenharmony_ci &createInfo, 4583e5c31af7Sopenharmony_ci NULL, 4584e5c31af7Sopenharmony_ci &myDescriptorUpdateTemplate); 4585e5c31af7Sopenharmony_ci 4586e5c31af7Sopenharmony_ciAppDataStructure appData; 4587e5c31af7Sopenharmony_ci// fill appData here or cache it in your engine 4588e5c31af7Sopenharmony_civkCmdPushDescriptorSetWithTemplateKHR(myCmdBuffer, myDescriptorUpdateTemplate, myPipelineLayout, 0,&appData); 4589e5c31af7Sopenharmony_ci~~~~ 4590e5c31af7Sopenharmony_ci-- 4591e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_descriptor_update_template[] 4592e5c31af7Sopenharmony_ciendif::VK_KHR_push_descriptor[] 4593e5c31af7Sopenharmony_ci 4594e5c31af7Sopenharmony_ci 4595e5c31af7Sopenharmony_ci[[descriptorsets-push-constants]] 4596e5c31af7Sopenharmony_ci=== Push Constant Updates 4597e5c31af7Sopenharmony_ci 4598e5c31af7Sopenharmony_ciAs described above in section <<descriptorsets-pipelinelayout, Pipeline 4599e5c31af7Sopenharmony_ciLayouts>>, the pipeline layout defines shader push constants which are 4600e5c31af7Sopenharmony_ciupdated via Vulkan commands rather than via writes to memory or copy 4601e5c31af7Sopenharmony_cicommands. 4602e5c31af7Sopenharmony_ci 4603e5c31af7Sopenharmony_ci[NOTE] 4604e5c31af7Sopenharmony_ci.Note 4605e5c31af7Sopenharmony_ci==== 4606e5c31af7Sopenharmony_ciPush constants represent a high speed path to modify constant data in 4607e5c31af7Sopenharmony_cipipelines that is expected to outperform memory-backed resource updates. 4608e5c31af7Sopenharmony_ci==== 4609e5c31af7Sopenharmony_ci 4610e5c31af7Sopenharmony_ci[open,refpage='vkCmdPushConstants',desc='Update the values of push constants',type='protos'] 4611e5c31af7Sopenharmony_ci-- 4612e5c31af7Sopenharmony_ciTo update push constants, call: 4613e5c31af7Sopenharmony_ci 4614e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCmdPushConstants.txt[] 4615e5c31af7Sopenharmony_ci 4616e5c31af7Sopenharmony_ci * pname:commandBuffer is the command buffer in which the push constant 4617e5c31af7Sopenharmony_ci update will be recorded. 4618e5c31af7Sopenharmony_ci * pname:layout is the pipeline layout used to program the push constant 4619e5c31af7Sopenharmony_ci updates. 4620e5c31af7Sopenharmony_ci * pname:stageFlags is a bitmask of elink:VkShaderStageFlagBits specifying 4621e5c31af7Sopenharmony_ci the shader stages that will use the push constants in the updated range. 4622e5c31af7Sopenharmony_ci * pname:offset is the start offset of the push constant range to update, 4623e5c31af7Sopenharmony_ci in units of bytes. 4624e5c31af7Sopenharmony_ci * pname:size is the size of the push constant range to update, in units of 4625e5c31af7Sopenharmony_ci bytes. 4626e5c31af7Sopenharmony_ci * pname:pValues is a pointer to an array of pname:size bytes containing 4627e5c31af7Sopenharmony_ci the new push constant values. 4628e5c31af7Sopenharmony_ci 4629e5c31af7Sopenharmony_ciWhen a command buffer begins recording, all push constant values are 4630e5c31af7Sopenharmony_ciundefined:. 4631e5c31af7Sopenharmony_ciifdef::VK_KHR_maintenance4[] 4632e5c31af7Sopenharmony_ciReads of undefined: push constant values by the executing shader return 4633e5c31af7Sopenharmony_ciundefined: values. 4634e5c31af7Sopenharmony_ciendif::VK_KHR_maintenance4[] 4635e5c31af7Sopenharmony_ci 4636e5c31af7Sopenharmony_ciPush constant values can: be updated incrementally, causing shader stages in 4637e5c31af7Sopenharmony_cipname:stageFlags to read the new data from pname:pValues for push constants 4638e5c31af7Sopenharmony_cimodified by this command, while still reading the previous data for push 4639e5c31af7Sopenharmony_ciconstants not modified by this command. 4640e5c31af7Sopenharmony_ciWhen a <<pipeline-bindpoint-commands, bound pipeline command>> is issued, 4641e5c31af7Sopenharmony_cithe bound pipeline's layout must: be compatible with the layouts used to set 4642e5c31af7Sopenharmony_cithe values of all push constants in the pipeline layout's push constant 4643e5c31af7Sopenharmony_ciranges, as described in <<descriptorsets-compatibility,Pipeline Layout 4644e5c31af7Sopenharmony_ciCompatibility>>. 4645e5c31af7Sopenharmony_ciBinding a pipeline with a layout that is not compatible with the push 4646e5c31af7Sopenharmony_ciconstant layout does not disturb the push constant values. 4647e5c31af7Sopenharmony_ci 4648e5c31af7Sopenharmony_ci[NOTE] 4649e5c31af7Sopenharmony_ci.Note 4650e5c31af7Sopenharmony_ci==== 4651e5c31af7Sopenharmony_ciAs pname:stageFlags needs to include all flags the relevant push constant 4652e5c31af7Sopenharmony_ciranges were created with, any flags that are not supported by the queue 4653e5c31af7Sopenharmony_cifamily that the slink:VkCommandPool used to allocate pname:commandBuffer was 4654e5c31af7Sopenharmony_cicreated on are ignored. 4655e5c31af7Sopenharmony_ci==== 4656e5c31af7Sopenharmony_ci 4657e5c31af7Sopenharmony_ci.Valid Usage 4658e5c31af7Sopenharmony_ci**** 4659e5c31af7Sopenharmony_ci * [[VUID-vkCmdPushConstants-offset-01795]] 4660e5c31af7Sopenharmony_ci For each byte in the range specified by pname:offset and pname:size and 4661e5c31af7Sopenharmony_ci for each shader stage in pname:stageFlags, there must: be a push 4662e5c31af7Sopenharmony_ci constant range in pname:layout that includes that byte and that stage 4663e5c31af7Sopenharmony_ci * [[VUID-vkCmdPushConstants-offset-01796]] 4664e5c31af7Sopenharmony_ci For each byte in the range specified by pname:offset and pname:size and 4665e5c31af7Sopenharmony_ci for each push constant range that overlaps that byte, pname:stageFlags 4666e5c31af7Sopenharmony_ci must: include all stages in that push constant range's 4667e5c31af7Sopenharmony_ci slink:VkPushConstantRange::pname:stageFlags 4668e5c31af7Sopenharmony_ci * [[VUID-vkCmdPushConstants-offset-00368]] 4669e5c31af7Sopenharmony_ci pname:offset must: be a multiple of `4` 4670e5c31af7Sopenharmony_ci * [[VUID-vkCmdPushConstants-size-00369]] 4671e5c31af7Sopenharmony_ci pname:size must: be a multiple of `4` 4672e5c31af7Sopenharmony_ci * [[VUID-vkCmdPushConstants-offset-00370]] 4673e5c31af7Sopenharmony_ci pname:offset must: be less than 4674e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceLimits::pname:maxPushConstantsSize 4675e5c31af7Sopenharmony_ci * [[VUID-vkCmdPushConstants-size-00371]] 4676e5c31af7Sopenharmony_ci pname:size must: be less than or equal to 4677e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceLimits::pname:maxPushConstantsSize minus 4678e5c31af7Sopenharmony_ci pname:offset 4679e5c31af7Sopenharmony_ci**** 4680e5c31af7Sopenharmony_ci 4681e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCmdPushConstants.txt[] 4682e5c31af7Sopenharmony_ci-- 4683e5c31af7Sopenharmony_ci 4684e5c31af7Sopenharmony_ci 4685e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_EXT_buffer_device_address,VK_KHR_buffer_device_address[] 4686e5c31af7Sopenharmony_ci[[descriptorsets-physical-storage-buffer]] 4687e5c31af7Sopenharmony_ci== Physical Storage Buffer Access 4688e5c31af7Sopenharmony_ci 4689e5c31af7Sopenharmony_ci[open,refpage='vkGetBufferDeviceAddress',desc='Query an address of a buffer',type='protos',alias='vkGetBufferDeviceAddressKHR'] 4690e5c31af7Sopenharmony_ci-- 4691e5c31af7Sopenharmony_ciTo query a 64-bit buffer device address value through which buffer memory 4692e5c31af7Sopenharmony_cican: be accessed in a shader, call: 4693e5c31af7Sopenharmony_ci 4694e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2[] 4695e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkGetBufferDeviceAddress.txt[] 4696e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2[] 4697e5c31af7Sopenharmony_ci 4698e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2+VK_KHR_buffer_device_address[or the equivalent command] 4699e5c31af7Sopenharmony_ci 4700e5c31af7Sopenharmony_ciifdef::VK_KHR_buffer_device_address[] 4701e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkGetBufferDeviceAddressKHR.txt[] 4702e5c31af7Sopenharmony_ciendif::VK_KHR_buffer_device_address[] 4703e5c31af7Sopenharmony_ci 4704e5c31af7Sopenharmony_ci// @Jon: 3-way conditional logic here is wrong 4705e5c31af7Sopenharmony_ci 4706e5c31af7Sopenharmony_ciifdef::VK_EXT_buffer_device_address[] 4707e5c31af7Sopenharmony_cior the equivalent command 4708e5c31af7Sopenharmony_ci 4709e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkGetBufferDeviceAddressEXT.txt[] 4710e5c31af7Sopenharmony_ciendif::VK_EXT_buffer_device_address[] 4711e5c31af7Sopenharmony_ci 4712e5c31af7Sopenharmony_ci * pname:device is the logical device that the buffer was created on. 4713e5c31af7Sopenharmony_ci * pname:pInfo is a pointer to a slink:VkBufferDeviceAddressInfo structure 4714e5c31af7Sopenharmony_ci specifying the buffer to retrieve an address for. 4715e5c31af7Sopenharmony_ci 4716e5c31af7Sopenharmony_ciThe 64-bit return value is an address of the start of pname:pInfo->buffer. 4717e5c31af7Sopenharmony_ciThe address range starting at this value and whose size is the size of the 4718e5c31af7Sopenharmony_cibuffer can: be used in a shader to access the memory bound to that buffer, 4719e5c31af7Sopenharmony_ciusing the 4720e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_KHR_buffer_device_address[] 4721e5c31af7Sopenharmony_ci`SPV_KHR_physical_storage_buffer` extension 4722e5c31af7Sopenharmony_ciifdef::VK_EXT_buffer_device_address[or the equivalent] 4723e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_KHR_buffer_device_address[] 4724e5c31af7Sopenharmony_ciifdef::VK_EXT_buffer_device_address[] 4725e5c31af7Sopenharmony_ci`SPV_EXT_physical_storage_buffer` extension 4726e5c31af7Sopenharmony_ciendif::VK_EXT_buffer_device_address[] 4727e5c31af7Sopenharmony_ciand the code:PhysicalStorageBuffer storage class. 4728e5c31af7Sopenharmony_ciFor example, this value can: be stored in a uniform buffer, and the shader 4729e5c31af7Sopenharmony_cican: read the value from the uniform buffer and use it to do a dependent 4730e5c31af7Sopenharmony_ciread/write to this buffer. 4731e5c31af7Sopenharmony_ciA value of zero is reserved as a "`null`" pointer and must: not be returned 4732e5c31af7Sopenharmony_cias a valid buffer device address. 4733e5c31af7Sopenharmony_ciAll loads, stores, and atomics in a shader through 4734e5c31af7Sopenharmony_cicode:PhysicalStorageBuffer pointers must: access addresses in the address 4735e5c31af7Sopenharmony_cirange of some buffer. 4736e5c31af7Sopenharmony_ci 4737e5c31af7Sopenharmony_ciIf the buffer was created with a non-zero value of 4738e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_KHR_buffer_device_address[] 4739e5c31af7Sopenharmony_cislink:VkBufferOpaqueCaptureAddressCreateInfo::pname:opaqueCaptureAddress 4740e5c31af7Sopenharmony_ciifdef::VK_EXT_buffer_device_address[or] 4741e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_KHR_buffer_device_address[] 4742e5c31af7Sopenharmony_ciifdef::VK_EXT_buffer_device_address[] 4743e5c31af7Sopenharmony_cislink:VkBufferDeviceAddressCreateInfoEXT::pname:deviceAddress 4744e5c31af7Sopenharmony_ciendif::VK_EXT_buffer_device_address[] 4745e5c31af7Sopenharmony_cithe return value will be the same address that was returned at capture time. 4746e5c31af7Sopenharmony_ci 4747e5c31af7Sopenharmony_ci.Valid Usage 4748e5c31af7Sopenharmony_ci**** 4749e5c31af7Sopenharmony_ci * [[VUID-vkGetBufferDeviceAddress-bufferDeviceAddress-03324]] 4750e5c31af7Sopenharmony_ci The <<features-bufferDeviceAddress,bufferDeviceAddress>> or 4751e5c31af7Sopenharmony_ci <<features-bufferDeviceAddressEXT,sname:VkPhysicalDeviceBufferDeviceAddressFeaturesEXT::pname:bufferDeviceAddress>> 4752e5c31af7Sopenharmony_ci feature must: be enabled 4753e5c31af7Sopenharmony_ci * [[VUID-vkGetBufferDeviceAddress-device-03325]] 4754e5c31af7Sopenharmony_ci If pname:device was created with multiple physical devices, then the 4755e5c31af7Sopenharmony_ci <<features-bufferDeviceAddressMultiDevice,bufferDeviceAddressMultiDevice>> 4756e5c31af7Sopenharmony_ci or 4757e5c31af7Sopenharmony_ci <<features-bufferDeviceAddressMultiDeviceEXT,sname:VkPhysicalDeviceBufferDeviceAddressFeaturesEXT::pname:bufferDeviceAddressMultiDevice>> 4758e5c31af7Sopenharmony_ci feature must: be enabled 4759e5c31af7Sopenharmony_ci**** 4760e5c31af7Sopenharmony_ci 4761e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkGetBufferDeviceAddress.txt[] 4762e5c31af7Sopenharmony_ci-- 4763e5c31af7Sopenharmony_ci 4764e5c31af7Sopenharmony_ci[open,refpage='VkBufferDeviceAddressInfo',desc='Structure specifying the buffer to query an address for',type='structs',alias='VkBufferDeviceAddressInfoKHR,VkBufferDeviceAddressInfoEXT'] 4765e5c31af7Sopenharmony_ci-- 4766e5c31af7Sopenharmony_ciThe sname:VkBufferDeviceAddressInfo structure is defined as: 4767e5c31af7Sopenharmony_ci 4768e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkBufferDeviceAddressInfo.txt[] 4769e5c31af7Sopenharmony_ci 4770e5c31af7Sopenharmony_ciifdef::VK_KHR_buffer_device_address[] 4771e5c31af7Sopenharmony_cior the equivalent 4772e5c31af7Sopenharmony_ci 4773e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkBufferDeviceAddressInfoKHR.txt[] 4774e5c31af7Sopenharmony_ciendif::VK_KHR_buffer_device_address[] 4775e5c31af7Sopenharmony_ci 4776e5c31af7Sopenharmony_ci// @Jon: three-way conditional logic is broken 4777e5c31af7Sopenharmony_ciifdef::VK_EXT_buffer_device_address[] 4778e5c31af7Sopenharmony_cior the equivalent 4779e5c31af7Sopenharmony_ci 4780e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkBufferDeviceAddressInfoEXT.txt[] 4781e5c31af7Sopenharmony_ciendif::VK_EXT_buffer_device_address[] 4782e5c31af7Sopenharmony_ci 4783e5c31af7Sopenharmony_ci * pname:sType is the type of this structure. 4784e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 4785e5c31af7Sopenharmony_ci structure. 4786e5c31af7Sopenharmony_ci * pname:buffer specifies the buffer whose address is being queried. 4787e5c31af7Sopenharmony_ci 4788e5c31af7Sopenharmony_ci.Valid Usage 4789e5c31af7Sopenharmony_ci**** 4790e5c31af7Sopenharmony_ci * [[VUID-VkBufferDeviceAddressInfo-buffer-02600]] 4791e5c31af7Sopenharmony_ci If pname:buffer is non-sparse and was not created with the 4792e5c31af7Sopenharmony_ci ename:VK_BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT flag, then it 4793e5c31af7Sopenharmony_ci must: be bound completely and contiguously to a single 4794e5c31af7Sopenharmony_ci sname:VkDeviceMemory object 4795e5c31af7Sopenharmony_ci * [[VUID-VkBufferDeviceAddressInfo-buffer-02601]] 4796e5c31af7Sopenharmony_ci pname:buffer must: have been created with 4797e5c31af7Sopenharmony_ci ename:VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT 4798e5c31af7Sopenharmony_ci**** 4799e5c31af7Sopenharmony_ci 4800e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkBufferDeviceAddressInfo.txt[] 4801e5c31af7Sopenharmony_ci-- 4802e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_EXT_buffer_device_address,VK_KHR_buffer_device_address[] 4803e5c31af7Sopenharmony_ci 4804e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_KHR_buffer_device_address[] 4805e5c31af7Sopenharmony_ci[open,refpage='vkGetBufferOpaqueCaptureAddress',desc='Query an opaque capture address of a buffer',type='protos',alias='vkGetBufferOpaqueCaptureAddressKHR'] 4806e5c31af7Sopenharmony_ci-- 4807e5c31af7Sopenharmony_ciTo query a 64-bit buffer opaque capture address, call: 4808e5c31af7Sopenharmony_ci 4809e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2[] 4810e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkGetBufferOpaqueCaptureAddress.txt[] 4811e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2[] 4812e5c31af7Sopenharmony_ci 4813e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2+VK_KHR_buffer_device_address[or the equivalent command] 4814e5c31af7Sopenharmony_ci 4815e5c31af7Sopenharmony_ciifdef::VK_KHR_buffer_device_address[] 4816e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkGetBufferOpaqueCaptureAddressKHR.txt[] 4817e5c31af7Sopenharmony_ciendif::VK_KHR_buffer_device_address[] 4818e5c31af7Sopenharmony_ci 4819e5c31af7Sopenharmony_ci * pname:device is the logical device that the buffer was created on. 4820e5c31af7Sopenharmony_ci * pname:pInfo is a pointer to a slink:VkBufferDeviceAddressInfo structure 4821e5c31af7Sopenharmony_ci specifying the buffer to retrieve an address for. 4822e5c31af7Sopenharmony_ci 4823e5c31af7Sopenharmony_ciThe 64-bit return value is an opaque capture address of the start of 4824e5c31af7Sopenharmony_cipname:pInfo->buffer. 4825e5c31af7Sopenharmony_ci 4826e5c31af7Sopenharmony_ciIf the buffer was created with a non-zero value of 4827e5c31af7Sopenharmony_cislink:VkBufferOpaqueCaptureAddressCreateInfo::pname:opaqueCaptureAddress the 4828e5c31af7Sopenharmony_cireturn value must: be the same address. 4829e5c31af7Sopenharmony_ci 4830e5c31af7Sopenharmony_ci.Valid Usage 4831e5c31af7Sopenharmony_ci**** 4832e5c31af7Sopenharmony_ci * [[VUID-vkGetBufferOpaqueCaptureAddress-None-03326]] 4833e5c31af7Sopenharmony_ci The <<features-bufferDeviceAddress,bufferDeviceAddress>> feature must: 4834e5c31af7Sopenharmony_ci be enabled 4835e5c31af7Sopenharmony_ci * [[VUID-vkGetBufferOpaqueCaptureAddress-device-03327]] 4836e5c31af7Sopenharmony_ci If pname:device was created with multiple physical devices, then the 4837e5c31af7Sopenharmony_ci <<features-bufferDeviceAddressMultiDevice,bufferDeviceAddressMultiDevice>> 4838e5c31af7Sopenharmony_ci feature must: be enabled 4839e5c31af7Sopenharmony_ci**** 4840e5c31af7Sopenharmony_ci 4841e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkGetBufferOpaqueCaptureAddress.txt[] 4842e5c31af7Sopenharmony_ci-- 4843e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_KHR_buffer_device_address[] 4844