1e5c31af7Sopenharmony_ci// Copyright 2015-2024 The Khronos Group Inc. 2e5c31af7Sopenharmony_ci// 3e5c31af7Sopenharmony_ci// SPDX-License-Identifier: CC-BY-4.0 4e5c31af7Sopenharmony_ci 5e5c31af7Sopenharmony_ci[[renderpass]] 6e5c31af7Sopenharmony_ci= Render Pass 7e5c31af7Sopenharmony_ci 8e5c31af7Sopenharmony_ci<<drawing, Draw commands>> must: be recorded within a _render pass 9e5c31af7Sopenharmony_ciinstance_. 10e5c31af7Sopenharmony_ciEach render pass instance defines a set of image resources, referred to as 11e5c31af7Sopenharmony_ci_attachments_, used during rendering. 12e5c31af7Sopenharmony_ci 13e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_3,VK_KHR_dynamic_rendering[] 14e5c31af7Sopenharmony_ci[open,refpage='vkCmdBeginRendering',desc='Begin a dynamic render pass instance',type='protos',alias='vkCmdBeginRenderingKHR'] 15e5c31af7Sopenharmony_ci-- 16e5c31af7Sopenharmony_ciTo begin a render pass instance, call: 17e5c31af7Sopenharmony_ci 18e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_3[] 19e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCmdBeginRendering.adoc[] 20e5c31af7Sopenharmony_ciendif::VK_VERSION_1_3[] 21e5c31af7Sopenharmony_ci 22e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_3+VK_KHR_dynamic_rendering[or the equivalent command] 23e5c31af7Sopenharmony_ci 24e5c31af7Sopenharmony_ciifdef::VK_KHR_dynamic_rendering[] 25e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCmdBeginRenderingKHR.adoc[] 26e5c31af7Sopenharmony_ciendif::VK_KHR_dynamic_rendering[] 27e5c31af7Sopenharmony_ci 28e5c31af7Sopenharmony_ci * pname:commandBuffer is the command buffer in which to record the 29e5c31af7Sopenharmony_ci command. 30e5c31af7Sopenharmony_ci * pname:pRenderingInfo is a pointer to a slink:VkRenderingInfo structure 31e5c31af7Sopenharmony_ci specifying details of the render pass instance to begin. 32e5c31af7Sopenharmony_ci 33e5c31af7Sopenharmony_ciAfter beginning a render pass instance, the command buffer is ready to 34e5c31af7Sopenharmony_cirecord <<drawing,draw commands>>. 35e5c31af7Sopenharmony_ci 36e5c31af7Sopenharmony_ciIf pname:pRenderingInfo->flags includes ename:VK_RENDERING_RESUMING_BIT then 37e5c31af7Sopenharmony_cithis render pass is resumed from a render pass instance that has been 38e5c31af7Sopenharmony_cisuspended earlier in <<synchronization-submission-order, submission order>>. 39e5c31af7Sopenharmony_ci 40e5c31af7Sopenharmony_ci.Valid Usage 41e5c31af7Sopenharmony_ci**** 42e5c31af7Sopenharmony_ci * [[VUID-vkCmdBeginRendering-dynamicRendering-06446]] 43e5c31af7Sopenharmony_ci The <<features-dynamicRendering, pname:dynamicRendering>> feature must: 44e5c31af7Sopenharmony_ci be enabled 45e5c31af7Sopenharmony_ci * [[VUID-vkCmdBeginRendering-commandBuffer-06068]] 46e5c31af7Sopenharmony_ci If pname:commandBuffer is a secondary command buffer, 47e5c31af7Sopenharmony_ciifdef::VK_EXT_nested_command_buffer[] 48e5c31af7Sopenharmony_ci and the <<features-nestedCommandBuffer, pname:nestedCommandBuffer>> 49e5c31af7Sopenharmony_ci feature is not enabled, 50e5c31af7Sopenharmony_ciendif::VK_EXT_nested_command_buffer[] 51e5c31af7Sopenharmony_ci pname:pRenderingInfo->flags must: not include 52e5c31af7Sopenharmony_ci ename:VK_RENDERING_CONTENTS_SECONDARY_COMMAND_BUFFERS_BIT 53e5c31af7Sopenharmony_ci**** 54e5c31af7Sopenharmony_ci 55e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCmdBeginRendering.adoc[] 56e5c31af7Sopenharmony_ci-- 57e5c31af7Sopenharmony_ci 58e5c31af7Sopenharmony_ci[open,refpage='VkRenderingInfo',desc='Structure specifying render pass instance begin info',type='structs',alias='VkRenderingInfoKHR'] 59e5c31af7Sopenharmony_ci-- 60e5c31af7Sopenharmony_ciThe sname:VkRenderingInfo structure is defined as: 61e5c31af7Sopenharmony_ci 62e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkRenderingInfo.adoc[] 63e5c31af7Sopenharmony_ci 64e5c31af7Sopenharmony_ciifdef::VK_KHR_dynamic_rendering[] 65e5c31af7Sopenharmony_cior the equivalent 66e5c31af7Sopenharmony_ci 67e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkRenderingInfoKHR.adoc[] 68e5c31af7Sopenharmony_ciendif::VK_KHR_dynamic_rendering[] 69e5c31af7Sopenharmony_ci 70e5c31af7Sopenharmony_ci * pname:sType is a elink:VkStructureType value identifying this structure. 71e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 72e5c31af7Sopenharmony_ci structure. 73e5c31af7Sopenharmony_ci * pname:flags is a bitmask of elink:VkRenderingFlagBits. 74e5c31af7Sopenharmony_ci * pname:renderArea is the render area that is affected by the render pass 75e5c31af7Sopenharmony_ci instance. 76e5c31af7Sopenharmony_ci * pname:layerCount is the number of layers rendered to in each attachment 77e5c31af7Sopenharmony_ci when pname:viewMask is `0`. 78e5c31af7Sopenharmony_ci * pname:viewMask is the view mask indicating the indices of attachment 79e5c31af7Sopenharmony_ci layers that will be rendered when it is not `0`. 80e5c31af7Sopenharmony_ci * pname:colorAttachmentCount is the number of elements in 81e5c31af7Sopenharmony_ci pname:pColorAttachments. 82e5c31af7Sopenharmony_ci * pname:pColorAttachments is a pointer to an array of 83e5c31af7Sopenharmony_ci pname:colorAttachmentCount slink:VkRenderingAttachmentInfo structures 84e5c31af7Sopenharmony_ci describing any color attachments used. 85e5c31af7Sopenharmony_ci * pname:pDepthAttachment is a pointer to a slink:VkRenderingAttachmentInfo 86e5c31af7Sopenharmony_ci structure describing a depth attachment. 87e5c31af7Sopenharmony_ci * pname:pStencilAttachment is a pointer to a 88e5c31af7Sopenharmony_ci slink:VkRenderingAttachmentInfo structure describing a stencil 89e5c31af7Sopenharmony_ci attachment. 90e5c31af7Sopenharmony_ci 91e5c31af7Sopenharmony_ciifdef::VK_KHR_multiview,VK_VERSION_1_1[] 92e5c31af7Sopenharmony_ciIf pname:viewMask is not `0`, multiview is enabled. 93e5c31af7Sopenharmony_ciendif::VK_KHR_multiview,VK_VERSION_1_1[] 94e5c31af7Sopenharmony_ci 95e5c31af7Sopenharmony_ciifdef::VK_KHR_device_group,VK_VERSION_1_1[] 96e5c31af7Sopenharmony_ciIf there is an instance of slink:VkDeviceGroupRenderPassBeginInfo included 97e5c31af7Sopenharmony_ciin the pname:pNext chain and its pname:deviceRenderAreaCount member is not 98e5c31af7Sopenharmony_ci`0`, then pname:renderArea is ignored, and the render area is defined 99e5c31af7Sopenharmony_ciper-device by that structure. 100e5c31af7Sopenharmony_ciendif::VK_KHR_device_group,VK_VERSION_1_1[] 101e5c31af7Sopenharmony_ci 102e5c31af7Sopenharmony_ciifdef::VK_QCOM_multiview_per_view_render_areas[] 103e5c31af7Sopenharmony_ciIf multiview is enabled, and the <<features-multiview-per-view-render-areas, 104e5c31af7Sopenharmony_cipname:multiviewPerViewRenderAreas>> feature is enabled, and there is an 105e5c31af7Sopenharmony_ciinstance of slink:VkMultiviewPerViewRenderAreasRenderPassBeginInfoQCOM 106e5c31af7Sopenharmony_ciincluded in the pname:pNext chain with pname:perViewRenderAreaCount not 107e5c31af7Sopenharmony_ciequal to `0`, then the elements of 108e5c31af7Sopenharmony_cislink:VkMultiviewPerViewRenderAreasRenderPassBeginInfoQCOM::pname:pPerViewRenderAreas 109e5c31af7Sopenharmony_cioverride pname:renderArea and define a render area for each view. 110e5c31af7Sopenharmony_ciIn this case, pname:renderArea must: be set to an area at least as large as 111e5c31af7Sopenharmony_cithe union of all the per-view render areas. 112e5c31af7Sopenharmony_ciendif::VK_QCOM_multiview_per_view_render_areas[] 113e5c31af7Sopenharmony_ci 114e5c31af7Sopenharmony_ciEach element of the pname:pColorAttachments array corresponds to an output 115e5c31af7Sopenharmony_cilocation in the shader, i.e. if the shader declares an output variable 116e5c31af7Sopenharmony_cidecorated with a code:Location value of *X*, then it uses the attachment 117e5c31af7Sopenharmony_ciprovided in pname:pColorAttachments[*X*]. 118e5c31af7Sopenharmony_ciIf the pname:imageView member of any element of pname:pColorAttachments is 119e5c31af7Sopenharmony_cidlink:VK_NULL_HANDLE, 120e5c31af7Sopenharmony_ciifdef::VK_ANDROID_external_format_resolve[] 121e5c31af7Sopenharmony_ciand pname:resolveMode is not 122e5c31af7Sopenharmony_ciename:VK_RESOLVE_MODE_EXTERNAL_FORMAT_DOWNSAMPLE_ANDROID, 123e5c31af7Sopenharmony_ciendif::VK_ANDROID_external_format_resolve[] 124e5c31af7Sopenharmony_ciwrites to the corresponding location by a fragment are discarded. 125e5c31af7Sopenharmony_ci 126e5c31af7Sopenharmony_ci.Valid Usage 127e5c31af7Sopenharmony_ci**** 128e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-viewMask-06069]] 129e5c31af7Sopenharmony_ci If pname:viewMask is `0`, pname:layerCount must: not be `0` 130e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-multisampledRenderToSingleSampled-06857]] 131e5c31af7Sopenharmony_ci pname:imageView members of pname:pDepthAttachment, 132e5c31af7Sopenharmony_ci pname:pStencilAttachment, and elements of pname:pColorAttachments that 133e5c31af7Sopenharmony_ci are not dlink:VK_NULL_HANDLE must: have been created with the same 134e5c31af7Sopenharmony_ci pname:sampleCount 135e5c31af7Sopenharmony_ciifdef::VK_AMD_mixed_attachment_samples,VK_NV_framebuffer_mixed_samples,VK_EXT_multisampled_render_to_single_sampled[] 136e5c31af7Sopenharmony_ci , if none of the following are enabled: 137e5c31af7Sopenharmony_ciifdef::VK_AMD_mixed_attachment_samples[] 138e5c31af7Sopenharmony_ci ** The `apiext:VK_AMD_mixed_attachment_samples` extension 139e5c31af7Sopenharmony_ciendif::VK_AMD_mixed_attachment_samples[] 140e5c31af7Sopenharmony_ciifdef::VK_NV_framebuffer_mixed_samples[] 141e5c31af7Sopenharmony_ci ** The `apiext:VK_NV_framebuffer_mixed_samples` extension 142e5c31af7Sopenharmony_ciendif::VK_NV_framebuffer_mixed_samples[] 143e5c31af7Sopenharmony_ciifdef::VK_EXT_multisampled_render_to_single_sampled[] 144e5c31af7Sopenharmony_ci ** The <<features-multisampledRenderToSingleSampled, 145e5c31af7Sopenharmony_ci pname:multisampledRenderToSingleSampled>> feature, 146e5c31af7Sopenharmony_ciendif::VK_EXT_multisampled_render_to_single_sampled[] 147e5c31af7Sopenharmony_ciendif::VK_AMD_mixed_attachment_samples,VK_NV_framebuffer_mixed_samples,VK_EXT_multisampled_render_to_single_sampled[] 148e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-imageView-09429]] 149e5c31af7Sopenharmony_ci pname:imageView members of elements of pname:pColorAttachments that are 150e5c31af7Sopenharmony_ci not dlink:VK_NULL_HANDLE must: have been created with the same 151e5c31af7Sopenharmony_ci pname:sampleCount 152e5c31af7Sopenharmony_ciifdef::VK_EXT_multisampled_render_to_single_sampled[] 153e5c31af7Sopenharmony_ci , if the <<features-multisampledRenderToSingleSampled, 154e5c31af7Sopenharmony_ci pname:multisampledRenderToSingleSampled>> feature is not enabled 155e5c31af7Sopenharmony_ciendif::VK_EXT_multisampled_render_to_single_sampled[] 156e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-None-08994]] 157e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_device_group[] 158e5c31af7Sopenharmony_ci If slink:VkDeviceGroupRenderPassBeginInfo::pname:deviceRenderAreaCount 159e5c31af7Sopenharmony_ci is 0, 160e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_device_group[] 161e5c31af7Sopenharmony_ci pname:renderArea.extent.width must: be greater than 0 162e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-None-08995]] 163e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_device_group[] 164e5c31af7Sopenharmony_ci If slink:VkDeviceGroupRenderPassBeginInfo::pname:deviceRenderAreaCount 165e5c31af7Sopenharmony_ci is 0, 166e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_device_group[] 167e5c31af7Sopenharmony_ci pname:renderArea.extent.height must: be greater than 0 168e5c31af7Sopenharmony_ciifdef::VK_EXT_multisampled_render_to_single_sampled[] 169e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-imageView-06858]] 170e5c31af7Sopenharmony_ci If 171e5c31af7Sopenharmony_ci <<subpass-multisampledrendertosinglesampled,multisampled-render-to-single-sampled>> 172e5c31af7Sopenharmony_ci is enabled, then all attachments referenced by pname:imageView members 173e5c31af7Sopenharmony_ci of pname:pDepthAttachment, pname:pStencilAttachment, and elements of 174e5c31af7Sopenharmony_ci pname:pColorAttachments that are not dlink:VK_NULL_HANDLE must: have a 175e5c31af7Sopenharmony_ci sample count that is either ename:VK_SAMPLE_COUNT_1_BIT or equal to 176e5c31af7Sopenharmony_ci slink:VkMultisampledRenderToSingleSampledInfoEXT::pname:rasterizationSamples 177e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-imageView-06859]] 178e5c31af7Sopenharmony_ci If 179e5c31af7Sopenharmony_ci <<subpass-multisampledrendertosinglesampled,multisampled-render-to-single-sampled>> 180e5c31af7Sopenharmony_ci is enabled, then all attachments referenced by pname:imageView members 181e5c31af7Sopenharmony_ci of pname:pDepthAttachment, pname:pStencilAttachment, and elements of 182e5c31af7Sopenharmony_ci pname:pColorAttachments that are not dlink:VK_NULL_HANDLE and have a 183e5c31af7Sopenharmony_ci sample count of ename:VK_SAMPLE_COUNT_1_BIT must: have been created with 184e5c31af7Sopenharmony_ci ename:VK_IMAGE_CREATE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_BIT_EXT in 185e5c31af7Sopenharmony_ci their slink:VkImageCreateInfo::pname:flags 186e5c31af7Sopenharmony_ciendif::VK_EXT_multisampled_render_to_single_sampled[] 187e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-pNext-06077]] 188e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_device_group[] 189e5c31af7Sopenharmony_ci If the pname:pNext chain does not contain 190e5c31af7Sopenharmony_ci slink:VkDeviceGroupRenderPassBeginInfo or its 191e5c31af7Sopenharmony_ci pname:deviceRenderAreaCount member is equal to 0, 192e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_device_group[] 193e5c31af7Sopenharmony_ci pname:renderArea.offset.x must: be greater than or equal to 0 194e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-pNext-06078]] 195e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_device_group[] 196e5c31af7Sopenharmony_ci If the pname:pNext chain does not contain 197e5c31af7Sopenharmony_ci slink:VkDeviceGroupRenderPassBeginInfo or its 198e5c31af7Sopenharmony_ci pname:deviceRenderAreaCount member is equal to 0, 199e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_device_group[] 200e5c31af7Sopenharmony_ci pname:renderArea.offset.y must: be greater than or equal to 0 201e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-pNext-07815]] 202e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_device_group[] 203e5c31af7Sopenharmony_ci If the pname:pNext chain does not contain 204e5c31af7Sopenharmony_ci slink:VkDeviceGroupRenderPassBeginInfo or its 205e5c31af7Sopenharmony_ci pname:deviceRenderAreaCount member is equal to 0, 206e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_device_group[] 207e5c31af7Sopenharmony_ci the sum of pname:renderArea.extent.width and pname:renderArea.offset.x 208e5c31af7Sopenharmony_ci must: be less than or equal to 209e5c31af7Sopenharmony_ci <<limits-maxFramebufferWidth,pname:maxFramebufferWidth>> 210e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-pNext-07816]] 211e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_device_group[] 212e5c31af7Sopenharmony_ci If the pname:pNext chain does not contain 213e5c31af7Sopenharmony_ci slink:VkDeviceGroupRenderPassBeginInfo or its 214e5c31af7Sopenharmony_ci pname:deviceRenderAreaCount member is equal to 0, 215e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_device_group[] 216e5c31af7Sopenharmony_ci the sum of pname:renderArea.extent.height and pname:renderArea.offset.y 217e5c31af7Sopenharmony_ci must: be less than or equal to 218e5c31af7Sopenharmony_ci <<limits-maxFramebufferWidth,pname:maxFramebufferHeight>> 219e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-pNext-06079]] 220e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_device_group[] 221e5c31af7Sopenharmony_ci If the pname:pNext chain does not contain 222e5c31af7Sopenharmony_ci slink:VkDeviceGroupRenderPassBeginInfo or its 223e5c31af7Sopenharmony_ci pname:deviceRenderAreaCount member is equal to 0, 224e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_device_group[] 225e5c31af7Sopenharmony_ci the width of the pname:imageView member of any element of 226e5c31af7Sopenharmony_ci pname:pColorAttachments, pname:pDepthAttachment, or 227e5c31af7Sopenharmony_ci pname:pStencilAttachment that is not dlink:VK_NULL_HANDLE must: be 228e5c31af7Sopenharmony_ci greater than or equal to [eq]#pname:renderArea.offset.x {plus} 229e5c31af7Sopenharmony_ci pname:renderArea.extent.width# 230e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-pNext-06080]] 231e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_device_group[] 232e5c31af7Sopenharmony_ci If the pname:pNext chain does not contain 233e5c31af7Sopenharmony_ci slink:VkDeviceGroupRenderPassBeginInfo or its 234e5c31af7Sopenharmony_ci pname:deviceRenderAreaCount member is equal to 0, 235e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_device_group[] 236e5c31af7Sopenharmony_ci the height of the pname:imageView member of any element of 237e5c31af7Sopenharmony_ci pname:pColorAttachments, pname:pDepthAttachment, or 238e5c31af7Sopenharmony_ci pname:pStencilAttachment that is not dlink:VK_NULL_HANDLE must: be 239e5c31af7Sopenharmony_ci greater than or equal to [eq]#pname:renderArea.offset.y {plus} 240e5c31af7Sopenharmony_ci pname:renderArea.extent.height# 241e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_device_group[] 242e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-pNext-06083]] 243e5c31af7Sopenharmony_ci If the pname:pNext chain contains 244e5c31af7Sopenharmony_ci slink:VkDeviceGroupRenderPassBeginInfo, the width of the pname:imageView 245e5c31af7Sopenharmony_ci member of any element of pname:pColorAttachments, 246e5c31af7Sopenharmony_ci pname:pDepthAttachment, or pname:pStencilAttachment that is not 247e5c31af7Sopenharmony_ci dlink:VK_NULL_HANDLE must: be greater than or equal to the sum of the 248e5c31af7Sopenharmony_ci pname:offset.x and pname:extent.width members of each element of 249e5c31af7Sopenharmony_ci pname:pDeviceRenderAreas 250e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-pNext-06084]] 251e5c31af7Sopenharmony_ci If the pname:pNext chain contains 252e5c31af7Sopenharmony_ci slink:VkDeviceGroupRenderPassBeginInfo, the height of the 253e5c31af7Sopenharmony_ci pname:imageView member of any element of pname:pColorAttachments, 254e5c31af7Sopenharmony_ci pname:pDepthAttachment, or pname:pStencilAttachment that is not 255e5c31af7Sopenharmony_ci dlink:VK_NULL_HANDLE must: be greater than or equal to the sum of the 256e5c31af7Sopenharmony_ci pname:offset.y and pname:extent.height members of each element of 257e5c31af7Sopenharmony_ci pname:pDeviceRenderAreas 258e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-pDepthAttachment-06085]] 259e5c31af7Sopenharmony_ci If neither pname:pDepthAttachment or pname:pStencilAttachment are `NULL` 260e5c31af7Sopenharmony_ci and the pname:imageView member of either structure is not 261e5c31af7Sopenharmony_ci dlink:VK_NULL_HANDLE, the pname:imageView member of each structure must: 262e5c31af7Sopenharmony_ci be the same 263e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-pDepthAttachment-06086]] 264e5c31af7Sopenharmony_ci If neither pname:pDepthAttachment or pname:pStencilAttachment are 265e5c31af7Sopenharmony_ci `NULL`, and the pname:resolveMode member of each is not 266e5c31af7Sopenharmony_ci ename:VK_RESOLVE_MODE_NONE, the pname:resolveImageView member of each 267e5c31af7Sopenharmony_ci structure must: be the same 268e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_device_group[] 269e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-colorAttachmentCount-06087]] 270e5c31af7Sopenharmony_ci If pname:colorAttachmentCount is not `0` and the pname:imageView member 271e5c31af7Sopenharmony_ci of an element of pname:pColorAttachments is not dlink:VK_NULL_HANDLE, 272e5c31af7Sopenharmony_ci that pname:imageView must: have been created with 273e5c31af7Sopenharmony_ci ename:VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT 274e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-colorAttachmentCount-09476]] 275e5c31af7Sopenharmony_ci If pname:colorAttachmentCount is not `0` and there is an element of 276e5c31af7Sopenharmony_ci pname:pColorAttachments with 277e5c31af7Sopenharmony_ciifdef::VK_ANDROID_external_format_resolve[] 278e5c31af7Sopenharmony_ci either its pname:resolveMode member set to 279e5c31af7Sopenharmony_ci ename:VK_RESOLVE_MODE_EXTERNAL_FORMAT_DOWNSAMPLE_ANDROID, or 280e5c31af7Sopenharmony_ciendif::VK_ANDROID_external_format_resolve[] 281e5c31af7Sopenharmony_ci its pname:imageView member not dlink:VK_NULL_HANDLE, and its 282e5c31af7Sopenharmony_ci pname:resolveMode member not set to ename:VK_RESOLVE_MODE_NONE, the 283e5c31af7Sopenharmony_ci pname:resolveImageView member of that element of pname:pColorAttachments 284e5c31af7Sopenharmony_ci must: have been created with ename:VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT 285e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-pDepthAttachment-06547]] 286e5c31af7Sopenharmony_ci If pname:pDepthAttachment is not `NULL` and 287e5c31af7Sopenharmony_ci pname:pDepthAttachment->imageView is not dlink:VK_NULL_HANDLE, 288e5c31af7Sopenharmony_ci pname:pDepthAttachment->imageView must: have been created with a format 289e5c31af7Sopenharmony_ci that includes a depth component 290e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-pDepthAttachment-06088]] 291e5c31af7Sopenharmony_ci If pname:pDepthAttachment is not `NULL` and 292e5c31af7Sopenharmony_ci pname:pDepthAttachment->imageView is not dlink:VK_NULL_HANDLE, 293e5c31af7Sopenharmony_ci pname:pDepthAttachment->imageView must: have been created with 294e5c31af7Sopenharmony_ci ename:VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT 295e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-pDepthAttachment-09477]] 296e5c31af7Sopenharmony_ci If pname:pDepthAttachment is not `NULL` and 297e5c31af7Sopenharmony_ci pname:pDepthAttachment->resolveMode is not ename:VK_RESOLVE_MODE_NONE, 298e5c31af7Sopenharmony_ci pname:pDepthAttachment->resolveImageView must: have been created with 299e5c31af7Sopenharmony_ci ename:VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT 300e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-pStencilAttachment-06548]] 301e5c31af7Sopenharmony_ci If pname:pStencilAttachment is not `NULL` and 302e5c31af7Sopenharmony_ci pname:pStencilAttachment->imageView is not dlink:VK_NULL_HANDLE, 303e5c31af7Sopenharmony_ci pname:pStencilAttachment->imageView must: have been created with a 304e5c31af7Sopenharmony_ci format that includes a stencil aspect 305e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-pStencilAttachment-06089]] 306e5c31af7Sopenharmony_ci If pname:pStencilAttachment is not `NULL` and 307e5c31af7Sopenharmony_ci pname:pStencilAttachment->imageView is not dlink:VK_NULL_HANDLE, 308e5c31af7Sopenharmony_ci pname:pStencilAttachment->imageView must: have been created with a 309e5c31af7Sopenharmony_ci stencil usage including 310e5c31af7Sopenharmony_ci ename:VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT 311e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-pStencilAttachment-09478]] 312e5c31af7Sopenharmony_ci If pname:pStencilAttachment is not `NULL` and 313e5c31af7Sopenharmony_ci pname:pStencilAttachment->resolveMode is not ename:VK_RESOLVE_MODE_NONE, 314e5c31af7Sopenharmony_ci pname:pStencilAttachment->resolveImageView must: have been created with 315e5c31af7Sopenharmony_ci ename:VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT 316e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-colorAttachmentCount-06090]] 317e5c31af7Sopenharmony_ci If pname:colorAttachmentCount is not `0` and the pname:imageView member 318e5c31af7Sopenharmony_ci of an element of pname:pColorAttachments is not dlink:VK_NULL_HANDLE, 319e5c31af7Sopenharmony_ci the pname:layout member of that element of pname:pColorAttachments must: 320e5c31af7Sopenharmony_ci not be ename:VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL or 321e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL 322e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-colorAttachmentCount-06091]] 323e5c31af7Sopenharmony_ci If pname:colorAttachmentCount is not `0` and the pname:imageView member 324e5c31af7Sopenharmony_ci of an element of pname:pColorAttachments is not dlink:VK_NULL_HANDLE, if 325e5c31af7Sopenharmony_ci the pname:resolveMode member of that element of pname:pColorAttachments 326e5c31af7Sopenharmony_ci is not ename:VK_RESOLVE_MODE_NONE, its pname:resolveImageLayout member 327e5c31af7Sopenharmony_ci must: not be ename:VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL or 328e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL 329e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-pDepthAttachment-06092]] 330e5c31af7Sopenharmony_ci If pname:pDepthAttachment is not `NULL` and 331e5c31af7Sopenharmony_ci pname:pDepthAttachment->imageView is not dlink:VK_NULL_HANDLE, 332e5c31af7Sopenharmony_ci pname:pDepthAttachment->layout must: not be 333e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL 334e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-pDepthAttachment-06093]] 335e5c31af7Sopenharmony_ci If pname:pDepthAttachment is not `NULL`, 336e5c31af7Sopenharmony_ci pname:pDepthAttachment->imageView is not dlink:VK_NULL_HANDLE, and 337e5c31af7Sopenharmony_ci pname:pDepthAttachment->resolveMode is not ename:VK_RESOLVE_MODE_NONE, 338e5c31af7Sopenharmony_ci pname:pDepthAttachment->resolveImageLayout must: not be 339e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL 340e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-pStencilAttachment-06094]] 341e5c31af7Sopenharmony_ci If pname:pStencilAttachment is not `NULL` and 342e5c31af7Sopenharmony_ci pname:pStencilAttachment->imageView is not dlink:VK_NULL_HANDLE, 343e5c31af7Sopenharmony_ci pname:pStencilAttachment->layout must: not be 344e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL 345e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-pStencilAttachment-06095]] 346e5c31af7Sopenharmony_ci If pname:pStencilAttachment is not `NULL`, 347e5c31af7Sopenharmony_ci pname:pStencilAttachment->imageView is not dlink:VK_NULL_HANDLE, and 348e5c31af7Sopenharmony_ci pname:pStencilAttachment->resolveMode is not ename:VK_RESOLVE_MODE_NONE, 349e5c31af7Sopenharmony_ci pname:pStencilAttachment->resolveImageLayout must: not be 350e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL 351e5c31af7Sopenharmony_ciifdef::VK_KHR_maintenance2,VK_VERSION_1_1[] 352e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-colorAttachmentCount-06096]] 353e5c31af7Sopenharmony_ci If pname:colorAttachmentCount is not `0` and the pname:imageView member 354e5c31af7Sopenharmony_ci of an element of pname:pColorAttachments is not dlink:VK_NULL_HANDLE, 355e5c31af7Sopenharmony_ci the pname:layout member of that element of pname:pColorAttachments must: 356e5c31af7Sopenharmony_ci not be ename:VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL 357e5c31af7Sopenharmony_ci or ename:VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL 358e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-colorAttachmentCount-06097]] 359e5c31af7Sopenharmony_ci If pname:colorAttachmentCount is not `0` and the pname:imageView member 360e5c31af7Sopenharmony_ci of an element of pname:pColorAttachments is not dlink:VK_NULL_HANDLE, if 361e5c31af7Sopenharmony_ci the pname:resolveMode member of that element of pname:pColorAttachments 362e5c31af7Sopenharmony_ci is not ename:VK_RESOLVE_MODE_NONE, its pname:resolveImageLayout member 363e5c31af7Sopenharmony_ci must: not be 364e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL or 365e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL 366e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-pDepthAttachment-06098]] 367e5c31af7Sopenharmony_ci If pname:pDepthAttachment is not `NULL`, 368e5c31af7Sopenharmony_ci pname:pDepthAttachment->imageView is not dlink:VK_NULL_HANDLE, and 369e5c31af7Sopenharmony_ci pname:pDepthAttachment->resolveMode is not ename:VK_RESOLVE_MODE_NONE, 370e5c31af7Sopenharmony_ci pname:pDepthAttachment->resolveImageLayout must: not be 371e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL 372e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-pStencilAttachment-06099]] 373e5c31af7Sopenharmony_ci If pname:pStencilAttachment is not `NULL`, 374e5c31af7Sopenharmony_ci pname:pStencilAttachment->imageView is not dlink:VK_NULL_HANDLE, and 375e5c31af7Sopenharmony_ci pname:pStencilAttachment->resolveMode is not ename:VK_RESOLVE_MODE_NONE, 376e5c31af7Sopenharmony_ci pname:pStencilAttachment->resolveImageLayout must: not be 377e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL 378e5c31af7Sopenharmony_ciendif::VK_KHR_maintenance2,VK_VERSION_1_1[] 379e5c31af7Sopenharmony_ciifdef::VK_KHR_separate_depth_stencil_layouts,VK_VERSION_1_2[] 380e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-colorAttachmentCount-06100]] 381e5c31af7Sopenharmony_ci If pname:colorAttachmentCount is not `0` and the pname:imageView member 382e5c31af7Sopenharmony_ci of an element of pname:pColorAttachments is not dlink:VK_NULL_HANDLE, 383e5c31af7Sopenharmony_ci the pname:layout member of that element of pname:pColorAttachments must: 384e5c31af7Sopenharmony_ci not be ename:VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL, 385e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL, 386e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL, or 387e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL 388e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-colorAttachmentCount-06101]] 389e5c31af7Sopenharmony_ci If pname:colorAttachmentCount is not `0` and the pname:imageView member 390e5c31af7Sopenharmony_ci of an element of pname:pColorAttachments is not dlink:VK_NULL_HANDLE, if 391e5c31af7Sopenharmony_ci the pname:resolveMode member of that element of pname:pColorAttachments 392e5c31af7Sopenharmony_ci is not ename:VK_RESOLVE_MODE_NONE, its pname:resolveImageLayout member 393e5c31af7Sopenharmony_ci must: not be ename:VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL, 394e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL, 395e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL, or 396e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL 397e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-pDepthAttachment-07732]] 398e5c31af7Sopenharmony_ci If pname:pDepthAttachment is not `NULL` and 399e5c31af7Sopenharmony_ci pname:pDepthAttachment->imageView is not dlink:VK_NULL_HANDLE, 400e5c31af7Sopenharmony_ci pname:pDepthAttachment->layout must: not be 401e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL or 402e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL 403e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-pDepthAttachment-07733]] 404e5c31af7Sopenharmony_ci If pname:pDepthAttachment is not `NULL`, 405e5c31af7Sopenharmony_ci pname:pDepthAttachment->imageView is not dlink:VK_NULL_HANDLE, and 406e5c31af7Sopenharmony_ci pname:pDepthAttachment->resolveMode is not ename:VK_RESOLVE_MODE_NONE, 407e5c31af7Sopenharmony_ci pname:pDepthAttachment->resolveImageLayout must: not be 408e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL or 409e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL 410e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-pStencilAttachment-07734]] 411e5c31af7Sopenharmony_ci If pname:pStencilAttachment is not `NULL` and 412e5c31af7Sopenharmony_ci pname:pStencilAttachment->imageView is not dlink:VK_NULL_HANDLE, 413e5c31af7Sopenharmony_ci pname:pStencilAttachment->layout must: not be 414e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL or 415e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL 416e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-pStencilAttachment-07735]] 417e5c31af7Sopenharmony_ci If pname:pStencilAttachment is not `NULL`, 418e5c31af7Sopenharmony_ci pname:pStencilAttachment->imageView is not dlink:VK_NULL_HANDLE, and 419e5c31af7Sopenharmony_ci pname:pStencilAttachment->resolveMode is not ename:VK_RESOLVE_MODE_NONE, 420e5c31af7Sopenharmony_ci pname:pStencilAttachment->resolveImageLayout must: not be 421e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL or 422e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL 423e5c31af7Sopenharmony_ciendif::VK_KHR_separate_depth_stencil_layouts,VK_VERSION_1_2[] 424e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-pDepthAttachment-06102]] 425e5c31af7Sopenharmony_ci If pname:pDepthAttachment is not `NULL` and 426e5c31af7Sopenharmony_ci pname:pDepthAttachment->imageView is not dlink:VK_NULL_HANDLE, 427e5c31af7Sopenharmony_ci pname:pDepthAttachment->resolveMode must: be one of the bits set in 428e5c31af7Sopenharmony_ci slink:VkPhysicalDeviceDepthStencilResolveProperties::pname:supportedDepthResolveModes 429e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-pStencilAttachment-06103]] 430e5c31af7Sopenharmony_ci If pname:pStencilAttachment is not `NULL` and 431e5c31af7Sopenharmony_ci pname:pStencilAttachment->imageView is not dlink:VK_NULL_HANDLE, 432e5c31af7Sopenharmony_ci pname:pStencilAttachment->resolveMode must: be one of the bits set in 433e5c31af7Sopenharmony_ci slink:VkPhysicalDeviceDepthStencilResolveProperties::pname:supportedStencilResolveModes 434e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-pDepthAttachment-06104]] 435e5c31af7Sopenharmony_ci If pname:pDepthAttachment or pname:pStencilAttachment are both not 436e5c31af7Sopenharmony_ci `NULL`, pname:pDepthAttachment->imageView and 437e5c31af7Sopenharmony_ci pname:pStencilAttachment->imageView are both not dlink:VK_NULL_HANDLE, 438e5c31af7Sopenharmony_ci and 439e5c31af7Sopenharmony_ci slink:VkPhysicalDeviceDepthStencilResolveProperties::pname:independentResolveNone 440e5c31af7Sopenharmony_ci is ename:VK_FALSE, the pname:resolveMode of both structures must: be the 441e5c31af7Sopenharmony_ci same value 442e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-pDepthAttachment-06105]] 443e5c31af7Sopenharmony_ci If pname:pDepthAttachment or pname:pStencilAttachment are both not 444e5c31af7Sopenharmony_ci `NULL`, pname:pDepthAttachment->imageView and 445e5c31af7Sopenharmony_ci pname:pStencilAttachment->imageView are both not dlink:VK_NULL_HANDLE, 446e5c31af7Sopenharmony_ci slink:VkPhysicalDeviceDepthStencilResolveProperties::pname:independentResolve 447e5c31af7Sopenharmony_ci is ename:VK_FALSE, and the pname:resolveMode of neither structure is 448e5c31af7Sopenharmony_ci ename:VK_RESOLVE_MODE_NONE, the pname:resolveMode of both structures 449e5c31af7Sopenharmony_ci must: be the same value 450e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-colorAttachmentCount-06106]] 451e5c31af7Sopenharmony_ci pname:colorAttachmentCount must: be less than or equal to 452e5c31af7Sopenharmony_ci slink:VkPhysicalDeviceLimits::pname:maxColorAttachments 453e5c31af7Sopenharmony_ciifdef::VK_EXT_fragment_density_map[] 454e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-imageView-06107]] 455e5c31af7Sopenharmony_ci If the pname:imageView member of a 456e5c31af7Sopenharmony_ci slink:VkRenderingFragmentDensityMapAttachmentInfoEXT structure included 457e5c31af7Sopenharmony_ci in the pname:pNext chain is not dlink:VK_NULL_HANDLE, and the 458e5c31af7Sopenharmony_ci <<features-fragmentDensityMapNonSubsampledImages, 459e5c31af7Sopenharmony_ci pname:fragmentDensityMapNonSubsampledImages>> feature is not enabled, 460e5c31af7Sopenharmony_ci valid pname:imageView and pname:resolveImageView members of 461e5c31af7Sopenharmony_ci pname:pDepthAttachment, pname:pStencilAttachment, and each element of 462e5c31af7Sopenharmony_ci pname:pColorAttachments must: be a slink:VkImageView created with 463e5c31af7Sopenharmony_ci ename:VK_IMAGE_CREATE_SUBSAMPLED_BIT_EXT 464e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_multiview[] 465e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-imageView-06108]] 466e5c31af7Sopenharmony_ci If the pname:imageView member of a 467e5c31af7Sopenharmony_ci slink:VkRenderingFragmentDensityMapAttachmentInfoEXT structure included 468e5c31af7Sopenharmony_ci in the pname:pNext chain is not dlink:VK_NULL_HANDLE, and pname:viewMask 469e5c31af7Sopenharmony_ci is not `0`, pname:imageView must: have a pname:layerCount greater than 470e5c31af7Sopenharmony_ci or equal to the index of the most significant bit in pname:viewMask 471e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-imageView-06109]] 472e5c31af7Sopenharmony_ci If the pname:imageView member of a 473e5c31af7Sopenharmony_ci slink:VkRenderingFragmentDensityMapAttachmentInfoEXT structure included 474e5c31af7Sopenharmony_ci in the pname:pNext chain is not dlink:VK_NULL_HANDLE, and pname:viewMask 475e5c31af7Sopenharmony_ci is `0`, pname:imageView must: have a pname:layerCount equal to `1` 476e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_multiview[] 477e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-pNext-06112]] 478e5c31af7Sopenharmony_ci If 479e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_device_group[] 480e5c31af7Sopenharmony_ci the pname:pNext chain does not contain 481e5c31af7Sopenharmony_ci slink:VkDeviceGroupRenderPassBeginInfo or its 482e5c31af7Sopenharmony_ci pname:deviceRenderAreaCount member is equal to 0 and 483e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_device_group[] 484e5c31af7Sopenharmony_ci the pname:imageView member of a 485e5c31af7Sopenharmony_ci slink:VkRenderingFragmentDensityMapAttachmentInfoEXT structure included 486e5c31af7Sopenharmony_ci in the pname:pNext chain is not dlink:VK_NULL_HANDLE, pname:imageView 487e5c31af7Sopenharmony_ci must: have a width greater than or equal to 488e5c31af7Sopenharmony_ci latexmath:[\left\lceil{\frac{renderArea_{x}+renderArea_{width}}{maxFragmentDensityTexelSize_{width}}}\right\rceil] 489e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-pNext-06114]] 490e5c31af7Sopenharmony_ci If 491e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_device_group[] 492e5c31af7Sopenharmony_ci the pname:pNext chain does not contain 493e5c31af7Sopenharmony_ci slink:VkDeviceGroupRenderPassBeginInfo or its 494e5c31af7Sopenharmony_ci pname:deviceRenderAreaCount member is equal to 0 and 495e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_device_group[] 496e5c31af7Sopenharmony_ci the pname:imageView member of a 497e5c31af7Sopenharmony_ci slink:VkRenderingFragmentDensityMapAttachmentInfoEXT structure included 498e5c31af7Sopenharmony_ci in the pname:pNext chain is not dlink:VK_NULL_HANDLE, pname:imageView 499e5c31af7Sopenharmony_ci must: have a height greater than or equal to 500e5c31af7Sopenharmony_ci latexmath:[\left\lceil{\frac{renderArea_{y}+renderArea_{height}}{maxFragmentDensityTexelSize_{height}}}\right\rceil] 501e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_device_group[] 502e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-pNext-06113]] 503e5c31af7Sopenharmony_ci If the pname:pNext chain contains a 504e5c31af7Sopenharmony_ci slink:VkDeviceGroupRenderPassBeginInfo structure, its 505e5c31af7Sopenharmony_ci pname:deviceRenderAreaCount member is not 0, and the pname:imageView 506e5c31af7Sopenharmony_ci member of a slink:VkRenderingFragmentDensityMapAttachmentInfoEXT 507e5c31af7Sopenharmony_ci structure included in the pname:pNext chain is not dlink:VK_NULL_HANDLE, 508e5c31af7Sopenharmony_ci pname:imageView must: have a width greater than or equal to 509e5c31af7Sopenharmony_ci latexmath:[\left\lceil{\frac{pDeviceRenderAreas_{x}+pDeviceRenderAreas_{width}}{maxFragmentDensityTexelSize_{width}}}\right\rceil] 510e5c31af7Sopenharmony_ci for each element of pname:pDeviceRenderAreas 511e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-pNext-06115]] 512e5c31af7Sopenharmony_ci If the pname:pNext chain contains a 513e5c31af7Sopenharmony_ci slink:VkDeviceGroupRenderPassBeginInfo structure, its 514e5c31af7Sopenharmony_ci pname:deviceRenderAreaCount member is not 0, and the pname:imageView 515e5c31af7Sopenharmony_ci member of a slink:VkRenderingFragmentDensityMapAttachmentInfoEXT 516e5c31af7Sopenharmony_ci structure included in the pname:pNext chain is not dlink:VK_NULL_HANDLE, 517e5c31af7Sopenharmony_ci pname:imageView must: have a height greater than or equal to 518e5c31af7Sopenharmony_ci latexmath:[\left\lceil{\frac{pDeviceRenderAreas_{y}+pDeviceRenderAreas_{height}}{maxFragmentDensityTexelSize_{height}}}\right\rceil] 519e5c31af7Sopenharmony_ci for each element of pname:pDeviceRenderAreas 520e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_device_group[] 521e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-imageView-06116]] 522e5c31af7Sopenharmony_ci If the pname:imageView member of a 523e5c31af7Sopenharmony_ci slink:VkRenderingFragmentDensityMapAttachmentInfoEXT structure included 524e5c31af7Sopenharmony_ci in the pname:pNext chain is not dlink:VK_NULL_HANDLE, it must: not be 525e5c31af7Sopenharmony_ci equal to the pname:imageView or pname:resolveImageView member of 526e5c31af7Sopenharmony_ci pname:pDepthAttachment, pname:pStencilAttachment, or any element of 527e5c31af7Sopenharmony_ci pname:pColorAttachments 528e5c31af7Sopenharmony_ciendif::VK_EXT_fragment_density_map[] 529e5c31af7Sopenharmony_ciifdef::VK_KHR_fragment_shading_rate[] 530e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-pNext-06119]] 531e5c31af7Sopenharmony_ci If 532e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_device_group[] 533e5c31af7Sopenharmony_ci the pname:pNext chain does not contain 534e5c31af7Sopenharmony_ci slink:VkDeviceGroupRenderPassBeginInfo or its 535e5c31af7Sopenharmony_ci pname:deviceRenderAreaCount member is equal to 0 and 536e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_device_group[] 537e5c31af7Sopenharmony_ci the pname:imageView member of a 538e5c31af7Sopenharmony_ci slink:VkRenderingFragmentShadingRateAttachmentInfoKHR structure included 539e5c31af7Sopenharmony_ci in the pname:pNext chain is not dlink:VK_NULL_HANDLE, pname:imageView 540e5c31af7Sopenharmony_ci must: have a width greater than or equal to 541e5c31af7Sopenharmony_ci latexmath:[\left\lceil{\frac{renderArea_{x}+renderArea_{width}}{shadingRateAttachmentTexelSize_{width}}}\right\rceil] 542e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-pNext-06121]] 543e5c31af7Sopenharmony_ci If 544e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_device_group[] 545e5c31af7Sopenharmony_ci the pname:pNext chain does not contain 546e5c31af7Sopenharmony_ci slink:VkDeviceGroupRenderPassBeginInfo or its 547e5c31af7Sopenharmony_ci pname:deviceRenderAreaCount member is equal to 0 and 548e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_device_group[] 549e5c31af7Sopenharmony_ci the pname:imageView member of a 550e5c31af7Sopenharmony_ci slink:VkRenderingFragmentShadingRateAttachmentInfoKHR structure included 551e5c31af7Sopenharmony_ci in the pname:pNext chain is not dlink:VK_NULL_HANDLE, pname:imageView 552e5c31af7Sopenharmony_ci must: have a height greater than or equal to 553e5c31af7Sopenharmony_ci latexmath:[\left\lceil{\frac{renderArea_{y}+renderArea_{height}}{shadingRateAttachmentTexelSize_{height}}}\right\rceil] 554e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_device_group[] 555e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-pNext-06120]] 556e5c31af7Sopenharmony_ci If the pname:pNext chain contains a 557e5c31af7Sopenharmony_ci slink:VkDeviceGroupRenderPassBeginInfo structure, its 558e5c31af7Sopenharmony_ci pname:deviceRenderAreaCount member is not 0, and the pname:imageView 559e5c31af7Sopenharmony_ci member of a slink:VkRenderingFragmentShadingRateAttachmentInfoKHR 560e5c31af7Sopenharmony_ci structure included in the pname:pNext chain is not dlink:VK_NULL_HANDLE, 561e5c31af7Sopenharmony_ci pname:imageView must: have a width greater than or equal to 562e5c31af7Sopenharmony_ci latexmath:[\left\lceil{\frac{pDeviceRenderAreas_{x}+pDeviceRenderAreas_{width}}{shadingRateAttachmentTexelSize_{width}}}\right\rceil] 563e5c31af7Sopenharmony_ci for each element of pname:pDeviceRenderAreas 564e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-pNext-06122]] 565e5c31af7Sopenharmony_ci If the pname:pNext chain contains a 566e5c31af7Sopenharmony_ci slink:VkDeviceGroupRenderPassBeginInfo structure, its 567e5c31af7Sopenharmony_ci pname:deviceRenderAreaCount member is not 0, and the pname:imageView 568e5c31af7Sopenharmony_ci member of a slink:VkRenderingFragmentShadingRateAttachmentInfoKHR 569e5c31af7Sopenharmony_ci structure included in the pname:pNext chain is not dlink:VK_NULL_HANDLE, 570e5c31af7Sopenharmony_ci pname:imageView must: have a height greater than or equal to 571e5c31af7Sopenharmony_ci latexmath:[\left\lceil{\frac{pDeviceRenderAreas_{y}+pDeviceRenderAreas_{height}}{shadingRateAttachmentTexelSize_{height}}}\right\rceil] 572e5c31af7Sopenharmony_ci for each element of pname:pDeviceRenderAreas 573e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_device_group[] 574e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-layerCount-07817]] 575e5c31af7Sopenharmony_ci pname:layerCount must: be less than or equal to 576e5c31af7Sopenharmony_ci <<limits-maxFramebufferLayers, pname:maxFramebufferLayers>> 577e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-imageView-06123]] 578e5c31af7Sopenharmony_ci If the pname:imageView member of a 579e5c31af7Sopenharmony_ci slink:VkRenderingFragmentShadingRateAttachmentInfoKHR structure included 580e5c31af7Sopenharmony_ci in the pname:pNext chain is not dlink:VK_NULL_HANDLE, and pname:viewMask 581e5c31af7Sopenharmony_ci is `0`, pname:imageView must: have a pname:layerCount that is either 582e5c31af7Sopenharmony_ci equal to `1` or greater than or equal to pname:layerCount 583e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-imageView-06124]] 584e5c31af7Sopenharmony_ci If the pname:imageView member of a 585e5c31af7Sopenharmony_ci slink:VkRenderingFragmentShadingRateAttachmentInfoKHR structure included 586e5c31af7Sopenharmony_ci in the pname:pNext chain is not dlink:VK_NULL_HANDLE, and pname:viewMask 587e5c31af7Sopenharmony_ci is not `0`, pname:imageView must: have a pname:layerCount that either 588e5c31af7Sopenharmony_ci equal to `1` or greater than or equal to the index of the most 589e5c31af7Sopenharmony_ci significant bit in pname:viewMask 590e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-imageView-06125]] 591e5c31af7Sopenharmony_ci If the pname:imageView member of a 592e5c31af7Sopenharmony_ci slink:VkRenderingFragmentShadingRateAttachmentInfoKHR structure included 593e5c31af7Sopenharmony_ci in the pname:pNext chain is not dlink:VK_NULL_HANDLE, it must: not be 594e5c31af7Sopenharmony_ci equal to the pname:imageView or pname:resolveImageView member of 595e5c31af7Sopenharmony_ci pname:pDepthAttachment, pname:pStencilAttachment, or any element of 596e5c31af7Sopenharmony_ci pname:pColorAttachments 597e5c31af7Sopenharmony_ciifdef::VK_EXT_fragment_density_map[] 598e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-imageView-06126]] 599e5c31af7Sopenharmony_ci If the pname:imageView member of a 600e5c31af7Sopenharmony_ci slink:VkRenderingFragmentShadingRateAttachmentInfoKHR structure included 601e5c31af7Sopenharmony_ci in the pname:pNext chain is not dlink:VK_NULL_HANDLE, it must: not be 602e5c31af7Sopenharmony_ci equal to the pname:imageView member of a 603e5c31af7Sopenharmony_ci slink:VkRenderingFragmentDensityMapAttachmentInfoEXT structure included 604e5c31af7Sopenharmony_ci in the pname:pNext chain 605e5c31af7Sopenharmony_ciendif::VK_EXT_fragment_density_map[] 606e5c31af7Sopenharmony_ciendif::VK_KHR_fragment_shading_rate[] 607e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-multiview-06127]] 608e5c31af7Sopenharmony_ci If the <<features-multiview, pname:multiview>> feature is not enabled, 609e5c31af7Sopenharmony_ci pname:viewMask must: be `0` 610e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_multiview[] 611e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-viewMask-06128]] 612e5c31af7Sopenharmony_ci The index of the most significant bit in pname:viewMask must: be less 613e5c31af7Sopenharmony_ci than <<limits-maxMultiviewViewCount, pname:maxMultiviewViewCount>> 614e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_multiview[] 615e5c31af7Sopenharmony_ciifdef::VK_QCOM_multiview_per_view_render_areas[] 616e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-perViewRenderAreaCount-07857]] 617e5c31af7Sopenharmony_ci If the pname:perViewRenderAreaCount member of a 618e5c31af7Sopenharmony_ci slink:VkMultiviewPerViewRenderAreasRenderPassBeginInfoQCOM structure 619e5c31af7Sopenharmony_ci included in the pname:pNext chain is not `0`, then the 620e5c31af7Sopenharmony_ci <<features-multiview-per-view-render-areas, 621e5c31af7Sopenharmony_ci pname:multiviewPerViewRenderAreas>> feature must: be enabled. 622e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-perViewRenderAreaCount-07858]] 623e5c31af7Sopenharmony_ci If the pname:perViewRenderAreaCount member of a 624e5c31af7Sopenharmony_ci slink:VkMultiviewPerViewRenderAreasRenderPassBeginInfoQCOM structure 625e5c31af7Sopenharmony_ci included in the pname:pNext chain is not `0`, then pname:renderArea 626e5c31af7Sopenharmony_ci must: specify a render area that includes the union of all per view 627e5c31af7Sopenharmony_ci render areas. 628e5c31af7Sopenharmony_ciendif::VK_QCOM_multiview_per_view_render_areas[] 629e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-None-09044]] 630e5c31af7Sopenharmony_ci Valid attachments specified by this structure must: not be bound to 631e5c31af7Sopenharmony_ci memory locations that are bound to any other valid attachments specified 632e5c31af7Sopenharmony_ci by this structure 633e5c31af7Sopenharmony_ciifdef::VK_EXT_nested_command_buffer[] 634e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-flags-09381]] 635e5c31af7Sopenharmony_ci If pname:flags includes ename:VK_RENDERING_CONTENTS_INLINE_BIT_EXT then 636e5c31af7Sopenharmony_ci the <<features-nestedCommandBuffer, pname:nestedCommandBuffer>> feature 637e5c31af7Sopenharmony_ci must: be enabled 638e5c31af7Sopenharmony_ciendif::VK_EXT_nested_command_buffer[] 639e5c31af7Sopenharmony_ciifdef::VK_ANDROID_external_format_resolve[] 640e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-pDepthAttachment-09318]] 641e5c31af7Sopenharmony_ci pname:pDepthAttachment->resolveMode must: not be 642e5c31af7Sopenharmony_ci ename:VK_RESOLVE_MODE_EXTERNAL_FORMAT_DOWNSAMPLE_ANDROID 643e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-pStencilAttachment-09319]] 644e5c31af7Sopenharmony_ci pname:pStencilAttachment->resolveMode must: not be 645e5c31af7Sopenharmony_ci ename:VK_RESOLVE_MODE_EXTERNAL_FORMAT_DOWNSAMPLE_ANDROID 646e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-colorAttachmentCount-09320]] 647e5c31af7Sopenharmony_ci If pname:colorAttachmentCount is not `1`, the pname:resolveMode member 648e5c31af7Sopenharmony_ci of any element of pname:pColorAttachments must: not be 649e5c31af7Sopenharmony_ci ename:VK_RESOLVE_MODE_EXTERNAL_FORMAT_DOWNSAMPLE_ANDROID 650e5c31af7Sopenharmony_ciifdef::VK_EXT_fragment_density_map[] 651e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-resolveMode-09321]] 652e5c31af7Sopenharmony_ci If the pname:resolveMode of any element of pname:pColorAttachments is 653e5c31af7Sopenharmony_ci ename:VK_RESOLVE_MODE_EXTERNAL_FORMAT_DOWNSAMPLE_ANDROID, 654e5c31af7Sopenharmony_ci slink:VkRenderingFragmentDensityMapAttachmentInfoEXT::pname:imageView 655e5c31af7Sopenharmony_ci must: be dlink:VK_NULL_HANDLE 656e5c31af7Sopenharmony_ciendif::VK_EXT_fragment_density_map[] 657e5c31af7Sopenharmony_ciifdef::VK_KHR_fragment_shading_rate[] 658e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-resolveMode-09322]] 659e5c31af7Sopenharmony_ci If the pname:resolveMode of any element of pname:pColorAttachments is 660e5c31af7Sopenharmony_ci ename:VK_RESOLVE_MODE_EXTERNAL_FORMAT_DOWNSAMPLE_ANDROID, 661e5c31af7Sopenharmony_ci slink:VkRenderingFragmentShadingRateAttachmentInfoKHR::pname:imageView 662e5c31af7Sopenharmony_ci must: be dlink:VK_NULL_HANDLE 663e5c31af7Sopenharmony_ciendif::VK_KHR_fragment_shading_rate[] 664e5c31af7Sopenharmony_ciendif::VK_ANDROID_external_format_resolve[] 665e5c31af7Sopenharmony_ciifdef::VK_ARM_render_pass_striped[] 666e5c31af7Sopenharmony_ci If the pname:pNext chain contains a slink:VkRenderPassStripeBeginInfoARM 667e5c31af7Sopenharmony_ci structure, the union of stripe areas defined by the elements of 668e5c31af7Sopenharmony_ci slink:VkRenderPassStripeInfoARM::pname:pStripeInfos must: cover the 669e5c31af7Sopenharmony_ci pname:renderArea 670e5c31af7Sopenharmony_ciendif::VK_ARM_render_pass_striped[] 671e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-colorAttachmentCount-09479]] 672e5c31af7Sopenharmony_ci If pname:colorAttachmentCount is not `0` and the pname:imageView member 673e5c31af7Sopenharmony_ci of an element of pname:pColorAttachments is not dlink:VK_NULL_HANDLE, 674e5c31af7Sopenharmony_ci that pname:imageView must: have been created with the 675e5c31af7Sopenharmony_ci <<resources-image-views-identity-mappings,identity swizzle>> 676e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-colorAttachmentCount-09480]] 677e5c31af7Sopenharmony_ci If pname:colorAttachmentCount is not `0`, and there is an element of 678e5c31af7Sopenharmony_ci pname:pColorAttachments with 679e5c31af7Sopenharmony_ciifdef::VK_ANDROID_external_format_resolve[] 680e5c31af7Sopenharmony_ci either its pname:resolveMode member set to 681e5c31af7Sopenharmony_ci ename:VK_RESOLVE_MODE_EXTERNAL_FORMAT_DOWNSAMPLE_ANDROID, or 682e5c31af7Sopenharmony_ciendif::VK_ANDROID_external_format_resolve[] 683e5c31af7Sopenharmony_ci its pname:imageView member not set to dlink:VK_NULL_HANDLE and its 684e5c31af7Sopenharmony_ci pname:resolveMode member not set to ename:VK_RESOLVE_MODE_NONE, the 685e5c31af7Sopenharmony_ci pname:resolveImageView member of that element of pname:pColorAttachments 686e5c31af7Sopenharmony_ci must: have been created with the 687e5c31af7Sopenharmony_ci <<resources-image-views-identity-mappings,identity swizzle>> 688e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-pDepthAttachment-09481]] 689e5c31af7Sopenharmony_ci If pname:pDepthAttachment is not `NULL` and 690e5c31af7Sopenharmony_ci pname:pDepthAttachment->imageView is not dlink:VK_NULL_HANDLE, 691e5c31af7Sopenharmony_ci pname:pDepthAttachment->imageView must: have been created with the 692e5c31af7Sopenharmony_ci <<resources-image-views-identity-mappings,identity swizzle>> 693e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-pDepthAttachment-09482]] 694e5c31af7Sopenharmony_ci If pname:pDepthAttachment is not `NULL`, 695e5c31af7Sopenharmony_ci pname:pDepthAttachment->imageView is not dlink:VK_NULL_HANDLE, and 696e5c31af7Sopenharmony_ci pname:pDepthAttachment->resolveMode is not ename:VK_RESOLVE_MODE_NONE, 697e5c31af7Sopenharmony_ci pname:pDepthAttachment->resolveImageView must: have been created with 698e5c31af7Sopenharmony_ci the <<resources-image-views-identity-mappings,identity swizzle>> 699e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-pStencilAttachment-09483]] 700e5c31af7Sopenharmony_ci If pname:pStencilAttachment is not `NULL` and 701e5c31af7Sopenharmony_ci pname:pStencilAttachment->imageView is not dlink:VK_NULL_HANDLE, 702e5c31af7Sopenharmony_ci pname:pStencilAttachment->imageView must: have been created with the 703e5c31af7Sopenharmony_ci <<resources-image-views-identity-mappings,identity swizzle>> 704e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-pStencilAttachment-09484]] 705e5c31af7Sopenharmony_ci If pname:pStencilAttachment is not `NULL`, 706e5c31af7Sopenharmony_ci pname:pStencilAttachment->imageView is not dlink:VK_NULL_HANDLE, and 707e5c31af7Sopenharmony_ci pname:pStencilAttachment->resolveMode is not ename:VK_RESOLVE_MODE_NONE, 708e5c31af7Sopenharmony_ci pname:pStencilAttachment->resolveImageView must: have been created with 709e5c31af7Sopenharmony_ci the <<resources-image-views-identity-mappings,identity swizzle>> 710e5c31af7Sopenharmony_ciifdef::VK_KHR_fragment_shading_rate[] 711e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-imageView-09485]] 712e5c31af7Sopenharmony_ci If the pname:imageView member of a 713e5c31af7Sopenharmony_ci slink:VkRenderingFragmentShadingRateAttachmentInfoKHR structure included 714e5c31af7Sopenharmony_ci in the pname:pNext chain is not dlink:VK_NULL_HANDLE, it must: have been 715e5c31af7Sopenharmony_ci created with the <<resources-image-views-identity-mappings,identity 716e5c31af7Sopenharmony_ci swizzle>> 717e5c31af7Sopenharmony_ciendif::VK_KHR_fragment_shading_rate[] 718e5c31af7Sopenharmony_ciifdef::VK_EXT_fragment_density_map[] 719e5c31af7Sopenharmony_ci * [[VUID-VkRenderingInfo-imageView-09486]] 720e5c31af7Sopenharmony_ci If the pname:imageView member of a 721e5c31af7Sopenharmony_ci slink:VkRenderingFragmentDensityMapAttachmentInfoEXT structure included 722e5c31af7Sopenharmony_ci in the pname:pNext chain is not dlink:VK_NULL_HANDLE, it must: have been 723e5c31af7Sopenharmony_ci created with the <<resources-image-views-identity-mappings,identity 724e5c31af7Sopenharmony_ci swizzle>> 725e5c31af7Sopenharmony_ciendif::VK_EXT_fragment_density_map[] 726e5c31af7Sopenharmony_ci**** 727e5c31af7Sopenharmony_ci 728e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkRenderingInfo.adoc[] 729e5c31af7Sopenharmony_ci-- 730e5c31af7Sopenharmony_ci 731e5c31af7Sopenharmony_ci[open,refpage='VkRenderingFlagBits',desc='Bitmask specifying additional properties of a dynamic render pass instance',type='enums',alias='VkRenderingFlagBitsKHR'] 732e5c31af7Sopenharmony_ci-- 733e5c31af7Sopenharmony_ciBits which can: be set in slink:VkRenderingInfo::pname:flags describing 734e5c31af7Sopenharmony_ciadditional properties of the render pass are: 735e5c31af7Sopenharmony_ci 736e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkRenderingFlagBits.adoc[] 737e5c31af7Sopenharmony_ci 738e5c31af7Sopenharmony_ciifdef::VK_KHR_dynamic_rendering[] 739e5c31af7Sopenharmony_cior the equivalent 740e5c31af7Sopenharmony_ci 741e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkRenderingFlagBitsKHR.adoc[] 742e5c31af7Sopenharmony_ciendif::VK_KHR_dynamic_rendering[] 743e5c31af7Sopenharmony_ci 744e5c31af7Sopenharmony_ci * ename:VK_RENDERING_CONTENTS_SECONDARY_COMMAND_BUFFERS_BIT specifies that 745e5c31af7Sopenharmony_ci draw calls for the render pass instance will be recorded in secondary 746e5c31af7Sopenharmony_ci command buffers. 747e5c31af7Sopenharmony_ciifdef::VK_EXT_nested_command_buffer[] 748e5c31af7Sopenharmony_ci If the <<features-nestedCommandBuffer, pname:nestedCommandBuffer>> 749e5c31af7Sopenharmony_ci feature is enabled, the draw calls can: come from both inline and 750e5c31af7Sopenharmony_ci flink:vkCmdExecuteCommands. 751e5c31af7Sopenharmony_ciendif::VK_EXT_nested_command_buffer[] 752e5c31af7Sopenharmony_ci * ename:VK_RENDERING_RESUMING_BIT specifies that the render pass instance 753e5c31af7Sopenharmony_ci is resuming an earlier suspended render pass instance. 754e5c31af7Sopenharmony_ci * ename:VK_RENDERING_SUSPENDING_BIT specifies that the render pass 755e5c31af7Sopenharmony_ci instance will be suspended. 756e5c31af7Sopenharmony_ciifdef::VK_EXT_legacy_dithering[] 757e5c31af7Sopenharmony_ci * ename:VK_RENDERING_ENABLE_LEGACY_DITHERING_BIT_EXT specifies that 758e5c31af7Sopenharmony_ci <<interfaces-legacy-dithering, Legacy Dithering>> is enabled for the 759e5c31af7Sopenharmony_ci render pass instance. 760e5c31af7Sopenharmony_ciendif::VK_EXT_legacy_dithering[] 761e5c31af7Sopenharmony_ciifdef::VK_EXT_nested_command_buffer[] 762e5c31af7Sopenharmony_ci * ename:VK_RENDERING_CONTENTS_INLINE_BIT_EXT specifies that draw calls for 763e5c31af7Sopenharmony_ci the render pass instance can: be recorded inline within the current 764e5c31af7Sopenharmony_ci command buffer. 765e5c31af7Sopenharmony_ci When the <<features-nestedCommandBuffer, pname:nestedCommandBuffer>> 766e5c31af7Sopenharmony_ci feature is enabled this can: be combined with the 767e5c31af7Sopenharmony_ci ename:VK_RENDERING_CONTENTS_SECONDARY_COMMAND_BUFFERS_BIT bit to allow 768e5c31af7Sopenharmony_ci draw calls to be recorded both inline and in secondary command buffers. 769e5c31af7Sopenharmony_ciendif::VK_EXT_nested_command_buffer[] 770e5c31af7Sopenharmony_ci 771e5c31af7Sopenharmony_ci[[renderpass-suspension]] 772e5c31af7Sopenharmony_ciThe contents of pname:pRenderingInfo must: match between suspended render 773e5c31af7Sopenharmony_cipass instances and the render pass instances that resume them, other than 774e5c31af7Sopenharmony_cithe presence or absence of the ename:VK_RENDERING_RESUMING_BIT, 775e5c31af7Sopenharmony_ciename:VK_RENDERING_SUSPENDING_BIT, and 776e5c31af7Sopenharmony_ciename:VK_RENDERING_CONTENTS_SECONDARY_COMMAND_BUFFERS_BIT flags. 777e5c31af7Sopenharmony_ciNo action or synchronization commands, or other render pass instances, are 778e5c31af7Sopenharmony_ciallowed between suspending and resuming render pass instances. 779e5c31af7Sopenharmony_ci-- 780e5c31af7Sopenharmony_ci 781e5c31af7Sopenharmony_ci[open,refpage='VkRenderingFlags',desc='Bitmask of VkRenderingFlagBits',type='flags',alias='VkRenderingFlagsKHR'] 782e5c31af7Sopenharmony_ci-- 783e5c31af7Sopenharmony_ciinclude::{generated}/api/flags/VkRenderingFlags.adoc[] 784e5c31af7Sopenharmony_ci 785e5c31af7Sopenharmony_ciifdef::VK_KHR_dynamic_rendering[] 786e5c31af7Sopenharmony_cior the equivalent 787e5c31af7Sopenharmony_ci 788e5c31af7Sopenharmony_ciinclude::{generated}/api/flags/VkRenderingFlagsKHR.adoc[] 789e5c31af7Sopenharmony_ciendif::VK_KHR_dynamic_rendering[] 790e5c31af7Sopenharmony_ci 791e5c31af7Sopenharmony_citname:VkRenderingFlags is a bitmask type for setting a mask of zero or more 792e5c31af7Sopenharmony_cielink:VkRenderingFlagBits. 793e5c31af7Sopenharmony_ci-- 794e5c31af7Sopenharmony_ci 795e5c31af7Sopenharmony_ci[open,refpage='VkRenderingAttachmentInfo',desc='Structure specifying attachment information',type='structs',alias='VkRenderingAttachmentInfoKHR'] 796e5c31af7Sopenharmony_ci-- 797e5c31af7Sopenharmony_ciThe sname:VkRenderingAttachmentInfo structure is defined as: 798e5c31af7Sopenharmony_ci 799e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkRenderingAttachmentInfo.adoc[] 800e5c31af7Sopenharmony_ci 801e5c31af7Sopenharmony_ciifdef::VK_KHR_dynamic_rendering[] 802e5c31af7Sopenharmony_cior the equivalent 803e5c31af7Sopenharmony_ci 804e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkRenderingAttachmentInfoKHR.adoc[] 805e5c31af7Sopenharmony_ciendif::VK_KHR_dynamic_rendering[] 806e5c31af7Sopenharmony_ci 807e5c31af7Sopenharmony_ci * pname:sType is a elink:VkStructureType value identifying this structure. 808e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 809e5c31af7Sopenharmony_ci structure. 810e5c31af7Sopenharmony_ci * pname:imageView is the image view that will be used for rendering. 811e5c31af7Sopenharmony_ci * pname:imageLayout is the layout that pname:imageView will be in during 812e5c31af7Sopenharmony_ci rendering. 813e5c31af7Sopenharmony_ci * pname:resolveMode is a elink:VkResolveModeFlagBits value defining how 814e5c31af7Sopenharmony_ci data written to pname:imageView will be resolved into 815e5c31af7Sopenharmony_ci pname:resolveImageView. 816e5c31af7Sopenharmony_ci * pname:resolveImageView is an image view used to write resolved data at 817e5c31af7Sopenharmony_ci the end of rendering. 818e5c31af7Sopenharmony_ci * pname:resolveImageLayout is the layout that pname:resolveImageView will 819e5c31af7Sopenharmony_ci be in during rendering. 820e5c31af7Sopenharmony_ci * pname:loadOp is a elink:VkAttachmentLoadOp value defining the 821e5c31af7Sopenharmony_ci <<renderpass-load-operations, load operation>> for the attachment. 822e5c31af7Sopenharmony_ci * pname:storeOp is a elink:VkAttachmentStoreOp value defining the 823e5c31af7Sopenharmony_ci <<renderpass-store-operations, store operation>> for the attachment. 824e5c31af7Sopenharmony_ci * pname:clearValue is a slink:VkClearValue structure defining values used 825e5c31af7Sopenharmony_ci to clear pname:imageView when pname:loadOp is 826e5c31af7Sopenharmony_ci ename:VK_ATTACHMENT_LOAD_OP_CLEAR. 827e5c31af7Sopenharmony_ci 828e5c31af7Sopenharmony_ciValues in pname:imageView are loaded and stored according to the values of 829e5c31af7Sopenharmony_cipname:loadOp and pname:storeOp, within the render area 830e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_device_group[] 831e5c31af7Sopenharmony_cifor each device 832e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_device_group[] 833e5c31af7Sopenharmony_cispecified in slink:VkRenderingInfo. 834e5c31af7Sopenharmony_ciIf pname:imageView is dlink:VK_NULL_HANDLE, 835e5c31af7Sopenharmony_ciifdef::VK_ANDROID_external_format_resolve[] 836e5c31af7Sopenharmony_ciand pname:resolveMode is not 837e5c31af7Sopenharmony_ciename:VK_RESOLVE_MODE_EXTERNAL_FORMAT_DOWNSAMPLE_ANDROID, 838e5c31af7Sopenharmony_ciendif::VK_ANDROID_external_format_resolve[] 839e5c31af7Sopenharmony_ciother members of this structure are ignored; writes to this attachment will 840e5c31af7Sopenharmony_cibe discarded, and no <<renderpass-load-operations, load>>, 841e5c31af7Sopenharmony_ci<<renderpass-store-operations, store>>, or <<renderpass-resolve-operations, 842e5c31af7Sopenharmony_cimultisample resolve>> operations will be performed. 843e5c31af7Sopenharmony_ci 844e5c31af7Sopenharmony_ciIf pname:resolveMode is ename:VK_RESOLVE_MODE_NONE, then 845e5c31af7Sopenharmony_cipname:resolveImageView is ignored. 846e5c31af7Sopenharmony_ciIf pname:resolveMode is not ename:VK_RESOLVE_MODE_NONE, and 847e5c31af7Sopenharmony_cipname:resolveImageView is not dlink:VK_NULL_HANDLE, a 848e5c31af7Sopenharmony_ci<<renderpass-resolve-operations, render pass multisample resolve operation>> 849e5c31af7Sopenharmony_ciis defined for the attachment subresource. 850e5c31af7Sopenharmony_ciifdef::VK_ANDROID_external_format_resolve[] 851e5c31af7Sopenharmony_ciIf pname:resolveMode is 852e5c31af7Sopenharmony_ciename:VK_RESOLVE_MODE_EXTERNAL_FORMAT_DOWNSAMPLE_ANDROID, and the 853e5c31af7Sopenharmony_ci<<limits-nullColorAttachmentWithExternalFormatResolve, 854e5c31af7Sopenharmony_cipname:nullColorAttachmentWithExternalFormatResolve>> limit is ename:VK_TRUE, 855e5c31af7Sopenharmony_civalues are only undefined: once <<renderpass-load-operations, load 856e5c31af7Sopenharmony_cioperations>> have completed. 857e5c31af7Sopenharmony_ciendif::VK_ANDROID_external_format_resolve[] 858e5c31af7Sopenharmony_ci 859e5c31af7Sopenharmony_ci[NOTE] 860e5c31af7Sopenharmony_ci.Note 861e5c31af7Sopenharmony_ci==== 862e5c31af7Sopenharmony_ciThe resolve mode and store operation are independent; it is valid to write 863e5c31af7Sopenharmony_ciboth resolved and unresolved values, and equally valid to discard the 864e5c31af7Sopenharmony_ciunresolved values while writing the resolved ones. 865e5c31af7Sopenharmony_ci==== 866e5c31af7Sopenharmony_ci 867e5c31af7Sopenharmony_ciStore and resolve operations are only performed at the end of a render pass 868e5c31af7Sopenharmony_ciinstance that does not specify the ename:VK_RENDERING_SUSPENDING_BIT_KHR 869e5c31af7Sopenharmony_ciflag. 870e5c31af7Sopenharmony_ci 871e5c31af7Sopenharmony_ciLoad operations are only performed at the beginning of a render pass 872e5c31af7Sopenharmony_ciinstance that does not specify the ename:VK_RENDERING_RESUMING_BIT_KHR flag. 873e5c31af7Sopenharmony_ci 874e5c31af7Sopenharmony_ciImage contents at the end of a suspended render pass instance remain defined 875e5c31af7Sopenharmony_cifor access by a resuming render pass instance. 876e5c31af7Sopenharmony_ci 877e5c31af7Sopenharmony_ciifdef::VK_ANDROID_external_format_resolve[] 878e5c31af7Sopenharmony_ciIf the <<limits-nullColorAttachmentWithExternalFormatResolve, 879e5c31af7Sopenharmony_cipname:nullColorAttachmentWithExternalFormatResolve>> limit is ename:VK_TRUE, 880e5c31af7Sopenharmony_ciand pname:resolveMode is 881e5c31af7Sopenharmony_ciename:VK_RESOLVE_MODE_EXTERNAL_FORMAT_DOWNSAMPLE_ANDROID, values in the 882e5c31af7Sopenharmony_cicolor attachment will be loaded from the resolve attachment at the start of 883e5c31af7Sopenharmony_cirendering, and may: also be reloaded any time after a resolve occurs or the 884e5c31af7Sopenharmony_ciresolve attachment is written to; if this occurs it must: happen-before any 885e5c31af7Sopenharmony_ciwrites to the color attachment are performed which happen-after the resolve 886e5c31af7Sopenharmony_cithat triggers this. 887e5c31af7Sopenharmony_ciIf any color component in the external format is subsampled, values will be 888e5c31af7Sopenharmony_ciread from the nearest sample in the image when they are loaded. 889e5c31af7Sopenharmony_ciendif::VK_ANDROID_external_format_resolve[] 890e5c31af7Sopenharmony_ci 891e5c31af7Sopenharmony_ci 892e5c31af7Sopenharmony_ci.Valid Usage 893e5c31af7Sopenharmony_ci**** 894e5c31af7Sopenharmony_ci * [[VUID-VkRenderingAttachmentInfo-imageView-06129]] 895e5c31af7Sopenharmony_ci If pname:imageView is not dlink:VK_NULL_HANDLE and has a non-integer 896e5c31af7Sopenharmony_ci color format, pname:resolveMode must: be ename:VK_RESOLVE_MODE_NONE or 897e5c31af7Sopenharmony_ci ename:VK_RESOLVE_MODE_AVERAGE_BIT 898e5c31af7Sopenharmony_ci * [[VUID-VkRenderingAttachmentInfo-imageView-06130]] 899e5c31af7Sopenharmony_ci If pname:imageView is not dlink:VK_NULL_HANDLE and has an integer color 900e5c31af7Sopenharmony_ci format, pname:resolveMode must: be ename:VK_RESOLVE_MODE_NONE or 901e5c31af7Sopenharmony_ci ename:VK_RESOLVE_MODE_SAMPLE_ZERO_BIT 902e5c31af7Sopenharmony_ci * [[VUID-VkRenderingAttachmentInfo-imageView-06861]] 903e5c31af7Sopenharmony_ci pname:imageView must: not have a sample count of 904e5c31af7Sopenharmony_ci ename:VK_SAMPLE_COUNT_1_BIT if all of the following hold: 905e5c31af7Sopenharmony_ci ** pname:imageView is not dlink:VK_NULL_HANDLE 906e5c31af7Sopenharmony_ci ** pname:resolveMode is not ename:VK_RESOLVE_MODE_NONE 907e5c31af7Sopenharmony_ciifdef::VK_EXT_multisampled_render_to_single_sampled[] 908e5c31af7Sopenharmony_ci ** the pname:pNext chain of slink:VkRenderingInfo does not include a 909e5c31af7Sopenharmony_ci slink:VkMultisampledRenderToSingleSampledInfoEXT structure with the 910e5c31af7Sopenharmony_ci pname:multisampledRenderToSingleSampledEnable field equal to 911e5c31af7Sopenharmony_ci ename:VK_TRUE 912e5c31af7Sopenharmony_ciendif::VK_EXT_multisampled_render_to_single_sampled[] 913e5c31af7Sopenharmony_ci * [[VUID-VkRenderingAttachmentInfo-imageView-06862]] 914e5c31af7Sopenharmony_ci pname:resolveImageView must: not be dlink:VK_NULL_HANDLE if all of the 915e5c31af7Sopenharmony_ci following hold: 916e5c31af7Sopenharmony_ci ** pname:imageView is not dlink:VK_NULL_HANDLE 917e5c31af7Sopenharmony_ci ** pname:resolveMode is not ename:VK_RESOLVE_MODE_NONE 918e5c31af7Sopenharmony_ciifdef::VK_EXT_multisampled_render_to_single_sampled[] 919e5c31af7Sopenharmony_ci ** the pname:pNext chain of slink:VkRenderingInfo does not include a 920e5c31af7Sopenharmony_ci slink:VkMultisampledRenderToSingleSampledInfoEXT structure with the 921e5c31af7Sopenharmony_ci pname:multisampledRenderToSingleSampledEnable field equal to 922e5c31af7Sopenharmony_ci ename:VK_TRUE 923e5c31af7Sopenharmony_ciendif::VK_EXT_multisampled_render_to_single_sampled[] 924e5c31af7Sopenharmony_ciifdef::VK_EXT_multisampled_render_to_single_sampled[] 925e5c31af7Sopenharmony_ci * [[VUID-VkRenderingAttachmentInfo-imageView-06863]] 926e5c31af7Sopenharmony_ci If pname:imageView is not dlink:VK_NULL_HANDLE, pname:resolveMode is not 927e5c31af7Sopenharmony_ci ename:VK_RESOLVE_MODE_NONE, the pname:pNext chain of 928e5c31af7Sopenharmony_ci slink:VkRenderingInfo includes a 929e5c31af7Sopenharmony_ci slink:VkMultisampledRenderToSingleSampledInfoEXT structure with the 930e5c31af7Sopenharmony_ci pname:multisampledRenderToSingleSampledEnable field equal to 931e5c31af7Sopenharmony_ci ename:VK_TRUE, and pname:imageView has a sample count of 932e5c31af7Sopenharmony_ci ename:VK_SAMPLE_COUNT_1_BIT, pname:resolveImageView must: be 933e5c31af7Sopenharmony_ci dlink:VK_NULL_HANDLE 934e5c31af7Sopenharmony_ciendif::VK_EXT_multisampled_render_to_single_sampled[] 935e5c31af7Sopenharmony_ci * [[VUID-VkRenderingAttachmentInfo-imageView-06864]] 936e5c31af7Sopenharmony_ci If pname:imageView is not dlink:VK_NULL_HANDLE, pname:resolveImageView 937e5c31af7Sopenharmony_ci is not dlink:VK_NULL_HANDLE, and pname:resolveMode is not 938e5c31af7Sopenharmony_ci ename:VK_RESOLVE_MODE_NONE, pname:resolveImageView must: have a sample 939e5c31af7Sopenharmony_ci count of ename:VK_SAMPLE_COUNT_1_BIT 940e5c31af7Sopenharmony_ci * [[VUID-VkRenderingAttachmentInfo-imageView-06865]] 941e5c31af7Sopenharmony_ci If pname:imageView is not dlink:VK_NULL_HANDLE, pname:resolveImageView 942e5c31af7Sopenharmony_ci is not dlink:VK_NULL_HANDLE, and pname:resolveMode is not 943e5c31af7Sopenharmony_ci ename:VK_RESOLVE_MODE_NONE, pname:imageView and pname:resolveImageView 944e5c31af7Sopenharmony_ci must: have the same elink:VkFormat 945e5c31af7Sopenharmony_ci * [[VUID-VkRenderingAttachmentInfo-imageView-06135]] 946e5c31af7Sopenharmony_ci If pname:imageView is not dlink:VK_NULL_HANDLE, pname:imageLayout must: 947e5c31af7Sopenharmony_ci not be ename:VK_IMAGE_LAYOUT_UNDEFINED, 948e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, 949e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, 950e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, or 951e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_PREINITIALIZED 952e5c31af7Sopenharmony_ci * [[VUID-VkRenderingAttachmentInfo-imageView-06136]] 953e5c31af7Sopenharmony_ci If pname:imageView is not dlink:VK_NULL_HANDLE and pname:resolveMode is 954e5c31af7Sopenharmony_ci not ename:VK_RESOLVE_MODE_NONE, pname:resolveImageLayout must: not be 955e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_UNDEFINED, 956e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL, 957e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, 958e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, 959e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, or 960e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_PREINITIALIZED 961e5c31af7Sopenharmony_ciifdef::VK_KHR_separate_depth_stencil_layouts,VK_VERSION_1_2[] 962e5c31af7Sopenharmony_ci * [[VUID-VkRenderingAttachmentInfo-imageView-06137]] 963e5c31af7Sopenharmony_ci If pname:imageView is not dlink:VK_NULL_HANDLE and pname:resolveMode is 964e5c31af7Sopenharmony_ci not ename:VK_RESOLVE_MODE_NONE, pname:resolveImageLayout must: not be 965e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL or 966e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL 967e5c31af7Sopenharmony_ciendif::VK_KHR_separate_depth_stencil_layouts,VK_VERSION_1_2[] 968e5c31af7Sopenharmony_ciifdef::VK_NV_shading_rate_image[] 969e5c31af7Sopenharmony_ci * [[VUID-VkRenderingAttachmentInfo-imageView-06138]] 970e5c31af7Sopenharmony_ci If pname:imageView is not dlink:VK_NULL_HANDLE, pname:imageLayout must: 971e5c31af7Sopenharmony_ci not be ename:VK_IMAGE_LAYOUT_SHADING_RATE_OPTIMAL_NV 972e5c31af7Sopenharmony_ci * [[VUID-VkRenderingAttachmentInfo-imageView-06139]] 973e5c31af7Sopenharmony_ci If pname:imageView is not dlink:VK_NULL_HANDLE and pname:resolveMode is 974e5c31af7Sopenharmony_ci not ename:VK_RESOLVE_MODE_NONE, pname:resolveImageLayout must: not be 975e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_SHADING_RATE_OPTIMAL_NV 976e5c31af7Sopenharmony_ciendif::VK_NV_shading_rate_image[] 977e5c31af7Sopenharmony_ciifdef::VK_EXT_fragment_density_map[] 978e5c31af7Sopenharmony_ci * [[VUID-VkRenderingAttachmentInfo-imageView-06140]] 979e5c31af7Sopenharmony_ci If pname:imageView is not dlink:VK_NULL_HANDLE, pname:imageLayout must: 980e5c31af7Sopenharmony_ci not be ename:VK_IMAGE_LAYOUT_FRAGMENT_DENSITY_MAP_OPTIMAL_EXT 981e5c31af7Sopenharmony_ci * [[VUID-VkRenderingAttachmentInfo-imageView-06141]] 982e5c31af7Sopenharmony_ci If pname:imageView is not dlink:VK_NULL_HANDLE and pname:resolveMode is 983e5c31af7Sopenharmony_ci not ename:VK_RESOLVE_MODE_NONE, pname:resolveImageLayout must: not be 984e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_FRAGMENT_DENSITY_MAP_OPTIMAL_EXT 985e5c31af7Sopenharmony_ciendif::VK_EXT_fragment_density_map[] 986e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_3,VK_KHR_synchronization2[] 987e5c31af7Sopenharmony_ci * [[VUID-VkRenderingAttachmentInfo-imageView-06142]] 988e5c31af7Sopenharmony_ci If pname:imageView is not dlink:VK_NULL_HANDLE and pname:resolveMode is 989e5c31af7Sopenharmony_ci not ename:VK_RESOLVE_MODE_NONE, pname:resolveImageLayout must: not be 990e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_READ_ONLY_OPTIMAL_KHR 991e5c31af7Sopenharmony_ciendif::VK_VERSION_1_3,VK_KHR_synchronization2[] 992e5c31af7Sopenharmony_ciifdef::VK_KHR_fragment_shading_rate[] 993e5c31af7Sopenharmony_ci * [[VUID-VkRenderingAttachmentInfo-imageView-06143]] 994e5c31af7Sopenharmony_ci If pname:imageView is not dlink:VK_NULL_HANDLE, pname:imageLayout must: 995e5c31af7Sopenharmony_ci not be 996e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_FRAGMENT_SHADING_RATE_ATTACHMENT_OPTIMAL_KHR 997e5c31af7Sopenharmony_ci * [[VUID-VkRenderingAttachmentInfo-imageView-06144]] 998e5c31af7Sopenharmony_ci If pname:imageView is not dlink:VK_NULL_HANDLE and pname:resolveMode is 999e5c31af7Sopenharmony_ci not ename:VK_RESOLVE_MODE_NONE, pname:resolveImageLayout must: not be 1000e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_FRAGMENT_SHADING_RATE_ATTACHMENT_OPTIMAL_KHR 1001e5c31af7Sopenharmony_ciendif::VK_KHR_fragment_shading_rate[] 1002e5c31af7Sopenharmony_ciifdef::VK_KHR_swapchain[] 1003e5c31af7Sopenharmony_ci * [[VUID-VkRenderingAttachmentInfo-imageView-06145]] 1004e5c31af7Sopenharmony_ci If pname:imageView is not dlink:VK_NULL_HANDLE, pname:imageLayout must: 1005e5c31af7Sopenharmony_ci not be ename:VK_IMAGE_LAYOUT_PRESENT_SRC_KHR 1006e5c31af7Sopenharmony_ci * [[VUID-VkRenderingAttachmentInfo-imageView-06146]] 1007e5c31af7Sopenharmony_ci If pname:imageView is not dlink:VK_NULL_HANDLE and pname:resolveMode is 1008e5c31af7Sopenharmony_ci not ename:VK_RESOLVE_MODE_NONE, pname:resolveImageLayout must: not be 1009e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_PRESENT_SRC_KHR 1010e5c31af7Sopenharmony_ciendif::VK_KHR_swapchain[] 1011e5c31af7Sopenharmony_ciifdef::VK_ANDROID_external_format_resolve[] 1012e5c31af7Sopenharmony_ci * [[VUID-VkRenderingAttachmentInfo-externalFormatResolve-09323]] 1013e5c31af7Sopenharmony_ci If <<features-externalFormatResolve,pname:externalFormatResolve>> is not 1014e5c31af7Sopenharmony_ci enabled, pname:resolveMode must: not be 1015e5c31af7Sopenharmony_ci ename:VK_RESOLVE_MODE_EXTERNAL_FORMAT_DOWNSAMPLE_ANDROID 1016e5c31af7Sopenharmony_ci * [[VUID-VkRenderingAttachmentInfo-resolveMode-09324]] 1017e5c31af7Sopenharmony_ci If pname:resolveMode is 1018e5c31af7Sopenharmony_ci ename:VK_RESOLVE_MODE_EXTERNAL_FORMAT_DOWNSAMPLE_ANDROID, 1019e5c31af7Sopenharmony_ci pname:resolveImageView must: be a valid image view 1020e5c31af7Sopenharmony_ci * [[VUID-VkRenderingAttachmentInfo-nullColorAttachmentWithExternalFormatResolve-09325]] 1021e5c31af7Sopenharmony_ci If the <<limits-nullColorAttachmentWithExternalFormatResolve, 1022e5c31af7Sopenharmony_ci pname:nullColorAttachmentWithExternalFormatResolve>> property is 1023e5c31af7Sopenharmony_ci ename:VK_TRUE and pname:resolveMode is 1024e5c31af7Sopenharmony_ci ename:VK_RESOLVE_MODE_EXTERNAL_FORMAT_DOWNSAMPLE_ANDROID, 1025e5c31af7Sopenharmony_ci pname:resolveImageView must: have been created with an image with a 1026e5c31af7Sopenharmony_ci pname:samples value of ename:VK_SAMPLE_COUNT_1_BIT 1027e5c31af7Sopenharmony_ci * [[VUID-VkRenderingAttachmentInfo-resolveMode-09326]] 1028e5c31af7Sopenharmony_ci If pname:resolveMode is 1029e5c31af7Sopenharmony_ci ename:VK_RESOLVE_MODE_EXTERNAL_FORMAT_DOWNSAMPLE_ANDROID, 1030e5c31af7Sopenharmony_ci pname:resolveImageView must: have been created with an external format 1031e5c31af7Sopenharmony_ci specified by slink:VkExternalFormatANDROID 1032e5c31af7Sopenharmony_ci * [[VUID-VkRenderingAttachmentInfo-resolveMode-09327]] 1033e5c31af7Sopenharmony_ci If pname:resolveMode is 1034e5c31af7Sopenharmony_ci ename:VK_RESOLVE_MODE_EXTERNAL_FORMAT_DOWNSAMPLE_ANDROID, 1035e5c31af7Sopenharmony_ci pname:resolveImageView must: have been created with a 1036e5c31af7Sopenharmony_ci pname:subresourceRange.layerCount of `1` 1037e5c31af7Sopenharmony_ci * [[VUID-VkRenderingAttachmentInfo-resolveMode-09328]] 1038e5c31af7Sopenharmony_ci If pname:resolveMode is 1039e5c31af7Sopenharmony_ci ename:VK_RESOLVE_MODE_EXTERNAL_FORMAT_DOWNSAMPLE_ANDROID and 1040e5c31af7Sopenharmony_ci <<limits-nullColorAttachmentWithExternalFormatResolve, 1041e5c31af7Sopenharmony_ci pname:nullColorAttachmentWithExternalFormatResolve>> is ename:VK_TRUE, 1042e5c31af7Sopenharmony_ci pname:imageView must: be dlink:VK_NULL_HANDLE 1043e5c31af7Sopenharmony_ci * [[VUID-VkRenderingAttachmentInfo-resolveMode-09329]] 1044e5c31af7Sopenharmony_ci If pname:resolveMode is 1045e5c31af7Sopenharmony_ci ename:VK_RESOLVE_MODE_EXTERNAL_FORMAT_DOWNSAMPLE_ANDROID and 1046e5c31af7Sopenharmony_ci <<limits-nullColorAttachmentWithExternalFormatResolve, 1047e5c31af7Sopenharmony_ci pname:nullColorAttachmentWithExternalFormatResolve>> is ename:VK_FALSE, 1048e5c31af7Sopenharmony_ci pname:imageView must: be a valid slink:VkImageView 1049e5c31af7Sopenharmony_ci * [[VUID-VkRenderingAttachmentInfo-resolveMode-09330]] 1050e5c31af7Sopenharmony_ci If pname:resolveMode is 1051e5c31af7Sopenharmony_ci ename:VK_RESOLVE_MODE_EXTERNAL_FORMAT_DOWNSAMPLE_ANDROID and 1052e5c31af7Sopenharmony_ci <<limits-nullColorAttachmentWithExternalFormatResolve, 1053e5c31af7Sopenharmony_ci pname:nullColorAttachmentWithExternalFormatResolve>> is ename:VK_FALSE, 1054e5c31af7Sopenharmony_ci pname:imageView must: have a format equal to the value of 1055e5c31af7Sopenharmony_ci slink:VkAndroidHardwareBufferFormatResolvePropertiesANDROID::pname:colorAttachmentFormat 1056e5c31af7Sopenharmony_ci as returned by a call to 1057e5c31af7Sopenharmony_ci flink:vkGetAndroidHardwareBufferPropertiesANDROID for the Android 1058e5c31af7Sopenharmony_ci hardware buffer that was used to create pname:resolveImageView 1059e5c31af7Sopenharmony_ciendif::VK_ANDROID_external_format_resolve[] 1060e5c31af7Sopenharmony_ci**** 1061e5c31af7Sopenharmony_ci 1062e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkRenderingAttachmentInfo.adoc[] 1063e5c31af7Sopenharmony_ci-- 1064e5c31af7Sopenharmony_ci 1065e5c31af7Sopenharmony_ciifdef::VK_KHR_fragment_shading_rate[] 1066e5c31af7Sopenharmony_ci[open,refpage='VkRenderingFragmentShadingRateAttachmentInfoKHR',desc='Structure specifying fragment shading rate attachment information',type='structs'] 1067e5c31af7Sopenharmony_ci-- 1068e5c31af7Sopenharmony_ciThe sname:VkRenderingFragmentShadingRateAttachmentInfoKHR structure is 1069e5c31af7Sopenharmony_cidefined as: 1070e5c31af7Sopenharmony_ci 1071e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkRenderingFragmentShadingRateAttachmentInfoKHR.adoc[] 1072e5c31af7Sopenharmony_ci 1073e5c31af7Sopenharmony_ci * pname:sType is a elink:VkStructureType value identifying this structure. 1074e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 1075e5c31af7Sopenharmony_ci structure. 1076e5c31af7Sopenharmony_ci * pname:imageView is the image view that will be used as a fragment 1077e5c31af7Sopenharmony_ci shading rate attachment. 1078e5c31af7Sopenharmony_ci * pname:imageLayout is the layout that pname:imageView will be in during 1079e5c31af7Sopenharmony_ci rendering. 1080e5c31af7Sopenharmony_ci * pname:shadingRateAttachmentTexelSize specifies the number of pixels 1081e5c31af7Sopenharmony_ci corresponding to each texel in pname:imageView. 1082e5c31af7Sopenharmony_ci 1083e5c31af7Sopenharmony_ciThis structure can be included in the pname:pNext chain of 1084e5c31af7Sopenharmony_cislink:VkRenderingInfo to define a 1085e5c31af7Sopenharmony_ci<<primsrast-fragment-shading-rate-attachment, fragment shading rate 1086e5c31af7Sopenharmony_ciattachment>>. 1087e5c31af7Sopenharmony_ciIf pname:imageView is dlink:VK_NULL_HANDLE, or if this structure is not 1088e5c31af7Sopenharmony_cispecified, the implementation behaves as if a valid shading rate attachment 1089e5c31af7Sopenharmony_ciwas specified with all texels specifying a single pixel per fragment. 1090e5c31af7Sopenharmony_ci 1091e5c31af7Sopenharmony_ci.Valid Usage 1092e5c31af7Sopenharmony_ci**** 1093e5c31af7Sopenharmony_ci * [[VUID-VkRenderingFragmentShadingRateAttachmentInfoKHR-imageView-06147]] 1094e5c31af7Sopenharmony_ci If pname:imageView is not dlink:VK_NULL_HANDLE, pname:layout must: be 1095e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_GENERAL or 1096e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_FRAGMENT_SHADING_RATE_ATTACHMENT_OPTIMAL_KHR 1097e5c31af7Sopenharmony_ci * [[VUID-VkRenderingFragmentShadingRateAttachmentInfoKHR-imageView-06148]] 1098e5c31af7Sopenharmony_ci If pname:imageView is not dlink:VK_NULL_HANDLE, it must: have been 1099e5c31af7Sopenharmony_ci created with 1100e5c31af7Sopenharmony_ci ename:VK_IMAGE_USAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR 1101e5c31af7Sopenharmony_ci * [[VUID-VkRenderingFragmentShadingRateAttachmentInfoKHR-imageView-06149]] 1102e5c31af7Sopenharmony_ci If pname:imageView is not dlink:VK_NULL_HANDLE, 1103e5c31af7Sopenharmony_ci pname:shadingRateAttachmentTexelSize.width must: be a power of two value 1104e5c31af7Sopenharmony_ci * [[VUID-VkRenderingFragmentShadingRateAttachmentInfoKHR-imageView-06150]] 1105e5c31af7Sopenharmony_ci If pname:imageView is not dlink:VK_NULL_HANDLE, 1106e5c31af7Sopenharmony_ci pname:shadingRateAttachmentTexelSize.width must: be less than or equal 1107e5c31af7Sopenharmony_ci to <<limits-maxFragmentShadingRateAttachmentTexelSize, 1108e5c31af7Sopenharmony_ci pname:maxFragmentShadingRateAttachmentTexelSize.width>> 1109e5c31af7Sopenharmony_ci * [[VUID-VkRenderingFragmentShadingRateAttachmentInfoKHR-imageView-06151]] 1110e5c31af7Sopenharmony_ci If pname:imageView is not dlink:VK_NULL_HANDLE, 1111e5c31af7Sopenharmony_ci pname:shadingRateAttachmentTexelSize.width must: be greater than or 1112e5c31af7Sopenharmony_ci equal to <<limits-minFragmentShadingRateAttachmentTexelSize, 1113e5c31af7Sopenharmony_ci pname:minFragmentShadingRateAttachmentTexelSize.width>> 1114e5c31af7Sopenharmony_ci * [[VUID-VkRenderingFragmentShadingRateAttachmentInfoKHR-imageView-06152]] 1115e5c31af7Sopenharmony_ci If pname:imageView is not dlink:VK_NULL_HANDLE, 1116e5c31af7Sopenharmony_ci pname:shadingRateAttachmentTexelSize.height must: be a power of two 1117e5c31af7Sopenharmony_ci value 1118e5c31af7Sopenharmony_ci * [[VUID-VkRenderingFragmentShadingRateAttachmentInfoKHR-imageView-06153]] 1119e5c31af7Sopenharmony_ci If pname:imageView is not dlink:VK_NULL_HANDLE, 1120e5c31af7Sopenharmony_ci pname:shadingRateAttachmentTexelSize.height must: be less than or equal 1121e5c31af7Sopenharmony_ci to <<limits-maxFragmentShadingRateAttachmentTexelSize, 1122e5c31af7Sopenharmony_ci pname:maxFragmentShadingRateAttachmentTexelSize.height>> 1123e5c31af7Sopenharmony_ci * [[VUID-VkRenderingFragmentShadingRateAttachmentInfoKHR-imageView-06154]] 1124e5c31af7Sopenharmony_ci If pname:imageView is not dlink:VK_NULL_HANDLE, 1125e5c31af7Sopenharmony_ci pname:shadingRateAttachmentTexelSize.height must: be greater than or 1126e5c31af7Sopenharmony_ci equal to <<limits-minFragmentShadingRateAttachmentTexelSize, 1127e5c31af7Sopenharmony_ci pname:minFragmentShadingRateAttachmentTexelSize.height>> 1128e5c31af7Sopenharmony_ci * [[VUID-VkRenderingFragmentShadingRateAttachmentInfoKHR-imageView-06155]] 1129e5c31af7Sopenharmony_ci If pname:imageView is not dlink:VK_NULL_HANDLE, the quotient of 1130e5c31af7Sopenharmony_ci pname:shadingRateAttachmentTexelSize.width and 1131e5c31af7Sopenharmony_ci pname:shadingRateAttachmentTexelSize.height must: be less than or equal 1132e5c31af7Sopenharmony_ci to <<limits-maxFragmentShadingRateAttachmentTexelSizeAspectRatio, 1133e5c31af7Sopenharmony_ci pname:maxFragmentShadingRateAttachmentTexelSizeAspectRatio>> 1134e5c31af7Sopenharmony_ci * [[VUID-VkRenderingFragmentShadingRateAttachmentInfoKHR-imageView-06156]] 1135e5c31af7Sopenharmony_ci If pname:imageView is not dlink:VK_NULL_HANDLE, the quotient of 1136e5c31af7Sopenharmony_ci pname:shadingRateAttachmentTexelSize.height and 1137e5c31af7Sopenharmony_ci pname:shadingRateAttachmentTexelSize.width must: be less than or equal 1138e5c31af7Sopenharmony_ci to <<limits-maxFragmentShadingRateAttachmentTexelSizeAspectRatio, 1139e5c31af7Sopenharmony_ci pname:maxFragmentShadingRateAttachmentTexelSizeAspectRatio>> 1140e5c31af7Sopenharmony_ci**** 1141e5c31af7Sopenharmony_ci 1142e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkRenderingFragmentShadingRateAttachmentInfoKHR.adoc[] 1143e5c31af7Sopenharmony_ci-- 1144e5c31af7Sopenharmony_ciendif::VK_KHR_fragment_shading_rate[] 1145e5c31af7Sopenharmony_ci 1146e5c31af7Sopenharmony_ciifdef::VK_EXT_fragment_density_map[] 1147e5c31af7Sopenharmony_ci[open,refpage='VkRenderingFragmentDensityMapAttachmentInfoEXT',desc='Structure specifying fragment shading rate attachment information',type='structs'] 1148e5c31af7Sopenharmony_ci-- 1149e5c31af7Sopenharmony_ciThe sname:VkRenderingFragmentDensityMapAttachmentInfoEXT structure is 1150e5c31af7Sopenharmony_cidefined as: 1151e5c31af7Sopenharmony_ci 1152e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkRenderingFragmentDensityMapAttachmentInfoEXT.adoc[] 1153e5c31af7Sopenharmony_ci 1154e5c31af7Sopenharmony_ci * pname:sType is a elink:VkStructureType value identifying this structure. 1155e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 1156e5c31af7Sopenharmony_ci structure. 1157e5c31af7Sopenharmony_ci * pname:imageView is the image view that will be used as a fragment 1158e5c31af7Sopenharmony_ci density map attachment. 1159e5c31af7Sopenharmony_ci * pname:imageLayout is the layout that pname:imageView will be in during 1160e5c31af7Sopenharmony_ci rendering. 1161e5c31af7Sopenharmony_ci 1162e5c31af7Sopenharmony_ciThis structure can be included in the pname:pNext chain of 1163e5c31af7Sopenharmony_cislink:VkRenderingInfo to define a fragment density map. 1164e5c31af7Sopenharmony_ciIf this structure is not included in the pname:pNext chain, pname:imageView 1165e5c31af7Sopenharmony_ciis treated as dlink:VK_NULL_HANDLE. 1166e5c31af7Sopenharmony_ci 1167e5c31af7Sopenharmony_ci.Valid Usage 1168e5c31af7Sopenharmony_ci**** 1169e5c31af7Sopenharmony_ci * [[VUID-VkRenderingFragmentDensityMapAttachmentInfoEXT-imageView-06157]] 1170e5c31af7Sopenharmony_ci If pname:imageView is not dlink:VK_NULL_HANDLE, pname:layout must: be 1171e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_GENERAL or 1172e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_FRAGMENT_DENSITY_MAP_OPTIMAL_EXT 1173e5c31af7Sopenharmony_ci * [[VUID-VkRenderingFragmentDensityMapAttachmentInfoEXT-imageView-06158]] 1174e5c31af7Sopenharmony_ci If pname:imageView is not dlink:VK_NULL_HANDLE, it must: have been 1175e5c31af7Sopenharmony_ci created with ename:VK_IMAGE_USAGE_FRAGMENT_DENSITY_MAP_BIT_EXT 1176e5c31af7Sopenharmony_ci * [[VUID-VkRenderingFragmentDensityMapAttachmentInfoEXT-imageView-06159]] 1177e5c31af7Sopenharmony_ci If pname:imageView is not dlink:VK_NULL_HANDLE, it must: not have been 1178e5c31af7Sopenharmony_ci created with ename:VK_IMAGE_CREATE_SUBSAMPLED_BIT_EXT 1179e5c31af7Sopenharmony_ci * [[VUID-VkRenderingFragmentDensityMapAttachmentInfoEXT-apiVersion-07908]] 1180e5c31af7Sopenharmony_ci If 1181e5c31af7Sopenharmony_ciifndef::VKSC_VERSION_1_0[] 1182e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_multiview[] 1183e5c31af7Sopenharmony_ci apiext:VK_KHR_multiview is not enabled, 1184e5c31af7Sopenharmony_ci slink:VkPhysicalDeviceProperties::pname:apiVersion is less than Vulkan 1185e5c31af7Sopenharmony_ci 1.1, and 1186e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_multiview[] 1187e5c31af7Sopenharmony_ciendif::VKSC_VERSION_1_0[] 1188e5c31af7Sopenharmony_ci pname:imageView is not dlink:VK_NULL_HANDLE, it must: have a 1189e5c31af7Sopenharmony_ci pname:layerCount equal to `1` 1190e5c31af7Sopenharmony_ci**** 1191e5c31af7Sopenharmony_ci 1192e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkRenderingFragmentDensityMapAttachmentInfoEXT.adoc[] 1193e5c31af7Sopenharmony_ci-- 1194e5c31af7Sopenharmony_ciendif::VK_EXT_fragment_density_map[] 1195e5c31af7Sopenharmony_ci 1196e5c31af7Sopenharmony_ciifdef::VK_KHR_maintenance5[] 1197e5c31af7Sopenharmony_ci[open,refpage='vkGetRenderingAreaGranularityKHR',desc='Returns the granularity for dynamic rendering optimal render area',type='protos'] 1198e5c31af7Sopenharmony_ci-- 1199e5c31af7Sopenharmony_ciTo query the render area granularity for a render pass instance, call: 1200e5c31af7Sopenharmony_ci 1201e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkGetRenderingAreaGranularityKHR.adoc[] 1202e5c31af7Sopenharmony_ci 1203e5c31af7Sopenharmony_ci * pname:device is the logical device that owns the render pass instance. 1204e5c31af7Sopenharmony_ci * pname:pRenderingAreaInfo is a pointer to a slink:VkRenderingAreaInfoKHR 1205e5c31af7Sopenharmony_ci structure specifying details of the render pass instance to query the 1206e5c31af7Sopenharmony_ci render area granularity for. 1207e5c31af7Sopenharmony_ci * pname:pGranularity is a pointer to a slink:VkExtent2D structure in which 1208e5c31af7Sopenharmony_ci the granularity is returned. 1209e5c31af7Sopenharmony_ci 1210e5c31af7Sopenharmony_ciThe conditions leading to an optimal pname:renderArea are: 1211e5c31af7Sopenharmony_ci 1212e5c31af7Sopenharmony_ci * the pname:offset.x member in pname:renderArea is a multiple of the 1213e5c31af7Sopenharmony_ci pname:width member of the returned slink:VkExtent2D (the horizontal 1214e5c31af7Sopenharmony_ci granularity). 1215e5c31af7Sopenharmony_ci * the pname:offset.y member in pname:renderArea is a multiple of the 1216e5c31af7Sopenharmony_ci pname:height member of the returned slink:VkExtent2D (the vertical 1217e5c31af7Sopenharmony_ci granularity). 1218e5c31af7Sopenharmony_ci * either the pname:extent.width member in pname:renderArea is a multiple 1219e5c31af7Sopenharmony_ci of the horizontal granularity or pname:offset.x+pname:extent.width is 1220e5c31af7Sopenharmony_ci equal to the pname:width of the pname:framebuffer in the 1221e5c31af7Sopenharmony_ci slink:VkRenderPassBeginInfo. 1222e5c31af7Sopenharmony_ci * either the pname:extent.height member in pname:renderArea is a multiple 1223e5c31af7Sopenharmony_ci of the vertical granularity or pname:offset.y+pname:extent.height is 1224e5c31af7Sopenharmony_ci equal to the pname:height of the pname:framebuffer in the 1225e5c31af7Sopenharmony_ci slink:VkRenderPassBeginInfo. 1226e5c31af7Sopenharmony_ci 1227e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkGetRenderingAreaGranularityKHR.adoc[] 1228e5c31af7Sopenharmony_ci-- 1229e5c31af7Sopenharmony_ci 1230e5c31af7Sopenharmony_ci[open,refpage='VkRenderingAreaInfoKHR',desc='Structure describing rendering area granularity query info',type='structs'] 1231e5c31af7Sopenharmony_ci-- 1232e5c31af7Sopenharmony_ciThe sname:VkRenderingAreaInfoKHR structure is defined as: 1233e5c31af7Sopenharmony_ci 1234e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkRenderingAreaInfoKHR.adoc[] 1235e5c31af7Sopenharmony_ci 1236e5c31af7Sopenharmony_ci * pname:sType is a elink:VkStructureType value identifying this structure. 1237e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 1238e5c31af7Sopenharmony_ci structure. 1239e5c31af7Sopenharmony_ci * pname:viewMask is the viewMask used for rendering. 1240e5c31af7Sopenharmony_ci * pname:colorAttachmentCount is the number of entries in 1241e5c31af7Sopenharmony_ci pname:pColorAttachmentFormats 1242e5c31af7Sopenharmony_ci * pname:pColorAttachmentFormats is a pointer to an array of elink:VkFormat 1243e5c31af7Sopenharmony_ci values defining the format of color attachments used in the render pass 1244e5c31af7Sopenharmony_ci instance. 1245e5c31af7Sopenharmony_ci * pname:depthAttachmentFormat is a elink:VkFormat value defining the 1246e5c31af7Sopenharmony_ci format of the depth attachment used in the render pass instance. 1247e5c31af7Sopenharmony_ci * pname:stencilAttachmentFormat is a elink:VkFormat value defining the 1248e5c31af7Sopenharmony_ci format of the stencil attachment used in the render pass instance. 1249e5c31af7Sopenharmony_ci 1250e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkRenderingAreaInfoKHR.adoc[] 1251e5c31af7Sopenharmony_ci-- 1252e5c31af7Sopenharmony_ciendif::VK_KHR_maintenance5[] 1253e5c31af7Sopenharmony_ci 1254e5c31af7Sopenharmony_ciifdef::VK_ARM_render_pass_striped[] 1255e5c31af7Sopenharmony_ci[open,refpage='VkRenderPassStripeBeginInfoARM',desc='Structure specifying striped rendering information',type='structs'] 1256e5c31af7Sopenharmony_ci-- 1257e5c31af7Sopenharmony_ciThe sname:VkRenderPassStripeBeginInfoARM structure is defined as: 1258e5c31af7Sopenharmony_ci 1259e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkRenderPassStripeBeginInfoARM.adoc[] 1260e5c31af7Sopenharmony_ci 1261e5c31af7Sopenharmony_ci * pname:sType is a elink:VkStructureType value identifying this structure. 1262e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 1263e5c31af7Sopenharmony_ci structure. 1264e5c31af7Sopenharmony_ci * pname:stripeInfoCount is the number of stripes in this render pass 1265e5c31af7Sopenharmony_ci instance 1266e5c31af7Sopenharmony_ci * pname:pStripeInfos is a pointer to an array of pname:stripeInfoCount 1267e5c31af7Sopenharmony_ci slink:VkRenderPassStripeInfoARM structures describing the stripes used 1268e5c31af7Sopenharmony_ci by the render pass instance. 1269e5c31af7Sopenharmony_ci 1270e5c31af7Sopenharmony_ciThis structure can be included in the pname:pNext chain of 1271e5c31af7Sopenharmony_cislink:VkRenderPassBeginInfo 1272e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_3,VK_KHR_dynamic_rendering[] 1273e5c31af7Sopenharmony_cior slink:VkRenderingInfo 1274e5c31af7Sopenharmony_ciendif::VK_VERSION_1_3,VK_KHR_dynamic_rendering[] 1275e5c31af7Sopenharmony_cito define how the render pass instance is split into stripes. 1276e5c31af7Sopenharmony_ci 1277e5c31af7Sopenharmony_ci.Valid Usage 1278e5c31af7Sopenharmony_ci**** 1279e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassStripeBeginInfoARM-stripeInfoCount-09450]] 1280e5c31af7Sopenharmony_ci pname:stripeInfoCount must: be less than or equal to 1281e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceRenderPassStripedPropertiesARM::pname:maxRenderPassStripes 1282e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassStripeBeginInfoARM-stripeArea-09451]] 1283e5c31af7Sopenharmony_ci The pname:stripeArea defined by each element of pname:pStripeInfos must: 1284e5c31af7Sopenharmony_ci not overlap the pname:stripeArea of any other element 1285e5c31af7Sopenharmony_ci**** 1286e5c31af7Sopenharmony_ci 1287e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkRenderPassStripeBeginInfoARM.adoc[] 1288e5c31af7Sopenharmony_ci-- 1289e5c31af7Sopenharmony_ci 1290e5c31af7Sopenharmony_ci[open,refpage='VkRenderPassStripeInfoARM',desc='Structure specifying per rendering stripe information',type='structs'] 1291e5c31af7Sopenharmony_ci-- 1292e5c31af7Sopenharmony_ciThe sname:VkRenderPassStripeInfoARM structure is defined as: 1293e5c31af7Sopenharmony_ci 1294e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkRenderPassStripeInfoARM.adoc[] 1295e5c31af7Sopenharmony_ci 1296e5c31af7Sopenharmony_ci * pname:sType is a elink:VkStructureType value identifying this structure. 1297e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 1298e5c31af7Sopenharmony_ci structure. 1299e5c31af7Sopenharmony_ci * pname:stripeArea is the stripe area, and is described in more detail 1300e5c31af7Sopenharmony_ci below. 1301e5c31af7Sopenharmony_ci 1302e5c31af7Sopenharmony_cipname:stripeArea is the render area that is affected by this stripe of the 1303e5c31af7Sopenharmony_cirender pass instance. 1304e5c31af7Sopenharmony_ciIt must: be a subregion of the pname:renderArea of the render pass instance. 1305e5c31af7Sopenharmony_ci 1306e5c31af7Sopenharmony_ci.Valid Usage 1307e5c31af7Sopenharmony_ci**** 1308e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassStripeInfoARM-stripeArea-09452]] 1309e5c31af7Sopenharmony_ci pname:stripeArea.offset.x must: be a multiple of 1310e5c31af7Sopenharmony_ci slink:VkPhysicalDeviceRenderPassStripedPropertiesARM::pname:renderPassStripeGranularity.width 1311e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassStripeInfoARM-stripeArea-09453]] 1312e5c31af7Sopenharmony_ci pname:stripeArea.extent.width must: be a multiple of 1313e5c31af7Sopenharmony_ci slink:VkPhysicalDeviceRenderPassStripedPropertiesARM::pname:renderPassStripeGranularity.width, 1314e5c31af7Sopenharmony_ci or the sum of pname:stripeArea.offset.x and 1315e5c31af7Sopenharmony_ci pname:stripeArea.extent.width must: be equal to the 1316e5c31af7Sopenharmony_ci pname:renderArea.extent.width of the render pass instance 1317e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassStripeInfoARM-stripeArea-09454]] 1318e5c31af7Sopenharmony_ci pname:stripeArea.offset.y must: be a multiple of 1319e5c31af7Sopenharmony_ci slink:VkPhysicalDeviceRenderPassStripedPropertiesARM::pname:renderPassStripeGranularity.height 1320e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassStripeInfoARM-stripeArea-09455]] 1321e5c31af7Sopenharmony_ci pname:stripeArea.extent.height must: be a multiple of 1322e5c31af7Sopenharmony_ci slink:VkPhysicalDeviceRenderPassStripedPropertiesARM::pname:renderPassStripeGranularity.height, 1323e5c31af7Sopenharmony_ci or the sum of pname:stripeArea.offset.y and 1324e5c31af7Sopenharmony_ci pname:stripeArea.extent.height must: be equal to the 1325e5c31af7Sopenharmony_ci pname:renderArea.extent.height of the render pass instance 1326e5c31af7Sopenharmony_ci**** 1327e5c31af7Sopenharmony_ci 1328e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkRenderPassStripeInfoARM.adoc[] 1329e5c31af7Sopenharmony_ci-- 1330e5c31af7Sopenharmony_ciendif::VK_ARM_render_pass_striped[] 1331e5c31af7Sopenharmony_ci 1332e5c31af7Sopenharmony_ci[open,refpage='vkCmdEndRendering',desc='End a dynamic render pass instance',type='protos',alias='vkCmdEndRenderingKHR'] 1333e5c31af7Sopenharmony_ci-- 1334e5c31af7Sopenharmony_ciTo end a render pass instance, call: 1335e5c31af7Sopenharmony_ci 1336e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_3[] 1337e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCmdEndRendering.adoc[] 1338e5c31af7Sopenharmony_ciendif::VK_VERSION_1_3[] 1339e5c31af7Sopenharmony_ci 1340e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_3+VK_KHR_dynamic_rendering[or the equivalent command] 1341e5c31af7Sopenharmony_ci 1342e5c31af7Sopenharmony_ciifdef::VK_KHR_dynamic_rendering[] 1343e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCmdEndRenderingKHR.adoc[] 1344e5c31af7Sopenharmony_ciendif::VK_KHR_dynamic_rendering[] 1345e5c31af7Sopenharmony_ci 1346e5c31af7Sopenharmony_ci * pname:commandBuffer is the command buffer in which to record the 1347e5c31af7Sopenharmony_ci command. 1348e5c31af7Sopenharmony_ci 1349e5c31af7Sopenharmony_ciIf the value of pname:pRenderingInfo->flags used to begin this render pass 1350e5c31af7Sopenharmony_ciinstance included ename:VK_RENDERING_SUSPENDING_BIT, then this render pass 1351e5c31af7Sopenharmony_ciis suspended and will be resumed later in 1352e5c31af7Sopenharmony_ci<<synchronization-submission-order, submission order>>. 1353e5c31af7Sopenharmony_ci 1354e5c31af7Sopenharmony_ci.Valid Usage 1355e5c31af7Sopenharmony_ci**** 1356e5c31af7Sopenharmony_ci * [[VUID-vkCmdEndRendering-None-06161]] 1357e5c31af7Sopenharmony_ci The current render pass instance must: have been begun with 1358e5c31af7Sopenharmony_ci flink:vkCmdBeginRendering 1359e5c31af7Sopenharmony_ci * [[VUID-vkCmdEndRendering-commandBuffer-06162]] 1360e5c31af7Sopenharmony_ci The current render pass instance must: have been begun in 1361e5c31af7Sopenharmony_ci pname:commandBuffer 1362e5c31af7Sopenharmony_ciifdef::VK_EXT_transform_feedback[] 1363e5c31af7Sopenharmony_ci * [[VUID-vkCmdEndRendering-None-06781]] 1364e5c31af7Sopenharmony_ci This command must: not be recorded when transform feedback is active 1365e5c31af7Sopenharmony_ciendif::VK_EXT_transform_feedback[] 1366e5c31af7Sopenharmony_ci * [[VUID-vkCmdEndRendering-None-06999]] 1367e5c31af7Sopenharmony_ci If fname:vkCmdBeginQuery* was called within the render pass, the 1368e5c31af7Sopenharmony_ci corresponding fname:vkCmdEndQuery* must: have been called subsequently 1369e5c31af7Sopenharmony_ci within the same subpass 1370e5c31af7Sopenharmony_ci**** 1371e5c31af7Sopenharmony_ci 1372e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCmdEndRendering.adoc[] 1373e5c31af7Sopenharmony_ci-- 1374e5c31af7Sopenharmony_ci 1375e5c31af7Sopenharmony_ci[NOTE] 1376e5c31af7Sopenharmony_ci.Note 1377e5c31af7Sopenharmony_ci==== 1378e5c31af7Sopenharmony_ciFor more complex rendering graphs, it is possible to pre-define a static 1379e5c31af7Sopenharmony_ci_render pass_ object, which as well as allowing draw commands, allows the 1380e5c31af7Sopenharmony_cidefinition of framebuffer-local dependencies between multiple subpasses. 1381e5c31af7Sopenharmony_ciThese objects have a lot of setup cost compared to 1382e5c31af7Sopenharmony_ciflink:vkCmdBeginRendering, but use of subpass dependencies can confer 1383e5c31af7Sopenharmony_ciimportant performance benefits on some devices. 1384e5c31af7Sopenharmony_ci==== 1385e5c31af7Sopenharmony_ci 1386e5c31af7Sopenharmony_ciifdef::VK_QCOM_tile_properties[] 1387e5c31af7Sopenharmony_ci[open,refpage='VkTilePropertiesQCOM',desc='Structure holding available tile properties',type='structs'] 1388e5c31af7Sopenharmony_ci-- 1389e5c31af7Sopenharmony_ciThe sname:VkTilePropertiesQCOM structure is defined as: 1390e5c31af7Sopenharmony_ci 1391e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkTilePropertiesQCOM.adoc[] 1392e5c31af7Sopenharmony_ci 1393e5c31af7Sopenharmony_ci * pname:sType is a elink:VkStructureType value identifying this structure. 1394e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 1395e5c31af7Sopenharmony_ci structure. 1396e5c31af7Sopenharmony_ci * pname:tileSize is the dimensions of a tile, with width and height 1397e5c31af7Sopenharmony_ci describing the width and height of a tile in pixels, and depth 1398e5c31af7Sopenharmony_ci corresponding to the number of slices the tile spans. 1399e5c31af7Sopenharmony_ci * pname:apronSize is the dimension of the apron. 1400e5c31af7Sopenharmony_ci * pname:origin is the top-left corner of the first tile in attachment 1401e5c31af7Sopenharmony_ci space. 1402e5c31af7Sopenharmony_ci 1403e5c31af7Sopenharmony_ciAll tiles will be tightly packed around the first tile, with edges being 1404e5c31af7Sopenharmony_cimultiples of tile width and/or height from the origin. 1405e5c31af7Sopenharmony_ci 1406e5c31af7Sopenharmony_ci[NOTE] 1407e5c31af7Sopenharmony_ci.Note 1408e5c31af7Sopenharmony_ci==== 1409e5c31af7Sopenharmony_ciReported value for pname:apronSize will be zero and its functionality will 1410e5c31af7Sopenharmony_cibe described in a future extension. 1411e5c31af7Sopenharmony_ci==== 1412e5c31af7Sopenharmony_ci 1413e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkTilePropertiesQCOM.adoc[] 1414e5c31af7Sopenharmony_ci-- 1415e5c31af7Sopenharmony_ci 1416e5c31af7Sopenharmony_ci[open,refpage='vkGetDynamicRenderingTilePropertiesQCOM',desc='Get the properties when using dynamic rendering',type='protos'] 1417e5c31af7Sopenharmony_ci-- 1418e5c31af7Sopenharmony_ciTo query the tile properties when using dynamic rendering, call: 1419e5c31af7Sopenharmony_ci 1420e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkGetDynamicRenderingTilePropertiesQCOM.adoc[] 1421e5c31af7Sopenharmony_ci 1422e5c31af7Sopenharmony_ci * pname:device is a logical device associated with the render pass. 1423e5c31af7Sopenharmony_ci * pname:pRenderingInfo is a pointer to the slink:VkRenderingInfo structure 1424e5c31af7Sopenharmony_ci specifying details of the render pass instance in dynamic rendering. 1425e5c31af7Sopenharmony_ci * pname:pProperties is a pointer to a slink:VkTilePropertiesQCOM structure 1426e5c31af7Sopenharmony_ci in which the properties are returned. 1427e5c31af7Sopenharmony_ci 1428e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkGetDynamicRenderingTilePropertiesQCOM.adoc[] 1429e5c31af7Sopenharmony_ci-- 1430e5c31af7Sopenharmony_ciendif::VK_QCOM_tile_properties[] 1431e5c31af7Sopenharmony_ci 1432e5c31af7Sopenharmony_ci 1433e5c31af7Sopenharmony_ci== Render Pass Objects 1434e5c31af7Sopenharmony_ci 1435e5c31af7Sopenharmony_ciendif::VK_VERSION_1_3,VK_KHR_dynamic_rendering[] 1436e5c31af7Sopenharmony_ci 1437e5c31af7Sopenharmony_ci[open,refpage='VkRenderPass',desc='Opaque handle to a render pass object',type='handles'] 1438e5c31af7Sopenharmony_ci-- 1439e5c31af7Sopenharmony_ciA render pass object represents a collection of attachments, subpasses, and 1440e5c31af7Sopenharmony_cidependencies between the subpasses, and describes how the attachments are 1441e5c31af7Sopenharmony_ciused over the course of the subpasses. 1442e5c31af7Sopenharmony_ci 1443e5c31af7Sopenharmony_ciRender passes are represented by sname:VkRenderPass handles: 1444e5c31af7Sopenharmony_ci 1445e5c31af7Sopenharmony_ciinclude::{generated}/api/handles/VkRenderPass.adoc[] 1446e5c31af7Sopenharmony_ci-- 1447e5c31af7Sopenharmony_ci 1448e5c31af7Sopenharmony_ciAn _attachment description_ describes the properties of an attachment 1449e5c31af7Sopenharmony_ciincluding its format, sample count, and how its contents are treated at the 1450e5c31af7Sopenharmony_cibeginning and end of each render pass instance. 1451e5c31af7Sopenharmony_ci 1452e5c31af7Sopenharmony_ci[[renderpass-subpass]] 1453e5c31af7Sopenharmony_ciA _subpass_ represents a phase of rendering that reads and writes a subset 1454e5c31af7Sopenharmony_ciof the attachments in a render pass. 1455e5c31af7Sopenharmony_ciRendering commands are recorded into a particular subpass of a render pass 1456e5c31af7Sopenharmony_ciinstance. 1457e5c31af7Sopenharmony_ci 1458e5c31af7Sopenharmony_ciA _subpass description_ describes the subset of attachments that is involved 1459e5c31af7Sopenharmony_ciin the execution of a subpass. 1460e5c31af7Sopenharmony_ciEach subpass can: read from some attachments as _input attachments_, write 1461e5c31af7Sopenharmony_cito some as _color attachments_ or _depth/stencil attachments_, 1462e5c31af7Sopenharmony_ciifdef::VK_QCOM_render_pass_shader_resolve[] 1463e5c31af7Sopenharmony_ciperform _shader resolve operations_ to _color_attachments_ or 1464e5c31af7Sopenharmony_ci_depth/stencil_attachments_, 1465e5c31af7Sopenharmony_ciendif::VK_QCOM_render_pass_shader_resolve[] 1466e5c31af7Sopenharmony_ciand perform _multisample resolve operations_ to _resolve attachments_. 1467e5c31af7Sopenharmony_ciA subpass description can: also include a set of _preserve attachments_, 1468e5c31af7Sopenharmony_ciwhich are attachments that are not read or written by the subpass but whose 1469e5c31af7Sopenharmony_cicontents must: be preserved throughout the subpass. 1470e5c31af7Sopenharmony_ci 1471e5c31af7Sopenharmony_ciA subpass _uses an attachment_ if the attachment is a color, depth/stencil, 1472e5c31af7Sopenharmony_ciresolve, 1473e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_KHR_depth_stencil_resolve[] 1474e5c31af7Sopenharmony_cidepth/stencil resolve, 1475e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_KHR_depth_stencil_resolve[] 1476e5c31af7Sopenharmony_ciifdef::VK_KHR_fragment_shading_rate[] 1477e5c31af7Sopenharmony_cifragment shading rate, 1478e5c31af7Sopenharmony_ciendif::VK_KHR_fragment_shading_rate[] 1479e5c31af7Sopenharmony_cior input attachment for that subpass (as determined by the 1480e5c31af7Sopenharmony_cipname:pColorAttachments, pname:pDepthStencilAttachment, 1481e5c31af7Sopenharmony_cipname:pResolveAttachments, 1482e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_KHR_depth_stencil_resolve[] 1483e5c31af7Sopenharmony_cislink:VkSubpassDescriptionDepthStencilResolve::pname:pDepthStencilResolveAttachment, 1484e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_KHR_depth_stencil_resolve[] 1485e5c31af7Sopenharmony_ciifdef::VK_KHR_fragment_shading_rate[] 1486e5c31af7Sopenharmony_cislink:VkFragmentShadingRateAttachmentInfoKHR::pname:pFragmentShadingRateAttachment->attachment, 1487e5c31af7Sopenharmony_ciendif::VK_KHR_fragment_shading_rate[] 1488e5c31af7Sopenharmony_ciand pname:pInputAttachments members of slink:VkSubpassDescription, 1489e5c31af7Sopenharmony_cirespectively). 1490e5c31af7Sopenharmony_ciA subpass does not use an attachment if that attachment is preserved by the 1491e5c31af7Sopenharmony_cisubpass. 1492e5c31af7Sopenharmony_ciThe _first use of an attachment_ is in the lowest numbered subpass that uses 1493e5c31af7Sopenharmony_cithat attachment. 1494e5c31af7Sopenharmony_ciSimilarly, the _last use of an attachment_ is in the highest numbered 1495e5c31af7Sopenharmony_cisubpass that uses that attachment. 1496e5c31af7Sopenharmony_ci 1497e5c31af7Sopenharmony_ciThe subpasses in a render pass all render to the same dimensions, and 1498e5c31af7Sopenharmony_cifragments for pixel (x,y,layer) in one subpass can: only read attachment 1499e5c31af7Sopenharmony_cicontents written by previous subpasses at that same (x,y,layer) location. 1500e5c31af7Sopenharmony_ciifdef::VK_KHR_fragment_shading_rate,VK_NV_shading_rate,VK_EXT_fragment_density_map[] 1501e5c31af7Sopenharmony_ciFor multi-pixel fragments, the pixel read from an input attachment is 1502e5c31af7Sopenharmony_ciselected from the pixels covered by that fragment in an 1503e5c31af7Sopenharmony_ciimplementation-dependent manner. 1504e5c31af7Sopenharmony_ciHowever, this selection must: be made consistently for any fragment with the 1505e5c31af7Sopenharmony_cisame shading rate for the lifetime of the slink:VkDevice. 1506e5c31af7Sopenharmony_ciendif::VK_KHR_fragment_shading_rate,VK_NV_shading_rate,VK_EXT_fragment_density_map[] 1507e5c31af7Sopenharmony_ci 1508e5c31af7Sopenharmony_ci[NOTE] 1509e5c31af7Sopenharmony_ci.Note 1510e5c31af7Sopenharmony_ci==== 1511e5c31af7Sopenharmony_ciBy describing a complete set of subpasses in advance, render passes provide 1512e5c31af7Sopenharmony_cithe implementation an opportunity to optimize the storage and transfer of 1513e5c31af7Sopenharmony_ciattachment data between subpasses. 1514e5c31af7Sopenharmony_ci 1515e5c31af7Sopenharmony_ciIn practice, this means that subpasses with a simple framebuffer-space 1516e5c31af7Sopenharmony_cidependency may: be merged into a single tiled rendering pass, keeping the 1517e5c31af7Sopenharmony_ciattachment data on-chip for the duration of a render pass instance. 1518e5c31af7Sopenharmony_ciHowever, it is also quite common for a render pass to only contain a single 1519e5c31af7Sopenharmony_cisubpass. 1520e5c31af7Sopenharmony_ci==== 1521e5c31af7Sopenharmony_ci 1522e5c31af7Sopenharmony_ci_Subpass dependencies_ describe <<synchronization-dependencies, execution 1523e5c31af7Sopenharmony_ciand memory dependencies>> between subpasses. 1524e5c31af7Sopenharmony_ci 1525e5c31af7Sopenharmony_ciA _subpass dependency chain_ is a sequence of subpass dependencies in a 1526e5c31af7Sopenharmony_cirender pass, where the source subpass of each subpass dependency (after the 1527e5c31af7Sopenharmony_cifirst) equals the destination subpass of the previous dependency. 1528e5c31af7Sopenharmony_ci 1529e5c31af7Sopenharmony_ciExecution of subpasses may: overlap or execute out of order with regards to 1530e5c31af7Sopenharmony_ciother subpasses, unless otherwise enforced by an execution dependency. 1531e5c31af7Sopenharmony_ciEach subpass only respects <<synchronization-submission-order, submission 1532e5c31af7Sopenharmony_ciorder>> for commands recorded in the same subpass, and the 1533e5c31af7Sopenharmony_ciflink:vkCmdBeginRenderPass and flink:vkCmdEndRenderPass commands that 1534e5c31af7Sopenharmony_cidelimit the render pass - commands within other subpasses are not included. 1535e5c31af7Sopenharmony_ciThis affects most other <<synchronization-implicit, implicit ordering 1536e5c31af7Sopenharmony_ciguarantees>>. 1537e5c31af7Sopenharmony_ci 1538e5c31af7Sopenharmony_ciA render pass describes the structure of subpasses and attachments 1539e5c31af7Sopenharmony_ciindependent of any specific image views for the attachments. 1540e5c31af7Sopenharmony_ciThe specific image views that will be used for the attachments, and their 1541e5c31af7Sopenharmony_cidimensions, are specified in sname:VkFramebuffer objects. 1542e5c31af7Sopenharmony_ciFramebuffers are created with respect to a specific render pass that the 1543e5c31af7Sopenharmony_ciframebuffer is compatible with (see <<renderpass-compatibility,Render Pass 1544e5c31af7Sopenharmony_ciCompatibility>>). 1545e5c31af7Sopenharmony_ciCollectively, a render pass and a framebuffer define the complete render 1546e5c31af7Sopenharmony_citarget state for one or more subpasses as well as the algorithmic 1547e5c31af7Sopenharmony_cidependencies between the subpasses. 1548e5c31af7Sopenharmony_ci 1549e5c31af7Sopenharmony_ciThe various pipeline stages of the drawing commands for a given subpass may: 1550e5c31af7Sopenharmony_ciexecute concurrently and/or out of order, both within and across drawing 1551e5c31af7Sopenharmony_cicommands, whilst still respecting <<synchronization-pipeline-stages-order, 1552e5c31af7Sopenharmony_cipipeline order>>. 1553e5c31af7Sopenharmony_ciHowever for a given (x,y,layer,sample) sample location, certain per-sample 1554e5c31af7Sopenharmony_cioperations are performed in <<primsrast-order,rasterization order>>. 1555e5c31af7Sopenharmony_ci 1556e5c31af7Sopenharmony_ci[open,refpage='VK_ATTACHMENT_UNUSED',desc='Unused attachment sentinel',type='consts'] 1557e5c31af7Sopenharmony_ci-- 1558e5c31af7Sopenharmony_ciename:VK_ATTACHMENT_UNUSED is a constant indicating that a render pass 1559e5c31af7Sopenharmony_ciattachment is not used. 1560e5c31af7Sopenharmony_ci 1561e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VK_ATTACHMENT_UNUSED.adoc[] 1562e5c31af7Sopenharmony_ci-- 1563e5c31af7Sopenharmony_ci 1564e5c31af7Sopenharmony_ci 1565e5c31af7Sopenharmony_ci[[renderpass-creation]] 1566e5c31af7Sopenharmony_ci== Render Pass Creation 1567e5c31af7Sopenharmony_ci 1568e5c31af7Sopenharmony_ci[open,refpage='vkCreateRenderPass',desc='Create a new render pass object',type='protos'] 1569e5c31af7Sopenharmony_ci-- 1570e5c31af7Sopenharmony_ci:refpage: vkCreateRenderPass 1571e5c31af7Sopenharmony_ci:objectnameplural: render passes 1572e5c31af7Sopenharmony_ci:objectnamecamelcase: renderPass 1573e5c31af7Sopenharmony_ci:objectcount: 1 1574e5c31af7Sopenharmony_ci 1575e5c31af7Sopenharmony_ciTo create a render pass, call: 1576e5c31af7Sopenharmony_ci 1577e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCreateRenderPass.adoc[] 1578e5c31af7Sopenharmony_ci 1579e5c31af7Sopenharmony_ci * pname:device is the logical device that creates the render pass. 1580e5c31af7Sopenharmony_ci * pname:pCreateInfo is a pointer to a slink:VkRenderPassCreateInfo 1581e5c31af7Sopenharmony_ci structure describing the parameters of the render pass. 1582e5c31af7Sopenharmony_ci * pname:pAllocator controls host memory allocation as described in the 1583e5c31af7Sopenharmony_ci <<memory-allocation, Memory Allocation>> chapter. 1584e5c31af7Sopenharmony_ci * pname:pRenderPass is a pointer to a slink:VkRenderPass handle in which 1585e5c31af7Sopenharmony_ci the resulting render pass object is returned. 1586e5c31af7Sopenharmony_ci 1587e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/no_dynamic_allocations_common.adoc[] 1588e5c31af7Sopenharmony_ci 1589e5c31af7Sopenharmony_ciifdef::VKSC_VERSION_1_0[] 1590e5c31af7Sopenharmony_ci.Valid Usage 1591e5c31af7Sopenharmony_ci**** 1592e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/memory_reservation_request_count_common.adoc[] 1593e5c31af7Sopenharmony_ci 1594e5c31af7Sopenharmony_ci:uniqifier: subpasses 1595e5c31af7Sopenharmony_ci:combinedobjectnameplural: subpasses 1596e5c31af7Sopenharmony_ci:combinedparentobject: VkRenderPass 1597e5c31af7Sopenharmony_ci:combinedobjectcount: pname:pCreateInfo->subpassCount 1598e5c31af7Sopenharmony_ci:combinedobjectnamecamelcase: subpassDescription 1599e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/memory_reservation_request_count_combined_common.adoc[] 1600e5c31af7Sopenharmony_ci 1601e5c31af7Sopenharmony_ci:uniqifier: attachments 1602e5c31af7Sopenharmony_ci:combinedobjectnameplural: attachments 1603e5c31af7Sopenharmony_ci:combinedparentobject: VkRenderPass 1604e5c31af7Sopenharmony_ci:combinedobjectcount: pname:pCreateInfo->attachmentCount 1605e5c31af7Sopenharmony_ci:combinedobjectnamecamelcase: attachmentDescription 1606e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/memory_reservation_request_count_combined_common.adoc[] 1607e5c31af7Sopenharmony_ci**** 1608e5c31af7Sopenharmony_ciendif::VKSC_VERSION_1_0[] 1609e5c31af7Sopenharmony_ci 1610e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCreateRenderPass.adoc[] 1611e5c31af7Sopenharmony_ci-- 1612e5c31af7Sopenharmony_ci 1613e5c31af7Sopenharmony_ci[open,refpage='VkRenderPassCreateInfo',desc='Structure specifying parameters of a newly created render pass',type='structs'] 1614e5c31af7Sopenharmony_ci-- 1615e5c31af7Sopenharmony_ciThe sname:VkRenderPassCreateInfo structure is defined as: 1616e5c31af7Sopenharmony_ci 1617e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkRenderPassCreateInfo.adoc[] 1618e5c31af7Sopenharmony_ci 1619e5c31af7Sopenharmony_ci * pname:sType is a elink:VkStructureType value identifying this structure. 1620e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 1621e5c31af7Sopenharmony_ci structure. 1622e5c31af7Sopenharmony_ciifndef::VK_QCOM_render_pass_transform[] 1623e5c31af7Sopenharmony_ci * pname:flags is reserved for future use. 1624e5c31af7Sopenharmony_ciendif::VK_QCOM_render_pass_transform[] 1625e5c31af7Sopenharmony_ciifdef::VK_QCOM_render_pass_transform[] 1626e5c31af7Sopenharmony_ci * pname:flags is a bitmask of elink:VkRenderPassCreateFlagBits 1627e5c31af7Sopenharmony_ciendif::VK_QCOM_render_pass_transform[] 1628e5c31af7Sopenharmony_ci * pname:attachmentCount is the number of attachments used by this render 1629e5c31af7Sopenharmony_ci pass. 1630e5c31af7Sopenharmony_ci * pname:pAttachments is a pointer to an array of pname:attachmentCount 1631e5c31af7Sopenharmony_ci slink:VkAttachmentDescription structures describing the attachments used 1632e5c31af7Sopenharmony_ci by the render pass. 1633e5c31af7Sopenharmony_ci * pname:subpassCount is the number of subpasses to create. 1634e5c31af7Sopenharmony_ci * pname:pSubpasses is a pointer to an array of pname:subpassCount 1635e5c31af7Sopenharmony_ci slink:VkSubpassDescription structures describing each subpass. 1636e5c31af7Sopenharmony_ci * pname:dependencyCount is the number of memory dependencies between pairs 1637e5c31af7Sopenharmony_ci of subpasses. 1638e5c31af7Sopenharmony_ci * pname:pDependencies is a pointer to an array of pname:dependencyCount 1639e5c31af7Sopenharmony_ci slink:VkSubpassDependency structures describing dependencies between 1640e5c31af7Sopenharmony_ci pairs of subpasses. 1641e5c31af7Sopenharmony_ci 1642e5c31af7Sopenharmony_ci[NOTE] 1643e5c31af7Sopenharmony_ci.Note 1644e5c31af7Sopenharmony_ci==== 1645e5c31af7Sopenharmony_ciCare should be taken to avoid a data race here; if any subpasses access 1646e5c31af7Sopenharmony_ciattachments with overlapping memory locations, and one of those accesses is 1647e5c31af7Sopenharmony_cia write, a subpass dependency needs to be included between them. 1648e5c31af7Sopenharmony_ci==== 1649e5c31af7Sopenharmony_ci 1650e5c31af7Sopenharmony_ci.Valid Usage 1651e5c31af7Sopenharmony_ci**** 1652e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassCreateInfo-attachment-00834]] 1653e5c31af7Sopenharmony_ci If the pname:attachment member of any element of 1654e5c31af7Sopenharmony_ci pname:pInputAttachments, pname:pColorAttachments, 1655e5c31af7Sopenharmony_ci pname:pResolveAttachments or pname:pDepthStencilAttachment, or any 1656e5c31af7Sopenharmony_ci element of pname:pPreserveAttachments in any element of pname:pSubpasses 1657e5c31af7Sopenharmony_ci is not ename:VK_ATTACHMENT_UNUSED, then it must: be less than 1658e5c31af7Sopenharmony_ci pname:attachmentCount 1659e5c31af7Sopenharmony_ciifdef::VK_EXT_fragment_density_map[] 1660e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassCreateInfo-fragmentDensityMapAttachment-06471]] 1661e5c31af7Sopenharmony_ci If the pNext chain includes a 1662e5c31af7Sopenharmony_ci slink:VkRenderPassFragmentDensityMapCreateInfoEXT structure and the 1663e5c31af7Sopenharmony_ci pname:fragmentDensityMapAttachment member is not 1664e5c31af7Sopenharmony_ci ename:VK_ATTACHMENT_UNUSED, then pname:attachment must: be less than 1665e5c31af7Sopenharmony_ci pname:attachmentCount 1666e5c31af7Sopenharmony_ciendif::VK_EXT_fragment_density_map[] 1667e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassCreateInfo-pAttachments-00836]] 1668e5c31af7Sopenharmony_ci For any member of pname:pAttachments with a pname:loadOp equal to 1669e5c31af7Sopenharmony_ci ename:VK_ATTACHMENT_LOAD_OP_CLEAR, the first use of that attachment 1670e5c31af7Sopenharmony_ci must: not specify a pname:layout equal to 1671e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL or 1672e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL 1673e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassCreateInfo-pAttachments-02511]] 1674e5c31af7Sopenharmony_ci For any member of pname:pAttachments with a pname:stencilLoadOp equal to 1675e5c31af7Sopenharmony_ci ename:VK_ATTACHMENT_LOAD_OP_CLEAR, the first use of that attachment 1676e5c31af7Sopenharmony_ci must: not specify a pname:layout equal to 1677e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL or 1678e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL 1679e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_maintenance2[] 1680e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassCreateInfo-pAttachments-01566]] 1681e5c31af7Sopenharmony_ci For any member of pname:pAttachments with a pname:loadOp equal to 1682e5c31af7Sopenharmony_ci ename:VK_ATTACHMENT_LOAD_OP_CLEAR, the first use of that attachment 1683e5c31af7Sopenharmony_ci must: not specify a pname:layout equal to 1684e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL 1685e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassCreateInfo-pAttachments-01567]] 1686e5c31af7Sopenharmony_ci For any member of pname:pAttachments with a pname:stencilLoadOp equal to 1687e5c31af7Sopenharmony_ci ename:VK_ATTACHMENT_LOAD_OP_CLEAR, the first use of that attachment 1688e5c31af7Sopenharmony_ci must: not specify a pname:layout equal to 1689e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL 1690e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassCreateInfo-pNext-01926]] 1691e5c31af7Sopenharmony_ci If the pname:pNext chain includes a 1692e5c31af7Sopenharmony_ci slink:VkRenderPassInputAttachmentAspectCreateInfo structure, the 1693e5c31af7Sopenharmony_ci pname:subpass member of each element of its pname:pAspectReferences 1694e5c31af7Sopenharmony_ci member must: be less than pname:subpassCount 1695e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassCreateInfo-pNext-01927]] 1696e5c31af7Sopenharmony_ci If the pname:pNext chain includes a 1697e5c31af7Sopenharmony_ci slink:VkRenderPassInputAttachmentAspectCreateInfo structure, the 1698e5c31af7Sopenharmony_ci pname:inputAttachmentIndex member of each element of its 1699e5c31af7Sopenharmony_ci pname:pAspectReferences member must: be less than the value of 1700e5c31af7Sopenharmony_ci pname:inputAttachmentCount in the element of pname:pSubpasses identified 1701e5c31af7Sopenharmony_ci by its pname:subpass member 1702e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassCreateInfo-pNext-01963]] 1703e5c31af7Sopenharmony_ci If the pname:pNext chain includes a 1704e5c31af7Sopenharmony_ci slink:VkRenderPassInputAttachmentAspectCreateInfo structure, for any 1705e5c31af7Sopenharmony_ci element of the pname:pInputAttachments member of any element of 1706e5c31af7Sopenharmony_ci pname:pSubpasses where the pname:attachment member is not 1707e5c31af7Sopenharmony_ci ename:VK_ATTACHMENT_UNUSED, the pname:aspectMask member of the 1708e5c31af7Sopenharmony_ci corresponding element of 1709e5c31af7Sopenharmony_ci slink:VkRenderPassInputAttachmentAspectCreateInfo::pname:pAspectReferences 1710e5c31af7Sopenharmony_ci must: only include aspects that are present in images of the format 1711e5c31af7Sopenharmony_ci specified by the element of pname:pAttachments at pname:attachment 1712e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_maintenance2[] 1713e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_multiview[] 1714e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassCreateInfo-pNext-01928]] 1715e5c31af7Sopenharmony_ci If the pname:pNext chain includes a 1716e5c31af7Sopenharmony_ci slink:VkRenderPassMultiviewCreateInfo structure, and its 1717e5c31af7Sopenharmony_ci pname:subpassCount member is not zero, that member must: be equal to the 1718e5c31af7Sopenharmony_ci value of pname:subpassCount 1719e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassCreateInfo-pNext-01929]] 1720e5c31af7Sopenharmony_ci If the pname:pNext chain includes a 1721e5c31af7Sopenharmony_ci slink:VkRenderPassMultiviewCreateInfo structure, if its 1722e5c31af7Sopenharmony_ci pname:dependencyCount member is not zero, it must: be equal to 1723e5c31af7Sopenharmony_ci pname:dependencyCount 1724e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassCreateInfo-pNext-01930]] 1725e5c31af7Sopenharmony_ci If the pname:pNext chain includes a 1726e5c31af7Sopenharmony_ci slink:VkRenderPassMultiviewCreateInfo structure, for each non-zero 1727e5c31af7Sopenharmony_ci element of pname:pViewOffsets, the pname:srcSubpass and pname:dstSubpass 1728e5c31af7Sopenharmony_ci members of pname:pDependencies at the same index must: not be equal 1729e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassCreateInfo-pNext-02512]] 1730e5c31af7Sopenharmony_ci If the pname:pNext chain includes a 1731e5c31af7Sopenharmony_ci slink:VkRenderPassMultiviewCreateInfo structure, for any element of 1732e5c31af7Sopenharmony_ci pname:pDependencies with a pname:dependencyFlags member that does not 1733e5c31af7Sopenharmony_ci include ename:VK_DEPENDENCY_VIEW_LOCAL_BIT, the corresponding element of 1734e5c31af7Sopenharmony_ci the pname:pViewOffsets member of that 1735e5c31af7Sopenharmony_ci slink:VkRenderPassMultiviewCreateInfo instance must: be `0` 1736e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassCreateInfo-pNext-02513]] 1737e5c31af7Sopenharmony_ci If the pname:pNext chain includes a 1738e5c31af7Sopenharmony_ci slink:VkRenderPassMultiviewCreateInfo structure, elements of its 1739e5c31af7Sopenharmony_ci pname:pViewMasks member must: either all be `0`, or all not be `0` 1740e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassCreateInfo-pNext-02514]] 1741e5c31af7Sopenharmony_ci If the pname:pNext chain includes a 1742e5c31af7Sopenharmony_ci slink:VkRenderPassMultiviewCreateInfo structure, and each element of its 1743e5c31af7Sopenharmony_ci pname:pViewMasks member is `0`, the pname:dependencyFlags member of each 1744e5c31af7Sopenharmony_ci element of pname:pDependencies must: not include 1745e5c31af7Sopenharmony_ci ename:VK_DEPENDENCY_VIEW_LOCAL_BIT 1746e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassCreateInfo-pNext-02515]] 1747e5c31af7Sopenharmony_ci If the pname:pNext chain includes a 1748e5c31af7Sopenharmony_ci slink:VkRenderPassMultiviewCreateInfo structure, and each element of its 1749e5c31af7Sopenharmony_ci pname:pViewMasks member is `0`, its pname:correlationMaskCount member 1750e5c31af7Sopenharmony_ci must: be `0` 1751e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_multiview[] 1752e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassCreateInfo-pDependencies-00837]] 1753e5c31af7Sopenharmony_ci For any element of pname:pDependencies, if the pname:srcSubpass is not 1754e5c31af7Sopenharmony_ci ename:VK_SUBPASS_EXTERNAL, all stage flags included in the 1755e5c31af7Sopenharmony_ci pname:srcStageMask member of that dependency must: be a pipeline stage 1756e5c31af7Sopenharmony_ci supported by the <<synchronization-pipeline-stages-types, pipeline>> 1757e5c31af7Sopenharmony_ci identified by the pname:pipelineBindPoint member of the source subpass 1758e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassCreateInfo-pDependencies-00838]] 1759e5c31af7Sopenharmony_ci For any element of pname:pDependencies, if the pname:dstSubpass is not 1760e5c31af7Sopenharmony_ci ename:VK_SUBPASS_EXTERNAL, all stage flags included in the 1761e5c31af7Sopenharmony_ci pname:dstStageMask member of that dependency must: be a pipeline stage 1762e5c31af7Sopenharmony_ci supported by the <<synchronization-pipeline-stages-types, pipeline>> 1763e5c31af7Sopenharmony_ci identified by the pname:pipelineBindPoint member of the destination 1764e5c31af7Sopenharmony_ci subpass 1765e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassCreateInfo-pDependencies-06866]] 1766e5c31af7Sopenharmony_ci For any element of pname:pDependencies, if its pname:srcSubpass is not 1767e5c31af7Sopenharmony_ci ename:VK_SUBPASS_EXTERNAL, it must: be less than pname:subpassCount 1768e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassCreateInfo-pDependencies-06867]] 1769e5c31af7Sopenharmony_ci For any element of pname:pDependencies, if its pname:dstSubpass is not 1770e5c31af7Sopenharmony_ci ename:VK_SUBPASS_EXTERNAL, it must: be less than pname:subpassCount 1771e5c31af7Sopenharmony_ciifdef::VKSC_VERSION_1_0[] 1772e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassCreateInfo-subpassCount-05050]] 1773e5c31af7Sopenharmony_ci pname:subpassCount must: be less than or equal to 1774e5c31af7Sopenharmony_ci <<limits-maxRenderPassSubpasses,maxRenderPassSubpasses>> 1775e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassCreateInfo-dependencyCount-05051]] 1776e5c31af7Sopenharmony_ci pname:dependencyCount must: be less than or equal to 1777e5c31af7Sopenharmony_ci <<limits-maxRenderPassDependencies,maxRenderPassDependencies>> 1778e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassCreateInfo-attachmentCount-05052]] 1779e5c31af7Sopenharmony_ci pname:attachmentCount must: be less than or equal to 1780e5c31af7Sopenharmony_ci <<limits-maxFramebufferAttachments,maxFramebufferAttachments>> 1781e5c31af7Sopenharmony_ciendif::VKSC_VERSION_1_0[] 1782e5c31af7Sopenharmony_ci**** 1783e5c31af7Sopenharmony_ci 1784e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkRenderPassCreateInfo.adoc[] 1785e5c31af7Sopenharmony_ci-- 1786e5c31af7Sopenharmony_ci 1787e5c31af7Sopenharmony_ci[open,refpage='VkRenderPassCreateFlagBits',desc='Bitmask specifying additional properties of a render pass',type='enums'] 1788e5c31af7Sopenharmony_ci-- 1789e5c31af7Sopenharmony_ciBits which can: be set in slink:VkRenderPassCreateInfo::pname:flags, 1790e5c31af7Sopenharmony_cidescribing additional properties of the render pass, are: 1791e5c31af7Sopenharmony_ci 1792e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkRenderPassCreateFlagBits.adoc[] 1793e5c31af7Sopenharmony_ci 1794e5c31af7Sopenharmony_ciifdef::VK_QCOM_render_pass_transform[] 1795e5c31af7Sopenharmony_ci * ename:VK_RENDER_PASS_CREATE_TRANSFORM_BIT_QCOM specifies that the 1796e5c31af7Sopenharmony_ci created render pass is compatible with 1797e5c31af7Sopenharmony_ci <<vertexpostproc-renderpass-transform, render pass transform>>. 1798e5c31af7Sopenharmony_ciendif::VK_QCOM_render_pass_transform[] 1799e5c31af7Sopenharmony_ci 1800e5c31af7Sopenharmony_ciifndef::VK_QCOM_render_pass_transform[] 1801e5c31af7Sopenharmony_ci[NOTE] 1802e5c31af7Sopenharmony_ci.Note 1803e5c31af7Sopenharmony_ci==== 1804e5c31af7Sopenharmony_ciAll bits for this type are defined by extensions, and none of those 1805e5c31af7Sopenharmony_ciextensions are enabled in this build of the specification. 1806e5c31af7Sopenharmony_ci==== 1807e5c31af7Sopenharmony_ciendif::VK_QCOM_render_pass_transform[] 1808e5c31af7Sopenharmony_ci-- 1809e5c31af7Sopenharmony_ci 1810e5c31af7Sopenharmony_ci[open,refpage='VkRenderPassCreateFlags',desc='Bitmask of VkRenderPassCreateFlagBits',type='flags'] 1811e5c31af7Sopenharmony_ci-- 1812e5c31af7Sopenharmony_ciinclude::{generated}/api/flags/VkRenderPassCreateFlags.adoc[] 1813e5c31af7Sopenharmony_ci 1814e5c31af7Sopenharmony_citname:VkRenderPassCreateFlags is a bitmask type for setting a mask of zero 1815e5c31af7Sopenharmony_cior more elink:VkRenderPassCreateFlagBits. 1816e5c31af7Sopenharmony_ci-- 1817e5c31af7Sopenharmony_ci 1818e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_multiview[] 1819e5c31af7Sopenharmony_ci[[renderpass-multiview]] 1820e5c31af7Sopenharmony_ci[open,refpage='VkRenderPassMultiviewCreateInfo',desc='Structure containing multiview information for all subpasses',type='structs'] 1821e5c31af7Sopenharmony_ci-- 1822e5c31af7Sopenharmony_ciIf the slink:VkRenderPassCreateInfo::pname:pNext chain includes a 1823e5c31af7Sopenharmony_cisname:VkRenderPassMultiviewCreateInfo structure, then that structure 1824e5c31af7Sopenharmony_ciincludes an array of view masks, view offsets, and correlation masks for the 1825e5c31af7Sopenharmony_cirender pass. 1826e5c31af7Sopenharmony_ci 1827e5c31af7Sopenharmony_ciThe sname:VkRenderPassMultiviewCreateInfo structure is defined as: 1828e5c31af7Sopenharmony_ci 1829e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkRenderPassMultiviewCreateInfo.adoc[] 1830e5c31af7Sopenharmony_ci 1831e5c31af7Sopenharmony_ciifdef::VK_KHR_multiview[] 1832e5c31af7Sopenharmony_cior the equivalent 1833e5c31af7Sopenharmony_ci 1834e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkRenderPassMultiviewCreateInfoKHR.adoc[] 1835e5c31af7Sopenharmony_ciendif::VK_KHR_multiview[] 1836e5c31af7Sopenharmony_ci 1837e5c31af7Sopenharmony_ci * pname:sType is a elink:VkStructureType value identifying this structure. 1838e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 1839e5c31af7Sopenharmony_ci structure. 1840e5c31af7Sopenharmony_ci * pname:subpassCount is zero or the number of subpasses in the render 1841e5c31af7Sopenharmony_ci pass. 1842e5c31af7Sopenharmony_ci * pname:pViewMasks is a pointer to an array of pname:subpassCount view 1843e5c31af7Sopenharmony_ci masks, where each mask is a bitfield of view indices describing which 1844e5c31af7Sopenharmony_ci views rendering is broadcast to in each subpass, when multiview is 1845e5c31af7Sopenharmony_ci enabled. 1846e5c31af7Sopenharmony_ci If pname:subpassCount is zero, each view mask is treated as zero. 1847e5c31af7Sopenharmony_ci * pname:dependencyCount is zero or the number of dependencies in the 1848e5c31af7Sopenharmony_ci render pass. 1849e5c31af7Sopenharmony_ci * pname:pViewOffsets is a pointer to an array of pname:dependencyCount 1850e5c31af7Sopenharmony_ci view offsets, one for each dependency. 1851e5c31af7Sopenharmony_ci If pname:dependencyCount is zero, each dependency's view offset is 1852e5c31af7Sopenharmony_ci treated as zero. 1853e5c31af7Sopenharmony_ci Each view offset controls which views in the source subpass the views in 1854e5c31af7Sopenharmony_ci the destination subpass depend on. 1855e5c31af7Sopenharmony_ci * pname:correlationMaskCount is zero or the number of correlation masks. 1856e5c31af7Sopenharmony_ci * pname:pCorrelationMasks is a pointer to an array of 1857e5c31af7Sopenharmony_ci pname:correlationMaskCount view masks indicating sets of views that may: 1858e5c31af7Sopenharmony_ci be more efficient to render concurrently. 1859e5c31af7Sopenharmony_ci 1860e5c31af7Sopenharmony_ciWhen a subpass uses a non-zero view mask, _multiview_ functionality is 1861e5c31af7Sopenharmony_ciconsidered to be enabled. 1862e5c31af7Sopenharmony_ciMultiview is all-or-nothing for a render pass - that is, either all 1863e5c31af7Sopenharmony_cisubpasses must: have a non-zero view mask (though some subpasses may: have 1864e5c31af7Sopenharmony_cionly one view) or all must: be zero. 1865e5c31af7Sopenharmony_ciMultiview causes all drawing and clear commands in the subpass to behave as 1866e5c31af7Sopenharmony_ciif they were broadcast to each view, where a view is represented by one 1867e5c31af7Sopenharmony_cilayer of the framebuffer attachments. 1868e5c31af7Sopenharmony_ciAll draws and clears are broadcast to each _view index_ whose bit is set in 1869e5c31af7Sopenharmony_cithe view mask. 1870e5c31af7Sopenharmony_ciThe view index is provided in the code:ViewIndex shader input variable, and 1871e5c31af7Sopenharmony_cicolor, depth/stencil, and input attachments all read/write the layer of the 1872e5c31af7Sopenharmony_ciframebuffer corresponding to the view index. 1873e5c31af7Sopenharmony_ci 1874e5c31af7Sopenharmony_ciIf the view mask is zero for all subpasses, multiview is considered to be 1875e5c31af7Sopenharmony_cidisabled and all drawing commands execute normally, without this additional 1876e5c31af7Sopenharmony_cibroadcasting. 1877e5c31af7Sopenharmony_ci 1878e5c31af7Sopenharmony_ciSome implementations may: not support multiview in conjunction with 1879e5c31af7Sopenharmony_ciifdef::VK_EXT_mesh_shader[<<features-multiview-mesh, mesh shaders>>,] 1880e5c31af7Sopenharmony_ci<<features-multiview-gs, geometry shaders>> or <<features-multiview-tess, 1881e5c31af7Sopenharmony_citessellation shaders>>. 1882e5c31af7Sopenharmony_ci 1883e5c31af7Sopenharmony_ci[[renderpass-multiview-view-local]] 1884e5c31af7Sopenharmony_ciWhen multiview is enabled, the ename:VK_DEPENDENCY_VIEW_LOCAL_BIT bit in a 1885e5c31af7Sopenharmony_cidependency can: be used to express a view-local dependency, meaning that 1886e5c31af7Sopenharmony_cieach view in the destination subpass depends on a single view in the source 1887e5c31af7Sopenharmony_cisubpass. 1888e5c31af7Sopenharmony_ciUnlike pipeline barriers, a subpass dependency can: potentially have a 1889e5c31af7Sopenharmony_cidifferent view mask in the source subpass and the destination subpass. 1890e5c31af7Sopenharmony_ciIf the dependency is view-local, then each view ([eq]#dstView#) in the 1891e5c31af7Sopenharmony_cidestination subpass depends on the view [eq]#dstView {plus} 1892e5c31af7Sopenharmony_cipname:pViewOffsets[dependency]# in the source subpass. 1893e5c31af7Sopenharmony_ciIf there is not such a view in the source subpass, then this dependency does 1894e5c31af7Sopenharmony_cinot affect that view in the destination subpass. 1895e5c31af7Sopenharmony_ciIf the dependency is not view-local, then all views in the destination 1896e5c31af7Sopenharmony_cisubpass depend on all views in the source subpass, and the view offset is 1897e5c31af7Sopenharmony_ciignored. 1898e5c31af7Sopenharmony_ciA non-zero view offset is not allowed in a self-dependency. 1899e5c31af7Sopenharmony_ci 1900e5c31af7Sopenharmony_ciThe elements of pname:pCorrelationMasks are a set of masks of views 1901e5c31af7Sopenharmony_ciindicating that views in the same mask may: exhibit spatial coherency 1902e5c31af7Sopenharmony_cibetween the views, making it more efficient to render them concurrently. 1903e5c31af7Sopenharmony_ciCorrelation masks must: not have a functional effect on the results of the 1904e5c31af7Sopenharmony_cimultiview rendering. 1905e5c31af7Sopenharmony_ci 1906e5c31af7Sopenharmony_ciWhen multiview is enabled, at the beginning of each subpass all non-render 1907e5c31af7Sopenharmony_cipass state is undefined:. 1908e5c31af7Sopenharmony_ciIn particular, each time flink:vkCmdBeginRenderPass or 1909e5c31af7Sopenharmony_ciflink:vkCmdNextSubpass is called the graphics pipeline must: be bound, any 1910e5c31af7Sopenharmony_cirelevant descriptor sets or vertex/index buffers must: be bound, and any 1911e5c31af7Sopenharmony_cirelevant dynamic state or push constants must: be set before they are used. 1912e5c31af7Sopenharmony_ci 1913e5c31af7Sopenharmony_ciifdef::VK_NVX_multiview_per_view_attributes[] 1914e5c31af7Sopenharmony_ci 1915e5c31af7Sopenharmony_ciA multiview subpass can: declare that its shaders will write per-view 1916e5c31af7Sopenharmony_ciattributes for all views in a single invocation, by setting the 1917e5c31af7Sopenharmony_ciename:VK_SUBPASS_DESCRIPTION_PER_VIEW_ATTRIBUTES_BIT_NVX bit in the subpass 1918e5c31af7Sopenharmony_cidescription. 1919e5c31af7Sopenharmony_ciThe only supported per-view attributes are position and viewport mask, and 1920e5c31af7Sopenharmony_ciper-view position and viewport masks are written to output array variables 1921e5c31af7Sopenharmony_cidecorated with code:PositionPerViewNV and code:ViewportMaskPerViewNV, 1922e5c31af7Sopenharmony_cirespectively. 1923e5c31af7Sopenharmony_ciIf `apiext:VK_NV_viewport_array2` is not supported and enabled, 1924e5c31af7Sopenharmony_cicode:ViewportMaskPerViewNV must: not be used. 1925e5c31af7Sopenharmony_ciValues written to elements of code:PositionPerViewNV and 1926e5c31af7Sopenharmony_cicode:ViewportMaskPerViewNV must: not depend on the code:ViewIndex. 1927e5c31af7Sopenharmony_ciThe shader must: also write to an output variable decorated with 1928e5c31af7Sopenharmony_cicode:Position, and the value written to code:Position must: equal the value 1929e5c31af7Sopenharmony_ciwritten to code:PositionPerViewNV[code:ViewIndex]. 1930e5c31af7Sopenharmony_ciSimilarly, if code:ViewportMaskPerViewNV is written to then the shader must: 1931e5c31af7Sopenharmony_cialso write to an output variable decorated with code:ViewportMaskNV, and the 1932e5c31af7Sopenharmony_civalue written to code:ViewportMaskNV must: equal the value written to 1933e5c31af7Sopenharmony_cicode:ViewportMaskPerViewNV[code:ViewIndex]. 1934e5c31af7Sopenharmony_ciImplementations will either use values taken from code:Position and 1935e5c31af7Sopenharmony_cicode:ViewportMaskNV and invoke the shader once for each view, or will use 1936e5c31af7Sopenharmony_civalues taken from code:PositionPerViewNV and code:ViewportMaskPerViewNV and 1937e5c31af7Sopenharmony_ciinvoke the shader fewer times. 1938e5c31af7Sopenharmony_ciThe values written to code:Position and code:ViewportMaskNV must: not depend 1939e5c31af7Sopenharmony_cion the values written to code:PositionPerViewNV and 1940e5c31af7Sopenharmony_cicode:ViewportMaskPerViewNV, or vice versa (to allow compilers to eliminate 1941e5c31af7Sopenharmony_cithe unused outputs). 1942e5c31af7Sopenharmony_ciAll attributes that do not have `*PerViewNV` counterparts must: not depend 1943e5c31af7Sopenharmony_cion code:ViewIndex. 1944e5c31af7Sopenharmony_ci 1945e5c31af7Sopenharmony_ciPer-view attributes are all-or-nothing for a subpass. 1946e5c31af7Sopenharmony_ciThat is, all pipelines compiled against a subpass that includes the 1947e5c31af7Sopenharmony_ciename:VK_SUBPASS_DESCRIPTION_PER_VIEW_ATTRIBUTES_BIT_NVX bit must: write 1948e5c31af7Sopenharmony_ciper-view attributes to the `*PerViewNV[]` shader outputs, in addition to the 1949e5c31af7Sopenharmony_cinon-per-view (e.g. code:Position) outputs. 1950e5c31af7Sopenharmony_ciPipelines compiled against a subpass that does not include this bit must: 1951e5c31af7Sopenharmony_cinot include the `*PerViewNV[]` outputs in their interfaces. 1952e5c31af7Sopenharmony_ci 1953e5c31af7Sopenharmony_ciendif::VK_NVX_multiview_per_view_attributes[] 1954e5c31af7Sopenharmony_ci 1955e5c31af7Sopenharmony_ci.Valid Usage 1956e5c31af7Sopenharmony_ci**** 1957e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassMultiviewCreateInfo-pCorrelationMasks-00841]] 1958e5c31af7Sopenharmony_ci Each view index must: not be set in more than one element of 1959e5c31af7Sopenharmony_ci pname:pCorrelationMasks 1960e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassMultiviewCreateInfo-multiview-06555]] 1961e5c31af7Sopenharmony_ci If the <<features-multiview, pname:multiview>> feature is not enabled, 1962e5c31af7Sopenharmony_ci each element of pname:pViewMasks must: be `0` 1963e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassMultiviewCreateInfo-pViewMasks-06697]] 1964e5c31af7Sopenharmony_ci The index of the most significant bit in each element of 1965e5c31af7Sopenharmony_ci pname:pViewMasks must: be less than <<limits-maxMultiviewViewCount, 1966e5c31af7Sopenharmony_ci pname:maxMultiviewViewCount>> 1967e5c31af7Sopenharmony_ci**** 1968e5c31af7Sopenharmony_ci 1969e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkRenderPassMultiviewCreateInfo.adoc[] 1970e5c31af7Sopenharmony_ci-- 1971e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_multiview[] 1972e5c31af7Sopenharmony_ci 1973e5c31af7Sopenharmony_ciifdef::VK_NVX_multiview_per_view_attributes[] 1974e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_3,VK_KHR_dynamic_rendering[] 1975e5c31af7Sopenharmony_ci[open,refpage='VkMultiviewPerViewAttributesInfoNVX',desc='Structure specifying the multiview per-attribute properties',type='structs'] 1976e5c31af7Sopenharmony_ci-- 1977e5c31af7Sopenharmony_ciThe sname:VkMultiviewPerViewAttributesInfoNVX structure is defined as: 1978e5c31af7Sopenharmony_ci 1979e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkMultiviewPerViewAttributesInfoNVX.adoc[] 1980e5c31af7Sopenharmony_ci 1981e5c31af7Sopenharmony_ci * pname:sType is a elink:VkStructureType value identifying this structure. 1982e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 1983e5c31af7Sopenharmony_ci structure. 1984e5c31af7Sopenharmony_ci * pname:perViewAttributes specifies that shaders compiled for this 1985e5c31af7Sopenharmony_ci pipeline write the attributes for all views in a single invocation of 1986e5c31af7Sopenharmony_ci each vertex processing stage. 1987e5c31af7Sopenharmony_ci All pipelines executed within a render pass instance that includes this 1988e5c31af7Sopenharmony_ci bit must: write per-view attributes to the `*PerViewNV[]` shader 1989e5c31af7Sopenharmony_ci outputs, in addition to the non-per-view (e.g. code:Position) outputs. 1990e5c31af7Sopenharmony_ci * pname:perViewAttributesPositionXOnly specifies that shaders compiled for 1991e5c31af7Sopenharmony_ci this pipeline use per-view positions which only differ in value in the x 1992e5c31af7Sopenharmony_ci component. 1993e5c31af7Sopenharmony_ci Per-view viewport mask can: also be used. 1994e5c31af7Sopenharmony_ci 1995e5c31af7Sopenharmony_ciWhen dynamic render pass instances are being used, instead of specifying 1996e5c31af7Sopenharmony_ciename:VK_SUBPASS_DESCRIPTION_PER_VIEW_ATTRIBUTES_BIT_NVX or 1997e5c31af7Sopenharmony_ciename:VK_SUBPASS_DESCRIPTION_PER_VIEW_POSITION_X_ONLY_BIT_NVX in the subpass 1998e5c31af7Sopenharmony_cidescription flags, the per-attribute properties of the render pass instance 1999e5c31af7Sopenharmony_cimust: be specified by the sname:VkMultiviewPerViewAttributesInfoNVX 2000e5c31af7Sopenharmony_cistructure Include the sname:VkMultiviewPerViewAttributesInfoNVX structure in 2001e5c31af7Sopenharmony_cithe pname:pNext chain of slink:VkGraphicsPipelineCreateInfo when creating a 2002e5c31af7Sopenharmony_cigraphics pipeline for dynamic rendering, slink:VkRenderingInfo when starting 2003e5c31af7Sopenharmony_cia dynamic render pass instance, and slink:VkCommandBufferInheritanceInfo 2004e5c31af7Sopenharmony_ciwhen specifying the dynamic render pass instance parameters for secondary 2005e5c31af7Sopenharmony_cicommand buffers. 2006e5c31af7Sopenharmony_ci 2007e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkMultiviewPerViewAttributesInfoNVX.adoc[] 2008e5c31af7Sopenharmony_ci-- 2009e5c31af7Sopenharmony_ciendif::VK_VERSION_1_3,VK_KHR_dynamic_rendering[] 2010e5c31af7Sopenharmony_ciendif::VK_NVX_multiview_per_view_attributes[] 2011e5c31af7Sopenharmony_ci 2012e5c31af7Sopenharmony_ciifdef::VK_EXT_fragment_density_map[] 2013e5c31af7Sopenharmony_ci[[renderpass-fragmentdensitymapattachment]] 2014e5c31af7Sopenharmony_ci[open,refpage='VkRenderPassFragmentDensityMapCreateInfoEXT',desc='Structure containing fragment density map attachment for render pass',type='structs'] 2015e5c31af7Sopenharmony_ci-- 2016e5c31af7Sopenharmony_ciIf the slink:VkRenderPassCreateInfo::pname:pNext chain includes a 2017e5c31af7Sopenharmony_cisname:VkRenderPassFragmentDensityMapCreateInfoEXT structure, then that 2018e5c31af7Sopenharmony_cistructure includes a fragment density map attachment for the render pass. 2019e5c31af7Sopenharmony_ci 2020e5c31af7Sopenharmony_ciThe sname:VkRenderPassFragmentDensityMapCreateInfoEXT structure is defined 2021e5c31af7Sopenharmony_cias: 2022e5c31af7Sopenharmony_ci 2023e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkRenderPassFragmentDensityMapCreateInfoEXT.adoc[] 2024e5c31af7Sopenharmony_ci 2025e5c31af7Sopenharmony_ci * pname:sType is a elink:VkStructureType value identifying this structure. 2026e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 2027e5c31af7Sopenharmony_ci structure. 2028e5c31af7Sopenharmony_ci * pname:fragmentDensityMapAttachment is the fragment density map to use 2029e5c31af7Sopenharmony_ci for the render pass. 2030e5c31af7Sopenharmony_ci 2031e5c31af7Sopenharmony_ciThe fragment density map is read at an implementation-dependent time with 2032e5c31af7Sopenharmony_cithe following constraints determined by the attachment's image view 2033e5c31af7Sopenharmony_cipname:flags: 2034e5c31af7Sopenharmony_ci 2035e5c31af7Sopenharmony_ci * ename:VK_IMAGE_VIEW_CREATE_FRAGMENT_DENSITY_MAP_DYNAMIC_BIT_EXT 2036e5c31af7Sopenharmony_ci specifies that the fragment density map will be read by the device 2037e5c31af7Sopenharmony_ci during ename:VK_PIPELINE_STAGE_FRAGMENT_DENSITY_PROCESS_BIT_EXT 2038e5c31af7Sopenharmony_ciifdef::VK_EXT_fragment_density_map2[] 2039e5c31af7Sopenharmony_ci * ename:VK_IMAGE_VIEW_CREATE_FRAGMENT_DENSITY_MAP_DEFERRED_BIT_EXT 2040e5c31af7Sopenharmony_ci specifies that the fragment density map will be read by the host during 2041e5c31af7Sopenharmony_ci flink:vkEndCommandBuffer of the primary command buffer that the render 2042e5c31af7Sopenharmony_ci pass is recorded into 2043e5c31af7Sopenharmony_ciendif::VK_EXT_fragment_density_map2[] 2044e5c31af7Sopenharmony_ci * Otherwise the fragment density map will be read by the host during 2045e5c31af7Sopenharmony_ci flink:vkCmdBeginRenderPass 2046e5c31af7Sopenharmony_ci 2047e5c31af7Sopenharmony_ciThe fragment density map may: additionally be read by the device during 2048e5c31af7Sopenharmony_ciename:VK_PIPELINE_STAGE_FRAGMENT_DENSITY_PROCESS_BIT_EXT for any mode. 2049e5c31af7Sopenharmony_ci 2050e5c31af7Sopenharmony_ciIf this structure is not present, it is as if 2051e5c31af7Sopenharmony_cipname:fragmentDensityMapAttachment was given as ename:VK_ATTACHMENT_UNUSED. 2052e5c31af7Sopenharmony_ci 2053e5c31af7Sopenharmony_ci.Valid Usage 2054e5c31af7Sopenharmony_ci**** 2055e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassFragmentDensityMapCreateInfoEXT-fragmentDensityMapAttachment-02548]] 2056e5c31af7Sopenharmony_ci If pname:fragmentDensityMapAttachment is not ename:VK_ATTACHMENT_UNUSED, 2057e5c31af7Sopenharmony_ci pname:fragmentDensityMapAttachment must: not be an element of 2058e5c31af7Sopenharmony_ci sname:VkSubpassDescription::pname:pInputAttachments, 2059e5c31af7Sopenharmony_ci sname:VkSubpassDescription::pname:pColorAttachments, 2060e5c31af7Sopenharmony_ci sname:VkSubpassDescription::pname:pResolveAttachments, 2061e5c31af7Sopenharmony_ci sname:VkSubpassDescription::pname:pDepthStencilAttachment, or 2062e5c31af7Sopenharmony_ci sname:VkSubpassDescription::pname:pPreserveAttachments for any subpass 2063e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassFragmentDensityMapCreateInfoEXT-fragmentDensityMapAttachment-02549]] 2064e5c31af7Sopenharmony_ci If pname:fragmentDensityMapAttachment is not ename:VK_ATTACHMENT_UNUSED, 2065e5c31af7Sopenharmony_ci pname:layout must: be equal to 2066e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_FRAGMENT_DENSITY_MAP_OPTIMAL_EXT, or 2067e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_GENERAL 2068e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassFragmentDensityMapCreateInfoEXT-fragmentDensityMapAttachment-02550]] 2069e5c31af7Sopenharmony_ci If pname:fragmentDensityMapAttachment is not ename:VK_ATTACHMENT_UNUSED, 2070e5c31af7Sopenharmony_ci pname:fragmentDensityMapAttachment must: reference an attachment with a 2071e5c31af7Sopenharmony_ci pname:loadOp equal to ename:VK_ATTACHMENT_LOAD_OP_LOAD or 2072e5c31af7Sopenharmony_ci ename:VK_ATTACHMENT_LOAD_OP_DONT_CARE 2073e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassFragmentDensityMapCreateInfoEXT-fragmentDensityMapAttachment-02551]] 2074e5c31af7Sopenharmony_ci If pname:fragmentDensityMapAttachment is not ename:VK_ATTACHMENT_UNUSED, 2075e5c31af7Sopenharmony_ci pname:fragmentDensityMapAttachment must: reference an attachment with a 2076e5c31af7Sopenharmony_ci pname:storeOp equal to ename:VK_ATTACHMENT_STORE_OP_DONT_CARE 2077e5c31af7Sopenharmony_ci**** 2078e5c31af7Sopenharmony_ci 2079e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkRenderPassFragmentDensityMapCreateInfoEXT.adoc[] 2080e5c31af7Sopenharmony_ci-- 2081e5c31af7Sopenharmony_ciendif::VK_EXT_fragment_density_map[] 2082e5c31af7Sopenharmony_ci 2083e5c31af7Sopenharmony_ci[open,refpage='VkAttachmentDescription',desc='Structure specifying an attachment description',type='structs'] 2084e5c31af7Sopenharmony_ci-- 2085e5c31af7Sopenharmony_ci:refpage: VkAttachmentDescription 2086e5c31af7Sopenharmony_ci 2087e5c31af7Sopenharmony_ciThe sname:VkAttachmentDescription structure is defined as: 2088e5c31af7Sopenharmony_ci 2089e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkAttachmentDescription.adoc[] 2090e5c31af7Sopenharmony_ci 2091e5c31af7Sopenharmony_ci * pname:flags is a bitmask of elink:VkAttachmentDescriptionFlagBits 2092e5c31af7Sopenharmony_ci specifying additional properties of the attachment. 2093e5c31af7Sopenharmony_ci * pname:format is a elink:VkFormat value specifying the format of the 2094e5c31af7Sopenharmony_ci image view that will be used for the attachment. 2095e5c31af7Sopenharmony_ci * pname:samples is a elink:VkSampleCountFlagBits value specifying the 2096e5c31af7Sopenharmony_ci number of samples of the image. 2097e5c31af7Sopenharmony_ci * pname:loadOp is a elink:VkAttachmentLoadOp value specifying how the 2098e5c31af7Sopenharmony_ci contents of color and depth components of the attachment are treated at 2099e5c31af7Sopenharmony_ci the beginning of the subpass where it is first used. 2100e5c31af7Sopenharmony_ci * pname:storeOp is a elink:VkAttachmentStoreOp value specifying how the 2101e5c31af7Sopenharmony_ci contents of color and depth components of the attachment are treated at 2102e5c31af7Sopenharmony_ci the end of the subpass where it is last used. 2103e5c31af7Sopenharmony_ci * pname:stencilLoadOp is a elink:VkAttachmentLoadOp value specifying how 2104e5c31af7Sopenharmony_ci the contents of stencil components of the attachment are treated at the 2105e5c31af7Sopenharmony_ci beginning of the subpass where it is first used. 2106e5c31af7Sopenharmony_ci * pname:stencilStoreOp is a elink:VkAttachmentStoreOp value specifying how 2107e5c31af7Sopenharmony_ci the contents of stencil components of the attachment are treated at the 2108e5c31af7Sopenharmony_ci end of the last subpass where it is used. 2109e5c31af7Sopenharmony_ci * pname:initialLayout is the layout the attachment image subresource will 2110e5c31af7Sopenharmony_ci be in when a render pass instance begins. 2111e5c31af7Sopenharmony_ci * pname:finalLayout is the layout the attachment image subresource will be 2112e5c31af7Sopenharmony_ci transitioned to when a render pass instance ends. 2113e5c31af7Sopenharmony_ci 2114e5c31af7Sopenharmony_ciIf the attachment uses a color format, then pname:loadOp and pname:storeOp 2115e5c31af7Sopenharmony_ciare used, and pname:stencilLoadOp and pname:stencilStoreOp are ignored. 2116e5c31af7Sopenharmony_ciIf the format has depth and/or stencil components, pname:loadOp and 2117e5c31af7Sopenharmony_cipname:storeOp apply only to the depth data, while pname:stencilLoadOp and 2118e5c31af7Sopenharmony_cipname:stencilStoreOp define how the stencil data is handled. 2119e5c31af7Sopenharmony_cipname:loadOp and pname:stencilLoadOp define the 2120e5c31af7Sopenharmony_ci<<renderpass-load-operations, load operations>> for the attachment. 2121e5c31af7Sopenharmony_cipname:storeOp and pname:stencilStoreOp define the 2122e5c31af7Sopenharmony_ci<<renderpass-store-operations, store operations>> for the attachment. 2123e5c31af7Sopenharmony_ciIf an attachment is not used by any subpass, pname:loadOp, pname:storeOp, 2124e5c31af7Sopenharmony_cipname:stencilStoreOp, and pname:stencilLoadOp will be ignored for that 2125e5c31af7Sopenharmony_ciattachment, and no load or store ops will be performed. 2126e5c31af7Sopenharmony_ciHowever, any transition specified by pname:initialLayout and 2127e5c31af7Sopenharmony_cipname:finalLayout will still be executed. 2128e5c31af7Sopenharmony_ci 2129e5c31af7Sopenharmony_ci[[renderpass-aliasing]] 2130e5c31af7Sopenharmony_ciIf pname:flags includes ename:VK_ATTACHMENT_DESCRIPTION_MAY_ALIAS_BIT, then 2131e5c31af7Sopenharmony_cithe attachment is treated as if it shares physical memory with another 2132e5c31af7Sopenharmony_ciattachment in the same render pass. 2133e5c31af7Sopenharmony_ciThis information limits the ability of the implementation to reorder certain 2134e5c31af7Sopenharmony_cioperations (like layout transitions and the pname:loadOp) such that it is 2135e5c31af7Sopenharmony_cinot improperly reordered against other uses of the same physical memory via 2136e5c31af7Sopenharmony_cia different attachment. 2137e5c31af7Sopenharmony_ciThis is described in more detail below. 2138e5c31af7Sopenharmony_ci 2139e5c31af7Sopenharmony_ciIf a render pass uses multiple attachments that alias the same device 2140e5c31af7Sopenharmony_cimemory, those attachments must: each include the 2141e5c31af7Sopenharmony_ciename:VK_ATTACHMENT_DESCRIPTION_MAY_ALIAS_BIT bit in their attachment 2142e5c31af7Sopenharmony_cidescription flags. 2143e5c31af7Sopenharmony_ciAttachments aliasing the same memory occurs in multiple ways: 2144e5c31af7Sopenharmony_ci 2145e5c31af7Sopenharmony_ci * Multiple attachments being assigned the same image view as part of 2146e5c31af7Sopenharmony_ci framebuffer creation. 2147e5c31af7Sopenharmony_ci * Attachments using distinct image views that correspond to the same image 2148e5c31af7Sopenharmony_ci subresource of an image. 2149e5c31af7Sopenharmony_ci * Attachments using views of distinct image subresources which are bound 2150e5c31af7Sopenharmony_ci to overlapping memory ranges. 2151e5c31af7Sopenharmony_ci 2152e5c31af7Sopenharmony_ci[NOTE] 2153e5c31af7Sopenharmony_ci.Note 2154e5c31af7Sopenharmony_ci==== 2155e5c31af7Sopenharmony_ciRender passes must: include subpass dependencies (either directly or via a 2156e5c31af7Sopenharmony_cisubpass dependency chain) between any two subpasses that operate on the same 2157e5c31af7Sopenharmony_ciattachment or aliasing attachments and those subpass dependencies must: 2158e5c31af7Sopenharmony_ciinclude execution and memory dependencies separating uses of the aliases, if 2159e5c31af7Sopenharmony_ciat least one of those subpasses writes to one of the aliases. 2160e5c31af7Sopenharmony_ciThese dependencies must: not include the ename:VK_DEPENDENCY_BY_REGION_BIT 2161e5c31af7Sopenharmony_ciif the aliases are views of distinct image subresources which overlap in 2162e5c31af7Sopenharmony_cimemory. 2163e5c31af7Sopenharmony_ci==== 2164e5c31af7Sopenharmony_ci 2165e5c31af7Sopenharmony_ciMultiple attachments that alias the same memory must: not be used in a 2166e5c31af7Sopenharmony_cisingle subpass. 2167e5c31af7Sopenharmony_ciA given attachment index must: not be used multiple times in a single 2168e5c31af7Sopenharmony_cisubpass, with one exception: two subpass attachments can: use the same 2169e5c31af7Sopenharmony_ciattachment index if at least one use is as an input attachment and neither 2170e5c31af7Sopenharmony_ciuse is as a resolve or preserve attachment. 2171e5c31af7Sopenharmony_ciIn other words, the same view can: be used simultaneously as an input and 2172e5c31af7Sopenharmony_cicolor or depth/stencil attachment, but must: not be used as multiple color 2173e5c31af7Sopenharmony_cior depth/stencil attachments nor as resolve or preserve attachments. 2174e5c31af7Sopenharmony_ci 2175e5c31af7Sopenharmony_ciIf a set of attachments alias each other, then all except the first to be 2176e5c31af7Sopenharmony_ciused in the render pass must: use an pname:initialLayout of 2177e5c31af7Sopenharmony_ciename:VK_IMAGE_LAYOUT_UNDEFINED, since the earlier uses of the other aliases 2178e5c31af7Sopenharmony_cimake their contents undefined:. 2179e5c31af7Sopenharmony_ciOnce an alias has been used and a different alias has been used after it, 2180e5c31af7Sopenharmony_cithe first alias must: not be used in any later subpasses. 2181e5c31af7Sopenharmony_ciHowever, an application can: assign the same image view to multiple aliasing 2182e5c31af7Sopenharmony_ciattachment indices, which allows that image view to be used multiple times 2183e5c31af7Sopenharmony_cieven if other aliases are used in between. 2184e5c31af7Sopenharmony_ci 2185e5c31af7Sopenharmony_ci[NOTE] 2186e5c31af7Sopenharmony_ci.Note 2187e5c31af7Sopenharmony_ci==== 2188e5c31af7Sopenharmony_ciOnce an attachment needs the ename:VK_ATTACHMENT_DESCRIPTION_MAY_ALIAS_BIT 2189e5c31af7Sopenharmony_cibit, there should: be no additional cost of introducing additional aliases, 2190e5c31af7Sopenharmony_ciand using these additional aliases may: allow more efficient clearing of the 2191e5c31af7Sopenharmony_ciattachments on multiple uses via ename:VK_ATTACHMENT_LOAD_OP_CLEAR. 2192e5c31af7Sopenharmony_ci==== 2193e5c31af7Sopenharmony_ci 2194e5c31af7Sopenharmony_ci.Valid Usage 2195e5c31af7Sopenharmony_ci**** 2196e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/attachment_description_common.adoc[] 2197e5c31af7Sopenharmony_ci * [[VUID-VkAttachmentDescription-format-06698]] 2198e5c31af7Sopenharmony_ci pname:format must: not be VK_FORMAT_UNDEFINED 2199e5c31af7Sopenharmony_ci * [[VUID-VkAttachmentDescription-format-06700]] 2200e5c31af7Sopenharmony_ci If pname:format includes a stencil component and pname:stencilLoadOp is 2201e5c31af7Sopenharmony_ci ename:VK_ATTACHMENT_LOAD_OP_LOAD, then pname:initialLayout must: not be 2202e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_UNDEFINED 2203e5c31af7Sopenharmony_ci * [[VUID-VkAttachmentDescription-format-03292]] 2204e5c31af7Sopenharmony_ci If pname:format is a depth/stencil format which includes only the 2205e5c31af7Sopenharmony_ci stencil component, pname:initialLayout must: not be 2206e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL or 2207e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL 2208e5c31af7Sopenharmony_ci * [[VUID-VkAttachmentDescription-format-03293]] 2209e5c31af7Sopenharmony_ci If pname:format is a depth/stencil format which includes only the 2210e5c31af7Sopenharmony_ci stencil component, pname:finalLayout must: not be 2211e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL or 2212e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL 2213e5c31af7Sopenharmony_ci * [[VUID-VkAttachmentDescription-format-06242]] 2214e5c31af7Sopenharmony_ci If pname:format is a depth/stencil format which includes both depth and 2215e5c31af7Sopenharmony_ci stencil components, pname:initialLayout must: not be 2216e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL or 2217e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL 2218e5c31af7Sopenharmony_ci * [[VUID-VkAttachmentDescription-format-06243]] 2219e5c31af7Sopenharmony_ci If pname:format is a depth/stencil format which includes both depth and 2220e5c31af7Sopenharmony_ci stencil components, pname:finalLayout must: not be 2221e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL or 2222e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL 2223e5c31af7Sopenharmony_ci**** 2224e5c31af7Sopenharmony_ci 2225e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkAttachmentDescription.adoc[] 2226e5c31af7Sopenharmony_ci-- 2227e5c31af7Sopenharmony_ci 2228e5c31af7Sopenharmony_ci[open,refpage='VkAttachmentDescriptionFlagBits',desc='Bitmask specifying additional properties of an attachment',type='enums'] 2229e5c31af7Sopenharmony_ci-- 2230e5c31af7Sopenharmony_ciBits which can: be set in slink:VkAttachmentDescription::pname:flags, 2231e5c31af7Sopenharmony_cidescribing additional properties of the attachment, are: 2232e5c31af7Sopenharmony_ci 2233e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkAttachmentDescriptionFlagBits.adoc[] 2234e5c31af7Sopenharmony_ci 2235e5c31af7Sopenharmony_ci * ename:VK_ATTACHMENT_DESCRIPTION_MAY_ALIAS_BIT specifies that the 2236e5c31af7Sopenharmony_ci attachment aliases the same device memory as other attachments. 2237e5c31af7Sopenharmony_ci-- 2238e5c31af7Sopenharmony_ci 2239e5c31af7Sopenharmony_ci[open,refpage='VkAttachmentDescriptionFlags',desc='Bitmask of VkAttachmentDescriptionFlagBits',type='flags'] 2240e5c31af7Sopenharmony_ci-- 2241e5c31af7Sopenharmony_ciinclude::{generated}/api/flags/VkAttachmentDescriptionFlags.adoc[] 2242e5c31af7Sopenharmony_ci 2243e5c31af7Sopenharmony_citname:VkAttachmentDescriptionFlags is a bitmask type for setting a mask of 2244e5c31af7Sopenharmony_cizero or more elink:VkAttachmentDescriptionFlagBits. 2245e5c31af7Sopenharmony_ci-- 2246e5c31af7Sopenharmony_ci 2247e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_maintenance2[] 2248e5c31af7Sopenharmony_ci[open,refpage='VkRenderPassInputAttachmentAspectCreateInfo',desc='Structure specifying, for a given subpass/input attachment pair, which aspect can: be read.',type='structs'] 2249e5c31af7Sopenharmony_ci-- 2250e5c31af7Sopenharmony_ciThe sname:VkRenderPassInputAttachmentAspectCreateInfo structure is defined 2251e5c31af7Sopenharmony_cias: 2252e5c31af7Sopenharmony_ci 2253e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkRenderPassInputAttachmentAspectCreateInfo.adoc[] 2254e5c31af7Sopenharmony_ci 2255e5c31af7Sopenharmony_ciifdef::VK_KHR_maintenance2[] 2256e5c31af7Sopenharmony_cior the equivalent 2257e5c31af7Sopenharmony_ci 2258e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkRenderPassInputAttachmentAspectCreateInfoKHR.adoc[] 2259e5c31af7Sopenharmony_ciendif::VK_KHR_maintenance2[] 2260e5c31af7Sopenharmony_ci 2261e5c31af7Sopenharmony_ci * pname:sType is a elink:VkStructureType value identifying this structure. 2262e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 2263e5c31af7Sopenharmony_ci structure. 2264e5c31af7Sopenharmony_ci * pname:aspectReferenceCount is the number of elements in the 2265e5c31af7Sopenharmony_ci pname:pAspectReferences array. 2266e5c31af7Sopenharmony_ci * pname:pAspectReferences is a pointer to an array of 2267e5c31af7Sopenharmony_ci pname:aspectReferenceCount slink:VkInputAttachmentAspectReference 2268e5c31af7Sopenharmony_ci structures containing a mask describing which aspect(s) can: be accessed 2269e5c31af7Sopenharmony_ci for a given input attachment within a given subpass. 2270e5c31af7Sopenharmony_ci 2271e5c31af7Sopenharmony_ciTo specify which aspects of an input attachment can: be read, add a 2272e5c31af7Sopenharmony_cislink:VkRenderPassInputAttachmentAspectCreateInfo structure to the 2273e5c31af7Sopenharmony_cipname:pNext chain of the slink:VkRenderPassCreateInfo structure: 2274e5c31af7Sopenharmony_ci 2275e5c31af7Sopenharmony_ciAn application can: access any aspect of an input attachment that does not 2276e5c31af7Sopenharmony_cihave a specified aspect mask in the pname:pAspectReferences array. 2277e5c31af7Sopenharmony_ciOtherwise, an application must: not access aspect(s) of an input attachment 2278e5c31af7Sopenharmony_ciother than those in its specified aspect mask. 2279e5c31af7Sopenharmony_ci 2280e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkRenderPassInputAttachmentAspectCreateInfo.adoc[] 2281e5c31af7Sopenharmony_ci-- 2282e5c31af7Sopenharmony_ci 2283e5c31af7Sopenharmony_ci[open,refpage='VkInputAttachmentAspectReference',desc='Structure specifying a subpass/input attachment pair and an aspect mask that can: be read.',type='structs'] 2284e5c31af7Sopenharmony_ci-- 2285e5c31af7Sopenharmony_ciThe sname:VkInputAttachmentAspectReference structure is defined as: 2286e5c31af7Sopenharmony_ci 2287e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkInputAttachmentAspectReference.adoc[] 2288e5c31af7Sopenharmony_ci 2289e5c31af7Sopenharmony_ciifdef::VK_KHR_maintenance2[] 2290e5c31af7Sopenharmony_cior the equivalent 2291e5c31af7Sopenharmony_ci 2292e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkInputAttachmentAspectReferenceKHR.adoc[] 2293e5c31af7Sopenharmony_ciendif::VK_KHR_maintenance2[] 2294e5c31af7Sopenharmony_ci 2295e5c31af7Sopenharmony_ci * pname:subpass is an index into the pname:pSubpasses array of the parent 2296e5c31af7Sopenharmony_ci sname:VkRenderPassCreateInfo structure. 2297e5c31af7Sopenharmony_ci * pname:inputAttachmentIndex is an index into the pname:pInputAttachments 2298e5c31af7Sopenharmony_ci of the specified subpass. 2299e5c31af7Sopenharmony_ci * pname:aspectMask is a mask of which aspect(s) can: be accessed within 2300e5c31af7Sopenharmony_ci the specified subpass. 2301e5c31af7Sopenharmony_ci 2302e5c31af7Sopenharmony_ciThis structure specifies an aspect mask for a specific input attachment of a 2303e5c31af7Sopenharmony_cispecific subpass in the render pass. 2304e5c31af7Sopenharmony_ci 2305e5c31af7Sopenharmony_cipname:subpass and pname:inputAttachmentIndex index into the render pass as: 2306e5c31af7Sopenharmony_ci 2307e5c31af7Sopenharmony_ci[source,c] 2308e5c31af7Sopenharmony_ci---- 2309e5c31af7Sopenharmony_cipCreateInfo->pSubpasses[subpass].pInputAttachments[inputAttachmentIndex] 2310e5c31af7Sopenharmony_ci---- 2311e5c31af7Sopenharmony_ci 2312e5c31af7Sopenharmony_ci.Valid Usage 2313e5c31af7Sopenharmony_ci**** 2314e5c31af7Sopenharmony_ci * [[VUID-VkInputAttachmentAspectReference-aspectMask-01964]] 2315e5c31af7Sopenharmony_ci pname:aspectMask must: not include ename:VK_IMAGE_ASPECT_METADATA_BIT 2316e5c31af7Sopenharmony_ciifdef::VK_EXT_image_drm_format_modifier[] 2317e5c31af7Sopenharmony_ci * [[VUID-VkInputAttachmentAspectReference-aspectMask-02250]] 2318e5c31af7Sopenharmony_ci pname:aspectMask must: not include 2319e5c31af7Sopenharmony_ci `VK_IMAGE_ASPECT_MEMORY_PLANE__{ibit}__BIT_EXT` for any index _i_ 2320e5c31af7Sopenharmony_ciendif::VK_EXT_image_drm_format_modifier[] 2321e5c31af7Sopenharmony_ci**** 2322e5c31af7Sopenharmony_ci 2323e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkInputAttachmentAspectReference.adoc[] 2324e5c31af7Sopenharmony_ci-- 2325e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_maintenance2[] 2326e5c31af7Sopenharmony_ci 2327e5c31af7Sopenharmony_ci[open,refpage='VkSubpassDescription',desc='Structure specifying a subpass description',type='structs'] 2328e5c31af7Sopenharmony_ci-- 2329e5c31af7Sopenharmony_ci:refpage: VkSubpassDescription 2330e5c31af7Sopenharmony_ci 2331e5c31af7Sopenharmony_ciThe sname:VkSubpassDescription structure is defined as: 2332e5c31af7Sopenharmony_ci 2333e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkSubpassDescription.adoc[] 2334e5c31af7Sopenharmony_ci 2335e5c31af7Sopenharmony_ci * pname:flags is a bitmask of elink:VkSubpassDescriptionFlagBits 2336e5c31af7Sopenharmony_ci specifying usage of the subpass. 2337e5c31af7Sopenharmony_ci * pname:pipelineBindPoint is a elink:VkPipelineBindPoint value specifying 2338e5c31af7Sopenharmony_ci the pipeline type supported for this subpass. 2339e5c31af7Sopenharmony_ci * pname:inputAttachmentCount is the number of input attachments. 2340e5c31af7Sopenharmony_ci * pname:pInputAttachments is a pointer to an array of 2341e5c31af7Sopenharmony_ci slink:VkAttachmentReference structures defining the input attachments 2342e5c31af7Sopenharmony_ci for this subpass and their layouts. 2343e5c31af7Sopenharmony_ci * pname:colorAttachmentCount is the number of color attachments. 2344e5c31af7Sopenharmony_ci * pname:pColorAttachments is a pointer to an array of 2345e5c31af7Sopenharmony_ci pname:colorAttachmentCount slink:VkAttachmentReference structures 2346e5c31af7Sopenharmony_ci defining the color attachments for this subpass and their layouts. 2347e5c31af7Sopenharmony_ci * pname:pResolveAttachments is `NULL` or a pointer to an array of 2348e5c31af7Sopenharmony_ci pname:colorAttachmentCount slink:VkAttachmentReference structures 2349e5c31af7Sopenharmony_ci defining the resolve attachments for this subpass and their layouts. 2350e5c31af7Sopenharmony_ci * pname:pDepthStencilAttachment is a pointer to a 2351e5c31af7Sopenharmony_ci slink:VkAttachmentReference structure specifying the depth/stencil 2352e5c31af7Sopenharmony_ci attachment for this subpass and its layout. 2353e5c31af7Sopenharmony_ci * pname:preserveAttachmentCount is the number of preserved attachments. 2354e5c31af7Sopenharmony_ci * pname:pPreserveAttachments is a pointer to an array of 2355e5c31af7Sopenharmony_ci pname:preserveAttachmentCount render pass attachment indices identifying 2356e5c31af7Sopenharmony_ci attachments that are not used by this subpass, but whose contents must: 2357e5c31af7Sopenharmony_ci be preserved throughout the subpass. 2358e5c31af7Sopenharmony_ci 2359e5c31af7Sopenharmony_ciEach element of the pname:pInputAttachments array corresponds to an input 2360e5c31af7Sopenharmony_ciattachment index in a fragment shader, i.e. if a shader declares an image 2361e5c31af7Sopenharmony_civariable decorated with a code:InputAttachmentIndex value of *X*, then it 2362e5c31af7Sopenharmony_ciuses the attachment provided in pname:pInputAttachments[*X*]. 2363e5c31af7Sopenharmony_ciInput attachments must: also be bound to the pipeline in a descriptor set. 2364e5c31af7Sopenharmony_ciIf the pname:attachment member of any element of pname:pInputAttachments is 2365e5c31af7Sopenharmony_ciename:VK_ATTACHMENT_UNUSED, the application must: not read from the 2366e5c31af7Sopenharmony_cicorresponding input attachment index. 2367e5c31af7Sopenharmony_ciFragment shaders can: use subpass input variables to access the contents of 2368e5c31af7Sopenharmony_cian input attachment at the fragment's (x, y, layer) framebuffer coordinates. 2369e5c31af7Sopenharmony_ciifdef::VK_QCOM_render_pass_transform[] 2370e5c31af7Sopenharmony_ciInput attachments must: not be used by any subpasses within a render pass 2371e5c31af7Sopenharmony_cithat enables <<vertexpostproc-renderpass-transform, render pass transform>>. 2372e5c31af7Sopenharmony_ciendif::VK_QCOM_render_pass_transform[] 2373e5c31af7Sopenharmony_ci 2374e5c31af7Sopenharmony_ciEach element of the pname:pColorAttachments array corresponds to an output 2375e5c31af7Sopenharmony_cilocation in the shader, i.e. if the shader declares an output variable 2376e5c31af7Sopenharmony_cidecorated with a code:Location value of *X*, then it uses the attachment 2377e5c31af7Sopenharmony_ciprovided in pname:pColorAttachments[*X*]. 2378e5c31af7Sopenharmony_ciIf the pname:attachment member of any element of pname:pColorAttachments is 2379e5c31af7Sopenharmony_ciename:VK_ATTACHMENT_UNUSED, 2380e5c31af7Sopenharmony_ciifdef::VK_EXT_color_write_enable[] 2381e5c31af7Sopenharmony_cior if <<framebuffer-color-write-enable,Color Write Enable>> has been 2382e5c31af7Sopenharmony_cidisabled for the corresponding attachment index, 2383e5c31af7Sopenharmony_ciendif::VK_EXT_color_write_enable[] 2384e5c31af7Sopenharmony_cithen writes to the corresponding location by a fragment shader are 2385e5c31af7Sopenharmony_cidiscarded. 2386e5c31af7Sopenharmony_ci 2387e5c31af7Sopenharmony_ciIf 2388e5c31af7Sopenharmony_ciifdef::VK_QCOM_render_pass_shader_resolve[] 2389e5c31af7Sopenharmony_cipname:flags does not include 2390e5c31af7Sopenharmony_ciename:VK_SUBPASS_DESCRIPTION_SHADER_RESOLVE_BIT_QCOM, and if 2391e5c31af7Sopenharmony_ciendif::VK_QCOM_render_pass_shader_resolve[] 2392e5c31af7Sopenharmony_cipname:pResolveAttachments is not `NULL`, each of its elements corresponds to 2393e5c31af7Sopenharmony_cia color attachment (the element in pname:pColorAttachments at the same 2394e5c31af7Sopenharmony_ciindex), and a <<renderpass-resolve-operations,multisample resolve 2395e5c31af7Sopenharmony_cioperation>> is defined for each attachment unless the resolve attachment 2396e5c31af7Sopenharmony_ciindex is ename:VK_ATTACHMENT_UNUSED. 2397e5c31af7Sopenharmony_ci 2398e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_KHR_depth_stencil_resolve[] 2399e5c31af7Sopenharmony_ciSimilarly, if 2400e5c31af7Sopenharmony_ciifdef::VK_QCOM_render_pass_shader_resolve[] 2401e5c31af7Sopenharmony_cipname:flags does not include 2402e5c31af7Sopenharmony_ciename:VK_SUBPASS_DESCRIPTION_SHADER_RESOLVE_BIT_QCOM, and 2403e5c31af7Sopenharmony_ciendif::VK_QCOM_render_pass_shader_resolve[] 2404e5c31af7Sopenharmony_cislink:VkSubpassDescriptionDepthStencilResolve::pname:pDepthStencilResolveAttachment 2405e5c31af7Sopenharmony_ciis not `NULL` and does not have the value ename:VK_ATTACHMENT_UNUSED, it 2406e5c31af7Sopenharmony_cicorresponds to the depth/stencil attachment in 2407e5c31af7Sopenharmony_cipname:pDepthStencilAttachment, and 2408e5c31af7Sopenharmony_ci<<renderpass-resolve-operations,multisample resolve operation>> for depth 2409e5c31af7Sopenharmony_ciand stencil are defined by 2410e5c31af7Sopenharmony_cislink:VkSubpassDescriptionDepthStencilResolve::pname:depthResolveMode and 2411e5c31af7Sopenharmony_cislink:VkSubpassDescriptionDepthStencilResolve::pname:stencilResolveMode, 2412e5c31af7Sopenharmony_cirespectively. 2413e5c31af7Sopenharmony_ciIf slink:VkSubpassDescriptionDepthStencilResolve::pname:depthResolveMode is 2414e5c31af7Sopenharmony_ciename:VK_RESOLVE_MODE_NONE or the pname:pDepthStencilResolveAttachment does 2415e5c31af7Sopenharmony_cinot have a depth aspect, no resolve operation is performed for the depth 2416e5c31af7Sopenharmony_ciattachment. 2417e5c31af7Sopenharmony_ciIf slink:VkSubpassDescriptionDepthStencilResolve::pname:stencilResolveMode 2418e5c31af7Sopenharmony_ciis ename:VK_RESOLVE_MODE_NONE or the pname:pDepthStencilResolveAttachment 2419e5c31af7Sopenharmony_cidoes not have a stencil aspect, no resolve operation is performed for the 2420e5c31af7Sopenharmony_cistencil attachment. 2421e5c31af7Sopenharmony_ci 2422e5c31af7Sopenharmony_ciifdef::VK_EXT_sample_locations[] 2423e5c31af7Sopenharmony_ciIf the image subresource range referenced by the depth/stencil attachment is 2424e5c31af7Sopenharmony_cicreated with 2425e5c31af7Sopenharmony_ciename:VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT, then the 2426e5c31af7Sopenharmony_ci<<renderpass-resolve-operations,multisample resolve operation>> uses the 2427e5c31af7Sopenharmony_cisample locations state specified in the pname:sampleLocationsInfo member of 2428e5c31af7Sopenharmony_cithe element of the 2429e5c31af7Sopenharmony_cisname:VkRenderPassSampleLocationsBeginInfoEXT::pname:pPostSubpassSampleLocations 2430e5c31af7Sopenharmony_cifor the subpass. 2431e5c31af7Sopenharmony_ciendif::VK_EXT_sample_locations[] 2432e5c31af7Sopenharmony_ci 2433e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_KHR_depth_stencil_resolve[] 2434e5c31af7Sopenharmony_ci 2435e5c31af7Sopenharmony_ciIf pname:pDepthStencilAttachment is `NULL`, or if its attachment index is 2436e5c31af7Sopenharmony_ciename:VK_ATTACHMENT_UNUSED, it indicates that no depth/stencil attachment 2437e5c31af7Sopenharmony_ciwill be used in the subpass. 2438e5c31af7Sopenharmony_ci 2439e5c31af7Sopenharmony_ci[[renderpass-attachment-contents]] 2440e5c31af7Sopenharmony_ciThe contents of an attachment within the render area become undefined: at 2441e5c31af7Sopenharmony_cithe start of a subpass *S* if all of the following conditions are true: 2442e5c31af7Sopenharmony_ci 2443e5c31af7Sopenharmony_ci * The attachment is used as a color, depth/stencil, or resolve attachment 2444e5c31af7Sopenharmony_ci in any subpass in the render pass. 2445e5c31af7Sopenharmony_ci * There is a subpass *S~1~* that uses or preserves the attachment, and a 2446e5c31af7Sopenharmony_ci subpass dependency from *S~1~* to *S*. 2447e5c31af7Sopenharmony_ci * The attachment is not used or preserved in subpass *S*. 2448e5c31af7Sopenharmony_ci 2449e5c31af7Sopenharmony_ciifdef::VK_QCOM_render_pass_shader_resolve[] 2450e5c31af7Sopenharmony_ciIn addition, the contents of an attachment within the render area become 2451e5c31af7Sopenharmony_ciundefined: at the start of a subpass *S* if all of the following conditions 2452e5c31af7Sopenharmony_ciare true: 2453e5c31af7Sopenharmony_ci 2454e5c31af7Sopenharmony_ci * ename:VK_SUBPASS_DESCRIPTION_SHADER_RESOLVE_BIT_QCOM is set. 2455e5c31af7Sopenharmony_ci * The attachment is used as a color or depth/stencil in the subpass. 2456e5c31af7Sopenharmony_ciendif::VK_QCOM_render_pass_shader_resolve[] 2457e5c31af7Sopenharmony_ci 2458e5c31af7Sopenharmony_ciOnce the contents of an attachment become undefined: in subpass *S*, they 2459e5c31af7Sopenharmony_ciremain undefined: for subpasses in subpass dependency chains starting with 2460e5c31af7Sopenharmony_cisubpass *S* until they are written again. 2461e5c31af7Sopenharmony_ciHowever, they remain valid for subpasses in other subpass dependency chains 2462e5c31af7Sopenharmony_cistarting with subpass *S~1~* if those subpasses use or preserve the 2463e5c31af7Sopenharmony_ciattachment. 2464e5c31af7Sopenharmony_ci 2465e5c31af7Sopenharmony_ci.Valid Usage 2466e5c31af7Sopenharmony_ci**** 2467e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/subpass_description_common.adoc[] 2468e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescription-pipelineBindPoint-04952]] 2469e5c31af7Sopenharmony_ci pname:pipelineBindPoint must: be ename:VK_PIPELINE_BIND_POINT_GRAPHICS 2470e5c31af7Sopenharmony_ciifdef::VK_HUAWEI_subpass_shading[] 2471e5c31af7Sopenharmony_ci or ename:VK_PIPELINE_BIND_POINT_SUBPASS_SHADING_HUAWEI 2472e5c31af7Sopenharmony_ciendif::VK_HUAWEI_subpass_shading[] 2473e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescription-colorAttachmentCount-00845]] 2474e5c31af7Sopenharmony_ci pname:colorAttachmentCount must: be less than or equal to 2475e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceLimits::pname:maxColorAttachments 2476e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescription-loadOp-00846]] 2477e5c31af7Sopenharmony_ci If the first use of an attachment in this render pass is as an input 2478e5c31af7Sopenharmony_ci attachment, and the attachment is not also used as a color or 2479e5c31af7Sopenharmony_ci depth/stencil attachment in the same subpass, then pname:loadOp must: 2480e5c31af7Sopenharmony_ci not be ename:VK_ATTACHMENT_LOAD_OP_CLEAR 2481e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescription-pResolveAttachments-00847]] 2482e5c31af7Sopenharmony_ci If pname:pResolveAttachments is not `NULL`, for each resolve attachment 2483e5c31af7Sopenharmony_ci that is not ename:VK_ATTACHMENT_UNUSED, the corresponding color 2484e5c31af7Sopenharmony_ci attachment must: not be ename:VK_ATTACHMENT_UNUSED 2485e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescription-pResolveAttachments-00848]] 2486e5c31af7Sopenharmony_ci If pname:pResolveAttachments is not `NULL`, for each resolve attachment 2487e5c31af7Sopenharmony_ci that is not ename:VK_ATTACHMENT_UNUSED, the corresponding color 2488e5c31af7Sopenharmony_ci attachment must: not have a sample count of ename:VK_SAMPLE_COUNT_1_BIT 2489e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescription-pResolveAttachments-00849]] 2490e5c31af7Sopenharmony_ci If pname:pResolveAttachments is not `NULL`, each resolve attachment that 2491e5c31af7Sopenharmony_ci is not ename:VK_ATTACHMENT_UNUSED must: have a sample count of 2492e5c31af7Sopenharmony_ci ename:VK_SAMPLE_COUNT_1_BIT 2493e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescription-pResolveAttachments-00850]] 2494e5c31af7Sopenharmony_ci If pname:pResolveAttachments is not `NULL`, each resolve attachment that 2495e5c31af7Sopenharmony_ci is not ename:VK_ATTACHMENT_UNUSED must: have the same elink:VkFormat as 2496e5c31af7Sopenharmony_ci its corresponding color attachment 2497e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescription-pColorAttachments-09430]] 2498e5c31af7Sopenharmony_ci All attachments in pname:pColorAttachments that are not 2499e5c31af7Sopenharmony_ci ename:VK_ATTACHMENT_UNUSED must: have the same sample count 2500e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescription-pInputAttachments-02647]] 2501e5c31af7Sopenharmony_ci All attachments in pname:pInputAttachments that are not 2502e5c31af7Sopenharmony_ci ename:VK_ATTACHMENT_UNUSED must: have image formats whose 2503e5c31af7Sopenharmony_ci <<potential-format-features, potential format features>> contain at 2504e5c31af7Sopenharmony_ci least ename:VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT or 2505e5c31af7Sopenharmony_ci ename:VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT 2506e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescription-pColorAttachments-02648]] 2507e5c31af7Sopenharmony_ci All attachments in pname:pColorAttachments that are not 2508e5c31af7Sopenharmony_ci ename:VK_ATTACHMENT_UNUSED must: have image formats whose 2509e5c31af7Sopenharmony_ci <<potential-format-features, potential format features>> contain 2510e5c31af7Sopenharmony_ci ename:VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT 2511e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescription-pResolveAttachments-02649]] 2512e5c31af7Sopenharmony_ci All attachments in pname:pResolveAttachments that are not 2513e5c31af7Sopenharmony_ci ename:VK_ATTACHMENT_UNUSED must: have image formats whose 2514e5c31af7Sopenharmony_ci <<potential-format-features, potential format features>> contain 2515e5c31af7Sopenharmony_ci ename:VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT 2516e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescription-pDepthStencilAttachment-02650]] 2517e5c31af7Sopenharmony_ci If pname:pDepthStencilAttachment is not `NULL` and the attachment is not 2518e5c31af7Sopenharmony_ci ename:VK_ATTACHMENT_UNUSED then it must: have an image format whose 2519e5c31af7Sopenharmony_ci <<potential-format-features, potential format features>> contain 2520e5c31af7Sopenharmony_ci ename:VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT 2521e5c31af7Sopenharmony_ciifdef::VK_NV_linear_color_attachment[] 2522e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescription-linearColorAttachment-06496]] 2523e5c31af7Sopenharmony_ci If the <<features-linearColorAttachment, pname:linearColorAttachment>> 2524e5c31af7Sopenharmony_ci feature is enabled and the image is created with 2525e5c31af7Sopenharmony_ci ename:VK_IMAGE_TILING_LINEAR, all attachments in pname:pInputAttachments 2526e5c31af7Sopenharmony_ci that are not ename:VK_ATTACHMENT_UNUSED must: have image formats whose 2527e5c31af7Sopenharmony_ci <<potential-format-features, potential format features>> must: contain 2528e5c31af7Sopenharmony_ci ename:VK_FORMAT_FEATURE_2_LINEAR_COLOR_ATTACHMENT_BIT_NV 2529e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescription-linearColorAttachment-06497]] 2530e5c31af7Sopenharmony_ci If the <<features-linearColorAttachment, pname:linearColorAttachment>> 2531e5c31af7Sopenharmony_ci feature is enabled and the image is created with 2532e5c31af7Sopenharmony_ci ename:VK_IMAGE_TILING_LINEAR, all attachments in pname:pColorAttachments 2533e5c31af7Sopenharmony_ci that are not ename:VK_ATTACHMENT_UNUSED must: have image formats whose 2534e5c31af7Sopenharmony_ci <<potential-format-features, potential format features>> must: contain 2535e5c31af7Sopenharmony_ci ename:VK_FORMAT_FEATURE_2_LINEAR_COLOR_ATTACHMENT_BIT_NV 2536e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescription-linearColorAttachment-06498]] 2537e5c31af7Sopenharmony_ci If the <<features-linearColorAttachment, pname:linearColorAttachment>> 2538e5c31af7Sopenharmony_ci feature is enabled and the image is created with 2539e5c31af7Sopenharmony_ci ename:VK_IMAGE_TILING_LINEAR, all attachments in 2540e5c31af7Sopenharmony_ci pname:pResolveAttachments that are not ename:VK_ATTACHMENT_UNUSED must: 2541e5c31af7Sopenharmony_ci have image formats whose <<potential-format-features, potential format 2542e5c31af7Sopenharmony_ci features>> must: contain 2543e5c31af7Sopenharmony_ci ename:VK_FORMAT_FEATURE_2_LINEAR_COLOR_ATTACHMENT_BIT_NV 2544e5c31af7Sopenharmony_ciendif::VK_NV_linear_color_attachment[] 2545e5c31af7Sopenharmony_ciifdef::VK_AMD_mixed_attachment_samples,VK_NV_framebuffer_mixed_samples[] 2546e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescription-None-09431]] 2547e5c31af7Sopenharmony_ci If either of the following is enabled: 2548e5c31af7Sopenharmony_ciifdef::VK_AMD_mixed_attachment_samples[] 2549e5c31af7Sopenharmony_ci ** The `apiext:VK_AMD_mixed_attachment_samples` extension 2550e5c31af7Sopenharmony_ciendif::VK_AMD_mixed_attachment_samples[] 2551e5c31af7Sopenharmony_ciifdef::VK_NV_framebuffer_mixed_samples[] 2552e5c31af7Sopenharmony_ci ** The `apiext:VK_NV_framebuffer_mixed_samples` extension 2553e5c31af7Sopenharmony_ciendif::VK_NV_framebuffer_mixed_samples[] 2554e5c31af7Sopenharmony_ci 2555e5c31af7Sopenharmony_ci+ 2556e5c31af7Sopenharmony_ciall attachments in pname:pColorAttachments that are not 2557e5c31af7Sopenharmony_ciename:VK_ATTACHMENT_UNUSED must: have a sample count that is smaller than or 2558e5c31af7Sopenharmony_ciequal to the sample count of pname:pDepthStencilAttachment if it is not 2559e5c31af7Sopenharmony_ciename:VK_ATTACHMENT_UNUSED 2560e5c31af7Sopenharmony_ciendif::VK_AMD_mixed_attachment_samples,VK_NV_framebuffer_mixed_samples[] 2561e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescription-pDepthStencilAttachment-01418]] 2562e5c31af7Sopenharmony_ci If pname:pDepthStencilAttachment is not ename:VK_ATTACHMENT_UNUSED and 2563e5c31af7Sopenharmony_ci any attachments in pname:pColorAttachments are not 2564e5c31af7Sopenharmony_ci ename:VK_ATTACHMENT_UNUSED, they must: have the same sample count 2565e5c31af7Sopenharmony_ciifdef::VK_AMD_mixed_attachment_samples,VK_NV_framebuffer_mixed_samples[] 2566e5c31af7Sopenharmony_ci , if none of the following are enabled: 2567e5c31af7Sopenharmony_ciifdef::VK_AMD_mixed_attachment_samples[] 2568e5c31af7Sopenharmony_ci ** The `apiext:VK_AMD_mixed_attachment_samples` extension 2569e5c31af7Sopenharmony_ciendif::VK_AMD_mixed_attachment_samples[] 2570e5c31af7Sopenharmony_ciifdef::VK_NV_framebuffer_mixed_samples[] 2571e5c31af7Sopenharmony_ci ** The `apiext:VK_NV_framebuffer_mixed_samples` extension 2572e5c31af7Sopenharmony_ciendif::VK_NV_framebuffer_mixed_samples[] 2573e5c31af7Sopenharmony_ciendif::VK_AMD_mixed_attachment_samples,VK_NV_framebuffer_mixed_samples[] 2574e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescription-attachment-00853]] 2575e5c31af7Sopenharmony_ci Each element of pname:pPreserveAttachments must: not be 2576e5c31af7Sopenharmony_ci ename:VK_ATTACHMENT_UNUSED 2577e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescription-pPreserveAttachments-00854]] 2578e5c31af7Sopenharmony_ci Each element of pname:pPreserveAttachments must: not also be an element 2579e5c31af7Sopenharmony_ci of any other member of the subpass description 2580e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescription-layout-02519]] 2581e5c31af7Sopenharmony_ci If any attachment is used by more than one slink:VkAttachmentReference 2582e5c31af7Sopenharmony_ci member, then each use must: use the same pname:layout 2583e5c31af7Sopenharmony_ciifdef::VK_NVX_multiview_per_view_attributes[] 2584e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescription-flags-00856]] 2585e5c31af7Sopenharmony_ci If pname:flags includes 2586e5c31af7Sopenharmony_ci ename:VK_SUBPASS_DESCRIPTION_PER_VIEW_POSITION_X_ONLY_BIT_NVX, it must: 2587e5c31af7Sopenharmony_ci also include ename:VK_SUBPASS_DESCRIPTION_PER_VIEW_ATTRIBUTES_BIT_NVX 2588e5c31af7Sopenharmony_ciendif::VK_NVX_multiview_per_view_attributes[] 2589e5c31af7Sopenharmony_ciifdef::VK_QCOM_render_pass_shader_resolve[] 2590e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescription-flags-03341]] 2591e5c31af7Sopenharmony_ci If pname:flags includes 2592e5c31af7Sopenharmony_ci ename:VK_SUBPASS_DESCRIPTION_SHADER_RESOLVE_BIT_QCOM, and if 2593e5c31af7Sopenharmony_ci pname:pResolveAttachments is not `NULL`, then each resolve attachment 2594e5c31af7Sopenharmony_ci must: be ename:VK_ATTACHMENT_UNUSED 2595e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescription-flags-03343]] 2596e5c31af7Sopenharmony_ci If pname:flags includes 2597e5c31af7Sopenharmony_ci ename:VK_SUBPASS_DESCRIPTION_SHADER_RESOLVE_BIT_QCOM, then the subpass 2598e5c31af7Sopenharmony_ci must: be the last subpass in a subpass dependency chain 2599e5c31af7Sopenharmony_ciendif::VK_QCOM_render_pass_shader_resolve[] 2600e5c31af7Sopenharmony_ciifdef::VK_QCOM_render_pass_transform[] 2601e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescription-pInputAttachments-02868]] 2602e5c31af7Sopenharmony_ci If the render pass is created with 2603e5c31af7Sopenharmony_ci ename:VK_RENDER_PASS_CREATE_TRANSFORM_BIT_QCOM each of the elements of 2604e5c31af7Sopenharmony_ci pname:pInputAttachments must: be ename:VK_ATTACHMENT_UNUSED 2605e5c31af7Sopenharmony_ciendif::VK_QCOM_render_pass_transform[] 2606e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescription-pDepthStencilAttachment-04438]] 2607e5c31af7Sopenharmony_ci pname:pDepthStencilAttachment and pname:pColorAttachments must: not 2608e5c31af7Sopenharmony_ci contain references to the same attachment 2609e5c31af7Sopenharmony_ciifdef::VKSC_VERSION_1_0[] 2610e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescription-inputAttachmentCount-05053]] 2611e5c31af7Sopenharmony_ci pname:inputAttachmentCount must: be less than or equal to 2612e5c31af7Sopenharmony_ci <<limits-maxSubpassInputAttachments,maxSubpassInputAttachments>> 2613e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescription-preserveAttachmentCount-05054]] 2614e5c31af7Sopenharmony_ci pname:preserveAttachmentCount must: be less than or equal to 2615e5c31af7Sopenharmony_ci <<limits-maxSubpassPreserveAttachments,maxSubpassPreserveAttachments>> 2616e5c31af7Sopenharmony_ciendif::VKSC_VERSION_1_0[] 2617e5c31af7Sopenharmony_ci**** 2618e5c31af7Sopenharmony_ci 2619e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkSubpassDescription.adoc[] 2620e5c31af7Sopenharmony_ci-- 2621e5c31af7Sopenharmony_ci 2622e5c31af7Sopenharmony_ci[open,refpage='VkSubpassDescriptionFlagBits',desc='Bitmask specifying usage of a subpass',type='enums'] 2623e5c31af7Sopenharmony_ci-- 2624e5c31af7Sopenharmony_ciBits which can: be set in slink:VkSubpassDescription::pname:flags, 2625e5c31af7Sopenharmony_cispecifying usage of the subpass, are: 2626e5c31af7Sopenharmony_ci 2627e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkSubpassDescriptionFlagBits.adoc[] 2628e5c31af7Sopenharmony_ci 2629e5c31af7Sopenharmony_ciifdef::VK_NVX_multiview_per_view_attributes[] 2630e5c31af7Sopenharmony_ci * ename:VK_SUBPASS_DESCRIPTION_PER_VIEW_ATTRIBUTES_BIT_NVX specifies that 2631e5c31af7Sopenharmony_ci shaders compiled for this subpass write the attributes for all views in 2632e5c31af7Sopenharmony_ci a single invocation of each 2633e5c31af7Sopenharmony_ci <<pipelines-graphics-subsets-pre-rasterization,pre-rasterization shader 2634e5c31af7Sopenharmony_ci stage>>. 2635e5c31af7Sopenharmony_ci All pipelines compiled against a subpass that includes this bit must: 2636e5c31af7Sopenharmony_ci write per-view attributes to the `*PerViewNV[]` shader outputs, in 2637e5c31af7Sopenharmony_ci addition to the non-per-view (e.g. code:Position) outputs. 2638e5c31af7Sopenharmony_ci * ename:VK_SUBPASS_DESCRIPTION_PER_VIEW_POSITION_X_ONLY_BIT_NVX specifies 2639e5c31af7Sopenharmony_ci that shaders compiled for this subpass use per-view positions which only 2640e5c31af7Sopenharmony_ci differ in value in the x component. 2641e5c31af7Sopenharmony_ci Per-view viewport mask can: also be used. 2642e5c31af7Sopenharmony_ciendif::VK_NVX_multiview_per_view_attributes[] 2643e5c31af7Sopenharmony_ciifdef::VK_QCOM_render_pass_shader_resolve[] 2644e5c31af7Sopenharmony_ci * ename:VK_SUBPASS_DESCRIPTION_FRAGMENT_REGION_BIT_QCOM specifies that the 2645e5c31af7Sopenharmony_ci framebuffer region is the fragment region, that is, the minimum region 2646e5c31af7Sopenharmony_ci dependencies are by pixel rather than by sample, such that any fragment 2647e5c31af7Sopenharmony_ci shader invocation can: access any sample associated with that fragment 2648e5c31af7Sopenharmony_ci shader invocation. 2649e5c31af7Sopenharmony_ci * ename:VK_SUBPASS_DESCRIPTION_SHADER_RESOLVE_BIT_QCOM specifies that the 2650e5c31af7Sopenharmony_ci subpass performs shader resolve operations. 2651e5c31af7Sopenharmony_ciendif::VK_QCOM_render_pass_shader_resolve[] 2652e5c31af7Sopenharmony_ciifdef::VK_EXT_rasterization_order_attachment_access,VK_ARM_rasterization_order_attachment_access[] 2653e5c31af7Sopenharmony_ci * ename:VK_SUBPASS_DESCRIPTION_RASTERIZATION_ORDER_ATTACHMENT_COLOR_ACCESS_BIT_EXT 2654e5c31af7Sopenharmony_ci specifies that this subpass supports pipelines created with 2655e5c31af7Sopenharmony_ci ename:VK_PIPELINE_COLOR_BLEND_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_BIT_EXT. 2656e5c31af7Sopenharmony_ci * ename:VK_SUBPASS_DESCRIPTION_RASTERIZATION_ORDER_ATTACHMENT_DEPTH_ACCESS_BIT_EXT 2657e5c31af7Sopenharmony_ci specifies that this subpass supports pipelines created with 2658e5c31af7Sopenharmony_ci ename:VK_PIPELINE_DEPTH_STENCIL_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_DEPTH_ACCESS_BIT_EXT. 2659e5c31af7Sopenharmony_ci * ename:VK_SUBPASS_DESCRIPTION_RASTERIZATION_ORDER_ATTACHMENT_STENCIL_ACCESS_BIT_EXT 2660e5c31af7Sopenharmony_ci specifies that this subpass supports pipelines created with 2661e5c31af7Sopenharmony_ci ename:VK_PIPELINE_DEPTH_STENCIL_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_STENCIL_ACCESS_BIT_EXT. 2662e5c31af7Sopenharmony_ciendif::VK_EXT_rasterization_order_attachment_access,VK_ARM_rasterization_order_attachment_access[] 2663e5c31af7Sopenharmony_ciifdef::VK_EXT_legacy_dithering[] 2664e5c31af7Sopenharmony_ci * ename:VK_SUBPASS_DESCRIPTION_ENABLE_LEGACY_DITHERING_BIT_EXT specifies 2665e5c31af7Sopenharmony_ci that <<interfaces-legacy-dithering, Legacy Dithering>> is enabled for 2666e5c31af7Sopenharmony_ci this subpass. 2667e5c31af7Sopenharmony_ciendif::VK_EXT_legacy_dithering[] 2668e5c31af7Sopenharmony_ci 2669e5c31af7Sopenharmony_ciifndef::VK_NVX_multiview_per_view_attributes,VK_QCOM_render_pass_shader_resolve[] 2670e5c31af7Sopenharmony_ci[NOTE] 2671e5c31af7Sopenharmony_ci.Note 2672e5c31af7Sopenharmony_ci==== 2673e5c31af7Sopenharmony_ciAll bits for this type are defined by extensions, and none of those 2674e5c31af7Sopenharmony_ciextensions are enabled in this build of the specification. 2675e5c31af7Sopenharmony_ci==== 2676e5c31af7Sopenharmony_ciendif::VK_NVX_multiview_per_view_attributes,VK_QCOM_render_pass_shader_resolve[] 2677e5c31af7Sopenharmony_ci 2678e5c31af7Sopenharmony_ciifdef::VK_QCOM_render_pass_shader_resolve[] 2679e5c31af7Sopenharmony_ci[NOTE] 2680e5c31af7Sopenharmony_ci.Note 2681e5c31af7Sopenharmony_ci==== 2682e5c31af7Sopenharmony_ciShader resolve operations allow for custom resolve operations, but 2683e5c31af7Sopenharmony_cioverdrawing pixels may: have a performance and/or power cost. 2684e5c31af7Sopenharmony_ciFurthermore, since the content of any depth stencil attachment or color 2685e5c31af7Sopenharmony_ciattachment is undefined: at the beginning of a shader resolve subpass, any 2686e5c31af7Sopenharmony_cidepth testing, stencil testing, or blending operation which sources these 2687e5c31af7Sopenharmony_ciundefined: values also has undefined: result value. 2688e5c31af7Sopenharmony_ci==== 2689e5c31af7Sopenharmony_ciendif::VK_QCOM_render_pass_shader_resolve[] 2690e5c31af7Sopenharmony_ci-- 2691e5c31af7Sopenharmony_ci 2692e5c31af7Sopenharmony_ci[open,refpage='VkSubpassDescriptionFlags',desc='Bitmask of VkSubpassDescriptionFlagBits',type='flags'] 2693e5c31af7Sopenharmony_ci-- 2694e5c31af7Sopenharmony_ciinclude::{generated}/api/flags/VkSubpassDescriptionFlags.adoc[] 2695e5c31af7Sopenharmony_ci 2696e5c31af7Sopenharmony_citname:VkSubpassDescriptionFlags is a bitmask type for setting a mask of zero 2697e5c31af7Sopenharmony_cior more elink:VkSubpassDescriptionFlagBits. 2698e5c31af7Sopenharmony_ci-- 2699e5c31af7Sopenharmony_ci 2700e5c31af7Sopenharmony_ci[open,refpage='VkAttachmentReference',desc='Structure specifying an attachment reference',type='structs'] 2701e5c31af7Sopenharmony_ci-- 2702e5c31af7Sopenharmony_ci:refpage: VkAttachmentReference 2703e5c31af7Sopenharmony_ci 2704e5c31af7Sopenharmony_ciThe sname:VkAttachmentReference structure is defined as: 2705e5c31af7Sopenharmony_ci 2706e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkAttachmentReference.adoc[] 2707e5c31af7Sopenharmony_ci 2708e5c31af7Sopenharmony_ci * pname:attachment is either an integer value identifying an attachment at 2709e5c31af7Sopenharmony_ci the corresponding index in 2710e5c31af7Sopenharmony_ci slink:VkRenderPassCreateInfo::pname:pAttachments, or 2711e5c31af7Sopenharmony_ci ename:VK_ATTACHMENT_UNUSED to signify that this attachment is not used. 2712e5c31af7Sopenharmony_ci * pname:layout is a elink:VkImageLayout value specifying the layout the 2713e5c31af7Sopenharmony_ci attachment uses during the subpass. 2714e5c31af7Sopenharmony_ci 2715e5c31af7Sopenharmony_ci.Valid Usage 2716e5c31af7Sopenharmony_ci**** 2717e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/attachment_reference_common.adoc[] 2718e5c31af7Sopenharmony_ci**** 2719e5c31af7Sopenharmony_ci 2720e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkAttachmentReference.adoc[] 2721e5c31af7Sopenharmony_ci-- 2722e5c31af7Sopenharmony_ci 2723e5c31af7Sopenharmony_ci[open,refpage='VK_SUBPASS_EXTERNAL',desc='Subpass index sentinel expanding synchronization scope outside a subpass',type='consts'] 2724e5c31af7Sopenharmony_ci-- 2725e5c31af7Sopenharmony_ciename:VK_SUBPASS_EXTERNAL is a special subpass index value expanding 2726e5c31af7Sopenharmony_cisynchronization scope outside a subpass. 2727e5c31af7Sopenharmony_ciIt is described in more detail by slink:VkSubpassDependency. 2728e5c31af7Sopenharmony_ci 2729e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VK_SUBPASS_EXTERNAL.adoc[] 2730e5c31af7Sopenharmony_ci-- 2731e5c31af7Sopenharmony_ci 2732e5c31af7Sopenharmony_ci[open,refpage='VkSubpassDependency',desc='Structure specifying a subpass dependency',type='structs'] 2733e5c31af7Sopenharmony_ci-- 2734e5c31af7Sopenharmony_ci:refpage: VkSubpassDependency 2735e5c31af7Sopenharmony_ciThe sname:VkSubpassDependency structure is defined as: 2736e5c31af7Sopenharmony_ci 2737e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkSubpassDependency.adoc[] 2738e5c31af7Sopenharmony_ci 2739e5c31af7Sopenharmony_ci * pname:srcSubpass is the subpass index of the first subpass in the 2740e5c31af7Sopenharmony_ci dependency, or ename:VK_SUBPASS_EXTERNAL. 2741e5c31af7Sopenharmony_ci * pname:dstSubpass is the subpass index of the second subpass in the 2742e5c31af7Sopenharmony_ci dependency, or ename:VK_SUBPASS_EXTERNAL. 2743e5c31af7Sopenharmony_ci * pname:srcStageMask is a bitmask of elink:VkPipelineStageFlagBits 2744e5c31af7Sopenharmony_ci specifying the <<synchronization-pipeline-stages-masks, source stage 2745e5c31af7Sopenharmony_ci mask>>. 2746e5c31af7Sopenharmony_ci * pname:dstStageMask is a bitmask of elink:VkPipelineStageFlagBits 2747e5c31af7Sopenharmony_ci specifying the <<synchronization-pipeline-stages-masks, destination 2748e5c31af7Sopenharmony_ci stage mask>> 2749e5c31af7Sopenharmony_ci * pname:srcAccessMask is a bitmask of elink:VkAccessFlagBits specifying a 2750e5c31af7Sopenharmony_ci <<synchronization-access-masks, source access mask>>. 2751e5c31af7Sopenharmony_ci * pname:dstAccessMask is a bitmask of elink:VkAccessFlagBits specifying a 2752e5c31af7Sopenharmony_ci <<synchronization-access-masks, destination access mask>>. 2753e5c31af7Sopenharmony_ci * pname:dependencyFlags is a bitmask of elink:VkDependencyFlagBits. 2754e5c31af7Sopenharmony_ci 2755e5c31af7Sopenharmony_ciIf pname:srcSubpass is equal to pname:dstSubpass then the 2756e5c31af7Sopenharmony_cislink:VkSubpassDependency does not directly define a 2757e5c31af7Sopenharmony_ci<<synchronization-dependencies,dependency>>. 2758e5c31af7Sopenharmony_ciInstead, it enables pipeline barriers to be used in a render pass instance 2759e5c31af7Sopenharmony_ciwithin the identified subpass, where the scopes of one pipeline barrier 2760e5c31af7Sopenharmony_cimust: be a subset of those described by one subpass dependency. 2761e5c31af7Sopenharmony_ciSubpass dependencies specified in this way that include 2762e5c31af7Sopenharmony_ci<<synchronization-framebuffer-regions,framebuffer-space stages>> in the 2763e5c31af7Sopenharmony_cipname:srcStageMask must: only include 2764e5c31af7Sopenharmony_ci<<synchronization-framebuffer-regions,framebuffer-space stages>> in 2765e5c31af7Sopenharmony_cipname:dstStageMask, and must: include ename:VK_DEPENDENCY_BY_REGION_BIT. 2766e5c31af7Sopenharmony_ciifdef::VK_KHR_multiview,VK_VERSION_1_1[] 2767e5c31af7Sopenharmony_ciWhen a subpass dependency is specified in this way for a subpass that has 2768e5c31af7Sopenharmony_cimore than one view in its view mask, its pname:dependencyFlags must: include 2769e5c31af7Sopenharmony_ciename:VK_DEPENDENCY_VIEW_LOCAL_BIT. 2770e5c31af7Sopenharmony_ciendif::VK_KHR_multiview,VK_VERSION_1_1[] 2771e5c31af7Sopenharmony_ci 2772e5c31af7Sopenharmony_ciIf pname:srcSubpass and pname:dstSubpass are not equal, when a render pass 2773e5c31af7Sopenharmony_ciinstance which includes a subpass dependency is submitted to a queue, it 2774e5c31af7Sopenharmony_cidefines a <<synchronization-dependencies,dependency>> between the subpasses 2775e5c31af7Sopenharmony_ciidentified by pname:srcSubpass and pname:dstSubpass. 2776e5c31af7Sopenharmony_ci 2777e5c31af7Sopenharmony_ciIf pname:srcSubpass is equal to ename:VK_SUBPASS_EXTERNAL, the first 2778e5c31af7Sopenharmony_ci<<synchronization-dependencies-scopes, synchronization scope>> includes 2779e5c31af7Sopenharmony_cicommands that occur earlier in <<synchronization-submission-order,submission 2780e5c31af7Sopenharmony_ciorder>> than the flink:vkCmdBeginRenderPass used to begin the render pass 2781e5c31af7Sopenharmony_ciinstance. 2782e5c31af7Sopenharmony_ciOtherwise, the first set of commands includes all commands submitted as part 2783e5c31af7Sopenharmony_ciof the subpass instance identified by pname:srcSubpass and any 2784e5c31af7Sopenharmony_ci<<renderpass-load-operations, load>>, <<renderpass-store-operations, 2785e5c31af7Sopenharmony_cistore>>, or <<renderpass-resolve-operations, multisample resolve>> 2786e5c31af7Sopenharmony_cioperations on attachments used in pname:srcSubpass. 2787e5c31af7Sopenharmony_ciIn either case, the first synchronization scope is limited to operations on 2788e5c31af7Sopenharmony_cithe pipeline stages determined by the 2789e5c31af7Sopenharmony_ci<<synchronization-pipeline-stages-masks, source stage mask>> specified by 2790e5c31af7Sopenharmony_cipname:srcStageMask. 2791e5c31af7Sopenharmony_ci 2792e5c31af7Sopenharmony_ciIf pname:dstSubpass is equal to ename:VK_SUBPASS_EXTERNAL, the second 2793e5c31af7Sopenharmony_ci<<synchronization-dependencies-scopes, synchronization scope>> includes 2794e5c31af7Sopenharmony_cicommands that occur later in <<synchronization-submission-order,submission 2795e5c31af7Sopenharmony_ciorder>> than the flink:vkCmdEndRenderPass used to end the render pass 2796e5c31af7Sopenharmony_ciinstance. 2797e5c31af7Sopenharmony_ciOtherwise, the second set of commands includes all commands submitted as 2798e5c31af7Sopenharmony_cipart of the subpass instance identified by pname:dstSubpass and any 2799e5c31af7Sopenharmony_ci<<renderpass-load-operations, load>>, <<renderpass-store-operations, 2800e5c31af7Sopenharmony_cistore>>, and <<renderpass-resolve-operations, multisample resolve>> 2801e5c31af7Sopenharmony_cioperations on attachments used in pname:dstSubpass. 2802e5c31af7Sopenharmony_ciIn either case, the second synchronization scope is limited to operations on 2803e5c31af7Sopenharmony_cithe pipeline stages determined by the 2804e5c31af7Sopenharmony_ci<<synchronization-pipeline-stages-masks, destination stage mask>> specified 2805e5c31af7Sopenharmony_ciby pname:dstStageMask. 2806e5c31af7Sopenharmony_ci 2807e5c31af7Sopenharmony_ciThe first <<synchronization-dependencies-access-scopes, access scope>> is 2808e5c31af7Sopenharmony_cilimited to accesses in the pipeline stages determined by the 2809e5c31af7Sopenharmony_ci<<synchronization-pipeline-stages-masks, source stage mask>> specified by 2810e5c31af7Sopenharmony_cipname:srcStageMask. 2811e5c31af7Sopenharmony_ciIt is also limited to access types in the <<synchronization-access-masks, 2812e5c31af7Sopenharmony_cisource access mask>> specified by pname:srcAccessMask. 2813e5c31af7Sopenharmony_ci 2814e5c31af7Sopenharmony_ciThe second <<synchronization-dependencies-access-scopes, access scope>> is 2815e5c31af7Sopenharmony_cilimited to accesses in the pipeline stages determined by the 2816e5c31af7Sopenharmony_ci<<synchronization-pipeline-stages-masks, destination stage mask>> specified 2817e5c31af7Sopenharmony_ciby pname:dstStageMask. 2818e5c31af7Sopenharmony_ciIt is also limited to access types in the <<synchronization-access-masks, 2819e5c31af7Sopenharmony_cidestination access mask>> specified by pname:dstAccessMask. 2820e5c31af7Sopenharmony_ci 2821e5c31af7Sopenharmony_ciThe <<synchronization-dependencies-available-and-visible, availability and 2822e5c31af7Sopenharmony_civisibility operations>> defined by a subpass dependency affect the execution 2823e5c31af7Sopenharmony_ciof <<renderpass-layout-transitions, image layout transitions>> within the 2824e5c31af7Sopenharmony_cirender pass. 2825e5c31af7Sopenharmony_ci 2826e5c31af7Sopenharmony_ci[NOTE] 2827e5c31af7Sopenharmony_ci.Note 2828e5c31af7Sopenharmony_ci==== 2829e5c31af7Sopenharmony_ciFor non-attachment resources, the memory dependency expressed by subpass 2830e5c31af7Sopenharmony_cidependency is nearly identical to that of a slink:VkMemoryBarrier (with 2831e5c31af7Sopenharmony_cimatching pname:srcAccessMask and pname:dstAccessMask parameters) submitted 2832e5c31af7Sopenharmony_cias a part of a flink:vkCmdPipelineBarrier (with matching pname:srcStageMask 2833e5c31af7Sopenharmony_ciand pname:dstStageMask parameters). 2834e5c31af7Sopenharmony_ciThe only difference being that its scopes are limited to the identified 2835e5c31af7Sopenharmony_cisubpasses rather than potentially affecting everything before and after. 2836e5c31af7Sopenharmony_ci 2837e5c31af7Sopenharmony_ciFor attachments however, subpass dependencies work more like a 2838e5c31af7Sopenharmony_cislink:VkImageMemoryBarrier defined similarly to the slink:VkMemoryBarrier 2839e5c31af7Sopenharmony_ciabove, the queue family indices set to ename:VK_QUEUE_FAMILY_IGNORED, and 2840e5c31af7Sopenharmony_cilayouts as follows: 2841e5c31af7Sopenharmony_ci 2842e5c31af7Sopenharmony_ci * The equivalent to pname:oldLayout is the attachment's layout according 2843e5c31af7Sopenharmony_ci to the subpass description for pname:srcSubpass. 2844e5c31af7Sopenharmony_ci * The equivalent to pname:newLayout is the attachment's layout according 2845e5c31af7Sopenharmony_ci to the subpass description for pname:dstSubpass. 2846e5c31af7Sopenharmony_ci==== 2847e5c31af7Sopenharmony_ci 2848e5c31af7Sopenharmony_ci.Valid Usage 2849e5c31af7Sopenharmony_ci**** 2850e5c31af7Sopenharmony_ci:stageMaskName: srcStageMask 2851e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/stage_mask_common.adoc[] 2852e5c31af7Sopenharmony_ci 2853e5c31af7Sopenharmony_ci:stageMaskName: dstStageMask 2854e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/stage_mask_common.adoc[] 2855e5c31af7Sopenharmony_ci 2856e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDependency-srcSubpass-00864]] 2857e5c31af7Sopenharmony_ci pname:srcSubpass must: be less than or equal to pname:dstSubpass, unless 2858e5c31af7Sopenharmony_ci one of them is ename:VK_SUBPASS_EXTERNAL, to avoid cyclic dependencies 2859e5c31af7Sopenharmony_ci and ensure a valid execution order 2860e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDependency-srcSubpass-00865]] 2861e5c31af7Sopenharmony_ci pname:srcSubpass and pname:dstSubpass must: not both be equal to 2862e5c31af7Sopenharmony_ci ename:VK_SUBPASS_EXTERNAL 2863e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDependency-srcSubpass-06809]] 2864e5c31af7Sopenharmony_ci If pname:srcSubpass is equal to pname:dstSubpass and pname:srcStageMask 2865e5c31af7Sopenharmony_ci includes a <<synchronization-framebuffer-regions,framebuffer-space 2866e5c31af7Sopenharmony_ci stage>>, pname:dstStageMask must: only contain 2867e5c31af7Sopenharmony_ci <<synchronization-framebuffer-regions, framebuffer-space stages>> 2868e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDependency-srcAccessMask-00868]] 2869e5c31af7Sopenharmony_ci Any access flag included in pname:srcAccessMask must: be supported by 2870e5c31af7Sopenharmony_ci one of the pipeline stages in pname:srcStageMask, as specified in the 2871e5c31af7Sopenharmony_ci <<synchronization-access-types-supported, table of supported access 2872e5c31af7Sopenharmony_ci types>> 2873e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDependency-dstAccessMask-00869]] 2874e5c31af7Sopenharmony_ci Any access flag included in pname:dstAccessMask must: be supported by 2875e5c31af7Sopenharmony_ci one of the pipeline stages in pname:dstStageMask, as specified in the 2876e5c31af7Sopenharmony_ci <<synchronization-access-types-supported, table of supported access 2877e5c31af7Sopenharmony_ci types>> 2878e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDependency-srcSubpass-02243]] 2879e5c31af7Sopenharmony_ci If pname:srcSubpass equals pname:dstSubpass, and pname:srcStageMask and 2880e5c31af7Sopenharmony_ci pname:dstStageMask both include a 2881e5c31af7Sopenharmony_ci <<synchronization-framebuffer-regions,framebuffer-space stage>>, then 2882e5c31af7Sopenharmony_ci pname:dependencyFlags must: include ename:VK_DEPENDENCY_BY_REGION_BIT 2883e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_multiview[] 2884e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDependency-dependencyFlags-02520]] 2885e5c31af7Sopenharmony_ci If pname:dependencyFlags includes ename:VK_DEPENDENCY_VIEW_LOCAL_BIT, 2886e5c31af7Sopenharmony_ci pname:srcSubpass must: not be equal to ename:VK_SUBPASS_EXTERNAL 2887e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDependency-dependencyFlags-02521]] 2888e5c31af7Sopenharmony_ci If pname:dependencyFlags includes ename:VK_DEPENDENCY_VIEW_LOCAL_BIT, 2889e5c31af7Sopenharmony_ci pname:dstSubpass must: not be equal to ename:VK_SUBPASS_EXTERNAL 2890e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDependency-srcSubpass-00872]] 2891e5c31af7Sopenharmony_ci If pname:srcSubpass equals pname:dstSubpass and that subpass has more 2892e5c31af7Sopenharmony_ci than one bit set in the view mask, then pname:dependencyFlags must: 2893e5c31af7Sopenharmony_ci include ename:VK_DEPENDENCY_VIEW_LOCAL_BIT 2894e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_multiview[] 2895e5c31af7Sopenharmony_ci**** 2896e5c31af7Sopenharmony_ci 2897e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkSubpassDependency.adoc[] 2898e5c31af7Sopenharmony_ci-- 2899e5c31af7Sopenharmony_ci 2900e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_multiview[] 2901e5c31af7Sopenharmony_ci 2902e5c31af7Sopenharmony_ciWhen multiview is enabled, the execution of the multiple views of one 2903e5c31af7Sopenharmony_cisubpass may: not occur simultaneously or even back-to-back, and rather may: 2904e5c31af7Sopenharmony_cibe interleaved with the execution of other subpasses. 2905e5c31af7Sopenharmony_ciThe load and store operations apply to attachments on a per-view basis. 2906e5c31af7Sopenharmony_ciFor example, an attachment using ename:VK_ATTACHMENT_LOAD_OP_CLEAR will have 2907e5c31af7Sopenharmony_cieach view cleared on first use, but the first use of one view may be 2908e5c31af7Sopenharmony_citemporally distant from the first use of another view. 2909e5c31af7Sopenharmony_ci 2910e5c31af7Sopenharmony_ci[NOTE] 2911e5c31af7Sopenharmony_ci.Note 2912e5c31af7Sopenharmony_ci==== 2913e5c31af7Sopenharmony_ciA good mental model for multiview is to think of a multiview subpass as if 2914e5c31af7Sopenharmony_ciit were a collection of individual (per-view) subpasses that are logically 2915e5c31af7Sopenharmony_cigrouped together and described as a single multiview subpass in the API. 2916e5c31af7Sopenharmony_ciSimilarly, a multiview attachment can be thought of like several individual 2917e5c31af7Sopenharmony_ciattachments that happen to be layers in a single image. 2918e5c31af7Sopenharmony_ciA view-local dependency between two multiview subpasses acts like a set of 2919e5c31af7Sopenharmony_cione-to-one dependencies between corresponding pairs of per-view subpasses. 2920e5c31af7Sopenharmony_ciA view-global dependency between two multiview subpasses acts like a set of 2921e5c31af7Sopenharmony_ci[eq]#N {times} M# dependencies between all pairs of per-view subpasses in 2922e5c31af7Sopenharmony_cithe source and destination. 2923e5c31af7Sopenharmony_ciThus, it is a more compact representation which also makes clear the 2924e5c31af7Sopenharmony_cicommonality and reuse that is present between views in a subpass. 2925e5c31af7Sopenharmony_ciThis interpretation motivates the answers to questions like "`when does the 2926e5c31af7Sopenharmony_ciload op apply`" - it is on the first use of each view of an attachment, as 2927e5c31af7Sopenharmony_ciif each view was a separate attachment. 2928e5c31af7Sopenharmony_ci 2929e5c31af7Sopenharmony_ciThe content of each view follows the description in 2930e5c31af7Sopenharmony_ci<<renderpass-attachment-contents, attachment content behavior>>. 2931e5c31af7Sopenharmony_ciIn particular, if an attachment is preserved, all views within the 2932e5c31af7Sopenharmony_ciattachment are preserved. 2933e5c31af7Sopenharmony_ci==== 2934e5c31af7Sopenharmony_ci 2935e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_multiview[] 2936e5c31af7Sopenharmony_ci 2937e5c31af7Sopenharmony_ciifdef::VK_EXT_transform_feedback[] 2938e5c31af7Sopenharmony_ciIf any two subpasses of a render pass activate transform feedback to the 2939e5c31af7Sopenharmony_cisame bound transform feedback buffers, a subpass dependency must: be 2940e5c31af7Sopenharmony_ciincluded (either directly or via some intermediate subpasses) between them. 2941e5c31af7Sopenharmony_ciendif::VK_EXT_transform_feedback[] 2942e5c31af7Sopenharmony_ci 2943e5c31af7Sopenharmony_ciifdef::editing-notes[] 2944e5c31af7Sopenharmony_ci[NOTE] 2945e5c31af7Sopenharmony_ci.editing-note 2946e5c31af7Sopenharmony_ci==== 2947e5c31af7Sopenharmony_ciThe following two alleged implicit dependencies are practically no-ops, as 2948e5c31af7Sopenharmony_cithe operations they describe are already guaranteed by semaphores and 2949e5c31af7Sopenharmony_cisubmission order (so they are almost entirely no-ops on their own). 2950e5c31af7Sopenharmony_ciThe *only* reason they exist is because it simplifies reasoning about where 2951e5c31af7Sopenharmony_ci<<renderpass-layout-transitions, automatic layout transitions>> happen. 2952e5c31af7Sopenharmony_ciFurther rewrites of this chapter could potentially remove the need for 2953e5c31af7Sopenharmony_cithese. 2954e5c31af7Sopenharmony_ci==== 2955e5c31af7Sopenharmony_ciendif::editing-notes[] 2956e5c31af7Sopenharmony_ci 2957e5c31af7Sopenharmony_ci[[renderpass-implicit-dependencies]] 2958e5c31af7Sopenharmony_ciIf there is no subpass dependency from ename:VK_SUBPASS_EXTERNAL to the 2959e5c31af7Sopenharmony_cifirst subpass that uses an attachment, then an implicit subpass dependency 2960e5c31af7Sopenharmony_ciexists from ename:VK_SUBPASS_EXTERNAL to the first subpass it is used in. 2961e5c31af7Sopenharmony_ciThe implicit subpass dependency only exists if there exists an automatic 2962e5c31af7Sopenharmony_cilayout transition away from pname:initialLayout. 2963e5c31af7Sopenharmony_ciThe subpass dependency operates as if defined with the following parameters: 2964e5c31af7Sopenharmony_ci 2965e5c31af7Sopenharmony_ci[source,c] 2966e5c31af7Sopenharmony_ci---- 2967e5c31af7Sopenharmony_ciVkSubpassDependency implicitDependency = { 2968e5c31af7Sopenharmony_ci .srcSubpass = VK_SUBPASS_EXTERNAL, 2969e5c31af7Sopenharmony_ci .dstSubpass = firstSubpass, // First subpass attachment is used in 2970e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_3,VK_KHR_synchronization2[] 2971e5c31af7Sopenharmony_ci .srcStageMask = VK_PIPELINE_STAGE_NONE, 2972e5c31af7Sopenharmony_ciendif::VK_VERSION_1_3,VK_KHR_synchronization2[] 2973e5c31af7Sopenharmony_ciifndef::VK_VERSION_1_3,VK_KHR_synchronization2[] 2974e5c31af7Sopenharmony_ci .srcStageMask = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, 2975e5c31af7Sopenharmony_ciendif::VK_VERSION_1_3,VK_KHR_synchronization2[] 2976e5c31af7Sopenharmony_ci .dstStageMask = VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, 2977e5c31af7Sopenharmony_ci .srcAccessMask = 0, 2978e5c31af7Sopenharmony_ci .dstAccessMask = VK_ACCESS_INPUT_ATTACHMENT_READ_BIT | 2979e5c31af7Sopenharmony_ci VK_ACCESS_COLOR_ATTACHMENT_READ_BIT | 2980e5c31af7Sopenharmony_ci VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT | 2981e5c31af7Sopenharmony_ci VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT | 2982e5c31af7Sopenharmony_ci VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT, 2983e5c31af7Sopenharmony_ci .dependencyFlags = 0 2984e5c31af7Sopenharmony_ci}; 2985e5c31af7Sopenharmony_ci---- 2986e5c31af7Sopenharmony_ci 2987e5c31af7Sopenharmony_ciSimilarly, if there is no subpass dependency from the last subpass that uses 2988e5c31af7Sopenharmony_cian attachment to ename:VK_SUBPASS_EXTERNAL, then an implicit subpass 2989e5c31af7Sopenharmony_cidependency exists from the last subpass it is used in to 2990e5c31af7Sopenharmony_ciename:VK_SUBPASS_EXTERNAL. 2991e5c31af7Sopenharmony_ciThe implicit subpass dependency only exists if there exists an automatic 2992e5c31af7Sopenharmony_cilayout transition into pname:finalLayout. 2993e5c31af7Sopenharmony_ciThe subpass dependency operates as if defined with the following parameters: 2994e5c31af7Sopenharmony_ci 2995e5c31af7Sopenharmony_ci[source,c] 2996e5c31af7Sopenharmony_ci---- 2997e5c31af7Sopenharmony_ciVkSubpassDependency implicitDependency = { 2998e5c31af7Sopenharmony_ci .srcSubpass = lastSubpass, // Last subpass attachment is used in 2999e5c31af7Sopenharmony_ci .dstSubpass = VK_SUBPASS_EXTERNAL, 3000e5c31af7Sopenharmony_ci .srcStageMask = VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, 3001e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_3,VK_KHR_synchronization2[] 3002e5c31af7Sopenharmony_ci .dstStageMask = VK_PIPELINE_STAGE_NONE, 3003e5c31af7Sopenharmony_ciendif::VK_VERSION_1_3,VK_KHR_synchronization2[] 3004e5c31af7Sopenharmony_ciifndef::VK_VERSION_1_3,VK_KHR_synchronization2[] 3005e5c31af7Sopenharmony_ci .dstStageMask = VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, 3006e5c31af7Sopenharmony_ciendif::VK_VERSION_1_3,VK_KHR_synchronization2[] 3007e5c31af7Sopenharmony_ci .srcAccessMask = VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT | 3008e5c31af7Sopenharmony_ci VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT, 3009e5c31af7Sopenharmony_ci .dstAccessMask = 0, 3010e5c31af7Sopenharmony_ci .dependencyFlags = 0 3011e5c31af7Sopenharmony_ci}; 3012e5c31af7Sopenharmony_ci---- 3013e5c31af7Sopenharmony_ci 3014e5c31af7Sopenharmony_ci[[renderpass-layout-transitions]] 3015e5c31af7Sopenharmony_ciAs subpasses may: overlap or execute out of order with regards to other 3016e5c31af7Sopenharmony_cisubpasses unless a subpass dependency chain describes otherwise, the layout 3017e5c31af7Sopenharmony_citransitions required between subpasses cannot: be known to an application. 3018e5c31af7Sopenharmony_ciInstead, an application provides the layout that each attachment must: be in 3019e5c31af7Sopenharmony_ciat the start and end of a render pass, and the layout it must: be in during 3020e5c31af7Sopenharmony_cieach subpass it is used in. 3021e5c31af7Sopenharmony_ciThe implementation then must: execute layout transitions between subpasses 3022e5c31af7Sopenharmony_ciin order to guarantee that the images are in the layouts required by each 3023e5c31af7Sopenharmony_cisubpass, and in the final layout at the end of the render pass. 3024e5c31af7Sopenharmony_ci 3025e5c31af7Sopenharmony_ciAutomatic layout transitions apply to the entire image subresource attached 3026e5c31af7Sopenharmony_cito the framebuffer. 3027e5c31af7Sopenharmony_ciIf 3028e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_multiview[] 3029e5c31af7Sopenharmony_cimultiview is not enabled and 3030e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_multiview[] 3031e5c31af7Sopenharmony_cithe attachment is a view of a 1D or 2D image, the automatic layout 3032e5c31af7Sopenharmony_citransitions apply to the number of layers specified by 3033e5c31af7Sopenharmony_cislink:VkFramebufferCreateInfo::pname:layers. 3034e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_multiview[] 3035e5c31af7Sopenharmony_ciIf multiview is enabled and the attachment is a view of a 1D or 2D image, 3036e5c31af7Sopenharmony_cithe automatic layout transitions apply to the layers corresponding to views 3037e5c31af7Sopenharmony_ciwhich are used by some subpass in the render pass, even if that subpass does 3038e5c31af7Sopenharmony_cinot reference the given attachment. 3039e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_multiview[] 3040e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_maintenance1[] 3041e5c31af7Sopenharmony_ciIf the attachment view is a 2D or 2D array view of a 3D image, even if the 3042e5c31af7Sopenharmony_ciattachment view only refers to a subset of the slices of the selected mip 3043e5c31af7Sopenharmony_cilevel of the 3D image, automatic layout transitions apply to the entire 3044e5c31af7Sopenharmony_cisubresource referenced which is the entire mip level in this case. 3045e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_maintenance1[] 3046e5c31af7Sopenharmony_ci 3047e5c31af7Sopenharmony_ciAutomatic layout transitions away from the layout used in a subpass 3048e5c31af7Sopenharmony_cihappen-after the availability operations for all dependencies with that 3049e5c31af7Sopenharmony_cisubpass as the pname:srcSubpass. 3050e5c31af7Sopenharmony_ci 3051e5c31af7Sopenharmony_ciAutomatic layout transitions into the layout used in a subpass happen-before 3052e5c31af7Sopenharmony_cithe visibility operations for all dependencies with that subpass as the 3053e5c31af7Sopenharmony_cipname:dstSubpass. 3054e5c31af7Sopenharmony_ci 3055e5c31af7Sopenharmony_ciAutomatic layout transitions away from pname:initialLayout happen-after the 3056e5c31af7Sopenharmony_ciavailability operations for all dependencies with a pname:srcSubpass equal 3057e5c31af7Sopenharmony_cito ename:VK_SUBPASS_EXTERNAL, where pname:dstSubpass uses the attachment 3058e5c31af7Sopenharmony_cithat will be transitioned. 3059e5c31af7Sopenharmony_ciFor attachments created with ename:VK_ATTACHMENT_DESCRIPTION_MAY_ALIAS_BIT, 3060e5c31af7Sopenharmony_ciautomatic layout transitions away from pname:initialLayout happen-after the 3061e5c31af7Sopenharmony_ciavailability operations for all dependencies with a pname:srcSubpass equal 3062e5c31af7Sopenharmony_cito ename:VK_SUBPASS_EXTERNAL, where pname:dstSubpass uses any aliased 3063e5c31af7Sopenharmony_ciattachment. 3064e5c31af7Sopenharmony_ci 3065e5c31af7Sopenharmony_ciAutomatic layout transitions into pname:finalLayout happen-before the 3066e5c31af7Sopenharmony_civisibility operations for all dependencies with a pname:dstSubpass equal to 3067e5c31af7Sopenharmony_ciename:VK_SUBPASS_EXTERNAL, where pname:srcSubpass uses the attachment that 3068e5c31af7Sopenharmony_ciwill be transitioned. 3069e5c31af7Sopenharmony_ciFor attachments created with ename:VK_ATTACHMENT_DESCRIPTION_MAY_ALIAS_BIT, 3070e5c31af7Sopenharmony_ciautomatic layout transitions into pname:finalLayout happen-before the 3071e5c31af7Sopenharmony_civisibility operations for all dependencies with a pname:dstSubpass equal to 3072e5c31af7Sopenharmony_ciename:VK_SUBPASS_EXTERNAL, where pname:srcSubpass uses any aliased 3073e5c31af7Sopenharmony_ciattachment. 3074e5c31af7Sopenharmony_ci 3075e5c31af7Sopenharmony_ciifdef::VK_EXT_sample_locations[] 3076e5c31af7Sopenharmony_ci 3077e5c31af7Sopenharmony_ciThe image layout of the depth aspect of a depth/stencil attachment referring 3078e5c31af7Sopenharmony_cito an image created with 3079e5c31af7Sopenharmony_ciename:VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT is dependent 3080e5c31af7Sopenharmony_cion the last sample locations used to render to the attachment, thus 3081e5c31af7Sopenharmony_ciautomatic layout transitions use the sample locations state specified in 3082e5c31af7Sopenharmony_cislink:VkRenderPassSampleLocationsBeginInfoEXT. 3083e5c31af7Sopenharmony_ci 3084e5c31af7Sopenharmony_ciAutomatic layout transitions of an attachment referring to a depth/stencil 3085e5c31af7Sopenharmony_ciimage created with 3086e5c31af7Sopenharmony_ciename:VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT use the 3087e5c31af7Sopenharmony_cisample locations the image subresource range referenced by the attachment 3088e5c31af7Sopenharmony_ciwas last rendered with. 3089e5c31af7Sopenharmony_ciIf the current render pass does not use the attachment as a depth/stencil 3090e5c31af7Sopenharmony_ciattachment in any subpass that happens-before, the automatic layout 3091e5c31af7Sopenharmony_citransition uses the sample locations state specified in the 3092e5c31af7Sopenharmony_cipname:sampleLocationsInfo member of the element of the 3093e5c31af7Sopenharmony_cisname:VkRenderPassSampleLocationsBeginInfoEXT::pname:pAttachmentInitialSampleLocations 3094e5c31af7Sopenharmony_ciarray for which the pname:attachmentIndex member equals the attachment index 3095e5c31af7Sopenharmony_ciof the attachment, if one is specified. 3096e5c31af7Sopenharmony_ciOtherwise, the automatic layout transition uses the sample locations state 3097e5c31af7Sopenharmony_cispecified in the pname:sampleLocationsInfo member of the element of the 3098e5c31af7Sopenharmony_cisname:VkRenderPassSampleLocationsBeginInfoEXT::pname:pPostSubpassSampleLocations 3099e5c31af7Sopenharmony_ciarray for which the pname:subpassIndex member equals the index of the 3100e5c31af7Sopenharmony_cisubpass that last used the attachment as a depth/stencil attachment, if one 3101e5c31af7Sopenharmony_ciis specified. 3102e5c31af7Sopenharmony_ci 3103e5c31af7Sopenharmony_ciIf no sample locations state has been specified for an automatic layout 3104e5c31af7Sopenharmony_citransition performed on an attachment referring to a depth/stencil image 3105e5c31af7Sopenharmony_cicreated with ename:VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT 3106e5c31af7Sopenharmony_cithe contents of the depth aspect of the depth/stencil attachment become 3107e5c31af7Sopenharmony_ciundefined: as if the layout of the attachment was transitioned from the 3108e5c31af7Sopenharmony_ciename:VK_IMAGE_LAYOUT_UNDEFINED layout. 3109e5c31af7Sopenharmony_ci 3110e5c31af7Sopenharmony_ciendif::VK_EXT_sample_locations[] 3111e5c31af7Sopenharmony_ci 3112e5c31af7Sopenharmony_ciIf two subpasses use the same attachment, and both subpasses use the 3113e5c31af7Sopenharmony_ciattachment in a read-only layout, no subpass dependency needs to be 3114e5c31af7Sopenharmony_cispecified between those subpasses. 3115e5c31af7Sopenharmony_ciIf an implementation treats those layouts separately, it must: insert an 3116e5c31af7Sopenharmony_ciimplicit subpass dependency between those subpasses to separate the uses in 3117e5c31af7Sopenharmony_cieach layout. 3118e5c31af7Sopenharmony_ciThe subpass dependency operates as if defined with the following parameters: 3119e5c31af7Sopenharmony_ci 3120e5c31af7Sopenharmony_ci[source,c] 3121e5c31af7Sopenharmony_ci---- 3122e5c31af7Sopenharmony_ci// Used for input attachments 3123e5c31af7Sopenharmony_ciVkPipelineStageFlags inputAttachmentStages = VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT; 3124e5c31af7Sopenharmony_ciVkAccessFlags inputAttachmentDstAccess = VK_ACCESS_INPUT_ATTACHMENT_READ_BIT; 3125e5c31af7Sopenharmony_ci 3126e5c31af7Sopenharmony_ci// Used for depth/stencil attachments 3127e5c31af7Sopenharmony_ciVkPipelineStageFlags depthStencilAttachmentStages = VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT | VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT; 3128e5c31af7Sopenharmony_ciVkAccessFlags depthStencilAttachmentDstAccess = VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT; 3129e5c31af7Sopenharmony_ci 3130e5c31af7Sopenharmony_ciVkSubpassDependency implicitDependency = { 3131e5c31af7Sopenharmony_ci .srcSubpass = firstSubpass; 3132e5c31af7Sopenharmony_ci .dstSubpass = secondSubpass; 3133e5c31af7Sopenharmony_ci .srcStageMask = inputAttachmentStages | depthStencilAttachmentStages; 3134e5c31af7Sopenharmony_ci .dstStageMask = inputAttachmentStages | depthStencilAttachmentStages; 3135e5c31af7Sopenharmony_ci .srcAccessMask = 0; 3136e5c31af7Sopenharmony_ci .dstAccessMask = inputAttachmentDstAccess | depthStencilAttachmentDstAccess; 3137e5c31af7Sopenharmony_ci .dependencyFlags = 0; 3138e5c31af7Sopenharmony_ci}; 3139e5c31af7Sopenharmony_ci---- 3140e5c31af7Sopenharmony_ci 3141e5c31af7Sopenharmony_ci 3142e5c31af7Sopenharmony_ciifdef::VK_EXT_attachment_feedback_loop_dynamic_state[] 3143e5c31af7Sopenharmony_ciWhen 3144e5c31af7Sopenharmony_ciifdef::VK_EXT_shader_object[drawing using <<shaders-objects, shader objects>>,] 3145e5c31af7Sopenharmony_ciifdef::VK_EXT_shader_object[or when] 3146e5c31af7Sopenharmony_cithe graphics pipeline is created with 3147e5c31af7Sopenharmony_ciename:VK_DYNAMIC_STATE_ATTACHMENT_FEEDBACK_LOOP_ENABLE_EXT set in 3148e5c31af7Sopenharmony_cislink:VkPipelineDynamicStateCreateInfo::pname:pDynamicStates, the 3149e5c31af7Sopenharmony_ciapplication must: specify which types of attachments that are written to 3150e5c31af7Sopenharmony_ciduring a render pass will also be accessed as non-attachments in the render 3151e5c31af7Sopenharmony_cipass. 3152e5c31af7Sopenharmony_ci 3153e5c31af7Sopenharmony_ci[open,refpage='vkCmdSetAttachmentFeedbackLoopEnableEXT',desc='Specify whether attachment feedback loops are enabled dynamically on a command buffer',type='protos'] 3154e5c31af7Sopenharmony_ci-- 3155e5c31af7Sopenharmony_ci:refpage: vkCmdSetAttachmentFeedbackLoopEnableEXT 3156e5c31af7Sopenharmony_ci 3157e5c31af7Sopenharmony_ciTo <<pipelines-dynamic-state, dynamically set>> whether a pipeline can: 3158e5c31af7Sopenharmony_ciaccess a resource as a non-attachment while it is also used as an attachment 3159e5c31af7Sopenharmony_cithat is written to, call: 3160e5c31af7Sopenharmony_ci 3161e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCmdSetAttachmentFeedbackLoopEnableEXT.adoc[] 3162e5c31af7Sopenharmony_ci 3163e5c31af7Sopenharmony_ci * pname:commandBuffer is the command buffer into which the command will be 3164e5c31af7Sopenharmony_ci recorded. 3165e5c31af7Sopenharmony_ci * pname:aspectMask specifies the types of attachments for which feedback 3166e5c31af7Sopenharmony_ci loops will be enabled. 3167e5c31af7Sopenharmony_ci Attachment types whose aspects are not included in pname:aspectMask will 3168e5c31af7Sopenharmony_ci have feedback loops disabled. 3169e5c31af7Sopenharmony_ci 3170e5c31af7Sopenharmony_ciFor attachments that are written to in a render pass, only attachments with 3171e5c31af7Sopenharmony_cithe aspects specified in pname:aspectMask can: be accessed as 3172e5c31af7Sopenharmony_cinon-attachments by subsequent <<drawing, drawing commands>>. 3173e5c31af7Sopenharmony_ci 3174e5c31af7Sopenharmony_ci.Valid Usage 3175e5c31af7Sopenharmony_ci**** 3176e5c31af7Sopenharmony_ci * [[VUID-vkCmdSetAttachmentFeedbackLoopEnableEXT-attachmentFeedbackLoopDynamicState-08862]] 3177e5c31af7Sopenharmony_ci The <<features-attachmentFeedbackLoopDynamicState, 3178e5c31af7Sopenharmony_ci pname:attachmentFeedbackLoopDynamicState>> feature must: be enabled 3179e5c31af7Sopenharmony_ci * [[VUID-vkCmdSetAttachmentFeedbackLoopEnableEXT-aspectMask-08863]] 3180e5c31af7Sopenharmony_ci pname:aspectMask must: only include ename:VK_IMAGE_ASPECT_NONE, 3181e5c31af7Sopenharmony_ci ename:VK_IMAGE_ASPECT_COLOR_BIT, ename:VK_IMAGE_ASPECT_DEPTH_BIT, and 3182e5c31af7Sopenharmony_ci ename:VK_IMAGE_ASPECT_STENCIL_BIT 3183e5c31af7Sopenharmony_ci * [[VUID-vkCmdSetAttachmentFeedbackLoopEnableEXT-attachmentFeedbackLoopLayout-08864]] 3184e5c31af7Sopenharmony_ci If the <<features-attachmentFeedbackLoopLayout, 3185e5c31af7Sopenharmony_ci pname:attachmentFeedbackLoopLayout>> feature is not enabled, 3186e5c31af7Sopenharmony_ci pname:aspectMask must: be ename:VK_IMAGE_ASPECT_NONE 3187e5c31af7Sopenharmony_ci**** 3188e5c31af7Sopenharmony_ci 3189e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCmdSetAttachmentFeedbackLoopEnableEXT.adoc[] 3190e5c31af7Sopenharmony_ci-- 3191e5c31af7Sopenharmony_ciendif::VK_EXT_attachment_feedback_loop_dynamic_state[] 3192e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_KHR_create_renderpass2[] 3193e5c31af7Sopenharmony_ciA more extensible version of render pass creation is also defined below. 3194e5c31af7Sopenharmony_ci 3195e5c31af7Sopenharmony_ci[open,refpage='vkCreateRenderPass2',desc='Create a new render pass object',type='protos',alias='vkCreateRenderPass2KHR'] 3196e5c31af7Sopenharmony_ci-- 3197e5c31af7Sopenharmony_ci 3198e5c31af7Sopenharmony_ci:refpage: vkCreateRenderPass2 3199e5c31af7Sopenharmony_ci:objectnameplural: render passes 3200e5c31af7Sopenharmony_ci:objectnamecamelcase: renderPass 3201e5c31af7Sopenharmony_ci:objectcount: 1 3202e5c31af7Sopenharmony_ci 3203e5c31af7Sopenharmony_ciTo create a render pass, call: 3204e5c31af7Sopenharmony_ci 3205e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2[] 3206e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCreateRenderPass2.adoc[] 3207e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2[] 3208e5c31af7Sopenharmony_ci 3209e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2+VK_KHR_create_renderpass2[or the equivalent command] 3210e5c31af7Sopenharmony_ci 3211e5c31af7Sopenharmony_ciifdef::VK_KHR_create_renderpass2[] 3212e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCreateRenderPass2KHR.adoc[] 3213e5c31af7Sopenharmony_ciendif::VK_KHR_create_renderpass2[] 3214e5c31af7Sopenharmony_ci 3215e5c31af7Sopenharmony_ci * pname:device is the logical device that creates the render pass. 3216e5c31af7Sopenharmony_ci * pname:pCreateInfo is a pointer to a slink:VkRenderPassCreateInfo2 3217e5c31af7Sopenharmony_ci structure describing the parameters of the render pass. 3218e5c31af7Sopenharmony_ci * pname:pAllocator controls host memory allocation as described in the 3219e5c31af7Sopenharmony_ci <<memory-allocation, Memory Allocation>> chapter. 3220e5c31af7Sopenharmony_ci * pname:pRenderPass is a pointer to a slink:VkRenderPass handle in which 3221e5c31af7Sopenharmony_ci the resulting render pass object is returned. 3222e5c31af7Sopenharmony_ci 3223e5c31af7Sopenharmony_ciThis command is functionally identical to flink:vkCreateRenderPass, but 3224e5c31af7Sopenharmony_ciincludes extensible sub-structures that include pname:sType and pname:pNext 3225e5c31af7Sopenharmony_ciparameters, allowing them to be more easily extended. 3226e5c31af7Sopenharmony_ci 3227e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/no_dynamic_allocations_common.adoc[] 3228e5c31af7Sopenharmony_ci 3229e5c31af7Sopenharmony_ciifdef::VKSC_VERSION_1_0[] 3230e5c31af7Sopenharmony_ci.Valid Usage 3231e5c31af7Sopenharmony_ci**** 3232e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/memory_reservation_request_count_common.adoc[] 3233e5c31af7Sopenharmony_ci 3234e5c31af7Sopenharmony_ci:uniqifier: subpasses 3235e5c31af7Sopenharmony_ci:combinedobjectnameplural: subpasses 3236e5c31af7Sopenharmony_ci:combinedparentobject: VkRenderPass 3237e5c31af7Sopenharmony_ci:combinedobjectcount: pname:pCreateInfo->subpassCount 3238e5c31af7Sopenharmony_ci:combinedobjectnamecamelcase: subpassDescription 3239e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/memory_reservation_request_count_combined_common.adoc[] 3240e5c31af7Sopenharmony_ci 3241e5c31af7Sopenharmony_ci:uniqifier: attachments 3242e5c31af7Sopenharmony_ci:combinedobjectnameplural: attachments 3243e5c31af7Sopenharmony_ci:combinedparentobject: VkRenderPass 3244e5c31af7Sopenharmony_ci:combinedobjectcount: pname:pCreateInfo->attachmentCount 3245e5c31af7Sopenharmony_ci:combinedobjectnamecamelcase: attachmentDescription 3246e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/memory_reservation_request_count_combined_common.adoc[] 3247e5c31af7Sopenharmony_ci**** 3248e5c31af7Sopenharmony_ciendif::VKSC_VERSION_1_0[] 3249e5c31af7Sopenharmony_ci 3250e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCreateRenderPass2.adoc[] 3251e5c31af7Sopenharmony_ci-- 3252e5c31af7Sopenharmony_ci 3253e5c31af7Sopenharmony_ci[open,refpage='VkRenderPassCreateInfo2',desc='Structure specifying parameters of a newly created render pass',type='structs',alias='VkRenderPassCreateInfo2KHR'] 3254e5c31af7Sopenharmony_ci-- 3255e5c31af7Sopenharmony_ciThe sname:VkRenderPassCreateInfo2 structure is defined as: 3256e5c31af7Sopenharmony_ci 3257e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkRenderPassCreateInfo2.adoc[] 3258e5c31af7Sopenharmony_ci 3259e5c31af7Sopenharmony_ciifdef::VK_KHR_create_renderpass2[] 3260e5c31af7Sopenharmony_cior the equivalent 3261e5c31af7Sopenharmony_ci 3262e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkRenderPassCreateInfo2KHR.adoc[] 3263e5c31af7Sopenharmony_ciendif::VK_KHR_create_renderpass2[] 3264e5c31af7Sopenharmony_ci 3265e5c31af7Sopenharmony_ci * pname:sType is a elink:VkStructureType value identifying this structure. 3266e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 3267e5c31af7Sopenharmony_ci structure. 3268e5c31af7Sopenharmony_ci * pname:flags is reserved for future use. 3269e5c31af7Sopenharmony_ci * pname:attachmentCount is the number of attachments used by this render 3270e5c31af7Sopenharmony_ci pass. 3271e5c31af7Sopenharmony_ci * pname:pAttachments is a pointer to an array of pname:attachmentCount 3272e5c31af7Sopenharmony_ci slink:VkAttachmentDescription2 structures describing the attachments 3273e5c31af7Sopenharmony_ci used by the render pass. 3274e5c31af7Sopenharmony_ci * pname:subpassCount is the number of subpasses to create. 3275e5c31af7Sopenharmony_ci * pname:pSubpasses is a pointer to an array of pname:subpassCount 3276e5c31af7Sopenharmony_ci slink:VkSubpassDescription2 structures describing each subpass. 3277e5c31af7Sopenharmony_ci * pname:dependencyCount is the number of dependencies between pairs of 3278e5c31af7Sopenharmony_ci subpasses. 3279e5c31af7Sopenharmony_ci * pname:pDependencies is a pointer to an array of pname:dependencyCount 3280e5c31af7Sopenharmony_ci slink:VkSubpassDependency2 structures describing dependencies between 3281e5c31af7Sopenharmony_ci pairs of subpasses. 3282e5c31af7Sopenharmony_ci * pname:correlatedViewMaskCount is the number of correlation masks. 3283e5c31af7Sopenharmony_ci * pname:pCorrelatedViewMasks is a pointer to an array of view masks 3284e5c31af7Sopenharmony_ci indicating sets of views that may: be more efficient to render 3285e5c31af7Sopenharmony_ci concurrently. 3286e5c31af7Sopenharmony_ci 3287e5c31af7Sopenharmony_ciParameters defined by this structure with the same name as those in 3288e5c31af7Sopenharmony_cislink:VkRenderPassCreateInfo have the identical effect to those parameters; 3289e5c31af7Sopenharmony_cithe child structures are variants of those used in 3290e5c31af7Sopenharmony_cislink:VkRenderPassCreateInfo which add pname:sType and pname:pNext 3291e5c31af7Sopenharmony_ciparameters, allowing them to be extended. 3292e5c31af7Sopenharmony_ci 3293e5c31af7Sopenharmony_ciIf the slink:VkSubpassDescription2::pname:viewMask member of any element of 3294e5c31af7Sopenharmony_cipname:pSubpasses is not zero, _multiview_ functionality is considered to be 3295e5c31af7Sopenharmony_cienabled for this render pass. 3296e5c31af7Sopenharmony_ci 3297e5c31af7Sopenharmony_cipname:correlatedViewMaskCount and pname:pCorrelatedViewMasks have the same 3298e5c31af7Sopenharmony_cieffect as slink:VkRenderPassMultiviewCreateInfo::pname:correlationMaskCount 3299e5c31af7Sopenharmony_ciand slink:VkRenderPassMultiviewCreateInfo::pname:pCorrelationMasks, 3300e5c31af7Sopenharmony_cirespectively. 3301e5c31af7Sopenharmony_ci 3302e5c31af7Sopenharmony_ci.Valid Usage 3303e5c31af7Sopenharmony_ci**** 3304e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassCreateInfo2-None-03049]] 3305e5c31af7Sopenharmony_ci If any two subpasses operate on attachments with overlapping ranges of 3306e5c31af7Sopenharmony_ci the same sname:VkDeviceMemory object, and at least one subpass writes to 3307e5c31af7Sopenharmony_ci that area of sname:VkDeviceMemory, a subpass dependency must: be 3308e5c31af7Sopenharmony_ci included (either directly or via some intermediate subpasses) between 3309e5c31af7Sopenharmony_ci them 3310e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassCreateInfo2-attachment-03050]] 3311e5c31af7Sopenharmony_ci If the pname:attachment member of any element of 3312e5c31af7Sopenharmony_ci pname:pInputAttachments, pname:pColorAttachments, 3313e5c31af7Sopenharmony_ci pname:pResolveAttachments or pname:pDepthStencilAttachment, or the 3314e5c31af7Sopenharmony_ci attachment indexed by any element of pname:pPreserveAttachments in any 3315e5c31af7Sopenharmony_ci element of pname:pSubpasses is bound to a range of a 3316e5c31af7Sopenharmony_ci sname:VkDeviceMemory object that overlaps with any other attachment in 3317e5c31af7Sopenharmony_ci any subpass (including the same subpass), the 3318e5c31af7Sopenharmony_ci sname:VkAttachmentDescription2 structures describing them must: include 3319e5c31af7Sopenharmony_ci ename:VK_ATTACHMENT_DESCRIPTION_MAY_ALIAS_BIT in pname:flags 3320e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassCreateInfo2-attachment-03051]] 3321e5c31af7Sopenharmony_ci If the pname:attachment member of any element of 3322e5c31af7Sopenharmony_ci pname:pInputAttachments, pname:pColorAttachments, 3323e5c31af7Sopenharmony_ci pname:pResolveAttachments or pname:pDepthStencilAttachment, or any 3324e5c31af7Sopenharmony_ci element of pname:pPreserveAttachments in any element of pname:pSubpasses 3325e5c31af7Sopenharmony_ci is not ename:VK_ATTACHMENT_UNUSED, then it must: be less than 3326e5c31af7Sopenharmony_ci pname:attachmentCount 3327e5c31af7Sopenharmony_ciifdef::VK_EXT_fragment_density_map[] 3328e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassCreateInfo2-fragmentDensityMapAttachment-06472]] 3329e5c31af7Sopenharmony_ci If the pNext chain includes a 3330e5c31af7Sopenharmony_ci slink:VkRenderPassFragmentDensityMapCreateInfoEXT structure and the 3331e5c31af7Sopenharmony_ci pname:fragmentDensityMapAttachment member is not 3332e5c31af7Sopenharmony_ci ename:VK_ATTACHMENT_UNUSED, then pname:attachment must: be less than 3333e5c31af7Sopenharmony_ci pname:attachmentCount 3334e5c31af7Sopenharmony_ciendif::VK_EXT_fragment_density_map[] 3335e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_KHR_depth_stencil_resolve[] 3336e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassCreateInfo2-pSubpasses-06473]] 3337e5c31af7Sopenharmony_ci If the pname:pSubpasses pNext chain includes a 3338e5c31af7Sopenharmony_ci slink:VkSubpassDescriptionDepthStencilResolve structure and the 3339e5c31af7Sopenharmony_ci pname:pDepthStencilResolveAttachment member is not `NULL` and does not 3340e5c31af7Sopenharmony_ci have the value ename:VK_ATTACHMENT_UNUSED, then pname:attachment must: 3341e5c31af7Sopenharmony_ci be less than pname:attachmentCount 3342e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_KHR_depth_stencil_resolve[] 3343e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassCreateInfo2-pAttachments-02522]] 3344e5c31af7Sopenharmony_ci For any member of pname:pAttachments with a pname:loadOp equal to 3345e5c31af7Sopenharmony_ci ename:VK_ATTACHMENT_LOAD_OP_CLEAR, the first use of that attachment 3346e5c31af7Sopenharmony_ci must: not specify a pname:layout equal to 3347e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, 3348e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL, or 3349e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL 3350e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassCreateInfo2-pAttachments-02523]] 3351e5c31af7Sopenharmony_ci For any member of pname:pAttachments with a pname:stencilLoadOp equal to 3352e5c31af7Sopenharmony_ci ename:VK_ATTACHMENT_LOAD_OP_CLEAR, the first use of that attachment 3353e5c31af7Sopenharmony_ci must: not specify a pname:layout equal to 3354e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, 3355e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL, or 3356e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL 3357e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassCreateInfo2-pDependencies-03054]] 3358e5c31af7Sopenharmony_ci For any element of pname:pDependencies, if the pname:srcSubpass is not 3359e5c31af7Sopenharmony_ci ename:VK_SUBPASS_EXTERNAL, all stage flags included in the 3360e5c31af7Sopenharmony_ci pname:srcStageMask member of that dependency must: be a pipeline stage 3361e5c31af7Sopenharmony_ci supported by the <<synchronization-pipeline-stages-types, pipeline>> 3362e5c31af7Sopenharmony_ci identified by the pname:pipelineBindPoint member of the source subpass 3363e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassCreateInfo2-pDependencies-03055]] 3364e5c31af7Sopenharmony_ci For any element of pname:pDependencies, if the pname:dstSubpass is not 3365e5c31af7Sopenharmony_ci ename:VK_SUBPASS_EXTERNAL, all stage flags included in the 3366e5c31af7Sopenharmony_ci pname:dstStageMask member of that dependency must: be a pipeline stage 3367e5c31af7Sopenharmony_ci supported by the <<synchronization-pipeline-stages-types, pipeline>> 3368e5c31af7Sopenharmony_ci identified by the pname:pipelineBindPoint member of the destination 3369e5c31af7Sopenharmony_ci subpass 3370e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassCreateInfo2-pCorrelatedViewMasks-03056]] 3371e5c31af7Sopenharmony_ci The set of bits included in any element of pname:pCorrelatedViewMasks 3372e5c31af7Sopenharmony_ci must: not overlap with the set of bits included in any other element of 3373e5c31af7Sopenharmony_ci pname:pCorrelatedViewMasks 3374e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassCreateInfo2-viewMask-03057]] 3375e5c31af7Sopenharmony_ci If the slink:VkSubpassDescription2::pname:viewMask member of all 3376e5c31af7Sopenharmony_ci elements of pname:pSubpasses is `0`, pname:correlatedViewMaskCount must: 3377e5c31af7Sopenharmony_ci be `0` 3378e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassCreateInfo2-viewMask-03058]] 3379e5c31af7Sopenharmony_ci The slink:VkSubpassDescription2::pname:viewMask member of all elements 3380e5c31af7Sopenharmony_ci of pname:pSubpasses must: either all be `0`, or all not be `0` 3381e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassCreateInfo2-viewMask-03059]] 3382e5c31af7Sopenharmony_ci If the slink:VkSubpassDescription2::pname:viewMask member of all 3383e5c31af7Sopenharmony_ci elements of pname:pSubpasses is `0`, the pname:dependencyFlags member of 3384e5c31af7Sopenharmony_ci any element of pname:pDependencies must: not include 3385e5c31af7Sopenharmony_ci ename:VK_DEPENDENCY_VIEW_LOCAL_BIT 3386e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassCreateInfo2-pDependencies-03060]] 3387e5c31af7Sopenharmony_ci For any element of pname:pDependencies where its pname:srcSubpass member 3388e5c31af7Sopenharmony_ci equals its pname:dstSubpass member, if the pname:viewMask member of the 3389e5c31af7Sopenharmony_ci corresponding element of pname:pSubpasses includes more than one bit, 3390e5c31af7Sopenharmony_ci its pname:dependencyFlags member must: include 3391e5c31af7Sopenharmony_ci ename:VK_DEPENDENCY_VIEW_LOCAL_BIT 3392e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassCreateInfo2-attachment-02525]] 3393e5c31af7Sopenharmony_ci If the pname:attachment member of any element of the 3394e5c31af7Sopenharmony_ci pname:pInputAttachments member of any element of pname:pSubpasses is not 3395e5c31af7Sopenharmony_ci ename:VK_ATTACHMENT_UNUSED, the pname:aspectMask member of that element 3396e5c31af7Sopenharmony_ci of pname:pInputAttachments must: only include aspects that are present 3397e5c31af7Sopenharmony_ci in images of the format specified by the element of pname:pAttachments 3398e5c31af7Sopenharmony_ci specified by pname:attachment 3399e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassCreateInfo2-srcSubpass-02526]] 3400e5c31af7Sopenharmony_ci The pname:srcSubpass member of each element of pname:pDependencies must: 3401e5c31af7Sopenharmony_ci be less than pname:subpassCount 3402e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassCreateInfo2-dstSubpass-02527]] 3403e5c31af7Sopenharmony_ci The pname:dstSubpass member of each element of pname:pDependencies must: 3404e5c31af7Sopenharmony_ci be less than pname:subpassCount 3405e5c31af7Sopenharmony_ciifdef::VK_KHR_fragment_shading_rate[] 3406e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassCreateInfo2-pAttachments-04585]] 3407e5c31af7Sopenharmony_ci If any element of pname:pAttachments is used as a fragment shading rate 3408e5c31af7Sopenharmony_ci attachment in any subpass, it must: not be used as any other attachment 3409e5c31af7Sopenharmony_ci in the render pass 3410e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassCreateInfo2-pAttachments-09387]] 3411e5c31af7Sopenharmony_ci If any element of pname:pAttachments is used as a fragment shading rate 3412e5c31af7Sopenharmony_ci attachment, the pname:loadOp for that attachment must: not be 3413e5c31af7Sopenharmony_ci ename:VK_ATTACHMENT_LOAD_OP_CLEAR 3414e5c31af7Sopenharmony_ciifdef::VK_QCOM_render_pass_transform[] 3415e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassCreateInfo2-flags-04521]] 3416e5c31af7Sopenharmony_ci If pname:flags includes ename:VK_RENDER_PASS_CREATE_TRANSFORM_BIT_QCOM, 3417e5c31af7Sopenharmony_ci an element of pname:pSubpasses includes an instance of 3418e5c31af7Sopenharmony_ci slink:VkFragmentShadingRateAttachmentInfoKHR in its pname:pNext chain, 3419e5c31af7Sopenharmony_ci and the pname:pFragmentShadingRateAttachment member of that structure is 3420e5c31af7Sopenharmony_ci not equal to `NULL`, the pname:attachment member of 3421e5c31af7Sopenharmony_ci pname:pFragmentShadingRateAttachment must: be ename:VK_ATTACHMENT_UNUSED 3422e5c31af7Sopenharmony_ciendif::VK_QCOM_render_pass_transform[] 3423e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassCreateInfo2-pAttachments-04586]] 3424e5c31af7Sopenharmony_ci If any element of pname:pAttachments is used as a fragment shading rate 3425e5c31af7Sopenharmony_ci attachment in any subpass, it must: have an image format whose 3426e5c31af7Sopenharmony_ci <<potential-format-features, potential format features>> contain 3427e5c31af7Sopenharmony_ci ename:VK_FORMAT_FEATURE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR 3428e5c31af7Sopenharmony_ciendif::VK_KHR_fragment_shading_rate[] 3429e5c31af7Sopenharmony_ciifdef::VK_QCOM_render_pass_shader_resolve[] 3430e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassCreateInfo2-rasterizationSamples-04905]] 3431e5c31af7Sopenharmony_ci If the pipeline is being created with fragment shader state, and the 3432e5c31af7Sopenharmony_ci `apiext:VK_QCOM_render_pass_shader_resolve extension` is enabled, and if 3433e5c31af7Sopenharmony_ci subpass has any input attachments, and if the subpass description 3434e5c31af7Sopenharmony_ci contains ename:VK_SUBPASS_DESCRIPTION_FRAGMENT_REGION_BIT_QCOM, then the 3435e5c31af7Sopenharmony_ci sample count of the input attachments must: equal 3436e5c31af7Sopenharmony_ci pname:rasterizationSamples 3437e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassCreateInfo2-sampleShadingEnable-04906]] 3438e5c31af7Sopenharmony_ci If the pipeline is being created with fragment shader state, and the 3439e5c31af7Sopenharmony_ci `apiext:VK_QCOM_render_pass_shader_resolve` extension is enabled, and if 3440e5c31af7Sopenharmony_ci the subpass description contains 3441e5c31af7Sopenharmony_ci ename:VK_SUBPASS_DESCRIPTION_FRAGMENT_REGION_BIT_QCOM, then 3442e5c31af7Sopenharmony_ci pname:sampleShadingEnable must: be false 3443e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassCreateInfo2-flags-04907]] 3444e5c31af7Sopenharmony_ci If pname:flags includes 3445e5c31af7Sopenharmony_ci ename:VK_SUBPASS_DESCRIPTION_SHADER_RESOLVE_BIT_QCOM, and if 3446e5c31af7Sopenharmony_ci pname:pResolveAttachments is not `NULL`, then each resolve attachment 3447e5c31af7Sopenharmony_ci must: be ename:VK_ATTACHMENT_UNUSED 3448e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassCreateInfo2-flags-04908]] 3449e5c31af7Sopenharmony_ci If pname:flags includes 3450e5c31af7Sopenharmony_ci ename:VK_SUBPASS_DESCRIPTION_SHADER_RESOLVE_BIT_QCOM, and if 3451e5c31af7Sopenharmony_ci pname:pDepthStencilResolveAttachment is not `NULL`, then the 3452e5c31af7Sopenharmony_ci depth/stencil resolve attachment must: be ename:VK_ATTACHMENT_UNUSED 3453e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassCreateInfo2-flags-04909]] 3454e5c31af7Sopenharmony_ci If pname:flags includes 3455e5c31af7Sopenharmony_ci ename:VK_SUBPASS_DESCRIPTION_SHADER_RESOLVE_BIT_QCOM, then the subpass 3456e5c31af7Sopenharmony_ci must: be the last subpass in a subpass dependency chain 3457e5c31af7Sopenharmony_ciendif::VK_QCOM_render_pass_shader_resolve[] 3458e5c31af7Sopenharmony_ciifdef::VKSC_VERSION_1_0[] 3459e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassCreateInfo2-subpassCount-05055]] 3460e5c31af7Sopenharmony_ci pname:subpassCount must: be less than or equal to 3461e5c31af7Sopenharmony_ci <<limits-maxRenderPassSubpasses,maxRenderPassSubpasses>> 3462e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassCreateInfo2-dependencyCount-05056]] 3463e5c31af7Sopenharmony_ci pname:dependencyCount must: be less than or equal to 3464e5c31af7Sopenharmony_ci <<limits-maxRenderPassDependencies,maxRenderPassDependencies>> 3465e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassCreateInfo2-attachmentCount-05057]] 3466e5c31af7Sopenharmony_ci pname:attachmentCount must: be less than or equal to 3467e5c31af7Sopenharmony_ci <<limits-maxFramebufferAttachments,maxFramebufferAttachments>> 3468e5c31af7Sopenharmony_ciendif::VKSC_VERSION_1_0[] 3469e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_KHR_separate_depth_stencil_layouts[] 3470e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassCreateInfo2-attachment-06244]] 3471e5c31af7Sopenharmony_ci If the pname:attachment member of the pname:pDepthStencilAttachment 3472e5c31af7Sopenharmony_ci member of an element of pname:pSubpasses is not 3473e5c31af7Sopenharmony_ci ename:VK_ATTACHMENT_UNUSED, the pname:layout member of that same 3474e5c31af7Sopenharmony_ci structure is either ename:VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL or 3475e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL, and the pname:pNext chain 3476e5c31af7Sopenharmony_ci of that structure does not include a 3477e5c31af7Sopenharmony_ci slink:VkAttachmentReferenceStencilLayout structure, then the element of 3478e5c31af7Sopenharmony_ci pname:pAttachments with an index equal to pname:attachment must: not 3479e5c31af7Sopenharmony_ci have a pname:format that includes both depth and stencil components 3480e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassCreateInfo2-attachment-06245]] 3481e5c31af7Sopenharmony_ci If the pname:attachment member of the pname:pDepthStencilAttachment 3482e5c31af7Sopenharmony_ci member of an element of pname:pSubpasses is not 3483e5c31af7Sopenharmony_ci ename:VK_ATTACHMENT_UNUSED and the pname:layout member of that same 3484e5c31af7Sopenharmony_ci structure is either ename:VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL or 3485e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL, then the element of 3486e5c31af7Sopenharmony_ci pname:pAttachments with an index equal to pname:attachment must: have a 3487e5c31af7Sopenharmony_ci pname:format that includes only a stencil component 3488e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassCreateInfo2-attachment-06246]] 3489e5c31af7Sopenharmony_ci If the pname:attachment member of the pname:pDepthStencilAttachment 3490e5c31af7Sopenharmony_ci member of an element of pname:pSubpasses is not 3491e5c31af7Sopenharmony_ci ename:VK_ATTACHMENT_UNUSED and the pname:layout member of that same 3492e5c31af7Sopenharmony_ci structure is either ename:VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL or 3493e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL, then the element of 3494e5c31af7Sopenharmony_ci pname:pAttachments with an index equal to pname:attachment must: not 3495e5c31af7Sopenharmony_ci have a pname:format that includes only a stencil component 3496e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_KHR_separate_depth_stencil_layouts[] 3497e5c31af7Sopenharmony_ciifdef::VK_ANDROID_external_format_resolve[] 3498e5c31af7Sopenharmony_ciifdef::VK_EXT_fragment_density_map[] 3499e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassCreateInfo2-pResolveAttachments-09331]] 3500e5c31af7Sopenharmony_ci If any element of pname:pResolveAttachments of any element of 3501e5c31af7Sopenharmony_ci pname:pSubpasses references an attachment description with a format of 3502e5c31af7Sopenharmony_ci ename:VK_FORMAT_UNDEFINED, 3503e5c31af7Sopenharmony_ci slink:VkRenderPassFragmentDensityMapCreateInfoEXT::pname:fragmentDensityMapAttachment->attachment 3504e5c31af7Sopenharmony_ci must: be ename:VK_ATTACHMENT_UNUSED 3505e5c31af7Sopenharmony_ciendif::VK_EXT_fragment_density_map[] 3506e5c31af7Sopenharmony_ciendif::VK_ANDROID_external_format_resolve[] 3507e5c31af7Sopenharmony_ci**** 3508e5c31af7Sopenharmony_ci 3509e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkRenderPassCreateInfo2.adoc[] 3510e5c31af7Sopenharmony_ci-- 3511e5c31af7Sopenharmony_ci 3512e5c31af7Sopenharmony_ci[open,refpage='VkAttachmentDescription2',desc='Structure specifying an attachment description',type='structs',alias='VkAttachmentDescription2KHR'] 3513e5c31af7Sopenharmony_ci-- 3514e5c31af7Sopenharmony_ci:refpage: VkAttachmentDescription2 3515e5c31af7Sopenharmony_ci 3516e5c31af7Sopenharmony_ciThe sname:VkAttachmentDescription2 structure is defined as: 3517e5c31af7Sopenharmony_ci 3518e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkAttachmentDescription2.adoc[] 3519e5c31af7Sopenharmony_ci 3520e5c31af7Sopenharmony_ciifdef::VK_KHR_create_renderpass2[] 3521e5c31af7Sopenharmony_cior the equivalent 3522e5c31af7Sopenharmony_ci 3523e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkAttachmentDescription2KHR.adoc[] 3524e5c31af7Sopenharmony_ciendif::VK_KHR_create_renderpass2[] 3525e5c31af7Sopenharmony_ci 3526e5c31af7Sopenharmony_ci * pname:sType is a elink:VkStructureType value identifying this structure. 3527e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 3528e5c31af7Sopenharmony_ci structure. 3529e5c31af7Sopenharmony_ci * pname:flags is a bitmask of elink:VkAttachmentDescriptionFlagBits 3530e5c31af7Sopenharmony_ci specifying additional properties of the attachment. 3531e5c31af7Sopenharmony_ci * pname:format is a elink:VkFormat value specifying the format of the 3532e5c31af7Sopenharmony_ci image that will be used for the attachment. 3533e5c31af7Sopenharmony_ci * pname:samples is a elink:VkSampleCountFlagBits value specifying the 3534e5c31af7Sopenharmony_ci number of samples of the image. 3535e5c31af7Sopenharmony_ci * pname:loadOp is a elink:VkAttachmentLoadOp value specifying how the 3536e5c31af7Sopenharmony_ci contents of color and depth components of the attachment are treated at 3537e5c31af7Sopenharmony_ci the beginning of the subpass where it is first used. 3538e5c31af7Sopenharmony_ci * pname:storeOp is a elink:VkAttachmentStoreOp value specifying how the 3539e5c31af7Sopenharmony_ci contents of color and depth components of the attachment are treated at 3540e5c31af7Sopenharmony_ci the end of the subpass where it is last used. 3541e5c31af7Sopenharmony_ci * pname:stencilLoadOp is a elink:VkAttachmentLoadOp value specifying how 3542e5c31af7Sopenharmony_ci the contents of stencil components of the attachment are treated at the 3543e5c31af7Sopenharmony_ci beginning of the subpass where it is first used. 3544e5c31af7Sopenharmony_ci * pname:stencilStoreOp is a elink:VkAttachmentStoreOp value specifying how 3545e5c31af7Sopenharmony_ci the contents of stencil components of the attachment are treated at the 3546e5c31af7Sopenharmony_ci end of the last subpass where it is used. 3547e5c31af7Sopenharmony_ci * pname:initialLayout is the layout the attachment image subresource will 3548e5c31af7Sopenharmony_ci be in when a render pass instance begins. 3549e5c31af7Sopenharmony_ci * pname:finalLayout is the layout the attachment image subresource will be 3550e5c31af7Sopenharmony_ci transitioned to when a render pass instance ends. 3551e5c31af7Sopenharmony_ci 3552e5c31af7Sopenharmony_ciParameters defined by this structure with the same name as those in 3553e5c31af7Sopenharmony_cislink:VkAttachmentDescription have the identical effect to those parameters. 3554e5c31af7Sopenharmony_ci 3555e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_KHR_separate_depth_stencil_layouts[] 3556e5c31af7Sopenharmony_ciIf the <<features-separateDepthStencilLayouts, 3557e5c31af7Sopenharmony_cipname:separateDepthStencilLayouts>> feature is enabled, and pname:format is 3558e5c31af7Sopenharmony_cia depth/stencil format, pname:initialLayout and pname:finalLayout can: be 3559e5c31af7Sopenharmony_ciset to a layout that only specifies the layout of the depth aspect. 3560e5c31af7Sopenharmony_ci 3561e5c31af7Sopenharmony_ciIf the pname:pNext chain includes a 3562e5c31af7Sopenharmony_cislink:VkAttachmentDescriptionStencilLayout structure, then the 3563e5c31af7Sopenharmony_cipname:stencilInitialLayout and pname:stencilFinalLayout members specify the 3564e5c31af7Sopenharmony_ciinitial and final layouts of the stencil aspect of a depth/stencil format, 3565e5c31af7Sopenharmony_ciand pname:initialLayout and pname:finalLayout only apply to the depth 3566e5c31af7Sopenharmony_ciaspect. 3567e5c31af7Sopenharmony_ciFor depth-only formats, the slink:VkAttachmentDescriptionStencilLayout 3568e5c31af7Sopenharmony_cistructure is ignored. 3569e5c31af7Sopenharmony_ciFor stencil-only formats, the initial and final layouts of the stencil 3570e5c31af7Sopenharmony_ciaspect are taken from the slink:VkAttachmentDescriptionStencilLayout 3571e5c31af7Sopenharmony_cistructure if present, or pname:initialLayout and pname:finalLayout if not 3572e5c31af7Sopenharmony_cipresent. 3573e5c31af7Sopenharmony_ci 3574e5c31af7Sopenharmony_ciIf pname:format is a depth/stencil format, and either pname:initialLayout or 3575e5c31af7Sopenharmony_cipname:finalLayout does not specify a layout for the stencil aspect, then the 3576e5c31af7Sopenharmony_ciapplication must: specify the initial and final layouts of the stencil 3577e5c31af7Sopenharmony_ciaspect by including a slink:VkAttachmentDescriptionStencilLayout structure 3578e5c31af7Sopenharmony_ciin the pname:pNext chain. 3579e5c31af7Sopenharmony_ci 3580e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_KHR_separate_depth_stencil_layouts[] 3581e5c31af7Sopenharmony_ci 3582e5c31af7Sopenharmony_ciifdef::VK_KHR_fragment_shading_rate[] 3583e5c31af7Sopenharmony_cipname:loadOp and pname:storeOp are ignored for fragment shading rate 3584e5c31af7Sopenharmony_ciattachments. 3585e5c31af7Sopenharmony_ciNo access to the shading rate attachment is performed in pname:loadOp and 3586e5c31af7Sopenharmony_cipname:storeOp. 3587e5c31af7Sopenharmony_ciInstead, access to 3588e5c31af7Sopenharmony_ciename:VK_ACCESS_FRAGMENT_SHADING_RATE_ATTACHMENT_READ_BIT_KHR is performed 3589e5c31af7Sopenharmony_cias fragments are rasterized. 3590e5c31af7Sopenharmony_ciendif::VK_KHR_fragment_shading_rate[] 3591e5c31af7Sopenharmony_ci 3592e5c31af7Sopenharmony_ci.Valid Usage 3593e5c31af7Sopenharmony_ci**** 3594e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/attachment_description_common.adoc[] 3595e5c31af7Sopenharmony_ci * [[VUID-VkAttachmentDescription2-pNext-06704]] 3596e5c31af7Sopenharmony_ci If 3597e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_KHR_separate_depth_stencil_layouts[] 3598e5c31af7Sopenharmony_ci the pname:pNext chain does not include a 3599e5c31af7Sopenharmony_ci slink:VkAttachmentDescriptionStencilLayout structure, 3600e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_KHR_separate_depth_stencil_layouts[] 3601e5c31af7Sopenharmony_ci pname:format includes a stencil component, and pname:stencilLoadOp is 3602e5c31af7Sopenharmony_ci ename:VK_ATTACHMENT_LOAD_OP_LOAD, then pname:initialLayout must: not be 3603e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_UNDEFINED 3604e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_KHR_separate_depth_stencil_layouts[] 3605e5c31af7Sopenharmony_ci * [[VUID-VkAttachmentDescription2-pNext-06705]] 3606e5c31af7Sopenharmony_ci If the pname:pNext chain includes a 3607e5c31af7Sopenharmony_ci slink:VkAttachmentDescriptionStencilLayout structure, pname:format 3608e5c31af7Sopenharmony_ci includes a stencil component, and pname:stencilLoadOp is 3609e5c31af7Sopenharmony_ci ename:VK_ATTACHMENT_LOAD_OP_LOAD, then 3610e5c31af7Sopenharmony_ci slink:VkAttachmentDescriptionStencilLayout::pname:stencilInitialLayout 3611e5c31af7Sopenharmony_ci must: not be ename:VK_IMAGE_LAYOUT_UNDEFINED 3612e5c31af7Sopenharmony_ci * [[VUID-VkAttachmentDescription2-format-06249]] 3613e5c31af7Sopenharmony_ci If pname:format is a depth/stencil format which includes both depth and 3614e5c31af7Sopenharmony_ci stencil components, and pname:initialLayout is 3615e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL or 3616e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL, the pname:pNext chain 3617e5c31af7Sopenharmony_ci must: include a slink:VkAttachmentDescriptionStencilLayout structure 3618e5c31af7Sopenharmony_ci * [[VUID-VkAttachmentDescription2-format-06250]] 3619e5c31af7Sopenharmony_ci If pname:format is a depth/stencil format which includes both depth and 3620e5c31af7Sopenharmony_ci stencil components, and pname:finalLayout is 3621e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL or 3622e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL, the pname:pNext chain 3623e5c31af7Sopenharmony_ci must: include a slink:VkAttachmentDescriptionStencilLayout structure 3624e5c31af7Sopenharmony_ci * [[VUID-VkAttachmentDescription2-format-06247]] 3625e5c31af7Sopenharmony_ci If the pname:pNext chain does not include a 3626e5c31af7Sopenharmony_ci slink:VkAttachmentDescriptionStencilLayout structure and pname:format 3627e5c31af7Sopenharmony_ci only includes a stencil component, pname:initialLayout must: not be 3628e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL or 3629e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL 3630e5c31af7Sopenharmony_ci * [[VUID-VkAttachmentDescription2-format-06248]] 3631e5c31af7Sopenharmony_ci If the pname:pNext chain does not include a 3632e5c31af7Sopenharmony_ci slink:VkAttachmentDescriptionStencilLayout structure and pname:format 3633e5c31af7Sopenharmony_ci only includes a stencil component, pname:finalLayout must: not be 3634e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL or 3635e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL 3636e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_KHR_separate_depth_stencil_layouts[] 3637e5c31af7Sopenharmony_ci * [[VUID-VkAttachmentDescription2-format-09332]] 3638e5c31af7Sopenharmony_ciifdef::VK_ANDROID_external_format_resolve[] 3639e5c31af7Sopenharmony_ci If <<features-externalFormatResolve,pname:externalFormatResolve>> is not 3640e5c31af7Sopenharmony_ci enabled, 3641e5c31af7Sopenharmony_ciendif::VK_ANDROID_external_format_resolve[] 3642e5c31af7Sopenharmony_ci pname:format must: not be ename:VK_FORMAT_UNDEFINED 3643e5c31af7Sopenharmony_ciifdef::VK_ANDROID_external_format_resolve[] 3644e5c31af7Sopenharmony_ci * [[VUID-VkAttachmentDescription2-format-09334]] 3645e5c31af7Sopenharmony_ci If pname:format is ename:VK_FORMAT_UNDEFINED, there must: be a 3646e5c31af7Sopenharmony_ci slink:VkExternalFormatANDROID structure in the pname:pNext chain with a 3647e5c31af7Sopenharmony_ci pname:externalFormat that is not equal to `0` 3648e5c31af7Sopenharmony_ciendif::VK_ANDROID_external_format_resolve[] 3649e5c31af7Sopenharmony_ci**** 3650e5c31af7Sopenharmony_ci 3651e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkAttachmentDescription2.adoc[] 3652e5c31af7Sopenharmony_ci-- 3653e5c31af7Sopenharmony_ci 3654e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_KHR_separate_depth_stencil_layouts[] 3655e5c31af7Sopenharmony_ci[open,refpage='VkAttachmentDescriptionStencilLayout',desc='Structure specifying an attachment description',type='structs',alias='VkAttachmentDescriptionStencilLayoutKHR'] 3656e5c31af7Sopenharmony_ci-- 3657e5c31af7Sopenharmony_ciThe sname:VkAttachmentDescriptionStencilLayout structure is defined as: 3658e5c31af7Sopenharmony_ci 3659e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkAttachmentDescriptionStencilLayout.adoc[] 3660e5c31af7Sopenharmony_ci 3661e5c31af7Sopenharmony_ciifdef::VK_KHR_separate_depth_stencil_layouts[] 3662e5c31af7Sopenharmony_cior the equivalent 3663e5c31af7Sopenharmony_ci 3664e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkAttachmentDescriptionStencilLayoutKHR.adoc[] 3665e5c31af7Sopenharmony_ciendif::VK_KHR_separate_depth_stencil_layouts[] 3666e5c31af7Sopenharmony_ci 3667e5c31af7Sopenharmony_ci * pname:sType is a elink:VkStructureType value identifying this structure. 3668e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 3669e5c31af7Sopenharmony_ci structure. 3670e5c31af7Sopenharmony_ci * pname:stencilInitialLayout is the layout the stencil aspect of the 3671e5c31af7Sopenharmony_ci attachment image subresource will be in when a render pass instance 3672e5c31af7Sopenharmony_ci begins. 3673e5c31af7Sopenharmony_ci * pname:stencilFinalLayout is the layout the stencil aspect of the 3674e5c31af7Sopenharmony_ci attachment image subresource will be transitioned to when a render pass 3675e5c31af7Sopenharmony_ci instance ends. 3676e5c31af7Sopenharmony_ci 3677e5c31af7Sopenharmony_ci.Valid Usage 3678e5c31af7Sopenharmony_ci**** 3679e5c31af7Sopenharmony_ci * [[VUID-VkAttachmentDescriptionStencilLayout-stencilInitialLayout-03308]] 3680e5c31af7Sopenharmony_ci pname:stencilInitialLayout must: not be 3681e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, 3682e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL, 3683e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL, 3684e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, 3685e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL, 3686e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL, or 3687e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL 3688e5c31af7Sopenharmony_ci * [[VUID-VkAttachmentDescriptionStencilLayout-stencilFinalLayout-03309]] 3689e5c31af7Sopenharmony_ci pname:stencilFinalLayout must: not be 3690e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, 3691e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL, 3692e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL, 3693e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, 3694e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL, 3695e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL, or 3696e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL 3697e5c31af7Sopenharmony_ci * [[VUID-VkAttachmentDescriptionStencilLayout-stencilFinalLayout-03310]] 3698e5c31af7Sopenharmony_ci pname:stencilFinalLayout must: not be ename:VK_IMAGE_LAYOUT_UNDEFINED or 3699e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_PREINITIALIZED 3700e5c31af7Sopenharmony_ci**** 3701e5c31af7Sopenharmony_ci 3702e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkAttachmentDescriptionStencilLayout.adoc[] 3703e5c31af7Sopenharmony_ci-- 3704e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_KHR_separate_depth_stencil_layouts[] 3705e5c31af7Sopenharmony_ci 3706e5c31af7Sopenharmony_ci[open,refpage='VkSubpassDescription2',desc='Structure specifying a subpass description',type='structs',alias='VkSubpassDescription2KHR'] 3707e5c31af7Sopenharmony_ci-- 3708e5c31af7Sopenharmony_ci:refpage: VkSubpassDescription2 3709e5c31af7Sopenharmony_ci 3710e5c31af7Sopenharmony_ciThe sname:VkSubpassDescription2 structure is defined as: 3711e5c31af7Sopenharmony_ci 3712e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkSubpassDescription2.adoc[] 3713e5c31af7Sopenharmony_ci 3714e5c31af7Sopenharmony_ciifdef::VK_KHR_create_renderpass2[] 3715e5c31af7Sopenharmony_cior the equivalent 3716e5c31af7Sopenharmony_ci 3717e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkSubpassDescription2KHR.adoc[] 3718e5c31af7Sopenharmony_ciendif::VK_KHR_create_renderpass2[] 3719e5c31af7Sopenharmony_ci 3720e5c31af7Sopenharmony_ci * pname:sType is a elink:VkStructureType value identifying this structure. 3721e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 3722e5c31af7Sopenharmony_ci structure. 3723e5c31af7Sopenharmony_ci * pname:flags is a bitmask of elink:VkSubpassDescriptionFlagBits 3724e5c31af7Sopenharmony_ci specifying usage of the subpass. 3725e5c31af7Sopenharmony_ci * pname:pipelineBindPoint is a elink:VkPipelineBindPoint value specifying 3726e5c31af7Sopenharmony_ci the pipeline type supported for this subpass. 3727e5c31af7Sopenharmony_ci * pname:viewMask is a bitfield of view indices describing which views 3728e5c31af7Sopenharmony_ci rendering is broadcast to in this subpass, when multiview is enabled. 3729e5c31af7Sopenharmony_ci * pname:inputAttachmentCount is the number of input attachments. 3730e5c31af7Sopenharmony_ci * pname:pInputAttachments is a pointer to an array of 3731e5c31af7Sopenharmony_ci slink:VkAttachmentReference2 structures defining the input attachments 3732e5c31af7Sopenharmony_ci for this subpass and their layouts. 3733e5c31af7Sopenharmony_ci * pname:colorAttachmentCount is the number of color attachments. 3734e5c31af7Sopenharmony_ci * pname:pColorAttachments is a pointer to an array of 3735e5c31af7Sopenharmony_ci pname:colorAttachmentCount slink:VkAttachmentReference2 structures 3736e5c31af7Sopenharmony_ci defining the color attachments for this subpass and their layouts. 3737e5c31af7Sopenharmony_ci * pname:pResolveAttachments is `NULL` or a pointer to an array of 3738e5c31af7Sopenharmony_ci pname:colorAttachmentCount slink:VkAttachmentReference2 structures 3739e5c31af7Sopenharmony_ci defining the resolve attachments for this subpass and their layouts. 3740e5c31af7Sopenharmony_ci * pname:pDepthStencilAttachment is a pointer to a 3741e5c31af7Sopenharmony_ci slink:VkAttachmentReference2 structure specifying the depth/stencil 3742e5c31af7Sopenharmony_ci attachment for this subpass and its layout. 3743e5c31af7Sopenharmony_ci * pname:preserveAttachmentCount is the number of preserved attachments. 3744e5c31af7Sopenharmony_ci * pname:pPreserveAttachments is a pointer to an array of 3745e5c31af7Sopenharmony_ci pname:preserveAttachmentCount render pass attachment indices identifying 3746e5c31af7Sopenharmony_ci attachments that are not used by this subpass, but whose contents must: 3747e5c31af7Sopenharmony_ci be preserved throughout the subpass. 3748e5c31af7Sopenharmony_ci 3749e5c31af7Sopenharmony_ciParameters defined by this structure with the same name as those in 3750e5c31af7Sopenharmony_cislink:VkSubpassDescription have the identical effect to those parameters. 3751e5c31af7Sopenharmony_ci 3752e5c31af7Sopenharmony_cipname:viewMask has the same effect for the described subpass as 3753e5c31af7Sopenharmony_cislink:VkRenderPassMultiviewCreateInfo::pname:pViewMasks has on each 3754e5c31af7Sopenharmony_cicorresponding subpass. 3755e5c31af7Sopenharmony_ci 3756e5c31af7Sopenharmony_ciifdef::VK_KHR_fragment_shading_rate[] 3757e5c31af7Sopenharmony_ciIf a slink:VkFragmentShadingRateAttachmentInfoKHR structure is included in 3758e5c31af7Sopenharmony_cithe pname:pNext chain, pname:pFragmentShadingRateAttachment is not `NULL`, 3759e5c31af7Sopenharmony_ciand its pname:attachment member is not ename:VK_ATTACHMENT_UNUSED, the 3760e5c31af7Sopenharmony_ciidentified attachment defines a fragment shading rate attachment for that 3761e5c31af7Sopenharmony_cisubpass. 3762e5c31af7Sopenharmony_ciendif::VK_KHR_fragment_shading_rate[] 3763e5c31af7Sopenharmony_ci 3764e5c31af7Sopenharmony_ciifdef::VK_ANDROID_external_format_resolve[] 3765e5c31af7Sopenharmony_ciIf any element of pname:pResolveAttachments is an image specified with an 3766e5c31af7Sopenharmony_cislink:VkExternalFormatANDROID, values in the corresponding color attachment 3767e5c31af7Sopenharmony_ciwill be resolved to the resolve attachment in the same manner as specified 3768e5c31af7Sopenharmony_cifor <<VkResolveModeFlagBits, 3769e5c31af7Sopenharmony_ciename:VK_RESOLVE_MODE_EXTERNAL_FORMAT_DOWNSAMPLE_ANDROID>>. 3770e5c31af7Sopenharmony_ci 3771e5c31af7Sopenharmony_ciIf the <<limits-nullColorAttachmentWithExternalFormatResolve, 3772e5c31af7Sopenharmony_cipname:nullColorAttachmentWithExternalFormatResolve>> limit is ename:VK_TRUE, 3773e5c31af7Sopenharmony_civalues in the color attachment will be loaded from the resolve attachment at 3774e5c31af7Sopenharmony_cithe start of rendering, and may: also be reloaded any time after a resolve 3775e5c31af7Sopenharmony_cioccurs or the resolve attachment is written to; if this occurs it must: 3776e5c31af7Sopenharmony_cihappen-before any writes to the color attachment are performed which 3777e5c31af7Sopenharmony_cihappen-after the resolve that triggers this. 3778e5c31af7Sopenharmony_ciIf any color component in the external format is subsampled, values will be 3779e5c31af7Sopenharmony_ciread from the nearest sample in the image when they are loaded. 3780e5c31af7Sopenharmony_ciIf the color attachment is also used as an input attachment, the same 3781e5c31af7Sopenharmony_cibehavior applies. 3782e5c31af7Sopenharmony_ci 3783e5c31af7Sopenharmony_ciSetting the color attachment to ename:VK_ATTACHMENT_UNUSED when an external 3784e5c31af7Sopenharmony_ciresolve attachment is used and the 3785e5c31af7Sopenharmony_ci<<limits-nullColorAttachmentWithExternalFormatResolve, 3786e5c31af7Sopenharmony_cipname:nullColorAttachmentWithExternalFormatResolve>> limit is ename:VK_TRUE 3787e5c31af7Sopenharmony_ciwill not result in color attachment writes to be discarded for that 3788e5c31af7Sopenharmony_ciattachment. 3789e5c31af7Sopenharmony_ci 3790e5c31af7Sopenharmony_ciWhen <<limits-nullColorAttachmentWithExternalFormatResolve, 3791e5c31af7Sopenharmony_cipname:nullColorAttachmentWithExternalFormatResolve>> is ename:VK_TRUE, the 3792e5c31af7Sopenharmony_cicolor output from the subpass can still be read via an input attachment; but 3793e5c31af7Sopenharmony_cithe application cannot bind an image view for the color attachment as there 3794e5c31af7Sopenharmony_ciis no such image view bound. 3795e5c31af7Sopenharmony_ciInstead to access the data as an input attachment applications can: use the 3796e5c31af7Sopenharmony_ciresolve attachment in its place - using the resolve attachment image for the 3797e5c31af7Sopenharmony_cidescriptor, and setting the corresponding element of pname:pInputAttachments 3798e5c31af7Sopenharmony_cito the index of the resolve attachment. 3799e5c31af7Sopenharmony_ci 3800e5c31af7Sopenharmony_ciLoads or input attachment reads from the resolve attachment are performed as 3801e5c31af7Sopenharmony_ciif using a slink:VkSamplerYcbcrConversionCreateInfo with the following 3802e5c31af7Sopenharmony_ciparameters: 3803e5c31af7Sopenharmony_ci 3804e5c31af7Sopenharmony_ci[source,c] 3805e5c31af7Sopenharmony_ci---- 3806e5c31af7Sopenharmony_ciVkSamplerYcbcrConversionCreateInfo createInfo = { 3807e5c31af7Sopenharmony_ci .sType = VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO, 3808e5c31af7Sopenharmony_ci .pNext = NULL, 3809e5c31af7Sopenharmony_ci .format = VK_FORMAT_UNDEFINED, 3810e5c31af7Sopenharmony_ci .ycbcrModel = VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY, 3811e5c31af7Sopenharmony_ci .ycbcrRange = VK_SAMPLER_YCBCR_RANGE_ITU_FULL, 3812e5c31af7Sopenharmony_ci .components = { 3813e5c31af7Sopenharmony_ci .r = VK_COMPONENT_SWIZZLE_B 3814e5c31af7Sopenharmony_ci .g = VK_COMPONENT_SWIZZLE_R 3815e5c31af7Sopenharmony_ci .b = VK_COMPONENT_SWIZZLE_G 3816e5c31af7Sopenharmony_ci .a = VK_COMPONENT_SWIZZLE_IDENTITY}, 3817e5c31af7Sopenharmony_ci .xChromaOffset = properties.chromaOffsetX, 3818e5c31af7Sopenharmony_ci .yChromaOffset = properties.chromaOffsetY, 3819e5c31af7Sopenharmony_ci .chromaFilter = VK_FILTER_NEAREST, 3820e5c31af7Sopenharmony_ci .forceExplicitReconstruction = ... }; 3821e5c31af7Sopenharmony_ci---- 3822e5c31af7Sopenharmony_ci 3823e5c31af7Sopenharmony_ciwhere `properties` is equal to 3824e5c31af7Sopenharmony_cislink:VkPhysicalDeviceExternalFormatResolvePropertiesANDROID returned by the 3825e5c31af7Sopenharmony_cidevice and `forceExplicitReconstruction` is effectively ignored as the 3826e5c31af7Sopenharmony_ciename:VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY model is used. 3827e5c31af7Sopenharmony_ciThe applied swizzle is the same effective swizzle that would be applied by 3828e5c31af7Sopenharmony_cithe ename:VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_IDENTITY model, but no 3829e5c31af7Sopenharmony_cirange expansion is applied. 3830e5c31af7Sopenharmony_ciendif::VK_ANDROID_external_format_resolve[] 3831e5c31af7Sopenharmony_ci 3832e5c31af7Sopenharmony_ci.Valid Usage 3833e5c31af7Sopenharmony_ci**** 3834e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/subpass_description_common.adoc[] 3835e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_KHR_separate_depth_stencil_layouts[] 3836e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescription2-attachment-06251]] 3837e5c31af7Sopenharmony_ci If the pname:attachment member of pname:pDepthStencilAttachment is not 3838e5c31af7Sopenharmony_ci ename:VK_ATTACHMENT_UNUSED and its pname:pNext chain includes a 3839e5c31af7Sopenharmony_ci slink:VkAttachmentReferenceStencilLayout structure, the pname:layout 3840e5c31af7Sopenharmony_ci member of pname:pDepthStencilAttachment must: not be 3841e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL or 3842e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL 3843e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_KHR_separate_depth_stencil_layouts[] 3844e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescription2-pipelineBindPoint-04953]] 3845e5c31af7Sopenharmony_ci pname:pipelineBindPoint must: be ename:VK_PIPELINE_BIND_POINT_GRAPHICS 3846e5c31af7Sopenharmony_ciifdef::VK_HUAWEI_subpass_shading[] 3847e5c31af7Sopenharmony_ci or ename:VK_PIPELINE_BIND_POINT_SUBPASS_SHADING_HUAWEI 3848e5c31af7Sopenharmony_ciendif::VK_HUAWEI_subpass_shading[] 3849e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescription2-colorAttachmentCount-03063]] 3850e5c31af7Sopenharmony_ci pname:colorAttachmentCount must: be less than or equal to 3851e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceLimits::pname:maxColorAttachments 3852e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescription2-loadOp-03064]] 3853e5c31af7Sopenharmony_ci If the first use of an attachment in this render pass is as an input 3854e5c31af7Sopenharmony_ci attachment, and the attachment is not also used as a color or 3855e5c31af7Sopenharmony_ci depth/stencil attachment in the same subpass, then pname:loadOp must: 3856e5c31af7Sopenharmony_ci not be ename:VK_ATTACHMENT_LOAD_OP_CLEAR 3857e5c31af7Sopenharmony_ciifndef::VK_ANDROID_external_format_resolve[] 3858e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescription2-pResolveAttachments-03065]] 3859e5c31af7Sopenharmony_ci If pname:pResolveAttachments is not `NULL`, for each resolve attachment 3860e5c31af7Sopenharmony_ci that does not have the value ename:VK_ATTACHMENT_UNUSED, the 3861e5c31af7Sopenharmony_ci corresponding color attachment must: not have the value 3862e5c31af7Sopenharmony_ci ename:VK_ATTACHMENT_UNUSED 3863e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescription2-pResolveAttachments-03066]] 3864e5c31af7Sopenharmony_ci If pname:pResolveAttachments is not `NULL`, for each resolve attachment 3865e5c31af7Sopenharmony_ci that is not ename:VK_ATTACHMENT_UNUSED, the corresponding color 3866e5c31af7Sopenharmony_ci attachment must: not have a sample count of ename:VK_SAMPLE_COUNT_1_BIT 3867e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescription2-pResolveAttachments-03068]] 3868e5c31af7Sopenharmony_ci Each element of pname:pResolveAttachments must: have the same 3869e5c31af7Sopenharmony_ci elink:VkFormat as its corresponding color attachment 3870e5c31af7Sopenharmony_ciendif::VK_ANDROID_external_format_resolve[] 3871e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescription2-pResolveAttachments-03067]] 3872e5c31af7Sopenharmony_ci If pname:pResolveAttachments is not `NULL`, each resolve attachment that 3873e5c31af7Sopenharmony_ci is not ename:VK_ATTACHMENT_UNUSED must: have a sample count of 3874e5c31af7Sopenharmony_ci ename:VK_SAMPLE_COUNT_1_BIT 3875e5c31af7Sopenharmony_ciifdef::VK_ANDROID_external_format_resolve[] 3876e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescription2-externalFormatResolve-09335]] 3877e5c31af7Sopenharmony_ci If <<features-externalFormatResolve,pname:externalFormatResolve>> is not 3878e5c31af7Sopenharmony_ci enabled and pname:pResolveAttachments is not `NULL`, for each resolve 3879e5c31af7Sopenharmony_ci attachment that does not have the value ename:VK_ATTACHMENT_UNUSED, the 3880e5c31af7Sopenharmony_ci corresponding color attachment must: not have the value 3881e5c31af7Sopenharmony_ci ename:VK_ATTACHMENT_UNUSED 3882e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescription2-nullColorAttachmentWithExternalFormatResolve-09336]] 3883e5c31af7Sopenharmony_ci If the <<limits-nullColorAttachmentWithExternalFormatResolve, 3884e5c31af7Sopenharmony_ci pname:nullColorAttachmentWithExternalFormatResolve>> property is 3885e5c31af7Sopenharmony_ci ename:VK_FALSE and pname:pResolveAttachments is not `NULL`, for each 3886e5c31af7Sopenharmony_ci resolve attachment that has a format of ename:VK_FORMAT_UNDEFINED, the 3887e5c31af7Sopenharmony_ci corresponding color attachment must: not have the value 3888e5c31af7Sopenharmony_ci ename:VK_ATTACHMENT_UNUSED 3889e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescription2-nullColorAttachmentWithExternalFormatResolve-09337]] 3890e5c31af7Sopenharmony_ci If the <<limits-nullColorAttachmentWithExternalFormatResolve, 3891e5c31af7Sopenharmony_ci pname:nullColorAttachmentWithExternalFormatResolve>> property is 3892e5c31af7Sopenharmony_ci ename:VK_TRUE and pname:pResolveAttachments is not `NULL`, for each 3893e5c31af7Sopenharmony_ci resolve attachment that has a format of ename:VK_FORMAT_UNDEFINED, the 3894e5c31af7Sopenharmony_ci corresponding color attachment must: have the value 3895e5c31af7Sopenharmony_ci ename:VK_ATTACHMENT_UNUSED 3896e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescription2-externalFormatResolve-09338]] 3897e5c31af7Sopenharmony_ci If <<features-externalFormatResolve,pname:externalFormatResolve>> is not 3898e5c31af7Sopenharmony_ci enabled and pname:pResolveAttachments is not `NULL`, for each resolve 3899e5c31af7Sopenharmony_ci attachment that is not ename:VK_ATTACHMENT_UNUSED, the corresponding 3900e5c31af7Sopenharmony_ci color attachment must: not have a sample count of 3901e5c31af7Sopenharmony_ci ename:VK_SAMPLE_COUNT_1_BIT 3902e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescription2-externalFormatResolve-09339]] 3903e5c31af7Sopenharmony_ci If <<features-externalFormatResolve,pname:externalFormatResolve>> is not 3904e5c31af7Sopenharmony_ci enabled, each element of pname:pResolveAttachments must: have the same 3905e5c31af7Sopenharmony_ci elink:VkFormat as its corresponding color attachment 3906e5c31af7Sopenharmony_ciendif::VK_ANDROID_external_format_resolve[] 3907e5c31af7Sopenharmony_ciifdef::VK_EXT_multisampled_render_to_single_sampled[] 3908e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescription2-multisampledRenderToSingleSampled-06869]] 3909e5c31af7Sopenharmony_ci If the <<features-multisampledRenderToSingleSampled, 3910e5c31af7Sopenharmony_ci pname:multisampledRenderToSingleSampled>> feature is not enabled, all 3911e5c31af7Sopenharmony_ci attachments in pname:pColorAttachments that are not 3912e5c31af7Sopenharmony_ci ename:VK_ATTACHMENT_UNUSED must: have the same sample count 3913e5c31af7Sopenharmony_ciendif::VK_EXT_multisampled_render_to_single_sampled[] 3914e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescription2-pInputAttachments-02897]] 3915e5c31af7Sopenharmony_ci All attachments in pname:pInputAttachments that are not 3916e5c31af7Sopenharmony_ci ename:VK_ATTACHMENT_UNUSED 3917e5c31af7Sopenharmony_ciifdef::VK_ANDROID_external_format_resolve[] 3918e5c31af7Sopenharmony_ci and any of the following is true: 3919e5c31af7Sopenharmony_ci ** the <<features-externalFormatResolve, pname:externalFormatResolve>> 3920e5c31af7Sopenharmony_ci feature is not enabled 3921e5c31af7Sopenharmony_ci ** the <<limits-nullColorAttachmentWithExternalFormatResolve, 3922e5c31af7Sopenharmony_ci pname:nullColorAttachmentWithExternalFormatResolve>> property is 3923e5c31af7Sopenharmony_ci ename:VK_FALSE 3924e5c31af7Sopenharmony_ci ** does not have a non-zero value of 3925e5c31af7Sopenharmony_ci slink:VkExternalFormatANDROID::pname:externalFormat 3926e5c31af7Sopenharmony_ciendif::VK_ANDROID_external_format_resolve[] 3927e5c31af7Sopenharmony_ci 3928e5c31af7Sopenharmony_ci+ 3929e5c31af7Sopenharmony_cimust: have image formats whose <<potential-format-features, potential format 3930e5c31af7Sopenharmony_ci features>> contain at least ename:VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT 3931e5c31af7Sopenharmony_ci or ename:VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT 3932e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescription2-pColorAttachments-02898]] 3933e5c31af7Sopenharmony_ci All attachments in pname:pColorAttachments that are not 3934e5c31af7Sopenharmony_ci ename:VK_ATTACHMENT_UNUSED must: have image formats whose 3935e5c31af7Sopenharmony_ci <<potential-format-features, potential format features>> contain 3936e5c31af7Sopenharmony_ci ename:VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT 3937e5c31af7Sopenharmony_ciifndef::VK_ANDROID_external_format_resolve[] 3938e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescription2-pResolveAttachments-02899]] 3939e5c31af7Sopenharmony_ci All attachments in pname:pResolveAttachments that are not 3940e5c31af7Sopenharmony_ci ename:VK_ATTACHMENT_UNUSED must: have image formats whose 3941e5c31af7Sopenharmony_ci <<potential-format-features, potential format features>> contain 3942e5c31af7Sopenharmony_ci ename:VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT 3943e5c31af7Sopenharmony_ciendif::VK_ANDROID_external_format_resolve[] 3944e5c31af7Sopenharmony_ciifdef::VK_ANDROID_external_format_resolve[] 3945e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescription2-pResolveAttachments-09343]] 3946e5c31af7Sopenharmony_ci All attachments in pname:pResolveAttachments that are not 3947e5c31af7Sopenharmony_ci ename:VK_ATTACHMENT_UNUSED and do not have an image format of 3948e5c31af7Sopenharmony_ci ename:VK_FORMAT_UNDEFINED must: have image formats whose 3949e5c31af7Sopenharmony_ci <<potential-format-features, potential format features>> contain 3950e5c31af7Sopenharmony_ci ename:VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT 3951e5c31af7Sopenharmony_ciendif::VK_ANDROID_external_format_resolve[] 3952e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescription2-pDepthStencilAttachment-02900]] 3953e5c31af7Sopenharmony_ci If pname:pDepthStencilAttachment is not `NULL` and the attachment is not 3954e5c31af7Sopenharmony_ci ename:VK_ATTACHMENT_UNUSED then it must: have an image format whose 3955e5c31af7Sopenharmony_ci <<potential-format-features, potential format features>> contain 3956e5c31af7Sopenharmony_ci ename:VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT 3957e5c31af7Sopenharmony_ciifdef::VK_NV_linear_color_attachment[] 3958e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescription2-linearColorAttachment-06499]] 3959e5c31af7Sopenharmony_ci If the <<features-linearColorAttachment, pname:linearColorAttachment>> 3960e5c31af7Sopenharmony_ci feature is enabled and the image is created with 3961e5c31af7Sopenharmony_ci ename:VK_IMAGE_TILING_LINEAR, all attachments in pname:pInputAttachments 3962e5c31af7Sopenharmony_ci that are not ename:VK_ATTACHMENT_UNUSED must: have image formats whose 3963e5c31af7Sopenharmony_ci <<potential-format-features, potential format features>> must: contain 3964e5c31af7Sopenharmony_ci ename:VK_FORMAT_FEATURE_2_LINEAR_COLOR_ATTACHMENT_BIT_NV 3965e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescription2-linearColorAttachment-06500]] 3966e5c31af7Sopenharmony_ci If the <<features-linearColorAttachment, pname:linearColorAttachment>> 3967e5c31af7Sopenharmony_ci feature is enabled and the image is created with 3968e5c31af7Sopenharmony_ci ename:VK_IMAGE_TILING_LINEAR, all attachments in pname:pColorAttachments 3969e5c31af7Sopenharmony_ci that are not ename:VK_ATTACHMENT_UNUSED must: have image formats whose 3970e5c31af7Sopenharmony_ci <<potential-format-features, potential format features>> must: contain 3971e5c31af7Sopenharmony_ci ename:VK_FORMAT_FEATURE_2_LINEAR_COLOR_ATTACHMENT_BIT_NV 3972e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescription2-linearColorAttachment-06501]] 3973e5c31af7Sopenharmony_ci If the <<features-linearColorAttachment, pname:linearColorAttachment>> 3974e5c31af7Sopenharmony_ci feature is enabled and the image is created with 3975e5c31af7Sopenharmony_ci ename:VK_IMAGE_TILING_LINEAR, all attachments in 3976e5c31af7Sopenharmony_ci pname:pResolveAttachments that are not ename:VK_ATTACHMENT_UNUSED must: 3977e5c31af7Sopenharmony_ci have image formats whose <<potential-format-features, potential format 3978e5c31af7Sopenharmony_ci features>> must: contain 3979e5c31af7Sopenharmony_ci ename:VK_FORMAT_FEATURE_2_LINEAR_COLOR_ATTACHMENT_BIT_NV 3980e5c31af7Sopenharmony_ciendif::VK_NV_linear_color_attachment[] 3981e5c31af7Sopenharmony_ciifdef::VK_AMD_mixed_attachment_samples,VK_NV_framebuffer_mixed_samples[] 3982e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescription2-None-09456]] 3983e5c31af7Sopenharmony_ci If either of the following is enabled: 3984e5c31af7Sopenharmony_ciifdef::VK_AMD_mixed_attachment_samples[] 3985e5c31af7Sopenharmony_ci ** The `apiext:VK_AMD_mixed_attachment_samples` extension 3986e5c31af7Sopenharmony_ciendif::VK_AMD_mixed_attachment_samples[] 3987e5c31af7Sopenharmony_ciifdef::VK_NV_framebuffer_mixed_samples[] 3988e5c31af7Sopenharmony_ci ** The `apiext:VK_NV_framebuffer_mixed_samples` extension 3989e5c31af7Sopenharmony_ciendif::VK_NV_framebuffer_mixed_samples[] 3990e5c31af7Sopenharmony_ci 3991e5c31af7Sopenharmony_ci+ 3992e5c31af7Sopenharmony_ciall attachments in pname:pColorAttachments that are not 3993e5c31af7Sopenharmony_ciename:VK_ATTACHMENT_UNUSED must: have a sample count that is smaller than or 3994e5c31af7Sopenharmony_ciequal to the sample count of pname:pDepthStencilAttachment if it is not 3995e5c31af7Sopenharmony_ciename:VK_ATTACHMENT_UNUSED 3996e5c31af7Sopenharmony_ciendif::VK_AMD_mixed_attachment_samples,VK_NV_framebuffer_mixed_samples[] 3997e5c31af7Sopenharmony_ciifdef::VK_EXT_multisampled_render_to_single_sampled[] 3998e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescription2-pNext-06870]] 3999e5c31af7Sopenharmony_ci If the pname:pNext chain includes a 4000e5c31af7Sopenharmony_ci slink:VkMultisampledRenderToSingleSampledInfoEXT structure with 4001e5c31af7Sopenharmony_ci pname:multisampledRenderToSingleSampledEnable equal to ename:VK_TRUE, 4002e5c31af7Sopenharmony_ci then all attachments in pname:pColorAttachments and 4003e5c31af7Sopenharmony_ci pname:pDepthStencilAttachment that are not ename:VK_ATTACHMENT_UNUSED 4004e5c31af7Sopenharmony_ci must: have a sample count that is either ename:VK_SAMPLE_COUNT_1_BIT or 4005e5c31af7Sopenharmony_ci equal to 4006e5c31af7Sopenharmony_ci slink:VkMultisampledRenderToSingleSampledInfoEXT::pname:rasterizationSamples 4007e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescription2-pNext-06871]] 4008e5c31af7Sopenharmony_ci If the pname:pNext chain includes a 4009e5c31af7Sopenharmony_ci slink:VkMultisampledRenderToSingleSampledInfoEXT structure with 4010e5c31af7Sopenharmony_ci pname:multisampledRenderToSingleSampledEnable equal to ename:VK_TRUE, 4011e5c31af7Sopenharmony_ci and pname:pDepthStencilAttachment is not `NULL`, does not have the value 4012e5c31af7Sopenharmony_ci ename:VK_ATTACHMENT_UNUSED, and has a sample count of 4013e5c31af7Sopenharmony_ci ename:VK_SAMPLE_COUNT_1_BIT, the pname:pNext chain must: also include a 4014e5c31af7Sopenharmony_ci slink:VkSubpassDescriptionDepthStencilResolve structure with 4015e5c31af7Sopenharmony_ci pname:pDepthStencilResolveAttachment that is either `NULL` or has the 4016e5c31af7Sopenharmony_ci value ename:VK_ATTACHMENT_UNUSED 4017e5c31af7Sopenharmony_ciendif::VK_EXT_multisampled_render_to_single_sampled[] 4018e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescription2-multisampledRenderToSingleSampled-06872]] 4019e5c31af7Sopenharmony_ci All attachments in pname:pDepthStencilAttachment or 4020e5c31af7Sopenharmony_ci pname:pColorAttachments that are not ename:VK_ATTACHMENT_UNUSED must: 4021e5c31af7Sopenharmony_ci have the same sample count 4022e5c31af7Sopenharmony_ciifdef::VK_AMD_mixed_attachment_samples,VK_NV_framebuffer_mixed_samples,VK_EXT_multisampled_render_to_single_sampled[] 4023e5c31af7Sopenharmony_ci , if none of the following are enabled: 4024e5c31af7Sopenharmony_ciifdef::VK_AMD_mixed_attachment_samples[] 4025e5c31af7Sopenharmony_ci ** The `apiext:VK_AMD_mixed_attachment_samples` extension 4026e5c31af7Sopenharmony_ciendif::VK_AMD_mixed_attachment_samples[] 4027e5c31af7Sopenharmony_ciifdef::VK_NV_framebuffer_mixed_samples[] 4028e5c31af7Sopenharmony_ci ** The `apiext:VK_NV_framebuffer_mixed_samples` extension 4029e5c31af7Sopenharmony_ciendif::VK_NV_framebuffer_mixed_samples[] 4030e5c31af7Sopenharmony_ciifdef::VK_EXT_multisampled_render_to_single_sampled[] 4031e5c31af7Sopenharmony_ci ** The <<features-multisampledRenderToSingleSampled, 4032e5c31af7Sopenharmony_ci pname:multisampledRenderToSingleSampled>> feature, 4033e5c31af7Sopenharmony_ciendif::VK_EXT_multisampled_render_to_single_sampled[] 4034e5c31af7Sopenharmony_ciendif::VK_AMD_mixed_attachment_samples,VK_NV_framebuffer_mixed_samples,VK_EXT_multisampled_render_to_single_sampled[] 4035e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescription2-attachment-03073]] 4036e5c31af7Sopenharmony_ci Each element of pname:pPreserveAttachments must: not be 4037e5c31af7Sopenharmony_ci ename:VK_ATTACHMENT_UNUSED 4038e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescription2-pPreserveAttachments-03074]] 4039e5c31af7Sopenharmony_ci Each element of pname:pPreserveAttachments must: not also be an element 4040e5c31af7Sopenharmony_ci of any other member of the subpass description 4041e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescription2-layout-02528]] 4042e5c31af7Sopenharmony_ci If any attachment is used by more than one slink:VkAttachmentReference2 4043e5c31af7Sopenharmony_ci member, then each use must: use the same pname:layout 4044e5c31af7Sopenharmony_ciifdef::VK_NVX_multiview_per_view_attributes[] 4045e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescription2-flags-03076]] 4046e5c31af7Sopenharmony_ci If pname:flags includes 4047e5c31af7Sopenharmony_ci ename:VK_SUBPASS_DESCRIPTION_PER_VIEW_POSITION_X_ONLY_BIT_NVX, it must: 4048e5c31af7Sopenharmony_ci also include ename:VK_SUBPASS_DESCRIPTION_PER_VIEW_ATTRIBUTES_BIT_NVX 4049e5c31af7Sopenharmony_ciendif::VK_NVX_multiview_per_view_attributes[] 4050e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescription2-attachment-02799]] 4051e5c31af7Sopenharmony_ci If the pname:attachment member of any element of pname:pInputAttachments 4052e5c31af7Sopenharmony_ci is not ename:VK_ATTACHMENT_UNUSED, then the pname:aspectMask member 4053e5c31af7Sopenharmony_ci must: be a valid combination of elink:VkImageAspectFlagBits 4054e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescription2-attachment-02800]] 4055e5c31af7Sopenharmony_ci If the pname:attachment member of any element of pname:pInputAttachments 4056e5c31af7Sopenharmony_ci is not ename:VK_ATTACHMENT_UNUSED, then the pname:aspectMask member 4057e5c31af7Sopenharmony_ci must: not be `0` 4058e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescription2-attachment-02801]] 4059e5c31af7Sopenharmony_ci If the pname:attachment member of any element of pname:pInputAttachments 4060e5c31af7Sopenharmony_ci is not ename:VK_ATTACHMENT_UNUSED, then the pname:aspectMask member 4061e5c31af7Sopenharmony_ci must: not include ename:VK_IMAGE_ASPECT_METADATA_BIT 4062e5c31af7Sopenharmony_ciifdef::VK_EXT_image_drm_format_modifier[] 4063e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescription2-attachment-04563]] 4064e5c31af7Sopenharmony_ci If the pname:attachment member of any element of pname:pInputAttachments 4065e5c31af7Sopenharmony_ci is not ename:VK_ATTACHMENT_UNUSED, then the pname:aspectMask member 4066e5c31af7Sopenharmony_ci must: not include `VK_IMAGE_ASPECT_MEMORY_PLANE__{ibit}__BIT_EXT` for 4067e5c31af7Sopenharmony_ci any index _i_ 4068e5c31af7Sopenharmony_ciendif::VK_EXT_image_drm_format_modifier[] 4069e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescription2-pDepthStencilAttachment-04440]] 4070e5c31af7Sopenharmony_ci An attachment must: not be used in both pname:pDepthStencilAttachment 4071e5c31af7Sopenharmony_ci and pname:pColorAttachments 4072e5c31af7Sopenharmony_ciifdef::VKSC_VERSION_1_0[] 4073e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescription2-inputAttachmentCount-05058]] 4074e5c31af7Sopenharmony_ci pname:inputAttachmentCount must: be less than or equal to 4075e5c31af7Sopenharmony_ci <<limits-maxSubpassInputAttachments,maxSubpassInputAttachments>> 4076e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescription2-preserveAttachmentCount-05059]] 4077e5c31af7Sopenharmony_ci pname:preserveAttachmentCount must: be less than or equal to 4078e5c31af7Sopenharmony_ci <<limits-maxSubpassPreserveAttachments,maxSubpassPreserveAttachments>> 4079e5c31af7Sopenharmony_ciendif::VKSC_VERSION_1_0[] 4080e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_multiview[] 4081e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescription2-multiview-06558]] 4082e5c31af7Sopenharmony_ci If the <<features-multiview, pname:multiview>> feature is not enabled, 4083e5c31af7Sopenharmony_ci pname:viewMask must: be `0` 4084e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescription2-viewMask-06706]] 4085e5c31af7Sopenharmony_ci The index of the most significant bit in pname:viewMask must: be less 4086e5c31af7Sopenharmony_ci than <<limits-maxMultiviewViewCount, pname:maxMultiviewViewCount>> 4087e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_multiview[] 4088e5c31af7Sopenharmony_ciifdef::VK_ANDROID_external_format_resolve[] 4089e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescription2-externalFormatResolve-09344]] 4090e5c31af7Sopenharmony_ci If <<features-externalFormatResolve,pname:externalFormatResolve>> is 4091e5c31af7Sopenharmony_ci enabled, pname:pResolveAttachments is not `NULL`, and 4092e5c31af7Sopenharmony_ci pname:colorAttachmentCount is not `1`, any element of 4093e5c31af7Sopenharmony_ci pname:pResolveAttachments that is not `VK_ATTACHMENT_UNUSED`, must: not 4094e5c31af7Sopenharmony_ci have a format of ename:VK_FORMAT_UNDEFINED 4095e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescription2-externalFormatResolve-09345]] 4096e5c31af7Sopenharmony_ci If <<features-externalFormatResolve,pname:externalFormatResolve>> is 4097e5c31af7Sopenharmony_ci enabled, pname:pResolveAttachments is not `NULL`, any element of 4098e5c31af7Sopenharmony_ci pname:pResolveAttachments is not ename:VK_ATTACHMENT_UNUSED and has a 4099e5c31af7Sopenharmony_ci format of ename:VK_FORMAT_UNDEFINED, and the corresponding element of 4100e5c31af7Sopenharmony_ci pname:pColorAttachments is not ename:VK_ATTACHMENT_UNUSED, the color 4101e5c31af7Sopenharmony_ci attachment must: have a pname:samples value of `1` 4102e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescription2-externalFormatResolve-09346]] 4103e5c31af7Sopenharmony_ci If <<features-externalFormatResolve,pname:externalFormatResolve>> is 4104e5c31af7Sopenharmony_ci enabled, pname:pResolveAttachments is not `NULL`, and any element of 4105e5c31af7Sopenharmony_ci pname:pResolveAttachments is not ename:VK_ATTACHMENT_UNUSED and has a 4106e5c31af7Sopenharmony_ci format of ename:VK_FORMAT_UNDEFINED, pname:viewMask must: be `0` 4107e5c31af7Sopenharmony_ciifdef::VK_KHR_fragment_shading_rate[] 4108e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescription2-externalFormatResolve-09347]] 4109e5c31af7Sopenharmony_ci If <<features-externalFormatResolve,pname:externalFormatResolve>> is 4110e5c31af7Sopenharmony_ci enabled, pname:pResolveAttachments is not `NULL`, and any element of 4111e5c31af7Sopenharmony_ci pname:pResolveAttachments is not ename:VK_ATTACHMENT_UNUSED and has a 4112e5c31af7Sopenharmony_ci format of ename:VK_FORMAT_UNDEFINED, 4113e5c31af7Sopenharmony_ci slink:VkFragmentShadingRateAttachmentInfoKHR::pname:pFragmentShadingRateAttachment 4114e5c31af7Sopenharmony_ci must: either be `NULL` or a slink:VkAttachmentReference2 structure with 4115e5c31af7Sopenharmony_ci a pname:attachment value of ename:VK_ATTACHMENT_UNUSED 4116e5c31af7Sopenharmony_ciendif::VK_KHR_fragment_shading_rate[] 4117e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescription2-externalFormatResolve-09348]] 4118e5c31af7Sopenharmony_ci If <<features-externalFormatResolve,pname:externalFormatResolve>> is 4119e5c31af7Sopenharmony_ci enabled, pname:pResolveAttachments is not `NULL`, and any element of 4120e5c31af7Sopenharmony_ci pname:pResolveAttachments is not ename:VK_ATTACHMENT_UNUSED and has a 4121e5c31af7Sopenharmony_ci format of ename:VK_FORMAT_UNDEFINED, elements of pname:pInputAttachments 4122e5c31af7Sopenharmony_ci referencing either a color attachment or resolve attachment used in this 4123e5c31af7Sopenharmony_ci subpass must: not include `VK_IMAGE_ASPECT_PLANE__{ibit}__BIT` for any 4124e5c31af7Sopenharmony_ci index _i_ in its pname:aspectMask 4125e5c31af7Sopenharmony_ciendif::VK_ANDROID_external_format_resolve[] 4126e5c31af7Sopenharmony_ci**** 4127e5c31af7Sopenharmony_ci 4128e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkSubpassDescription2.adoc[] 4129e5c31af7Sopenharmony_ci-- 4130e5c31af7Sopenharmony_ci 4131e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_KHR_depth_stencil_resolve[] 4132e5c31af7Sopenharmony_ci[open,refpage='VkSubpassDescriptionDepthStencilResolve',desc='Structure specifying depth/stencil resolve operations for a subpass',type='structs',alias='VkSubpassDescriptionDepthStencilResolveKHR'] 4133e5c31af7Sopenharmony_ci-- 4134e5c31af7Sopenharmony_ciThe sname:VkSubpassDescriptionDepthStencilResolve structure is defined as: 4135e5c31af7Sopenharmony_ci 4136e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkSubpassDescriptionDepthStencilResolve.adoc[] 4137e5c31af7Sopenharmony_ci 4138e5c31af7Sopenharmony_ciifdef::VK_KHR_depth_stencil_resolve[] 4139e5c31af7Sopenharmony_cior the equivalent 4140e5c31af7Sopenharmony_ci 4141e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkSubpassDescriptionDepthStencilResolveKHR.adoc[] 4142e5c31af7Sopenharmony_ciendif::VK_KHR_depth_stencil_resolve[] 4143e5c31af7Sopenharmony_ci 4144e5c31af7Sopenharmony_ci * pname:sType is a elink:VkStructureType value identifying this structure. 4145e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 4146e5c31af7Sopenharmony_ci structure. 4147e5c31af7Sopenharmony_ci * pname:depthResolveMode is a elink:VkResolveModeFlagBits value describing 4148e5c31af7Sopenharmony_ci the depth resolve mode. 4149e5c31af7Sopenharmony_ci * pname:stencilResolveMode is a elink:VkResolveModeFlagBits value 4150e5c31af7Sopenharmony_ci describing the stencil resolve mode. 4151e5c31af7Sopenharmony_ci * pname:pDepthStencilResolveAttachment is `NULL` or a pointer to a 4152e5c31af7Sopenharmony_ci slink:VkAttachmentReference2 structure defining the depth/stencil 4153e5c31af7Sopenharmony_ci resolve attachment for this subpass and its layout. 4154e5c31af7Sopenharmony_ci 4155e5c31af7Sopenharmony_ciIf the pname:pNext chain of slink:VkSubpassDescription2 includes a 4156e5c31af7Sopenharmony_cisname:VkSubpassDescriptionDepthStencilResolve structure, then that structure 4157e5c31af7Sopenharmony_cidescribes <<renderpass-resolve-operations, multisample resolve operations>> 4158e5c31af7Sopenharmony_cifor the depth/stencil attachment in a subpass. 4159e5c31af7Sopenharmony_ciIf this structure is not included in the pname:pNext chain of 4160e5c31af7Sopenharmony_cislink:VkSubpassDescription2, or if it is and either 4161e5c31af7Sopenharmony_cipname:pDepthStencilResolveAttachment is `NULL` or its attachment index is 4162e5c31af7Sopenharmony_ciename:VK_ATTACHMENT_UNUSED, it indicates that no depth/stencil resolve 4163e5c31af7Sopenharmony_ciattachment will be used in the subpass. 4164e5c31af7Sopenharmony_ci 4165e5c31af7Sopenharmony_ci.Valid Usage 4166e5c31af7Sopenharmony_ci**** 4167e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescriptionDepthStencilResolve-pDepthStencilResolveAttachment-03177]] 4168e5c31af7Sopenharmony_ci If pname:pDepthStencilResolveAttachment is not `NULL` and does not have 4169e5c31af7Sopenharmony_ci the value ename:VK_ATTACHMENT_UNUSED, pname:pDepthStencilAttachment 4170e5c31af7Sopenharmony_ci must: not be `NULL` or have the value ename:VK_ATTACHMENT_UNUSED 4171e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescriptionDepthStencilResolve-pDepthStencilResolveAttachment-03179]] 4172e5c31af7Sopenharmony_ci If pname:pDepthStencilResolveAttachment is not `NULL` and does not have 4173e5c31af7Sopenharmony_ci the value ename:VK_ATTACHMENT_UNUSED, pname:pDepthStencilAttachment 4174e5c31af7Sopenharmony_ci must: not have a sample count of ename:VK_SAMPLE_COUNT_1_BIT 4175e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescriptionDepthStencilResolve-pDepthStencilResolveAttachment-03180]] 4176e5c31af7Sopenharmony_ci If pname:pDepthStencilResolveAttachment is not `NULL` and does not have 4177e5c31af7Sopenharmony_ci the value ename:VK_ATTACHMENT_UNUSED, 4178e5c31af7Sopenharmony_ci pname:pDepthStencilResolveAttachment must: have a sample count of 4179e5c31af7Sopenharmony_ci ename:VK_SAMPLE_COUNT_1_BIT 4180e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescriptionDepthStencilResolve-pDepthStencilResolveAttachment-02651]] 4181e5c31af7Sopenharmony_ci If pname:pDepthStencilResolveAttachment is not `NULL` and does not have 4182e5c31af7Sopenharmony_ci the value ename:VK_ATTACHMENT_UNUSED then it must: have an image format 4183e5c31af7Sopenharmony_ci whose <<potential-format-features, potential format features>> contain 4184e5c31af7Sopenharmony_ci ename:VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT 4185e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescriptionDepthStencilResolve-pDepthStencilResolveAttachment-03181]] 4186e5c31af7Sopenharmony_ci If pname:pDepthStencilResolveAttachment is not `NULL` and does not have 4187e5c31af7Sopenharmony_ci the value ename:VK_ATTACHMENT_UNUSED and elink:VkFormat of 4188e5c31af7Sopenharmony_ci pname:pDepthStencilResolveAttachment has a depth component, then the 4189e5c31af7Sopenharmony_ci elink:VkFormat of pname:pDepthStencilAttachment must: have a depth 4190e5c31af7Sopenharmony_ci component with the same number of bits and <<formats-numericformat, 4191e5c31af7Sopenharmony_ci numeric format>> 4192e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescriptionDepthStencilResolve-pDepthStencilResolveAttachment-03182]] 4193e5c31af7Sopenharmony_ci If pname:pDepthStencilResolveAttachment is not `NULL` and does not have 4194e5c31af7Sopenharmony_ci the value ename:VK_ATTACHMENT_UNUSED, and elink:VkFormat of 4195e5c31af7Sopenharmony_ci pname:pDepthStencilResolveAttachment has a stencil component, then the 4196e5c31af7Sopenharmony_ci elink:VkFormat of pname:pDepthStencilAttachment must: have a stencil 4197e5c31af7Sopenharmony_ci component with the same number of bits and <<formats-numericformat, 4198e5c31af7Sopenharmony_ci numeric format>> 4199e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescriptionDepthStencilResolve-pDepthStencilResolveAttachment-03178]] 4200e5c31af7Sopenharmony_ci If pname:pDepthStencilResolveAttachment is not `NULL` and does not have 4201e5c31af7Sopenharmony_ci the value ename:VK_ATTACHMENT_UNUSED, pname:depthResolveMode and 4202e5c31af7Sopenharmony_ci pname:stencilResolveMode must: not both be ename:VK_RESOLVE_MODE_NONE 4203e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescriptionDepthStencilResolve-depthResolveMode-03183]] 4204e5c31af7Sopenharmony_ci If pname:pDepthStencilResolveAttachment is not `NULL` and does not have 4205e5c31af7Sopenharmony_ci the value ename:VK_ATTACHMENT_UNUSED and the elink:VkFormat of 4206e5c31af7Sopenharmony_ci pname:pDepthStencilResolveAttachment has a depth component, then the 4207e5c31af7Sopenharmony_ci value of pname:depthResolveMode must: be one of the bits set in 4208e5c31af7Sopenharmony_ci slink:VkPhysicalDeviceDepthStencilResolveProperties::pname:supportedDepthResolveModes 4209e5c31af7Sopenharmony_ci or ename:VK_RESOLVE_MODE_NONE 4210e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescriptionDepthStencilResolve-stencilResolveMode-03184]] 4211e5c31af7Sopenharmony_ci If pname:pDepthStencilResolveAttachment is not `NULL` and does not have 4212e5c31af7Sopenharmony_ci the value ename:VK_ATTACHMENT_UNUSED and the elink:VkFormat of 4213e5c31af7Sopenharmony_ci pname:pDepthStencilResolveAttachment has a stencil component, then the 4214e5c31af7Sopenharmony_ci value of pname:stencilResolveMode must: be one of the bits set in 4215e5c31af7Sopenharmony_ci slink:VkPhysicalDeviceDepthStencilResolveProperties::pname:supportedStencilResolveModes 4216e5c31af7Sopenharmony_ci or ename:VK_RESOLVE_MODE_NONE 4217e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescriptionDepthStencilResolve-pDepthStencilResolveAttachment-03185]] 4218e5c31af7Sopenharmony_ci If pname:pDepthStencilResolveAttachment is not `NULL` and does not have 4219e5c31af7Sopenharmony_ci the value ename:VK_ATTACHMENT_UNUSED, the elink:VkFormat of 4220e5c31af7Sopenharmony_ci pname:pDepthStencilResolveAttachment has both depth and stencil 4221e5c31af7Sopenharmony_ci components, 4222e5c31af7Sopenharmony_ci slink:VkPhysicalDeviceDepthStencilResolveProperties::pname:independentResolve 4223e5c31af7Sopenharmony_ci is ename:VK_FALSE, and 4224e5c31af7Sopenharmony_ci slink:VkPhysicalDeviceDepthStencilResolveProperties::pname:independentResolveNone 4225e5c31af7Sopenharmony_ci is ename:VK_FALSE, then the values of pname:depthResolveMode and 4226e5c31af7Sopenharmony_ci pname:stencilResolveMode must: be identical 4227e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescriptionDepthStencilResolve-pDepthStencilResolveAttachment-03186]] 4228e5c31af7Sopenharmony_ci If pname:pDepthStencilResolveAttachment is not `NULL` and does not have 4229e5c31af7Sopenharmony_ci the value ename:VK_ATTACHMENT_UNUSED, the elink:VkFormat of 4230e5c31af7Sopenharmony_ci pname:pDepthStencilResolveAttachment has both depth and stencil 4231e5c31af7Sopenharmony_ci components, 4232e5c31af7Sopenharmony_ci slink:VkPhysicalDeviceDepthStencilResolveProperties::pname:independentResolve 4233e5c31af7Sopenharmony_ci is ename:VK_FALSE and 4234e5c31af7Sopenharmony_ci slink:VkPhysicalDeviceDepthStencilResolveProperties::pname:independentResolveNone 4235e5c31af7Sopenharmony_ci is ename:VK_TRUE, then the values of pname:depthResolveMode and 4236e5c31af7Sopenharmony_ci pname:stencilResolveMode must: be identical or one of them must: be 4237e5c31af7Sopenharmony_ci ename:VK_RESOLVE_MODE_NONE 4238e5c31af7Sopenharmony_ciifdef::VK_EXT_multisampled_render_to_single_sampled[] 4239e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescriptionDepthStencilResolve-pNext-06873]] 4240e5c31af7Sopenharmony_ci If the pname:pNext chain of slink:VkSubpassDescription2 includes a 4241e5c31af7Sopenharmony_ci sname:VkMultisampledRenderToSingleSampledInfoEXT structure, the 4242e5c31af7Sopenharmony_ci pname:multisampledRenderToSingleSampledEnable field is ename:VK_TRUE, 4243e5c31af7Sopenharmony_ci and pname:pDepthStencilAttachment is not `NULL` and does not have the 4244e5c31af7Sopenharmony_ci value ename:VK_ATTACHMENT_UNUSED, pname:depthResolveMode and 4245e5c31af7Sopenharmony_ci pname:stencilResolveMode must: not both be ename:VK_RESOLVE_MODE_NONE 4246e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescriptionDepthStencilResolve-pNext-06874]] 4247e5c31af7Sopenharmony_ci If the pname:pNext chain of slink:VkSubpassDescription2 includes a 4248e5c31af7Sopenharmony_ci sname:VkMultisampledRenderToSingleSampledInfoEXT structure whose 4249e5c31af7Sopenharmony_ci pname:multisampledRenderToSingleSampledEnable field is ename:VK_TRUE, 4250e5c31af7Sopenharmony_ci and pname:pDepthStencilAttachment is not `NULL`, does not have the value 4251e5c31af7Sopenharmony_ci ename:VK_ATTACHMENT_UNUSED, and has a elink:VkFormat that has a depth 4252e5c31af7Sopenharmony_ci component, then the value of pname:depthResolveMode must: be one of the 4253e5c31af7Sopenharmony_ci bits set in 4254e5c31af7Sopenharmony_ci slink:VkPhysicalDeviceDepthStencilResolveProperties::pname:supportedDepthResolveModes 4255e5c31af7Sopenharmony_ci or ename:VK_RESOLVE_MODE_NONE 4256e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescriptionDepthStencilResolve-pNext-06875]] 4257e5c31af7Sopenharmony_ci If the pname:pNext chain of slink:VkSubpassDescription2 includes a 4258e5c31af7Sopenharmony_ci sname:VkMultisampledRenderToSingleSampledInfoEXT structure whose 4259e5c31af7Sopenharmony_ci pname:multisampledRenderToSingleSampledEnable field is ename:VK_TRUE, 4260e5c31af7Sopenharmony_ci and pname:pDepthStencilAttachment is not `NULL`, does not have the value 4261e5c31af7Sopenharmony_ci ename:VK_ATTACHMENT_UNUSED, and has a elink:VkFormat with a stencil 4262e5c31af7Sopenharmony_ci component, then the value of pname:stencilResolveMode must: be one of 4263e5c31af7Sopenharmony_ci the bits set in 4264e5c31af7Sopenharmony_ci slink:VkPhysicalDeviceDepthStencilResolveProperties::pname:supportedStencilResolveModes 4265e5c31af7Sopenharmony_ci or ename:VK_RESOLVE_MODE_NONE 4266e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescriptionDepthStencilResolve-pNext-06876]] 4267e5c31af7Sopenharmony_ci If the pname:pNext chain of slink:VkSubpassDescription2 includes a 4268e5c31af7Sopenharmony_ci sname:VkMultisampledRenderToSingleSampledInfoEXT structure whose 4269e5c31af7Sopenharmony_ci pname:multisampledRenderToSingleSampledEnable field is ename:VK_TRUE, 4270e5c31af7Sopenharmony_ci pname:pDepthStencilAttachment is not `NULL`, does not have the value 4271e5c31af7Sopenharmony_ci ename:VK_ATTACHMENT_UNUSED, and has a elink:VkFormat with both depth and 4272e5c31af7Sopenharmony_ci stencil components, and both 4273e5c31af7Sopenharmony_ci slink:VkPhysicalDeviceDepthStencilResolveProperties::pname:independentResolve 4274e5c31af7Sopenharmony_ci and 4275e5c31af7Sopenharmony_ci slink:VkPhysicalDeviceDepthStencilResolveProperties::pname:independentResolveNone 4276e5c31af7Sopenharmony_ci are ename:VK_FALSE, then the values of pname:depthResolveMode and 4277e5c31af7Sopenharmony_ci pname:stencilResolveMode must: be identical 4278e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDescriptionDepthStencilResolve-pNext-06877]] 4279e5c31af7Sopenharmony_ci If the pname:pNext chain of slink:VkSubpassDescription2 includes a 4280e5c31af7Sopenharmony_ci sname:VkMultisampledRenderToSingleSampledInfoEXT structure whose 4281e5c31af7Sopenharmony_ci pname:multisampledRenderToSingleSampledEnable field is ename:VK_TRUE, 4282e5c31af7Sopenharmony_ci pname:pDepthStencilAttachment is not `NULL`, does not have the value 4283e5c31af7Sopenharmony_ci ename:VK_ATTACHMENT_UNUSED, and has a elink:VkFormat with both depth and 4284e5c31af7Sopenharmony_ci stencil components, 4285e5c31af7Sopenharmony_ci slink:VkPhysicalDeviceDepthStencilResolveProperties::pname:independentResolve 4286e5c31af7Sopenharmony_ci is ename:VK_FALSE, and 4287e5c31af7Sopenharmony_ci slink:VkPhysicalDeviceDepthStencilResolveProperties::pname:independentResolveNone 4288e5c31af7Sopenharmony_ci is ename:VK_TRUE, then the values of pname:depthResolveMode and 4289e5c31af7Sopenharmony_ci pname:stencilResolveMode must: be identical or one of them must: be 4290e5c31af7Sopenharmony_ci ename:VK_RESOLVE_MODE_NONE 4291e5c31af7Sopenharmony_ciendif::VK_EXT_multisampled_render_to_single_sampled[] 4292e5c31af7Sopenharmony_ci**** 4293e5c31af7Sopenharmony_ci 4294e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkSubpassDescriptionDepthStencilResolve.adoc[] 4295e5c31af7Sopenharmony_ci-- 4296e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_KHR_depth_stencil_resolve[] 4297e5c31af7Sopenharmony_ci 4298e5c31af7Sopenharmony_ci 4299e5c31af7Sopenharmony_ciifdef::VK_KHR_fragment_shading_rate[] 4300e5c31af7Sopenharmony_ci[open,refpage='VkFragmentShadingRateAttachmentInfoKHR',desc='Structure specifying a fragment shading rate attachment for a subpass',type='structs'] 4301e5c31af7Sopenharmony_ci-- 4302e5c31af7Sopenharmony_ciThe sname:VkFragmentShadingRateAttachmentInfoKHR structure is defined as: 4303e5c31af7Sopenharmony_ci 4304e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkFragmentShadingRateAttachmentInfoKHR.adoc[] 4305e5c31af7Sopenharmony_ci 4306e5c31af7Sopenharmony_ci * pname:sType is a elink:VkStructureType value identifying this structure. 4307e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 4308e5c31af7Sopenharmony_ci structure. 4309e5c31af7Sopenharmony_ci * pname:pFragmentShadingRateAttachment is `NULL` or a pointer to a 4310e5c31af7Sopenharmony_ci slink:VkAttachmentReference2 structure defining the fragment shading 4311e5c31af7Sopenharmony_ci rate attachment for this subpass. 4312e5c31af7Sopenharmony_ci * pname:shadingRateAttachmentTexelSize specifies the size of the portion 4313e5c31af7Sopenharmony_ci of the framebuffer corresponding to each texel in 4314e5c31af7Sopenharmony_ci pname:pFragmentShadingRateAttachment. 4315e5c31af7Sopenharmony_ci 4316e5c31af7Sopenharmony_ciIf no shading rate attachment is specified, or if this structure is not 4317e5c31af7Sopenharmony_cispecified, the implementation behaves as if a valid shading rate attachment 4318e5c31af7Sopenharmony_ciwas specified with all texels specifying a single pixel per fragment. 4319e5c31af7Sopenharmony_ci 4320e5c31af7Sopenharmony_ci.Valid Usage 4321e5c31af7Sopenharmony_ci**** 4322e5c31af7Sopenharmony_ci * [[VUID-VkFragmentShadingRateAttachmentInfoKHR-pFragmentShadingRateAttachment-04524]] 4323e5c31af7Sopenharmony_ci If pname:pFragmentShadingRateAttachment is not `NULL` and its 4324e5c31af7Sopenharmony_ci pname:attachment member is not ename:VK_ATTACHMENT_UNUSED, its 4325e5c31af7Sopenharmony_ci pname:layout member must: be equal to ename:VK_IMAGE_LAYOUT_GENERAL or 4326e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_FRAGMENT_SHADING_RATE_ATTACHMENT_OPTIMAL_KHR 4327e5c31af7Sopenharmony_ci * [[VUID-VkFragmentShadingRateAttachmentInfoKHR-pFragmentShadingRateAttachment-04525]] 4328e5c31af7Sopenharmony_ci If pname:pFragmentShadingRateAttachment is not `NULL` and its 4329e5c31af7Sopenharmony_ci pname:attachment member is not ename:VK_ATTACHMENT_UNUSED, 4330e5c31af7Sopenharmony_ci pname:shadingRateAttachmentTexelSize.width must: be a power of two value 4331e5c31af7Sopenharmony_ci * [[VUID-VkFragmentShadingRateAttachmentInfoKHR-pFragmentShadingRateAttachment-04526]] 4332e5c31af7Sopenharmony_ci If pname:pFragmentShadingRateAttachment is not `NULL` and its 4333e5c31af7Sopenharmony_ci pname:attachment member is not ename:VK_ATTACHMENT_UNUSED, 4334e5c31af7Sopenharmony_ci pname:shadingRateAttachmentTexelSize.width must: be less than or equal 4335e5c31af7Sopenharmony_ci to <<limits-maxFragmentShadingRateAttachmentTexelSize, 4336e5c31af7Sopenharmony_ci pname:maxFragmentShadingRateAttachmentTexelSize.width>> 4337e5c31af7Sopenharmony_ci * [[VUID-VkFragmentShadingRateAttachmentInfoKHR-pFragmentShadingRateAttachment-04527]] 4338e5c31af7Sopenharmony_ci If pname:pFragmentShadingRateAttachment is not `NULL` and its 4339e5c31af7Sopenharmony_ci pname:attachment member is not ename:VK_ATTACHMENT_UNUSED, 4340e5c31af7Sopenharmony_ci pname:shadingRateAttachmentTexelSize.width must: be greater than or 4341e5c31af7Sopenharmony_ci equal to <<limits-minFragmentShadingRateAttachmentTexelSize, 4342e5c31af7Sopenharmony_ci pname:minFragmentShadingRateAttachmentTexelSize.width>> 4343e5c31af7Sopenharmony_ci * [[VUID-VkFragmentShadingRateAttachmentInfoKHR-pFragmentShadingRateAttachment-04528]] 4344e5c31af7Sopenharmony_ci If pname:pFragmentShadingRateAttachment is not `NULL` and its 4345e5c31af7Sopenharmony_ci pname:attachment member is not ename:VK_ATTACHMENT_UNUSED, 4346e5c31af7Sopenharmony_ci pname:shadingRateAttachmentTexelSize.height must: be a power of two 4347e5c31af7Sopenharmony_ci value 4348e5c31af7Sopenharmony_ci * [[VUID-VkFragmentShadingRateAttachmentInfoKHR-pFragmentShadingRateAttachment-04529]] 4349e5c31af7Sopenharmony_ci If pname:pFragmentShadingRateAttachment is not `NULL` and its 4350e5c31af7Sopenharmony_ci pname:attachment member is not ename:VK_ATTACHMENT_UNUSED, 4351e5c31af7Sopenharmony_ci pname:shadingRateAttachmentTexelSize.height must: be less than or equal 4352e5c31af7Sopenharmony_ci to <<limits-maxFragmentShadingRateAttachmentTexelSize, 4353e5c31af7Sopenharmony_ci pname:maxFragmentShadingRateAttachmentTexelSize.height>> 4354e5c31af7Sopenharmony_ci * [[VUID-VkFragmentShadingRateAttachmentInfoKHR-pFragmentShadingRateAttachment-04530]] 4355e5c31af7Sopenharmony_ci If pname:pFragmentShadingRateAttachment is not `NULL` and its 4356e5c31af7Sopenharmony_ci pname:attachment member is not ename:VK_ATTACHMENT_UNUSED, 4357e5c31af7Sopenharmony_ci pname:shadingRateAttachmentTexelSize.height must: be greater than or 4358e5c31af7Sopenharmony_ci equal to <<limits-minFragmentShadingRateAttachmentTexelSize, 4359e5c31af7Sopenharmony_ci pname:minFragmentShadingRateAttachmentTexelSize.height>> 4360e5c31af7Sopenharmony_ci * [[VUID-VkFragmentShadingRateAttachmentInfoKHR-pFragmentShadingRateAttachment-04531]] 4361e5c31af7Sopenharmony_ci If pname:pFragmentShadingRateAttachment is not `NULL` and its 4362e5c31af7Sopenharmony_ci pname:attachment member is not ename:VK_ATTACHMENT_UNUSED, the quotient 4363e5c31af7Sopenharmony_ci of pname:shadingRateAttachmentTexelSize.width and 4364e5c31af7Sopenharmony_ci pname:shadingRateAttachmentTexelSize.height must: be less than or equal 4365e5c31af7Sopenharmony_ci to <<limits-maxFragmentShadingRateAttachmentTexelSizeAspectRatio, 4366e5c31af7Sopenharmony_ci pname:maxFragmentShadingRateAttachmentTexelSizeAspectRatio>> 4367e5c31af7Sopenharmony_ci * [[VUID-VkFragmentShadingRateAttachmentInfoKHR-pFragmentShadingRateAttachment-04532]] 4368e5c31af7Sopenharmony_ci If pname:pFragmentShadingRateAttachment is not `NULL` and its 4369e5c31af7Sopenharmony_ci pname:attachment member is not ename:VK_ATTACHMENT_UNUSED, the quotient 4370e5c31af7Sopenharmony_ci of pname:shadingRateAttachmentTexelSize.height and 4371e5c31af7Sopenharmony_ci pname:shadingRateAttachmentTexelSize.width must: be less than or equal 4372e5c31af7Sopenharmony_ci to <<limits-maxFragmentShadingRateAttachmentTexelSizeAspectRatio, 4373e5c31af7Sopenharmony_ci pname:maxFragmentShadingRateAttachmentTexelSizeAspectRatio>> 4374e5c31af7Sopenharmony_ci**** 4375e5c31af7Sopenharmony_ci 4376e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkFragmentShadingRateAttachmentInfoKHR.adoc[] 4377e5c31af7Sopenharmony_ci-- 4378e5c31af7Sopenharmony_ciendif::VK_KHR_fragment_shading_rate[] 4379e5c31af7Sopenharmony_ci 4380e5c31af7Sopenharmony_ciifdef::VK_EXT_multisampled_render_to_single_sampled[] 4381e5c31af7Sopenharmony_ci[[subpass-multisampledrendertosinglesampled]] 4382e5c31af7Sopenharmony_ci[open,refpage='VkMultisampledRenderToSingleSampledInfoEXT',desc='Structure containing info for multisampled rendering to single-sampled attachments in a subpass',type='structs'] 4383e5c31af7Sopenharmony_ci-- 4384e5c31af7Sopenharmony_ciIf the pname:pNext chain of slink:VkSubpassDescription2 4385e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_3,VK_KHR_dynamic_rendering[or slink:VkRenderingInfo] 4386e5c31af7Sopenharmony_ciincludes a sname:VkMultisampledRenderToSingleSampledInfoEXT structure, then 4387e5c31af7Sopenharmony_cithat structure describes how multisampled rendering is performed on single 4388e5c31af7Sopenharmony_cisampled attachments in that subpass. 4389e5c31af7Sopenharmony_ci 4390e5c31af7Sopenharmony_ciThe sname:VkMultisampledRenderToSingleSampledInfoEXT structure is defined 4391e5c31af7Sopenharmony_cias: 4392e5c31af7Sopenharmony_ci 4393e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkMultisampledRenderToSingleSampledInfoEXT.adoc[] 4394e5c31af7Sopenharmony_ci 4395e5c31af7Sopenharmony_ci * pname:sType is a elink:VkStructureType value identifying this structure. 4396e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 4397e5c31af7Sopenharmony_ci structure. 4398e5c31af7Sopenharmony_ci * pname:multisampledRenderToSingleSampledEnable controls whether 4399e5c31af7Sopenharmony_ci multisampled rendering to single-sampled attachments is performed as 4400e5c31af7Sopenharmony_ci described <<multisampled-render-to-single-sampled, below>>. 4401e5c31af7Sopenharmony_ci * pname:rasterizationSamples is a elink:VkSampleCountFlagBits specifying 4402e5c31af7Sopenharmony_ci the number of samples used in rasterization. 4403e5c31af7Sopenharmony_ci 4404e5c31af7Sopenharmony_ci.Valid Usage 4405e5c31af7Sopenharmony_ci**** 4406e5c31af7Sopenharmony_ci * [[VUID-VkMultisampledRenderToSingleSampledInfoEXT-rasterizationSamples-06878]] 4407e5c31af7Sopenharmony_ci The value of pname:rasterizationSamples must: not be 4408e5c31af7Sopenharmony_ci ename:VK_SAMPLE_COUNT_1_BIT 4409e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_3,VK_KHR_dynamic_rendering[] 4410e5c31af7Sopenharmony_ci * [[VUID-VkMultisampledRenderToSingleSampledInfoEXT-pNext-06880]] 4411e5c31af7Sopenharmony_ci If added to the pname:pNext chain of slink:VkRenderingInfo, each 4412e5c31af7Sopenharmony_ci pname:imageView member of any element of 4413e5c31af7Sopenharmony_ci slink:VkRenderingInfo::pname:pColorAttachments, 4414e5c31af7Sopenharmony_ci slink:VkRenderingInfo::pname:pDepthAttachment, or 4415e5c31af7Sopenharmony_ci slink:VkRenderingInfo::pname:pStencilAttachment that is not 4416e5c31af7Sopenharmony_ci dlink:VK_NULL_HANDLE must: have a format that supports the sample count 4417e5c31af7Sopenharmony_ci specified in pname:rasterizationSamples 4418e5c31af7Sopenharmony_ciendif::VK_VERSION_1_3,VK_KHR_dynamic_rendering[] 4419e5c31af7Sopenharmony_ci**** 4420e5c31af7Sopenharmony_ci 4421e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkMultisampledRenderToSingleSampledInfoEXT.adoc[] 4422e5c31af7Sopenharmony_ci-- 4423e5c31af7Sopenharmony_ci 4424e5c31af7Sopenharmony_ci[[multisampled-render-to-single-sampled]] 4425e5c31af7Sopenharmony_ciIf the pname:pNext chain of slink:VkSubpassDescription2 4426e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_3,VK_KHR_dynamic_rendering[or slink:VkRenderingInfo] 4427e5c31af7Sopenharmony_ciincludes a slink:VkMultisampledRenderToSingleSampledInfoEXT structure whose 4428e5c31af7Sopenharmony_cipname:multisampledRenderToSingleSampledEnable field is ename:VK_TRUE, the 4429e5c31af7Sopenharmony_cigraphics pipelines must: have 4430e5c31af7Sopenharmony_cislink:VkGraphicsPipelineCreateInfo::pname:rasterizationSamples equal to 4431e5c31af7Sopenharmony_cislink:VkMultisampledRenderToSingleSampledInfoEXT::pname:rasterizationSamples, 4432e5c31af7Sopenharmony_ciand the subpass attachments can: have a sample count of 4433e5c31af7Sopenharmony_ciename:VK_SAMPLE_COUNT_1_BIT. 4434e5c31af7Sopenharmony_ciFor attachments with a sample count of ename:VK_SAMPLE_COUNT_1_BIT, 4435e5c31af7Sopenharmony_cimultisampled rendering is performed to an intermediate multisampled image 4436e5c31af7Sopenharmony_ciwith 4437e5c31af7Sopenharmony_cislink:VkMultisampledRenderToSingleSampledInfoEXT::pname:rasterizationSamples 4438e5c31af7Sopenharmony_cisamples, implicitly allocated by the implementation for the duration of the 4439e5c31af7Sopenharmony_cisubpass. 4440e5c31af7Sopenharmony_ciFor such attachments: 4441e5c31af7Sopenharmony_ci 4442e5c31af7Sopenharmony_ci * If pname:loadOp equals to ename:VK_ATTACHMENT_LOAD_OP_LOAD, samples of 4443e5c31af7Sopenharmony_ci the implicit image are initialized by replicating the value from the 4444e5c31af7Sopenharmony_ci corresponding pixel in the attachment. 4445e5c31af7Sopenharmony_ci * If pname:storeOp or pname:stencilStoreOp is equal to 4446e5c31af7Sopenharmony_ci ename:VK_ATTACHMENT_STORE_OP_STORE, the implicit image is implicitly 4447e5c31af7Sopenharmony_ci resolved prior to storage in the attachment. 4448e5c31af7Sopenharmony_ci 4449e5c31af7Sopenharmony_ciMemory constraints due to high primitive counts may: result in an implicit 4450e5c31af7Sopenharmony_cisplit of the subpass. 4451e5c31af7Sopenharmony_ciThis is the equivalent of partial rasterization of geometry in a render pass 4452e5c31af7Sopenharmony_cithat ends in pname:storeOp and pname:stencilStoreOp equal to 4453e5c31af7Sopenharmony_ciename:VK_ATTACHMENT_STORE_OP_STORE, followed by another render pass with 4454e5c31af7Sopenharmony_cipname:loadOp and pname:stencilLoadOp equal to 4455e5c31af7Sopenharmony_ciename:VK_ATTACHMENT_LOAD_OP_LOAD with appropriate barriers in between. 4456e5c31af7Sopenharmony_ciWhen slink:VkMultisampledRenderToSingleSampledInfoEXT is used, the 4457e5c31af7Sopenharmony_ciimplementation is allowed to resolve attachments with a sample count of 4458e5c31af7Sopenharmony_ciename:VK_SAMPLE_COUNT_1_BIT and lose multisampled data on such splits. 4459e5c31af7Sopenharmony_ciThe implementation may: similarly split the render pass at subpass 4460e5c31af7Sopenharmony_ciboundaries even if they use the same value for 4461e5c31af7Sopenharmony_cislink:VkMultisampledRenderToSingleSampledInfoEXT::pname:rasterizationSamples. 4462e5c31af7Sopenharmony_ciendif::VK_EXT_multisampled_render_to_single_sampled[] 4463e5c31af7Sopenharmony_ci 4464e5c31af7Sopenharmony_ci[open,refpage='VkAttachmentReference2',desc='Structure specifying an attachment reference',type='structs',alias='VkAttachmentReference2KHR'] 4465e5c31af7Sopenharmony_ci-- 4466e5c31af7Sopenharmony_ci:refpage: VkAttachmentReference2 4467e5c31af7Sopenharmony_ci 4468e5c31af7Sopenharmony_ciThe sname:VkAttachmentReference2 structure is defined as: 4469e5c31af7Sopenharmony_ci 4470e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkAttachmentReference2.adoc[] 4471e5c31af7Sopenharmony_ci 4472e5c31af7Sopenharmony_ciifdef::VK_KHR_create_renderpass2[] 4473e5c31af7Sopenharmony_cior the equivalent 4474e5c31af7Sopenharmony_ci 4475e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkAttachmentReference2KHR.adoc[] 4476e5c31af7Sopenharmony_ciendif::VK_KHR_create_renderpass2[] 4477e5c31af7Sopenharmony_ci 4478e5c31af7Sopenharmony_ci * pname:sType is a elink:VkStructureType value identifying this structure. 4479e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 4480e5c31af7Sopenharmony_ci structure. 4481e5c31af7Sopenharmony_ci * pname:attachment is either an integer value identifying an attachment at 4482e5c31af7Sopenharmony_ci the corresponding index in 4483e5c31af7Sopenharmony_ci slink:VkRenderPassCreateInfo2::pname:pAttachments, or 4484e5c31af7Sopenharmony_ci ename:VK_ATTACHMENT_UNUSED to signify that this attachment is not used. 4485e5c31af7Sopenharmony_ci * pname:layout is a elink:VkImageLayout value specifying the layout the 4486e5c31af7Sopenharmony_ci attachment uses during the subpass. 4487e5c31af7Sopenharmony_ci * pname:aspectMask is a mask of which aspect(s) can: be accessed within 4488e5c31af7Sopenharmony_ci the specified subpass as an input attachment. 4489e5c31af7Sopenharmony_ci 4490e5c31af7Sopenharmony_ciParameters defined by this structure with the same name as those in 4491e5c31af7Sopenharmony_cislink:VkAttachmentReference have the identical effect to those parameters. 4492e5c31af7Sopenharmony_ci 4493e5c31af7Sopenharmony_cipname:aspectMask is ignored when this structure is used to describe anything 4494e5c31af7Sopenharmony_ciother than an input attachment reference. 4495e5c31af7Sopenharmony_ci 4496e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_KHR_separate_depth_stencil_layouts[] 4497e5c31af7Sopenharmony_ciIf the <<features-separateDepthStencilLayouts, 4498e5c31af7Sopenharmony_cipname:separateDepthStencilLayouts>> feature is enabled, and pname:attachment 4499e5c31af7Sopenharmony_cihas a depth/stencil format, pname:layout can: be set to a layout that only 4500e5c31af7Sopenharmony_cispecifies the layout of the depth aspect. 4501e5c31af7Sopenharmony_ci 4502e5c31af7Sopenharmony_ciIf pname:layout only specifies the layout of the depth aspect of the 4503e5c31af7Sopenharmony_ciattachment, the layout of the stencil aspect is specified by the 4504e5c31af7Sopenharmony_cipname:stencilLayout member of a slink:VkAttachmentReferenceStencilLayout 4505e5c31af7Sopenharmony_cistructure included in the pname:pNext chain. 4506e5c31af7Sopenharmony_ciOtherwise, pname:layout describes the layout for all relevant image aspects. 4507e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_KHR_separate_depth_stencil_layouts[] 4508e5c31af7Sopenharmony_ci 4509e5c31af7Sopenharmony_ci.Valid Usage 4510e5c31af7Sopenharmony_ci**** 4511e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/attachment_reference_common.adoc[] 4512e5c31af7Sopenharmony_ci**** 4513e5c31af7Sopenharmony_ci 4514e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkAttachmentReference2.adoc[] 4515e5c31af7Sopenharmony_ci-- 4516e5c31af7Sopenharmony_ci 4517e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_KHR_separate_depth_stencil_layouts[] 4518e5c31af7Sopenharmony_ci[open,refpage='VkAttachmentReferenceStencilLayout',desc='Structure specifying an attachment description',type='structs',alias='VkAttachmentReferenceStencilLayoutKHR'] 4519e5c31af7Sopenharmony_ci-- 4520e5c31af7Sopenharmony_ciThe sname:VkAttachmentReferenceStencilLayout structure is defined as: 4521e5c31af7Sopenharmony_ci 4522e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkAttachmentReferenceStencilLayout.adoc[] 4523e5c31af7Sopenharmony_ci 4524e5c31af7Sopenharmony_ciifdef::VK_KHR_separate_depth_stencil_layouts[] 4525e5c31af7Sopenharmony_cior the equivalent 4526e5c31af7Sopenharmony_ci 4527e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkAttachmentReferenceStencilLayoutKHR.adoc[] 4528e5c31af7Sopenharmony_ciendif::VK_KHR_separate_depth_stencil_layouts[] 4529e5c31af7Sopenharmony_ci 4530e5c31af7Sopenharmony_ci * pname:sType is a elink:VkStructureType value identifying this structure. 4531e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 4532e5c31af7Sopenharmony_ci structure. 4533e5c31af7Sopenharmony_ci * pname:stencilLayout is a elink:VkImageLayout value specifying the layout 4534e5c31af7Sopenharmony_ci the stencil aspect of the attachment uses during the subpass. 4535e5c31af7Sopenharmony_ci 4536e5c31af7Sopenharmony_ci.Valid Usage 4537e5c31af7Sopenharmony_ci**** 4538e5c31af7Sopenharmony_ci * [[VUID-VkAttachmentReferenceStencilLayout-stencilLayout-03318]] 4539e5c31af7Sopenharmony_ci pname:stencilLayout must: not be ename:VK_IMAGE_LAYOUT_UNDEFINED, 4540e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_PREINITIALIZED, 4541e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, 4542e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL, 4543e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL, 4544e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, 4545e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL, 4546e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL, 4547e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL, or 4548e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_PRESENT_SRC_KHR 4549e5c31af7Sopenharmony_ci**** 4550e5c31af7Sopenharmony_ci 4551e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkAttachmentReferenceStencilLayout.adoc[] 4552e5c31af7Sopenharmony_ci-- 4553e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_KHR_separate_depth_stencil_layouts[] 4554e5c31af7Sopenharmony_ci 4555e5c31af7Sopenharmony_ci[open,refpage='VkSubpassDependency2',desc='Structure specifying a subpass dependency',type='structs',alias='VkSubpassDependency2KHR'] 4556e5c31af7Sopenharmony_ci-- 4557e5c31af7Sopenharmony_ci:refpage: VkSubpassDependency2 4558e5c31af7Sopenharmony_ciThe sname:VkSubpassDependency2 structure is defined as: 4559e5c31af7Sopenharmony_ci 4560e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkSubpassDependency2.adoc[] 4561e5c31af7Sopenharmony_ci 4562e5c31af7Sopenharmony_ciifdef::VK_KHR_create_renderpass2[] 4563e5c31af7Sopenharmony_cior the equivalent 4564e5c31af7Sopenharmony_ci 4565e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkSubpassDependency2KHR.adoc[] 4566e5c31af7Sopenharmony_ciendif::VK_KHR_create_renderpass2[] 4567e5c31af7Sopenharmony_ci 4568e5c31af7Sopenharmony_ci * pname:sType is a elink:VkStructureType value identifying this structure. 4569e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 4570e5c31af7Sopenharmony_ci structure. 4571e5c31af7Sopenharmony_ci * pname:srcSubpass is the subpass index of the first subpass in the 4572e5c31af7Sopenharmony_ci dependency, or ename:VK_SUBPASS_EXTERNAL. 4573e5c31af7Sopenharmony_ci * pname:dstSubpass is the subpass index of the second subpass in the 4574e5c31af7Sopenharmony_ci dependency, or ename:VK_SUBPASS_EXTERNAL. 4575e5c31af7Sopenharmony_ci * pname:srcStageMask is a bitmask of elink:VkPipelineStageFlagBits 4576e5c31af7Sopenharmony_ci specifying the <<synchronization-pipeline-stages-masks, source stage 4577e5c31af7Sopenharmony_ci mask>>. 4578e5c31af7Sopenharmony_ci * pname:dstStageMask is a bitmask of elink:VkPipelineStageFlagBits 4579e5c31af7Sopenharmony_ci specifying the <<synchronization-pipeline-stages-masks, destination 4580e5c31af7Sopenharmony_ci stage mask>> 4581e5c31af7Sopenharmony_ci * pname:srcAccessMask is a bitmask of elink:VkAccessFlagBits specifying a 4582e5c31af7Sopenharmony_ci <<synchronization-access-masks, source access mask>>. 4583e5c31af7Sopenharmony_ci * pname:dstAccessMask is a bitmask of elink:VkAccessFlagBits specifying a 4584e5c31af7Sopenharmony_ci <<synchronization-access-masks, destination access mask>>. 4585e5c31af7Sopenharmony_ci * pname:dependencyFlags is a bitmask of elink:VkDependencyFlagBits. 4586e5c31af7Sopenharmony_ci * pname:viewOffset controls which views in the source subpass the views in 4587e5c31af7Sopenharmony_ci the destination subpass depend on. 4588e5c31af7Sopenharmony_ci 4589e5c31af7Sopenharmony_ciParameters defined by this structure with the same name as those in 4590e5c31af7Sopenharmony_cislink:VkSubpassDependency have the identical effect to those parameters. 4591e5c31af7Sopenharmony_ci 4592e5c31af7Sopenharmony_cipname:viewOffset has the same effect for the described subpass dependency as 4593e5c31af7Sopenharmony_cislink:VkRenderPassMultiviewCreateInfo::pname:pViewOffsets has on each 4594e5c31af7Sopenharmony_cicorresponding subpass dependency. 4595e5c31af7Sopenharmony_ci 4596e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_3,VK_KHR_synchronization2[] 4597e5c31af7Sopenharmony_ciIf a slink:VkMemoryBarrier2 is included in the pname:pNext chain, 4598e5c31af7Sopenharmony_cipname:srcStageMask, pname:dstStageMask, pname:srcAccessMask, and 4599e5c31af7Sopenharmony_cipname:dstAccessMask parameters are ignored. 4600e5c31af7Sopenharmony_ciThe synchronization and access scopes instead are defined by the parameters 4601e5c31af7Sopenharmony_ciof slink:VkMemoryBarrier2. 4602e5c31af7Sopenharmony_ciendif::VK_VERSION_1_3,VK_KHR_synchronization2[] 4603e5c31af7Sopenharmony_ci 4604e5c31af7Sopenharmony_ci.Valid Usage 4605e5c31af7Sopenharmony_ci**** 4606e5c31af7Sopenharmony_ci:stageMaskName: srcStageMask 4607e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/stage_mask_common.adoc[] 4608e5c31af7Sopenharmony_ci 4609e5c31af7Sopenharmony_ci:stageMaskName: dstStageMask 4610e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/stage_mask_common.adoc[] 4611e5c31af7Sopenharmony_ci 4612e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDependency2-srcSubpass-03084]] 4613e5c31af7Sopenharmony_ci pname:srcSubpass must: be less than or equal to pname:dstSubpass, unless 4614e5c31af7Sopenharmony_ci one of them is ename:VK_SUBPASS_EXTERNAL, to avoid cyclic dependencies 4615e5c31af7Sopenharmony_ci and ensure a valid execution order 4616e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDependency2-srcSubpass-03085]] 4617e5c31af7Sopenharmony_ci pname:srcSubpass and pname:dstSubpass must: not both be equal to 4618e5c31af7Sopenharmony_ci ename:VK_SUBPASS_EXTERNAL 4619e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDependency2-srcSubpass-06810]] 4620e5c31af7Sopenharmony_ci If pname:srcSubpass is equal to pname:dstSubpass and pname:srcStageMask 4621e5c31af7Sopenharmony_ci includes a <<synchronization-framebuffer-regions,framebuffer-space 4622e5c31af7Sopenharmony_ci stage>>, pname:dstStageMask must: only contain 4623e5c31af7Sopenharmony_ci <<synchronization-framebuffer-regions, framebuffer-space stages>> 4624e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDependency2-srcAccessMask-03088]] 4625e5c31af7Sopenharmony_ci Any access flag included in pname:srcAccessMask must: be supported by 4626e5c31af7Sopenharmony_ci one of the pipeline stages in pname:srcStageMask, as specified in the 4627e5c31af7Sopenharmony_ci <<synchronization-access-types-supported, table of supported access 4628e5c31af7Sopenharmony_ci types>> 4629e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDependency2-dstAccessMask-03089]] 4630e5c31af7Sopenharmony_ci Any access flag included in pname:dstAccessMask must: be supported by 4631e5c31af7Sopenharmony_ci one of the pipeline stages in pname:dstStageMask, as specified in the 4632e5c31af7Sopenharmony_ci <<synchronization-access-types-supported, table of supported access 4633e5c31af7Sopenharmony_ci types>> 4634e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDependency2-dependencyFlags-03090]] 4635e5c31af7Sopenharmony_ci If pname:dependencyFlags includes ename:VK_DEPENDENCY_VIEW_LOCAL_BIT, 4636e5c31af7Sopenharmony_ci pname:srcSubpass must: not be equal to ename:VK_SUBPASS_EXTERNAL 4637e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDependency2-dependencyFlags-03091]] 4638e5c31af7Sopenharmony_ci If pname:dependencyFlags includes ename:VK_DEPENDENCY_VIEW_LOCAL_BIT, 4639e5c31af7Sopenharmony_ci pname:dstSubpass must: not be equal to ename:VK_SUBPASS_EXTERNAL 4640e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDependency2-srcSubpass-02245]] 4641e5c31af7Sopenharmony_ci If pname:srcSubpass equals pname:dstSubpass, and pname:srcStageMask and 4642e5c31af7Sopenharmony_ci pname:dstStageMask both include a 4643e5c31af7Sopenharmony_ci <<synchronization-framebuffer-regions,framebuffer-space stage>>, then 4644e5c31af7Sopenharmony_ci pname:dependencyFlags must: include ename:VK_DEPENDENCY_BY_REGION_BIT 4645e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDependency2-viewOffset-02530]] 4646e5c31af7Sopenharmony_ci If pname:viewOffset is not equal to `0`, pname:srcSubpass must: not be 4647e5c31af7Sopenharmony_ci equal to pname:dstSubpass 4648e5c31af7Sopenharmony_ci * [[VUID-VkSubpassDependency2-dependencyFlags-03092]] 4649e5c31af7Sopenharmony_ci If pname:dependencyFlags does not include 4650e5c31af7Sopenharmony_ci ename:VK_DEPENDENCY_VIEW_LOCAL_BIT, pname:viewOffset must: be `0` 4651e5c31af7Sopenharmony_ci**** 4652e5c31af7Sopenharmony_ci 4653e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkSubpassDependency2.adoc[] 4654e5c31af7Sopenharmony_ci-- 4655e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_KHR_create_renderpass2[] 4656e5c31af7Sopenharmony_ci 4657e5c31af7Sopenharmony_ci[open,refpage='vkDestroyRenderPass',desc='Destroy a render pass object',type='protos'] 4658e5c31af7Sopenharmony_ci-- 4659e5c31af7Sopenharmony_ciTo destroy a render pass, call: 4660e5c31af7Sopenharmony_ci 4661e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkDestroyRenderPass.adoc[] 4662e5c31af7Sopenharmony_ci 4663e5c31af7Sopenharmony_ci * pname:device is the logical device that destroys the render pass. 4664e5c31af7Sopenharmony_ci * pname:renderPass is the handle of the render pass to destroy. 4665e5c31af7Sopenharmony_ci * pname:pAllocator controls host memory allocation as described in the 4666e5c31af7Sopenharmony_ci <<memory-allocation, Memory Allocation>> chapter. 4667e5c31af7Sopenharmony_ci 4668e5c31af7Sopenharmony_ci.Valid Usage 4669e5c31af7Sopenharmony_ci**** 4670e5c31af7Sopenharmony_ci * [[VUID-vkDestroyRenderPass-renderPass-00873]] 4671e5c31af7Sopenharmony_ci All submitted commands that refer to pname:renderPass must: have 4672e5c31af7Sopenharmony_ci completed execution 4673e5c31af7Sopenharmony_ciifndef::VKSC_VERSION_1_0[] 4674e5c31af7Sopenharmony_ci * [[VUID-vkDestroyRenderPass-renderPass-00874]] 4675e5c31af7Sopenharmony_ci If sname:VkAllocationCallbacks were provided when pname:renderPass was 4676e5c31af7Sopenharmony_ci created, a compatible set of callbacks must: be provided here 4677e5c31af7Sopenharmony_ci * [[VUID-vkDestroyRenderPass-renderPass-00875]] 4678e5c31af7Sopenharmony_ci If no sname:VkAllocationCallbacks were provided when pname:renderPass 4679e5c31af7Sopenharmony_ci was created, pname:pAllocator must: be `NULL` 4680e5c31af7Sopenharmony_ciendif::VKSC_VERSION_1_0[] 4681e5c31af7Sopenharmony_ci**** 4682e5c31af7Sopenharmony_ci 4683e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkDestroyRenderPass.adoc[] 4684e5c31af7Sopenharmony_ci-- 4685e5c31af7Sopenharmony_ci 4686e5c31af7Sopenharmony_ci 4687e5c31af7Sopenharmony_ci[[renderpass-compatibility]] 4688e5c31af7Sopenharmony_ci== Render Pass Compatibility 4689e5c31af7Sopenharmony_ci 4690e5c31af7Sopenharmony_ciFramebuffers and graphics pipelines are created based on a specific render 4691e5c31af7Sopenharmony_cipass object. 4692e5c31af7Sopenharmony_ciThey must: only be used with that render pass object, or one compatible with 4693e5c31af7Sopenharmony_ciit. 4694e5c31af7Sopenharmony_ci 4695e5c31af7Sopenharmony_ciTwo attachment references are compatible if they have matching format and 4696e5c31af7Sopenharmony_cisample count, or are both ename:VK_ATTACHMENT_UNUSED or the pointer that 4697e5c31af7Sopenharmony_ciwould contain the reference is `NULL`. 4698e5c31af7Sopenharmony_ci 4699e5c31af7Sopenharmony_ciTwo arrays of attachment references are compatible if all corresponding 4700e5c31af7Sopenharmony_cipairs of attachments are compatible. 4701e5c31af7Sopenharmony_ciIf the arrays are of different lengths, attachment references not present in 4702e5c31af7Sopenharmony_cithe smaller array are treated as ename:VK_ATTACHMENT_UNUSED. 4703e5c31af7Sopenharmony_ci 4704e5c31af7Sopenharmony_ciTwo render passes are compatible if their corresponding color, input, 4705e5c31af7Sopenharmony_ciresolve, and depth/stencil attachment references are compatible and if they 4706e5c31af7Sopenharmony_ciare otherwise identical except for: 4707e5c31af7Sopenharmony_ci 4708e5c31af7Sopenharmony_ci * Initial and final image layout in attachment descriptions 4709e5c31af7Sopenharmony_ci * Load and store operations in attachment descriptions 4710e5c31af7Sopenharmony_ci * Image layout in attachment references 4711e5c31af7Sopenharmony_ci 4712e5c31af7Sopenharmony_ciAs an additional special case, if two render passes have a single subpass, 4713e5c31af7Sopenharmony_cithe resolve attachment reference 4714e5c31af7Sopenharmony_ciifdef::VK_KHR_depth_stencil_resolve[] 4715e5c31af7Sopenharmony_ciand depth/stencil resolve mode 4716e5c31af7Sopenharmony_ciendif::VK_KHR_depth_stencil_resolve[] 4717e5c31af7Sopenharmony_cicompatibility requirements are ignored. 4718e5c31af7Sopenharmony_ci 4719e5c31af7Sopenharmony_ciA framebuffer is compatible with a render pass if it was created using the 4720e5c31af7Sopenharmony_cisame render pass or a compatible render pass. 4721e5c31af7Sopenharmony_ci 4722e5c31af7Sopenharmony_ci 4723e5c31af7Sopenharmony_ci== Framebuffers 4724e5c31af7Sopenharmony_ci 4725e5c31af7Sopenharmony_ci[open,refpage='VkFramebuffer',desc='Opaque handle to a framebuffer object',type='handles'] 4726e5c31af7Sopenharmony_ci-- 4727e5c31af7Sopenharmony_ciRender passes operate in conjunction with _framebuffers_. 4728e5c31af7Sopenharmony_ciFramebuffers represent a collection of specific memory attachments that a 4729e5c31af7Sopenharmony_cirender pass instance uses. 4730e5c31af7Sopenharmony_ci 4731e5c31af7Sopenharmony_ciFramebuffers are represented by sname:VkFramebuffer handles: 4732e5c31af7Sopenharmony_ci 4733e5c31af7Sopenharmony_ciinclude::{generated}/api/handles/VkFramebuffer.adoc[] 4734e5c31af7Sopenharmony_ci-- 4735e5c31af7Sopenharmony_ci 4736e5c31af7Sopenharmony_ci[open,refpage='vkCreateFramebuffer',desc='Create a new framebuffer object',type='protos'] 4737e5c31af7Sopenharmony_ci-- 4738e5c31af7Sopenharmony_ci:refpage: vkCreateFramebuffer 4739e5c31af7Sopenharmony_ci:objectnameplural: framebuffers 4740e5c31af7Sopenharmony_ci:objectnamecamelcase: framebuffer 4741e5c31af7Sopenharmony_ci:objectcount: 1 4742e5c31af7Sopenharmony_ci 4743e5c31af7Sopenharmony_ciTo create a framebuffer, call: 4744e5c31af7Sopenharmony_ci 4745e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCreateFramebuffer.adoc[] 4746e5c31af7Sopenharmony_ci 4747e5c31af7Sopenharmony_ci * pname:device is the logical device that creates the framebuffer. 4748e5c31af7Sopenharmony_ci * pname:pCreateInfo is a pointer to a slink:VkFramebufferCreateInfo 4749e5c31af7Sopenharmony_ci structure describing additional information about framebuffer creation. 4750e5c31af7Sopenharmony_ci * pname:pAllocator controls host memory allocation as described in the 4751e5c31af7Sopenharmony_ci <<memory-allocation, Memory Allocation>> chapter. 4752e5c31af7Sopenharmony_ci * pname:pFramebuffer is a pointer to a slink:VkFramebuffer handle in which 4753e5c31af7Sopenharmony_ci the resulting framebuffer object is returned. 4754e5c31af7Sopenharmony_ci 4755e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/no_dynamic_allocations_common.adoc[] 4756e5c31af7Sopenharmony_ci 4757e5c31af7Sopenharmony_ci.Valid Usage 4758e5c31af7Sopenharmony_ci**** 4759e5c31af7Sopenharmony_ci * [[VUID-vkCreateFramebuffer-pCreateInfo-02777]] 4760e5c31af7Sopenharmony_ci If pname:pCreateInfo->flags does not include 4761e5c31af7Sopenharmony_ci ename:VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT, and pname:attachmentCount is 4762e5c31af7Sopenharmony_ci not `0`, each element of pname:pCreateInfo->pAttachments must: have been 4763e5c31af7Sopenharmony_ci created on pname:device 4764e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/memory_reservation_request_count_common.adoc[] 4765e5c31af7Sopenharmony_ci**** 4766e5c31af7Sopenharmony_ci 4767e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCreateFramebuffer.adoc[] 4768e5c31af7Sopenharmony_ci-- 4769e5c31af7Sopenharmony_ci 4770e5c31af7Sopenharmony_ci[open,refpage='VkFramebufferCreateInfo',desc='Structure specifying parameters of a newly created framebuffer',type='structs'] 4771e5c31af7Sopenharmony_ci-- 4772e5c31af7Sopenharmony_ciThe sname:VkFramebufferCreateInfo structure is defined as: 4773e5c31af7Sopenharmony_ci 4774e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkFramebufferCreateInfo.adoc[] 4775e5c31af7Sopenharmony_ci 4776e5c31af7Sopenharmony_ci * pname:sType is a elink:VkStructureType value identifying this structure. 4777e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 4778e5c31af7Sopenharmony_ci structure. 4779e5c31af7Sopenharmony_ci * pname:flags is a bitmask of elink:VkFramebufferCreateFlagBits 4780e5c31af7Sopenharmony_ci * pname:renderPass is a render pass defining what render passes the 4781e5c31af7Sopenharmony_ci framebuffer will be compatible with. 4782e5c31af7Sopenharmony_ci See <<renderpass-compatibility,Render Pass Compatibility>> for details. 4783e5c31af7Sopenharmony_ci * pname:attachmentCount is the number of attachments. 4784e5c31af7Sopenharmony_ci * pname:pAttachments is a pointer to an array of slink:VkImageView 4785e5c31af7Sopenharmony_ci handles, each of which will be used as the corresponding attachment in a 4786e5c31af7Sopenharmony_ci render pass instance. 4787e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_KHR_imageless_framebuffer[] 4788e5c31af7Sopenharmony_ci If pname:flags includes ename:VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT, this 4789e5c31af7Sopenharmony_ci parameter is ignored. 4790e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_KHR_imageless_framebuffer[] 4791e5c31af7Sopenharmony_ci * pname:width, pname:height and pname:layers define the dimensions of the 4792e5c31af7Sopenharmony_ci framebuffer. 4793e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_multiview[] 4794e5c31af7Sopenharmony_ci If the render pass uses multiview, then pname:layers must: be one and 4795e5c31af7Sopenharmony_ci each attachment requires a number of layers that is greater than the 4796e5c31af7Sopenharmony_ci maximum bit index set in the view mask in the subpasses in which it is 4797e5c31af7Sopenharmony_ci used. 4798e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_multiview[] 4799e5c31af7Sopenharmony_ci 4800e5c31af7Sopenharmony_ci[[renderpass-noattachments]] 4801e5c31af7Sopenharmony_ciIt is legal for a subpass to use no color or depth/stencil attachments, 4802e5c31af7Sopenharmony_cieither because it has no attachment references or because all of them are 4803e5c31af7Sopenharmony_ciename:VK_ATTACHMENT_UNUSED. 4804e5c31af7Sopenharmony_ciThis kind of subpass can: use shader side effects such as image stores and 4805e5c31af7Sopenharmony_ciatomics to produce an output. 4806e5c31af7Sopenharmony_ciIn this case, the subpass continues to use the pname:width, pname:height, 4807e5c31af7Sopenharmony_ciand pname:layers of the framebuffer to define the dimensions of the 4808e5c31af7Sopenharmony_cirendering area, and the pname:rasterizationSamples from each pipeline's 4809e5c31af7Sopenharmony_cislink:VkPipelineMultisampleStateCreateInfo to define the number of samples 4810e5c31af7Sopenharmony_ciused in rasterization; however, if 4811e5c31af7Sopenharmony_cislink:VkPhysicalDeviceFeatures::pname:variableMultisampleRate is 4812e5c31af7Sopenharmony_ciename:VK_FALSE, then all pipelines to be bound with the subpass must: have 4813e5c31af7Sopenharmony_cithe same value for 4814e5c31af7Sopenharmony_cislink:VkPipelineMultisampleStateCreateInfo::pname:rasterizationSamples. 4815e5c31af7Sopenharmony_ciIn all such cases, pname:rasterizationSamples must: be a valid 4816e5c31af7Sopenharmony_cielink:VkSampleCountFlagBits value that is set in 4817e5c31af7Sopenharmony_cislink:VkPhysicalDeviceLimits::pname:framebufferNoAttachmentsSampleCounts. 4818e5c31af7Sopenharmony_ci 4819e5c31af7Sopenharmony_ci.Valid Usage 4820e5c31af7Sopenharmony_ci**** 4821e5c31af7Sopenharmony_ci * [[VUID-VkFramebufferCreateInfo-attachmentCount-00876]] 4822e5c31af7Sopenharmony_ci pname:attachmentCount must: be equal to the attachment count specified 4823e5c31af7Sopenharmony_ci in pname:renderPass 4824e5c31af7Sopenharmony_ci * [[VUID-VkFramebufferCreateInfo-flags-02778]] 4825e5c31af7Sopenharmony_ci If pname:flags does not include 4826e5c31af7Sopenharmony_ci ename:VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT and pname:attachmentCount is 4827e5c31af7Sopenharmony_ci not `0`, pname:pAttachments must: be a valid pointer to an array of 4828e5c31af7Sopenharmony_ci pname:attachmentCount valid slink:VkImageView handles 4829e5c31af7Sopenharmony_ci * [[VUID-VkFramebufferCreateInfo-pAttachments-00877]] 4830e5c31af7Sopenharmony_ci If pname:flags does not include 4831e5c31af7Sopenharmony_ci ename:VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT, each element of 4832e5c31af7Sopenharmony_ci pname:pAttachments that is used as a color attachment or resolve 4833e5c31af7Sopenharmony_ci attachment by pname:renderPass must: have been created with a 4834e5c31af7Sopenharmony_ci pname:usage value including ename:VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT 4835e5c31af7Sopenharmony_ci * [[VUID-VkFramebufferCreateInfo-pAttachments-02633]] 4836e5c31af7Sopenharmony_ci If pname:flags does not include 4837e5c31af7Sopenharmony_ci ename:VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT, each element of 4838e5c31af7Sopenharmony_ci pname:pAttachments that is used as a depth/stencil attachment by 4839e5c31af7Sopenharmony_ci pname:renderPass must: have been created with a pname:usage value 4840e5c31af7Sopenharmony_ci including ename:VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT 4841e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_KHR_depth_stencil_resolve[] 4842e5c31af7Sopenharmony_ci * [[VUID-VkFramebufferCreateInfo-pAttachments-02634]] 4843e5c31af7Sopenharmony_ci If pname:flags does not include 4844e5c31af7Sopenharmony_ci ename:VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT, each element of 4845e5c31af7Sopenharmony_ci pname:pAttachments that is used as a depth/stencil resolve attachment by 4846e5c31af7Sopenharmony_ci pname:renderPass must: have been created with a pname:usage value 4847e5c31af7Sopenharmony_ci including ename:VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT 4848e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_KHR_depth_stencil_resolve[] 4849e5c31af7Sopenharmony_ci * [[VUID-VkFramebufferCreateInfo-pAttachments-00879]] 4850e5c31af7Sopenharmony_ci If pname:renderpass is not dlink:VK_NULL_HANDLE, pname:flags does not 4851e5c31af7Sopenharmony_ci include ename:VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT, each element of 4852e5c31af7Sopenharmony_ci pname:pAttachments that is used as an input attachment by 4853e5c31af7Sopenharmony_ci pname:renderPass must: have been created with a pname:usage value 4854e5c31af7Sopenharmony_ci including ename:VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT 4855e5c31af7Sopenharmony_ciifdef::VK_EXT_fragment_density_map[] 4856e5c31af7Sopenharmony_ci * [[VUID-VkFramebufferCreateInfo-pAttachments-02552]] 4857e5c31af7Sopenharmony_ci Each element of pname:pAttachments that is used as a fragment density 4858e5c31af7Sopenharmony_ci map attachment by pname:renderPass must: not have been created with a 4859e5c31af7Sopenharmony_ci pname:flags value including ename:VK_IMAGE_CREATE_SUBSAMPLED_BIT_EXT 4860e5c31af7Sopenharmony_ci * [[VUID-VkFramebufferCreateInfo-renderPass-02553]] 4861e5c31af7Sopenharmony_ci If pname:renderPass has a fragment density map attachment and the 4862e5c31af7Sopenharmony_ci <<features-fragmentDensityMapNonSubsampledImages, 4863e5c31af7Sopenharmony_ci pname:fragmentDensityMapNonSubsampledImages>> feature is not enabled, 4864e5c31af7Sopenharmony_ci each element of pname:pAttachments must: have been created with a 4865e5c31af7Sopenharmony_ci pname:flags value including ename:VK_IMAGE_CREATE_SUBSAMPLED_BIT_EXT 4866e5c31af7Sopenharmony_ci unless that element is the fragment density map attachment 4867e5c31af7Sopenharmony_ciifdef::VK_QCOM_fragment_density_map_offset[] 4868e5c31af7Sopenharmony_ci * [[VUID-VkFramebufferCreateInfo-renderPass-06502]] 4869e5c31af7Sopenharmony_ci If pname:renderPass was created with 4870e5c31af7Sopenharmony_ci <<renderpass-fragmentdensitymapoffsets,fragment density map offsets>> 4871e5c31af7Sopenharmony_ci other than [eq]#(0,0)#, each element of pname:pAttachments must: have 4872e5c31af7Sopenharmony_ci been created with a pname:flags value including 4873e5c31af7Sopenharmony_ci ename:VK_IMAGE_CREATE_FRAGMENT_DENSITY_MAP_OFFSET_BIT_QCOM 4874e5c31af7Sopenharmony_ciendif::VK_QCOM_fragment_density_map_offset[] 4875e5c31af7Sopenharmony_ciendif::VK_EXT_fragment_density_map[] 4876e5c31af7Sopenharmony_ci * [[VUID-VkFramebufferCreateInfo-pAttachments-00880]] 4877e5c31af7Sopenharmony_ci If pname:flags does not include 4878e5c31af7Sopenharmony_ci ename:VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT, each element of 4879e5c31af7Sopenharmony_ci pname:pAttachments must: have been created with a elink:VkFormat value 4880e5c31af7Sopenharmony_ci that matches the elink:VkFormat specified by the corresponding 4881e5c31af7Sopenharmony_ci sname:VkAttachmentDescription in pname:renderPass 4882e5c31af7Sopenharmony_ci * [[VUID-VkFramebufferCreateInfo-pAttachments-00881]] 4883e5c31af7Sopenharmony_ci If pname:flags does not include 4884e5c31af7Sopenharmony_ci ename:VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT, each element of 4885e5c31af7Sopenharmony_ci pname:pAttachments must: have been created with a pname:samples value 4886e5c31af7Sopenharmony_ci that matches the pname:samples value specified by the corresponding 4887e5c31af7Sopenharmony_ci sname:VkAttachmentDescription in pname:renderPass 4888e5c31af7Sopenharmony_ci * [[VUID-VkFramebufferCreateInfo-flags-04533]] 4889e5c31af7Sopenharmony_ci If pname:flags does not include 4890e5c31af7Sopenharmony_ci ename:VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT, each element of 4891e5c31af7Sopenharmony_ci pname:pAttachments that is used as an input, color, resolve, or 4892e5c31af7Sopenharmony_ci depth/stencil attachment by pname:renderPass must: have been created 4893e5c31af7Sopenharmony_ci with a slink:VkImageCreateInfo::pname:extent.width greater than or equal 4894e5c31af7Sopenharmony_ci to pname:width 4895e5c31af7Sopenharmony_ci * [[VUID-VkFramebufferCreateInfo-flags-04534]] 4896e5c31af7Sopenharmony_ci If pname:flags does not include 4897e5c31af7Sopenharmony_ci ename:VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT, each element of 4898e5c31af7Sopenharmony_ci pname:pAttachments that is used as an input, color, resolve, or 4899e5c31af7Sopenharmony_ci depth/stencil attachment by pname:renderPass must: have been created 4900e5c31af7Sopenharmony_ci with a slink:VkImageCreateInfo::pname:extent.height greater than or 4901e5c31af7Sopenharmony_ci equal to pname:height 4902e5c31af7Sopenharmony_ci * [[VUID-VkFramebufferCreateInfo-flags-04535]] 4903e5c31af7Sopenharmony_ci If pname:flags does not include 4904e5c31af7Sopenharmony_ci ename:VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT, each element of 4905e5c31af7Sopenharmony_ci pname:pAttachments that is used as an input, color, resolve, or 4906e5c31af7Sopenharmony_ci depth/stencil attachment by pname:renderPass must: have been created 4907e5c31af7Sopenharmony_ci with a slink:VkImageViewCreateInfo::pname:subresourceRange.layerCount 4908e5c31af7Sopenharmony_ci greater than or equal to pname:layers 4909e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_multiview[] 4910e5c31af7Sopenharmony_ci * [[VUID-VkFramebufferCreateInfo-renderPass-04536]] 4911e5c31af7Sopenharmony_ci If pname:renderPass was specified with non-zero view masks, each element 4912e5c31af7Sopenharmony_ci of pname:pAttachments that is used as an input, color, resolve, or 4913e5c31af7Sopenharmony_ci depth/stencil attachment by pname:renderPass must: have a 4914e5c31af7Sopenharmony_ci pname:layerCount greater than the index of the most significant bit set 4915e5c31af7Sopenharmony_ci in any of those view masks 4916e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_multiview[] 4917e5c31af7Sopenharmony_ciifdef::VK_EXT_fragment_density_map[] 4918e5c31af7Sopenharmony_ci * [[VUID-VkFramebufferCreateInfo-renderPass-02746]] 4919e5c31af7Sopenharmony_ci Each element of pname:pAttachments that is referenced by 4920e5c31af7Sopenharmony_ci pname:fragmentDensityMapAttachment must: have a pname:layerCount equal 4921e5c31af7Sopenharmony_ci to `1` 4922e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_multiview[] 4923e5c31af7Sopenharmony_ci or if pname:renderPass was specified with non-zero view masks, greater 4924e5c31af7Sopenharmony_ci than the index of the most significant bit set in any of those view 4925e5c31af7Sopenharmony_ci masks 4926e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_multiview[] 4927e5c31af7Sopenharmony_ci * [[VUID-VkFramebufferCreateInfo-pAttachments-02555]] 4928e5c31af7Sopenharmony_ci If pname:flags does not include 4929e5c31af7Sopenharmony_ci ename:VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT, an element of 4930e5c31af7Sopenharmony_ci pname:pAttachments that is referenced by 4931e5c31af7Sopenharmony_ci pname:fragmentDensityMapAttachment must: have a width at least as large 4932e5c31af7Sopenharmony_ci as 4933e5c31af7Sopenharmony_ci latexmath:[\left\lceil{\frac{width}{maxFragmentDensityTexelSize_{width}}}\right\rceil] 4934e5c31af7Sopenharmony_ci * [[VUID-VkFramebufferCreateInfo-pAttachments-02556]] 4935e5c31af7Sopenharmony_ci If pname:flags does not include 4936e5c31af7Sopenharmony_ci ename:VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT, an element of 4937e5c31af7Sopenharmony_ci pname:pAttachments that is referenced by 4938e5c31af7Sopenharmony_ci pname:fragmentDensityMapAttachment must: have a height at least as large 4939e5c31af7Sopenharmony_ci as 4940e5c31af7Sopenharmony_ci latexmath:[\left\lceil{\frac{height}{maxFragmentDensityTexelSize_{height}}}\right\rceil] 4941e5c31af7Sopenharmony_ciendif::VK_EXT_fragment_density_map[] 4942e5c31af7Sopenharmony_ciifdef::VK_KHR_fragment_shading_rate[] 4943e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_multiview[] 4944e5c31af7Sopenharmony_ci * [[VUID-VkFramebufferCreateInfo-flags-04537]] 4945e5c31af7Sopenharmony_ci If pname:flags does not include 4946e5c31af7Sopenharmony_ci ename:VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT, and pname:renderPass was 4947e5c31af7Sopenharmony_ci specified with non-zero view masks, each element of pname:pAttachments 4948e5c31af7Sopenharmony_ci that is used as a <<primsrast-fragment-shading-rate-attachment,fragment 4949e5c31af7Sopenharmony_ci shading rate attachment>> by pname:renderPass must: have a 4950e5c31af7Sopenharmony_ci pname:layerCount that is either `1`, or greater than the index of the 4951e5c31af7Sopenharmony_ci most significant bit set in any of those view masks 4952e5c31af7Sopenharmony_ci * [[VUID-VkFramebufferCreateInfo-flags-04538]] 4953e5c31af7Sopenharmony_ci If pname:flags does not include 4954e5c31af7Sopenharmony_ci ename:VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT, and pname:renderPass was not 4955e5c31af7Sopenharmony_ci specified with non-zero view masks, each element of pname:pAttachments 4956e5c31af7Sopenharmony_ci that is used as a <<primsrast-fragment-shading-rate-attachment,fragment 4957e5c31af7Sopenharmony_ci shading rate attachment>> by pname:renderPass must: have a 4958e5c31af7Sopenharmony_ci pname:layerCount that is either `1`, or greater than pname:layers 4959e5c31af7Sopenharmony_ci * [[VUID-VkFramebufferCreateInfo-renderPass-08921]] 4960e5c31af7Sopenharmony_ci If pname:renderPass was specified with non-zero view masks, each element 4961e5c31af7Sopenharmony_ci of pname:pAttachments that is used as a 4962e5c31af7Sopenharmony_ci <<primsrast-fragment-shading-rate-attachment,fragment shading rate 4963e5c31af7Sopenharmony_ci attachment>> must: have a pname:layerCount equal to `1` or greater than 4964e5c31af7Sopenharmony_ci the index of the most significant bit set in any of those view masks 4965e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_multiview[] 4966e5c31af7Sopenharmony_ci * [[VUID-VkFramebufferCreateInfo-flags-04539]] 4967e5c31af7Sopenharmony_ci If pname:flags does not include 4968e5c31af7Sopenharmony_ci ename:VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT, an element of 4969e5c31af7Sopenharmony_ci pname:pAttachments that is used as a 4970e5c31af7Sopenharmony_ci <<primsrast-fragment-shading-rate-attachment, fragment shading rate 4971e5c31af7Sopenharmony_ci attachment>> must: have a width at least as large as 4972e5c31af7Sopenharmony_ci [eq]#{lceil}pname:width / code:texelWidth{rceil}#, where code:texelWidth 4973e5c31af7Sopenharmony_ci is the largest value of pname:shadingRateAttachmentTexelSize.width in a 4974e5c31af7Sopenharmony_ci slink:VkFragmentShadingRateAttachmentInfoKHR which references that 4975e5c31af7Sopenharmony_ci attachment 4976e5c31af7Sopenharmony_ci * [[VUID-VkFramebufferCreateInfo-flags-04540]] 4977e5c31af7Sopenharmony_ci If pname:flags does not include 4978e5c31af7Sopenharmony_ci ename:VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT, an element of 4979e5c31af7Sopenharmony_ci pname:pAttachments that is used as a 4980e5c31af7Sopenharmony_ci <<primsrast-fragment-shading-rate-attachment, fragment shading rate 4981e5c31af7Sopenharmony_ci attachment>> must: have a height at least as large as 4982e5c31af7Sopenharmony_ci [eq]#{lceil}pname:height / code:texelHeight{rceil}#, where 4983e5c31af7Sopenharmony_ci code:texelHeight is the largest value of 4984e5c31af7Sopenharmony_ci pname:shadingRateAttachmentTexelSize.height in a 4985e5c31af7Sopenharmony_ci slink:VkFragmentShadingRateAttachmentInfoKHR which references that 4986e5c31af7Sopenharmony_ci attachment 4987e5c31af7Sopenharmony_ciendif::VK_KHR_fragment_shading_rate[] 4988e5c31af7Sopenharmony_ci * [[VUID-VkFramebufferCreateInfo-pAttachments-00883]] 4989e5c31af7Sopenharmony_ci If pname:flags does not include 4990e5c31af7Sopenharmony_ci ename:VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT, each element of 4991e5c31af7Sopenharmony_ci pname:pAttachments must: only specify a single mip level 4992e5c31af7Sopenharmony_ci * [[VUID-VkFramebufferCreateInfo-pAttachments-00884]] 4993e5c31af7Sopenharmony_ci If pname:flags does not include 4994e5c31af7Sopenharmony_ci ename:VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT, each element of 4995e5c31af7Sopenharmony_ci pname:pAttachments must: have been created with the identity swizzle 4996e5c31af7Sopenharmony_ci * [[VUID-VkFramebufferCreateInfo-width-00885]] 4997e5c31af7Sopenharmony_ci pname:width must: be greater than `0` 4998e5c31af7Sopenharmony_ci * [[VUID-VkFramebufferCreateInfo-width-00886]] 4999e5c31af7Sopenharmony_ci pname:width must: be less than or equal to <<limits-maxFramebufferWidth, 5000e5c31af7Sopenharmony_ci pname:maxFramebufferWidth>> 5001e5c31af7Sopenharmony_ci * [[VUID-VkFramebufferCreateInfo-height-00887]] 5002e5c31af7Sopenharmony_ci pname:height must: be greater than `0` 5003e5c31af7Sopenharmony_ci * [[VUID-VkFramebufferCreateInfo-height-00888]] 5004e5c31af7Sopenharmony_ci pname:height must: be less than or equal to 5005e5c31af7Sopenharmony_ci <<limits-maxFramebufferHeight, pname:maxFramebufferHeight>> 5006e5c31af7Sopenharmony_ci * [[VUID-VkFramebufferCreateInfo-layers-00889]] 5007e5c31af7Sopenharmony_ci pname:layers must: be greater than `0` 5008e5c31af7Sopenharmony_ci * [[VUID-VkFramebufferCreateInfo-layers-00890]] 5009e5c31af7Sopenharmony_ci pname:layers must: be less than or equal to 5010e5c31af7Sopenharmony_ci <<limits-maxFramebufferLayers, pname:maxFramebufferLayers>> 5011e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_multiview[] 5012e5c31af7Sopenharmony_ci * [[VUID-VkFramebufferCreateInfo-renderPass-02531]] 5013e5c31af7Sopenharmony_ci If pname:renderPass was specified with non-zero view masks, pname:layers 5014e5c31af7Sopenharmony_ci must: be `1` 5015e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_multiview[] 5016e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_maintenance1[] 5017e5c31af7Sopenharmony_ci * [[VUID-VkFramebufferCreateInfo-pAttachments-00891]] 5018e5c31af7Sopenharmony_ci If pname:flags does not include 5019e5c31af7Sopenharmony_ci ename:VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT, each element of 5020e5c31af7Sopenharmony_ci pname:pAttachments that is a 2D or 2D array image view taken from a 3D 5021e5c31af7Sopenharmony_ci image must: not be a depth/stencil format 5022e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_maintenance1[] 5023e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_KHR_imageless_framebuffer[] 5024e5c31af7Sopenharmony_ci * [[VUID-VkFramebufferCreateInfo-flags-03189]] 5025e5c31af7Sopenharmony_ci If the <<features-imagelessFramebuffer, pname:imagelessFramebuffer>> 5026e5c31af7Sopenharmony_ci feature is not enabled, pname:flags must: not include 5027e5c31af7Sopenharmony_ci ename:VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT 5028e5c31af7Sopenharmony_ci * [[VUID-VkFramebufferCreateInfo-flags-03190]] 5029e5c31af7Sopenharmony_ci If pname:flags includes ename:VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT, the 5030e5c31af7Sopenharmony_ci pname:pNext chain must: include a 5031e5c31af7Sopenharmony_ci slink:VkFramebufferAttachmentsCreateInfo structure 5032e5c31af7Sopenharmony_ci * [[VUID-VkFramebufferCreateInfo-flags-03191]] 5033e5c31af7Sopenharmony_ci If pname:flags includes ename:VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT, the 5034e5c31af7Sopenharmony_ci pname:attachmentImageInfoCount member of a 5035e5c31af7Sopenharmony_ci slink:VkFramebufferAttachmentsCreateInfo structure in the pname:pNext 5036e5c31af7Sopenharmony_ci chain must: be equal to either zero or pname:attachmentCount 5037e5c31af7Sopenharmony_ci * [[VUID-VkFramebufferCreateInfo-flags-04541]] 5038e5c31af7Sopenharmony_ci If pname:flags includes ename:VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT, the 5039e5c31af7Sopenharmony_ci pname:width member of any element of the pname:pAttachmentImageInfos 5040e5c31af7Sopenharmony_ci member of a slink:VkFramebufferAttachmentsCreateInfo structure in the 5041e5c31af7Sopenharmony_ci pname:pNext chain that is used as an input, color, resolve or 5042e5c31af7Sopenharmony_ci depth/stencil attachment in pname:renderPass must: be greater than or 5043e5c31af7Sopenharmony_ci equal to pname:width 5044e5c31af7Sopenharmony_ci * [[VUID-VkFramebufferCreateInfo-flags-04542]] 5045e5c31af7Sopenharmony_ci If pname:flags includes ename:VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT, the 5046e5c31af7Sopenharmony_ci pname:height member of any element of the pname:pAttachmentImageInfos 5047e5c31af7Sopenharmony_ci member of a slink:VkFramebufferAttachmentsCreateInfo structure in the 5048e5c31af7Sopenharmony_ci pname:pNext chain that is used as an input, color, resolve or 5049e5c31af7Sopenharmony_ci depth/stencil attachment in pname:renderPass must: be greater than or 5050e5c31af7Sopenharmony_ci equal to pname:height 5051e5c31af7Sopenharmony_ciifdef::VK_EXT_fragment_density_map[] 5052e5c31af7Sopenharmony_ci * [[VUID-VkFramebufferCreateInfo-flags-03196]] 5053e5c31af7Sopenharmony_ci If pname:flags includes ename:VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT, the 5054e5c31af7Sopenharmony_ci pname:width member of any element of the pname:pAttachmentImageInfos 5055e5c31af7Sopenharmony_ci member of a slink:VkFramebufferAttachmentsCreateInfo structure in the 5056e5c31af7Sopenharmony_ci pname:pNext chain that is referenced by 5057e5c31af7Sopenharmony_ci slink:VkRenderPassFragmentDensityMapCreateInfoEXT::pname:fragmentDensityMapAttachment 5058e5c31af7Sopenharmony_ci in pname:renderPass must: be greater than or equal to 5059e5c31af7Sopenharmony_ci latexmath:[\left\lceil{\frac{width}{maxFragmentDensityTexelSize_{width}}}\right\rceil] 5060e5c31af7Sopenharmony_ci * [[VUID-VkFramebufferCreateInfo-flags-03197]] 5061e5c31af7Sopenharmony_ci If pname:flags includes ename:VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT, the 5062e5c31af7Sopenharmony_ci pname:height member of any element of the pname:pAttachmentImageInfos 5063e5c31af7Sopenharmony_ci member of a slink:VkFramebufferAttachmentsCreateInfo structure included 5064e5c31af7Sopenharmony_ci in the pname:pNext chain that is referenced by 5065e5c31af7Sopenharmony_ci slink:VkRenderPassFragmentDensityMapCreateInfoEXT::pname:fragmentDensityMapAttachment 5066e5c31af7Sopenharmony_ci in pname:renderPass must: be greater than or equal to 5067e5c31af7Sopenharmony_ci latexmath:[\left\lceil{\frac{height}{maxFragmentDensityTexelSize_{height}}}\right\rceil] 5068e5c31af7Sopenharmony_ciendif::VK_EXT_fragment_density_map[] 5069e5c31af7Sopenharmony_ciifdef::VK_KHR_fragment_shading_rate[] 5070e5c31af7Sopenharmony_ci * [[VUID-VkFramebufferCreateInfo-flags-04543]] 5071e5c31af7Sopenharmony_ci If pname:flags includes ename:VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT, the 5072e5c31af7Sopenharmony_ci pname:width member of any element of the pname:pAttachmentImageInfos 5073e5c31af7Sopenharmony_ci member of a slink:VkFramebufferAttachmentsCreateInfo structure in the 5074e5c31af7Sopenharmony_ci pname:pNext chain that is used as a 5075e5c31af7Sopenharmony_ci <<primsrast-fragment-shading-rate-attachment, fragment shading rate 5076e5c31af7Sopenharmony_ci attachment>> must: be greater than or equal to [eq]#{lceil}pname:width / 5077e5c31af7Sopenharmony_ci code:texelWidth{rceil}#, where code:texelWidth is the largest value of 5078e5c31af7Sopenharmony_ci pname:shadingRateAttachmentTexelSize.width in a 5079e5c31af7Sopenharmony_ci slink:VkFragmentShadingRateAttachmentInfoKHR which references that 5080e5c31af7Sopenharmony_ci attachment 5081e5c31af7Sopenharmony_ci * [[VUID-VkFramebufferCreateInfo-flags-04544]] 5082e5c31af7Sopenharmony_ci If pname:flags includes ename:VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT, the 5083e5c31af7Sopenharmony_ci pname:height member of any element of the pname:pAttachmentImageInfos 5084e5c31af7Sopenharmony_ci member of a slink:VkFramebufferAttachmentsCreateInfo structure in the 5085e5c31af7Sopenharmony_ci pname:pNext chain that is used as a 5086e5c31af7Sopenharmony_ci <<primsrast-fragment-shading-rate-attachment, fragment shading rate 5087e5c31af7Sopenharmony_ci attachment>> must: be greater than or equal to [eq]#{lceil}pname:height 5088e5c31af7Sopenharmony_ci / code:texelHeight{rceil}#, where code:texelHeight is the largest value 5089e5c31af7Sopenharmony_ci of pname:shadingRateAttachmentTexelSize.height in a 5090e5c31af7Sopenharmony_ci slink:VkFragmentShadingRateAttachmentInfoKHR which references that 5091e5c31af7Sopenharmony_ci attachment 5092e5c31af7Sopenharmony_ci * [[VUID-VkFramebufferCreateInfo-flags-04545]] 5093e5c31af7Sopenharmony_ci If pname:flags includes ename:VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT, the 5094e5c31af7Sopenharmony_ci pname:layerCount member of any element of the 5095e5c31af7Sopenharmony_ci pname:pAttachmentImageInfos member of a 5096e5c31af7Sopenharmony_ci slink:VkFramebufferAttachmentsCreateInfo structure in the pname:pNext 5097e5c31af7Sopenharmony_ci chain that is used as a <<primsrast-fragment-shading-rate-attachment, 5098e5c31af7Sopenharmony_ci fragment shading rate attachment>> must: be either `1`, or greater than 5099e5c31af7Sopenharmony_ci or equal to pname:layers 5100e5c31af7Sopenharmony_ci * [[VUID-VkFramebufferCreateInfo-flags-04587]] 5101e5c31af7Sopenharmony_ci If pname:flags includes ename:VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT and 5102e5c31af7Sopenharmony_ci pname:renderPass was specified with non-zero view masks, each element of 5103e5c31af7Sopenharmony_ci pname:pAttachments that is used as a 5104e5c31af7Sopenharmony_ci <<primsrast-fragment-shading-rate-attachment,fragment shading rate 5105e5c31af7Sopenharmony_ci attachment>> by pname:renderPass must: have a pname:layerCount that is 5106e5c31af7Sopenharmony_ci either `1`, or greater than the index of the most significant bit set in 5107e5c31af7Sopenharmony_ci any of those view masks 5108e5c31af7Sopenharmony_ciendif::VK_KHR_fragment_shading_rate[] 5109e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_multiview[] 5110e5c31af7Sopenharmony_ci * [[VUID-VkFramebufferCreateInfo-renderPass-03198]] 5111e5c31af7Sopenharmony_ci If multiview is enabled for pname:renderPass and pname:flags includes 5112e5c31af7Sopenharmony_ci ename:VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT, the pname:layerCount member 5113e5c31af7Sopenharmony_ci of any element of the pname:pAttachmentImageInfos member of a 5114e5c31af7Sopenharmony_ci slink:VkFramebufferAttachmentsCreateInfo structure included in the 5115e5c31af7Sopenharmony_ci pname:pNext chain used as an input, color, resolve, or depth/stencil 5116e5c31af7Sopenharmony_ci attachment in pname:renderPass must: be greater than the maximum bit 5117e5c31af7Sopenharmony_ci index set in the view mask in the subpasses in which it is used in 5118e5c31af7Sopenharmony_ci pname:renderPass 5119e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_multiview[] 5120e5c31af7Sopenharmony_ci * [[VUID-VkFramebufferCreateInfo-renderPass-04546]] 5121e5c31af7Sopenharmony_ci If 5122e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_multiview[] 5123e5c31af7Sopenharmony_ci multiview is not enabled for pname:renderPass and 5124e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_multiview[] 5125e5c31af7Sopenharmony_ci pname:flags includes ename:VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT, the 5126e5c31af7Sopenharmony_ci pname:layerCount member of any element of the 5127e5c31af7Sopenharmony_ci pname:pAttachmentImageInfos member of a 5128e5c31af7Sopenharmony_ci slink:VkFramebufferAttachmentsCreateInfo structure included in the 5129e5c31af7Sopenharmony_ci pname:pNext chain used as an input, color, resolve, or depth/stencil 5130e5c31af7Sopenharmony_ci attachment in pname:renderPass must: be greater than or equal to 5131e5c31af7Sopenharmony_ci pname:layers 5132e5c31af7Sopenharmony_ci * [[VUID-VkFramebufferCreateInfo-flags-03201]] 5133e5c31af7Sopenharmony_ci If pname:flags includes ename:VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT, the 5134e5c31af7Sopenharmony_ci pname:usage member of any element of the pname:pAttachmentImageInfos 5135e5c31af7Sopenharmony_ci member of a slink:VkFramebufferAttachmentsCreateInfo structure included 5136e5c31af7Sopenharmony_ci in the pname:pNext chain that refers to an attachment used as a color 5137e5c31af7Sopenharmony_ci attachment or resolve attachment by pname:renderPass must: include 5138e5c31af7Sopenharmony_ci ename:VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT 5139e5c31af7Sopenharmony_ci * [[VUID-VkFramebufferCreateInfo-flags-03202]] 5140e5c31af7Sopenharmony_ci If pname:flags includes ename:VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT, the 5141e5c31af7Sopenharmony_ci pname:usage member of any element of the pname:pAttachmentImageInfos 5142e5c31af7Sopenharmony_ci member of a slink:VkFramebufferAttachmentsCreateInfo structure included 5143e5c31af7Sopenharmony_ci in the pname:pNext chain that refers to an attachment used as a 5144e5c31af7Sopenharmony_ci depth/stencil attachment by pname:renderPass must: include 5145e5c31af7Sopenharmony_ci ename:VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT 5146e5c31af7Sopenharmony_ciifdef::VK_KHR_depth_stencil_resolve[] 5147e5c31af7Sopenharmony_ci * [[VUID-VkFramebufferCreateInfo-flags-03203]] 5148e5c31af7Sopenharmony_ci If pname:flags includes ename:VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT, the 5149e5c31af7Sopenharmony_ci pname:usage member of any element of the pname:pAttachmentImageInfos 5150e5c31af7Sopenharmony_ci member of a slink:VkFramebufferAttachmentsCreateInfo structure included 5151e5c31af7Sopenharmony_ci in the pname:pNext chain that refers to an attachment used as a 5152e5c31af7Sopenharmony_ci depth/stencil resolve attachment by pname:renderPass must: include 5153e5c31af7Sopenharmony_ci ename:VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT 5154e5c31af7Sopenharmony_ciendif::VK_KHR_depth_stencil_resolve[] 5155e5c31af7Sopenharmony_ci * [[VUID-VkFramebufferCreateInfo-flags-03204]] 5156e5c31af7Sopenharmony_ci If pname:flags includes ename:VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT, the 5157e5c31af7Sopenharmony_ci pname:usage member of any element of the pname:pAttachmentImageInfos 5158e5c31af7Sopenharmony_ci member of a slink:VkFramebufferAttachmentsCreateInfo structure included 5159e5c31af7Sopenharmony_ci in the pname:pNext chain that refers to an attachment used as an input 5160e5c31af7Sopenharmony_ci attachment by pname:renderPass must: include 5161e5c31af7Sopenharmony_ci ename:VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT 5162e5c31af7Sopenharmony_ci * [[VUID-VkFramebufferCreateInfo-flags-03205]] 5163e5c31af7Sopenharmony_ci If pname:flags includes ename:VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT, at 5164e5c31af7Sopenharmony_ci least one element of the pname:pViewFormats member of any element of the 5165e5c31af7Sopenharmony_ci pname:pAttachmentImageInfos member of a 5166e5c31af7Sopenharmony_ci slink:VkFramebufferAttachmentsCreateInfo structure included in the 5167e5c31af7Sopenharmony_ci pname:pNext chain must: be equal to the corresponding value of 5168e5c31af7Sopenharmony_ci slink:VkAttachmentDescription::pname:format used to create 5169e5c31af7Sopenharmony_ci pname:renderPass 5170e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_KHR_imageless_framebuffer[] 5171e5c31af7Sopenharmony_ci * [[VUID-VkFramebufferCreateInfo-flags-04113]] 5172e5c31af7Sopenharmony_ci If pname:flags does not include 5173e5c31af7Sopenharmony_ci ename:VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT, each element of 5174e5c31af7Sopenharmony_ci pname:pAttachments must: have been created with 5175e5c31af7Sopenharmony_ci slink:VkImageViewCreateInfo::pname:viewType not equal to 5176e5c31af7Sopenharmony_ci ename:VK_IMAGE_VIEW_TYPE_3D 5177e5c31af7Sopenharmony_ciifdef::VK_KHR_fragment_shading_rate[] 5178e5c31af7Sopenharmony_ci * [[VUID-VkFramebufferCreateInfo-flags-04548]] 5179e5c31af7Sopenharmony_ci If pname:flags does not include 5180e5c31af7Sopenharmony_ci ename:VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT, each element of 5181e5c31af7Sopenharmony_ci pname:pAttachments that is used as a fragment shading rate attachment by 5182e5c31af7Sopenharmony_ci pname:renderPass must: have been created with a pname:usage value 5183e5c31af7Sopenharmony_ci including ename:VK_IMAGE_USAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR 5184e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_KHR_imageless_framebuffer[] 5185e5c31af7Sopenharmony_ci * [[VUID-VkFramebufferCreateInfo-flags-04549]] 5186e5c31af7Sopenharmony_ci If pname:flags includes ename:VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT, the 5187e5c31af7Sopenharmony_ci pname:usage member of any element of the pname:pAttachmentImageInfos 5188e5c31af7Sopenharmony_ci member of a slink:VkFramebufferAttachmentsCreateInfo structure included 5189e5c31af7Sopenharmony_ci in the pname:pNext chain that refers to an attachment used as a fragment 5190e5c31af7Sopenharmony_ci shading rate attachment by pname:renderPass must: include 5191e5c31af7Sopenharmony_ci ename:VK_IMAGE_USAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR 5192e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_KHR_imageless_framebuffer[] 5193e5c31af7Sopenharmony_ciendif::VK_KHR_fragment_shading_rate[] 5194e5c31af7Sopenharmony_ciifdef::VKSC_VERSION_1_0[] 5195e5c31af7Sopenharmony_ci * [[VUID-VkFramebufferCreateInfo-attachmentCount-05060]] 5196e5c31af7Sopenharmony_ci pname:attachmentCount must: be less than or equal to 5197e5c31af7Sopenharmony_ci <<limits-maxFramebufferAttachments,maxFramebufferAttachments>> 5198e5c31af7Sopenharmony_ciendif::VKSC_VERSION_1_0[] 5199e5c31af7Sopenharmony_ciifdef::VK_EXT_multisampled_render_to_single_sampled[] 5200e5c31af7Sopenharmony_ci * [[VUID-VkFramebufferCreateInfo-samples-06881]] 5201e5c31af7Sopenharmony_ci If 5202e5c31af7Sopenharmony_ci <<subpass-multisampledrendertosinglesampled,multisampled-render-to-single-sampled>> 5203e5c31af7Sopenharmony_ci is enabled for any subpass, all color, depth/stencil and input 5204e5c31af7Sopenharmony_ci attachments used in that subpass which have 5205e5c31af7Sopenharmony_ci sname:VkAttachmentDescription::pname:samples or 5206e5c31af7Sopenharmony_ci sname:VkAttachmentDescription2::pname:samples equal to 5207e5c31af7Sopenharmony_ci ename:VK_SAMPLE_COUNT_1_BIT must: have been created with 5208e5c31af7Sopenharmony_ci ename:VK_IMAGE_CREATE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_BIT_EXT in 5209e5c31af7Sopenharmony_ci their slink:VkImageCreateInfo::pname:flags 5210e5c31af7Sopenharmony_ci * [[VUID-VkFramebufferCreateInfo-samples-07009]] 5211e5c31af7Sopenharmony_ci If 5212e5c31af7Sopenharmony_ci <<subpass-multisampledrendertosinglesampled,multisampled-render-to-single-sampled>> 5213e5c31af7Sopenharmony_ci is enabled for any subpass, all color, depth/stencil and input 5214e5c31af7Sopenharmony_ci attachments used in that subpass which have 5215e5c31af7Sopenharmony_ci sname:VkAttachmentDescription::pname:samples or 5216e5c31af7Sopenharmony_ci sname:VkAttachmentDescription2::pname:samples equal to 5217e5c31af7Sopenharmony_ci ename:VK_SAMPLE_COUNT_1_BIT must: have a format that supports the sample 5218e5c31af7Sopenharmony_ci count specified in 5219e5c31af7Sopenharmony_ci slink:VkMultisampledRenderToSingleSampledInfoEXT::pname:rasterizationSamples 5220e5c31af7Sopenharmony_ciendif::VK_EXT_multisampled_render_to_single_sampled[] 5221e5c31af7Sopenharmony_ciifdef::VK_ANDROID_external_format_resolve[] 5222e5c31af7Sopenharmony_ci * [[VUID-VkFramebufferCreateInfo-nullColorAttachmentWithExternalFormatResolve-09349]] 5223e5c31af7Sopenharmony_ci If the <<limits-nullColorAttachmentWithExternalFormatResolve, 5224e5c31af7Sopenharmony_ci pname:nullColorAttachmentWithExternalFormatResolve>> is ename:VK_FALSE, 5225e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_KHR_imageless_framebuffer[] 5226e5c31af7Sopenharmony_ci and pname:flags does not include 5227e5c31af7Sopenharmony_ci ename:VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT, 5228e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_KHR_imageless_framebuffer[] 5229e5c31af7Sopenharmony_ci the format of the color attachment for each subpass in pname:renderPass 5230e5c31af7Sopenharmony_ci that includes an external format image as a resolve attachment must: 5231e5c31af7Sopenharmony_ci have a format equal to the value of 5232e5c31af7Sopenharmony_ci slink:VkAndroidHardwareBufferFormatResolvePropertiesANDROID::pname:colorAttachmentFormat 5233e5c31af7Sopenharmony_ci as returned by a call to 5234e5c31af7Sopenharmony_ci flink:vkGetAndroidHardwareBufferPropertiesANDROID for the Android 5235e5c31af7Sopenharmony_ci hardware buffer that was used to create the image view use as its 5236e5c31af7Sopenharmony_ci resolve attachment 5237e5c31af7Sopenharmony_ci * [[VUID-VkFramebufferCreateInfo-pAttachments-09350]] 5238e5c31af7Sopenharmony_ci If 5239e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_KHR_imageless_framebuffer[] 5240e5c31af7Sopenharmony_ci pname:flags does not include ename:VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT, 5241e5c31af7Sopenharmony_ci then if 5242e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_KHR_imageless_framebuffer[] 5243e5c31af7Sopenharmony_ci an element of pname:pAttachments has a format of 5244e5c31af7Sopenharmony_ci ename:VK_FORMAT_UNDEFINED, it must: have been created with a 5245e5c31af7Sopenharmony_ci slink:VkExternalFormatANDROID::pname:externalFormat value identical to 5246e5c31af7Sopenharmony_ci that provided in the slink:VkExternalFormatANDROID::pname:externalFormat 5247e5c31af7Sopenharmony_ci specified by the corresponding slink:VkAttachmentDescription2 in 5248e5c31af7Sopenharmony_ci pname:renderPass 5249e5c31af7Sopenharmony_ciendif::VK_ANDROID_external_format_resolve[] 5250e5c31af7Sopenharmony_ci**** 5251e5c31af7Sopenharmony_ci 5252e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkFramebufferCreateInfo.adoc[] 5253e5c31af7Sopenharmony_ci-- 5254e5c31af7Sopenharmony_ci 5255e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_KHR_imageless_framebuffer[] 5256e5c31af7Sopenharmony_ci[open,refpage='VkFramebufferAttachmentsCreateInfo',desc='Structure specifying parameters of images that will be used with a framebuffer',type='structs',alias='VkFramebufferAttachmentsCreateInfo'] 5257e5c31af7Sopenharmony_ci-- 5258e5c31af7Sopenharmony_ciThe sname:VkFramebufferAttachmentsCreateInfo structure is defined as: 5259e5c31af7Sopenharmony_ci 5260e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkFramebufferAttachmentsCreateInfo.adoc[] 5261e5c31af7Sopenharmony_ci 5262e5c31af7Sopenharmony_ciifdef::VK_KHR_imageless_framebuffer[] 5263e5c31af7Sopenharmony_cior the equivalent 5264e5c31af7Sopenharmony_ci 5265e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkFramebufferAttachmentsCreateInfoKHR.adoc[] 5266e5c31af7Sopenharmony_ciendif::VK_KHR_imageless_framebuffer[] 5267e5c31af7Sopenharmony_ci 5268e5c31af7Sopenharmony_ci * pname:sType is a elink:VkStructureType value identifying this structure. 5269e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 5270e5c31af7Sopenharmony_ci structure. 5271e5c31af7Sopenharmony_ci * pname:attachmentImageInfoCount is the number of attachments being 5272e5c31af7Sopenharmony_ci described. 5273e5c31af7Sopenharmony_ci * pname:pAttachmentImageInfos is a pointer to an array of 5274e5c31af7Sopenharmony_ci slink:VkFramebufferAttachmentImageInfo structures, each structure 5275e5c31af7Sopenharmony_ci describing a number of parameters of the corresponding attachment in a 5276e5c31af7Sopenharmony_ci render pass instance. 5277e5c31af7Sopenharmony_ci 5278e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkFramebufferAttachmentsCreateInfo.adoc[] 5279e5c31af7Sopenharmony_ci-- 5280e5c31af7Sopenharmony_ci 5281e5c31af7Sopenharmony_ci[open,refpage='VkFramebufferAttachmentImageInfo',desc='Structure specifying parameters of an image that will be used with a framebuffer',type='structs',alias='VkFramebufferAttachmentImageInfoKHR'] 5282e5c31af7Sopenharmony_ci-- 5283e5c31af7Sopenharmony_ciThe sname:VkFramebufferAttachmentImageInfo structure is defined as: 5284e5c31af7Sopenharmony_ci 5285e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkFramebufferAttachmentImageInfo.adoc[] 5286e5c31af7Sopenharmony_ci 5287e5c31af7Sopenharmony_ciifdef::VK_KHR_imageless_framebuffer[] 5288e5c31af7Sopenharmony_cior the equivalent 5289e5c31af7Sopenharmony_ci 5290e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkFramebufferAttachmentImageInfoKHR.adoc[] 5291e5c31af7Sopenharmony_ciendif::VK_KHR_imageless_framebuffer[] 5292e5c31af7Sopenharmony_ci 5293e5c31af7Sopenharmony_ci * pname:sType is a elink:VkStructureType value identifying this structure. 5294e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 5295e5c31af7Sopenharmony_ci structure. 5296e5c31af7Sopenharmony_ci * pname:flags is a bitmask of elink:VkImageCreateFlagBits, matching the 5297e5c31af7Sopenharmony_ci value of slink:VkImageCreateInfo::pname:flags used to create an image 5298e5c31af7Sopenharmony_ci that will be used with this framebuffer. 5299e5c31af7Sopenharmony_ci * pname:usage is a bitmask of elink:VkImageUsageFlagBits, matching the 5300e5c31af7Sopenharmony_ci value of slink:VkImageCreateInfo::pname:usage used to create an image 5301e5c31af7Sopenharmony_ci used with this framebuffer. 5302e5c31af7Sopenharmony_ci * pname:width is the width of the image view used for rendering. 5303e5c31af7Sopenharmony_ci * pname:height is the height of the image view used for rendering. 5304e5c31af7Sopenharmony_ci * pname:layerCount is the number of array layers of the image view used 5305e5c31af7Sopenharmony_ci for rendering. 5306e5c31af7Sopenharmony_ci * pname:viewFormatCount is the number of entries in the pname:pViewFormats 5307e5c31af7Sopenharmony_ci array, matching the value of 5308e5c31af7Sopenharmony_ci slink:VkImageFormatListCreateInfo::pname:viewFormatCount used to create 5309e5c31af7Sopenharmony_ci an image used with this framebuffer. 5310e5c31af7Sopenharmony_ci * pname:pViewFormats is a pointer to an array of elink:VkFormat values 5311e5c31af7Sopenharmony_ci specifying all of the formats which can: be used when creating views of 5312e5c31af7Sopenharmony_ci the image, matching the value of 5313e5c31af7Sopenharmony_ci slink:VkImageFormatListCreateInfo::pname:pViewFormats used to create an 5314e5c31af7Sopenharmony_ci image used with this framebuffer. 5315e5c31af7Sopenharmony_ci 5316e5c31af7Sopenharmony_ciImages that can: be used with the framebuffer when beginning a render pass, 5317e5c31af7Sopenharmony_cias specified by slink:VkRenderPassAttachmentBeginInfo, must: be created with 5318e5c31af7Sopenharmony_ciparameters that are identical to those specified here. 5319e5c31af7Sopenharmony_ci 5320e5c31af7Sopenharmony_ci 5321e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkFramebufferAttachmentImageInfo.adoc[] 5322e5c31af7Sopenharmony_ci-- 5323e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_KHR_imageless_framebuffer[] 5324e5c31af7Sopenharmony_ci 5325e5c31af7Sopenharmony_ci 5326e5c31af7Sopenharmony_ci[open,refpage='VkFramebufferCreateFlagBits',desc='Bitmask specifying framebuffer properties',type='enums'] 5327e5c31af7Sopenharmony_ci-- 5328e5c31af7Sopenharmony_ciBits which can: be set in slink:VkFramebufferCreateInfo::pname:flags, 5329e5c31af7Sopenharmony_cispecifying options for framebuffers, are: 5330e5c31af7Sopenharmony_ci 5331e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkFramebufferCreateFlagBits.adoc[] 5332e5c31af7Sopenharmony_ci 5333e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_KHR_imageless_framebuffer[] 5334e5c31af7Sopenharmony_ci * ename:VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT specifies that image views are 5335e5c31af7Sopenharmony_ci not specified, and only attachment compatibility information will be 5336e5c31af7Sopenharmony_ci provided via a slink:VkFramebufferAttachmentImageInfo structure. 5337e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_KHR_imageless_framebuffer[] 5338e5c31af7Sopenharmony_ci 5339e5c31af7Sopenharmony_ciifndef::VK_VERSION_1_2,VK_KHR_imageless_framebuffer[] 5340e5c31af7Sopenharmony_ci[NOTE] 5341e5c31af7Sopenharmony_ci.Note 5342e5c31af7Sopenharmony_ci==== 5343e5c31af7Sopenharmony_ciAll bits for this type are defined by extensions, and none of those 5344e5c31af7Sopenharmony_ciextensions are enabled in this build of the specification. 5345e5c31af7Sopenharmony_ci==== 5346e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_KHR_imageless_framebuffer[] 5347e5c31af7Sopenharmony_ci-- 5348e5c31af7Sopenharmony_ci 5349e5c31af7Sopenharmony_ci[open,refpage='VkFramebufferCreateFlags',desc='Bitmask of VkFramebufferCreateFlagBits',type='flags'] 5350e5c31af7Sopenharmony_ci-- 5351e5c31af7Sopenharmony_ciinclude::{generated}/api/flags/VkFramebufferCreateFlags.adoc[] 5352e5c31af7Sopenharmony_ci 5353e5c31af7Sopenharmony_citname:VkFramebufferCreateFlags is a bitmask type for setting a mask of zero 5354e5c31af7Sopenharmony_cior more elink:VkFramebufferCreateFlagBits. 5355e5c31af7Sopenharmony_ci-- 5356e5c31af7Sopenharmony_ci 5357e5c31af7Sopenharmony_ci[open,refpage='vkDestroyFramebuffer',desc='Destroy a framebuffer object',type='protos'] 5358e5c31af7Sopenharmony_ci-- 5359e5c31af7Sopenharmony_ciTo destroy a framebuffer, call: 5360e5c31af7Sopenharmony_ci 5361e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkDestroyFramebuffer.adoc[] 5362e5c31af7Sopenharmony_ci 5363e5c31af7Sopenharmony_ci * pname:device is the logical device that destroys the framebuffer. 5364e5c31af7Sopenharmony_ci * pname:framebuffer is the handle of the framebuffer to destroy. 5365e5c31af7Sopenharmony_ci * pname:pAllocator controls host memory allocation as described in the 5366e5c31af7Sopenharmony_ci <<memory-allocation, Memory Allocation>> chapter. 5367e5c31af7Sopenharmony_ci 5368e5c31af7Sopenharmony_ci.Valid Usage 5369e5c31af7Sopenharmony_ci**** 5370e5c31af7Sopenharmony_ci * [[VUID-vkDestroyFramebuffer-framebuffer-00892]] 5371e5c31af7Sopenharmony_ci All submitted commands that refer to pname:framebuffer must: have 5372e5c31af7Sopenharmony_ci completed execution 5373e5c31af7Sopenharmony_ciifndef::VKSC_VERSION_1_0[] 5374e5c31af7Sopenharmony_ci * [[VUID-vkDestroyFramebuffer-framebuffer-00893]] 5375e5c31af7Sopenharmony_ci If sname:VkAllocationCallbacks were provided when pname:framebuffer was 5376e5c31af7Sopenharmony_ci created, a compatible set of callbacks must: be provided here 5377e5c31af7Sopenharmony_ci * [[VUID-vkDestroyFramebuffer-framebuffer-00894]] 5378e5c31af7Sopenharmony_ci If no sname:VkAllocationCallbacks were provided when pname:framebuffer 5379e5c31af7Sopenharmony_ci was created, pname:pAllocator must: be `NULL` 5380e5c31af7Sopenharmony_ciendif::VKSC_VERSION_1_0[] 5381e5c31af7Sopenharmony_ci**** 5382e5c31af7Sopenharmony_ci 5383e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkDestroyFramebuffer.adoc[] 5384e5c31af7Sopenharmony_ci-- 5385e5c31af7Sopenharmony_ci 5386e5c31af7Sopenharmony_ci 5387e5c31af7Sopenharmony_ci[[renderpass-load-operations]] 5388e5c31af7Sopenharmony_ci== Render Pass Load Operations 5389e5c31af7Sopenharmony_ci 5390e5c31af7Sopenharmony_ciRender pass load operations define the initial values of an attachment 5391e5c31af7Sopenharmony_ciduring a render pass instance. 5392e5c31af7Sopenharmony_ci 5393e5c31af7Sopenharmony_ciLoad operations for attachments with a depth/stencil format execute in the 5394e5c31af7Sopenharmony_ciename:VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT pipeline stage. 5395e5c31af7Sopenharmony_ciLoad operations for attachments with a color format execute in the 5396e5c31af7Sopenharmony_ciename:VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT pipeline stage. 5397e5c31af7Sopenharmony_ciThe load operation for each sample in an attachment happens-before any 5398e5c31af7Sopenharmony_cirecorded command which accesses the sample in that render pass instance via 5399e5c31af7Sopenharmony_cithat attachment or an alias. 5400e5c31af7Sopenharmony_ci 5401e5c31af7Sopenharmony_ci[NOTE] 5402e5c31af7Sopenharmony_ci.Note 5403e5c31af7Sopenharmony_ci==== 5404e5c31af7Sopenharmony_ciBecause load operations always happen first, external synchronization with 5405e5c31af7Sopenharmony_ciattachment access only needs to synchronize the load operations with 5406e5c31af7Sopenharmony_ciprevious commands; not the operations within the render pass instance. 5407e5c31af7Sopenharmony_ciifdef::VK_EXT_load_store_op_none[] 5408e5c31af7Sopenharmony_ciThis does not apply when using ename:VK_ATTACHMENT_LOAD_OP_NONE_EXT. 5409e5c31af7Sopenharmony_ciendif::VK_EXT_load_store_op_none[] 5410e5c31af7Sopenharmony_ci==== 5411e5c31af7Sopenharmony_ci 5412e5c31af7Sopenharmony_ciLoad operations only update values within the defined render area for the 5413e5c31af7Sopenharmony_cirender pass instance. 5414e5c31af7Sopenharmony_ciHowever, any writes performed by a load operation (as defined by its access 5415e5c31af7Sopenharmony_cimasks) to a given attachment may: read and write back any memory locations 5416e5c31af7Sopenharmony_ciwithin the image subresource bound for that attachment. 5417e5c31af7Sopenharmony_ciFor depth/stencil images, writes to one aspect may: also result in 5418e5c31af7Sopenharmony_ciread-modify-write operations for the other aspect. 5419e5c31af7Sopenharmony_ciifdef::VK_EXT_attachment_feedback_loop_layout[] 5420e5c31af7Sopenharmony_ciIf the subresource is in the 5421e5c31af7Sopenharmony_ciename:VK_IMAGE_LAYOUT_ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT layout, 5422e5c31af7Sopenharmony_ciimplementations must: not access pixels outside of the render area. 5423e5c31af7Sopenharmony_ciendif::VK_EXT_attachment_feedback_loop_layout[] 5424e5c31af7Sopenharmony_ci 5425e5c31af7Sopenharmony_ci[NOTE] 5426e5c31af7Sopenharmony_ci.Note 5427e5c31af7Sopenharmony_ci==== 5428e5c31af7Sopenharmony_ciAs entire subresources could be accessed by load operations, applications 5429e5c31af7Sopenharmony_cicannot safely access values outside of the render area during a render pass 5430e5c31af7Sopenharmony_ciinstance when a load operation that modifies values is used. 5431e5c31af7Sopenharmony_ci==== 5432e5c31af7Sopenharmony_ci 5433e5c31af7Sopenharmony_ci[open,refpage='VkAttachmentLoadOp',desc='Specify how contents of an attachment are initialized at the beginning of a subpass',type='enums'] 5434e5c31af7Sopenharmony_ci-- 5435e5c31af7Sopenharmony_ciLoad operations that can: be used for a render pass are: 5436e5c31af7Sopenharmony_ci 5437e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkAttachmentLoadOp.adoc[] 5438e5c31af7Sopenharmony_ci 5439e5c31af7Sopenharmony_ci * ename:VK_ATTACHMENT_LOAD_OP_LOAD specifies that the previous contents of 5440e5c31af7Sopenharmony_ci the image within the render area will be preserved as the initial 5441e5c31af7Sopenharmony_ci values. 5442e5c31af7Sopenharmony_ci For attachments with a depth/stencil format, this uses the access type 5443e5c31af7Sopenharmony_ci ename:VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT. 5444e5c31af7Sopenharmony_ci For attachments with a color format, this uses the access type 5445e5c31af7Sopenharmony_ci ename:VK_ACCESS_COLOR_ATTACHMENT_READ_BIT. 5446e5c31af7Sopenharmony_ci * ename:VK_ATTACHMENT_LOAD_OP_CLEAR specifies that the contents within the 5447e5c31af7Sopenharmony_ci render area will be cleared to a uniform value, which is specified when 5448e5c31af7Sopenharmony_ci a render pass instance is begun. 5449e5c31af7Sopenharmony_ci For attachments with a depth/stencil format, this uses the access type 5450e5c31af7Sopenharmony_ci ename:VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT. 5451e5c31af7Sopenharmony_ci For attachments with a color format, this uses the access type 5452e5c31af7Sopenharmony_ci ename:VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT. 5453e5c31af7Sopenharmony_ci * ename:VK_ATTACHMENT_LOAD_OP_DONT_CARE specifies that the previous 5454e5c31af7Sopenharmony_ci contents within the area need not be preserved; the contents of the 5455e5c31af7Sopenharmony_ci attachment will be undefined: inside the render area. 5456e5c31af7Sopenharmony_ci For attachments with a depth/stencil format, this uses the access type 5457e5c31af7Sopenharmony_ci ename:VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT. 5458e5c31af7Sopenharmony_ci For attachments with a color format, this uses the access type 5459e5c31af7Sopenharmony_ci ename:VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT. 5460e5c31af7Sopenharmony_ciifdef::VK_EXT_load_store_op_none[] 5461e5c31af7Sopenharmony_ci * ename:VK_ATTACHMENT_LOAD_OP_NONE_EXT specifies that the previous 5462e5c31af7Sopenharmony_ci contents of the image will be undefined: inside the render pass. 5463e5c31af7Sopenharmony_ci No access type is used as the image is not accessed. 5464e5c31af7Sopenharmony_ciendif::VK_EXT_load_store_op_none[] 5465e5c31af7Sopenharmony_ci-- 5466e5c31af7Sopenharmony_ci 5467e5c31af7Sopenharmony_ci[[renderpass-precision]] 5468e5c31af7Sopenharmony_ciDuring a render pass instance, input and color attachments with color 5469e5c31af7Sopenharmony_ciformats that have a component size of 8, 16, or 32 bits must: be represented 5470e5c31af7Sopenharmony_ciin the attachment's format throughout the instance. 5471e5c31af7Sopenharmony_ciAttachments with other floating- or fixed-point color formats, or with depth 5472e5c31af7Sopenharmony_cicomponents may: be represented in a format with a precision higher than the 5473e5c31af7Sopenharmony_ciattachment format, but must: be represented with the same range. 5474e5c31af7Sopenharmony_ciWhen such a component is loaded via the pname:loadOp, it will be converted 5475e5c31af7Sopenharmony_ciinto an implementation-dependent format used by the render pass. 5476e5c31af7Sopenharmony_ciSuch components must: be converted from the render pass format, to the 5477e5c31af7Sopenharmony_ciformat of the attachment, before they are resolved or stored at the end of a 5478e5c31af7Sopenharmony_cirender pass instance via pname:storeOp. 5479e5c31af7Sopenharmony_ciConversions occur as described in <<fundamentals-numerics,Numeric 5480e5c31af7Sopenharmony_ciRepresentation and Computation>> and <<fundamentals-fixedconv, Fixed-Point 5481e5c31af7Sopenharmony_ciData Conversions>>. 5482e5c31af7Sopenharmony_ci 5483e5c31af7Sopenharmony_ci 5484e5c31af7Sopenharmony_ci[[renderpass-store-operations]] 5485e5c31af7Sopenharmony_ci== Render Pass Store Operations 5486e5c31af7Sopenharmony_ci 5487e5c31af7Sopenharmony_ciRender pass store operations define how values written to an attachment 5488e5c31af7Sopenharmony_ciduring a render pass instance are stored to memory. 5489e5c31af7Sopenharmony_ci 5490e5c31af7Sopenharmony_ciStore operations for attachments with a depth/stencil format execute in the 5491e5c31af7Sopenharmony_ciename:VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT pipeline stage. 5492e5c31af7Sopenharmony_ciStore operations for attachments with a color format execute in the 5493e5c31af7Sopenharmony_ciename:VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT pipeline stage. 5494e5c31af7Sopenharmony_ciThe store operation for each sample in an attachment happens-after any 5495e5c31af7Sopenharmony_cirecorded command which accesses the sample via that attachment or an alias. 5496e5c31af7Sopenharmony_ci 5497e5c31af7Sopenharmony_ci[NOTE] 5498e5c31af7Sopenharmony_ci.Note 5499e5c31af7Sopenharmony_ci==== 5500e5c31af7Sopenharmony_ciBecause store operations always happen after other accesses in a render pass 5501e5c31af7Sopenharmony_ciinstance, external synchronization with attachment access in an earlier 5502e5c31af7Sopenharmony_cirender pass only needs to synchronize with the store operations; not the 5503e5c31af7Sopenharmony_cioperations within the render pass instance. 5504e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_3,VK_EXT_load_store_op_none,VK_KHR_dynamic_rendering,VK_QCOM_render_pass_store_ops[] 5505e5c31af7Sopenharmony_ciThis does not apply when using ename:VK_ATTACHMENT_STORE_OP_NONE. 5506e5c31af7Sopenharmony_ciendif::VK_VERSION_1_3,VK_EXT_load_store_op_none,VK_KHR_dynamic_rendering,VK_QCOM_render_pass_store_ops[] 5507e5c31af7Sopenharmony_ci==== 5508e5c31af7Sopenharmony_ci 5509e5c31af7Sopenharmony_ci 5510e5c31af7Sopenharmony_ciStore operations only update values within the defined render area for the 5511e5c31af7Sopenharmony_cirender pass instance. 5512e5c31af7Sopenharmony_ciHowever, any writes performed by a store operation (as defined by its access 5513e5c31af7Sopenharmony_cimasks) to a given attachment may: read and write back any memory locations 5514e5c31af7Sopenharmony_ciwithin the image subresource bound for that attachment. 5515e5c31af7Sopenharmony_ciFor depth/stencil images writes to one aspect may: also result in 5516e5c31af7Sopenharmony_ciread-modify-write operations for the other aspect. 5517e5c31af7Sopenharmony_ciifdef::VK_EXT_attachment_feedback_loop_layout[] 5518e5c31af7Sopenharmony_ciIf the subresource is in the 5519e5c31af7Sopenharmony_ciename:VK_IMAGE_LAYOUT_ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT layout, 5520e5c31af7Sopenharmony_ciimplementations must: not access pixels outside of the render area. 5521e5c31af7Sopenharmony_ciendif::VK_EXT_attachment_feedback_loop_layout[] 5522e5c31af7Sopenharmony_ci 5523e5c31af7Sopenharmony_ci[NOTE] 5524e5c31af7Sopenharmony_ci.Note 5525e5c31af7Sopenharmony_ci==== 5526e5c31af7Sopenharmony_ciAs entire subresources could be accessed by store operations, applications 5527e5c31af7Sopenharmony_cicannot safely access values outside of the render area via aliased resources 5528e5c31af7Sopenharmony_ciduring a render pass instance when a store operation that modifies values is 5529e5c31af7Sopenharmony_ciused. 5530e5c31af7Sopenharmony_ci==== 5531e5c31af7Sopenharmony_ci 5532e5c31af7Sopenharmony_ci[open,refpage='VkAttachmentStoreOp',desc='Specify how contents of an attachment are stored to memory at the end of a subpass',type='enums'] 5533e5c31af7Sopenharmony_ci-- 5534e5c31af7Sopenharmony_ciPossible values of slink:VkAttachmentDescription::pname:storeOp and 5535e5c31af7Sopenharmony_cipname:stencilStoreOp, specifying how the contents of the attachment are 5536e5c31af7Sopenharmony_citreated, are: 5537e5c31af7Sopenharmony_ci 5538e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkAttachmentStoreOp.adoc[] 5539e5c31af7Sopenharmony_ci 5540e5c31af7Sopenharmony_ci * ename:VK_ATTACHMENT_STORE_OP_STORE specifies the contents generated 5541e5c31af7Sopenharmony_ci during the render pass and within the render area are written to memory. 5542e5c31af7Sopenharmony_ci For attachments with a depth/stencil format, this uses the access type 5543e5c31af7Sopenharmony_ci ename:VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT. 5544e5c31af7Sopenharmony_ci For attachments with a color format, this uses the access type 5545e5c31af7Sopenharmony_ci ename:VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT. 5546e5c31af7Sopenharmony_ci * ename:VK_ATTACHMENT_STORE_OP_DONT_CARE specifies the contents within the 5547e5c31af7Sopenharmony_ci render area are not needed after rendering, and may: be discarded; the 5548e5c31af7Sopenharmony_ci contents of the attachment will be undefined: inside the render area. 5549e5c31af7Sopenharmony_ci For attachments with a depth/stencil format, this uses the access type 5550e5c31af7Sopenharmony_ci ename:VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT. 5551e5c31af7Sopenharmony_ci For attachments with a color format, this uses the access type 5552e5c31af7Sopenharmony_ci ename:VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT. 5553e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_3,VK_EXT_load_store_op_none,VK_KHR_dynamic_rendering,VK_QCOM_render_pass_store_ops[] 5554e5c31af7Sopenharmony_ci * ename:VK_ATTACHMENT_STORE_OP_NONE specifies the contents within the 5555e5c31af7Sopenharmony_ci render area are not accessed by the store operation as long as no values 5556e5c31af7Sopenharmony_ci are written to the attachment during the render pass. 5557e5c31af7Sopenharmony_ci If values are written during the render pass, this behaves identically 5558e5c31af7Sopenharmony_ci to ename:VK_ATTACHMENT_STORE_OP_DONT_CARE and with matching access 5559e5c31af7Sopenharmony_ci semantics. 5560e5c31af7Sopenharmony_ciendif::VK_VERSION_1_3,VK_EXT_load_store_op_none,VK_KHR_dynamic_rendering,VK_QCOM_render_pass_store_ops[] 5561e5c31af7Sopenharmony_ci 5562e5c31af7Sopenharmony_ci[NOTE] 5563e5c31af7Sopenharmony_ci.Note 5564e5c31af7Sopenharmony_ci==== 5565e5c31af7Sopenharmony_ciename:VK_ATTACHMENT_STORE_OP_DONT_CARE can: cause contents generated during 5566e5c31af7Sopenharmony_ciprevious render passes to be discarded before reaching memory, even if no 5567e5c31af7Sopenharmony_ciwrite to the attachment occurs during the current render pass. 5568e5c31af7Sopenharmony_ci==== 5569e5c31af7Sopenharmony_ci-- 5570e5c31af7Sopenharmony_ci 5571e5c31af7Sopenharmony_ci 5572e5c31af7Sopenharmony_ci[[renderpass-resolve-operations]] 5573e5c31af7Sopenharmony_ci== Render Pass Multisample Resolve Operations 5574e5c31af7Sopenharmony_ci 5575e5c31af7Sopenharmony_ciRender pass multisample resolve operations combine sample values from a 5576e5c31af7Sopenharmony_cisingle pixel in a multisample attachment and store the result to the 5577e5c31af7Sopenharmony_cicorresponding pixel in a single sample attachment. 5578e5c31af7Sopenharmony_ci 5579e5c31af7Sopenharmony_ciMultisample resolve operations for attachments execute in the 5580e5c31af7Sopenharmony_ciename:VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT pipeline stage. 5581e5c31af7Sopenharmony_ciA final resolve operation for all pixels in the render area happens-after 5582e5c31af7Sopenharmony_ciany recorded command which writes a pixel via the multisample attachment to 5583e5c31af7Sopenharmony_cibe resolved or an explicit alias of it in the subpass that it is specified. 5584e5c31af7Sopenharmony_ciAny single sample attachment specified for use in a multisample resolve 5585e5c31af7Sopenharmony_cioperation may: have its contents modified at any point once rendering begins 5586e5c31af7Sopenharmony_cifor the render pass instance. 5587e5c31af7Sopenharmony_ciReads from the multisample attachment can be synchronized with 5588e5c31af7Sopenharmony_ciename:VK_ACCESS_COLOR_ATTACHMENT_READ_BIT. 5589e5c31af7Sopenharmony_ciAccess to the single sample attachment can be synchronized with 5590e5c31af7Sopenharmony_ciename:VK_ACCESS_COLOR_ATTACHMENT_READ_BIT and 5591e5c31af7Sopenharmony_ciename:VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT. 5592e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_KHR_depth_stencil_resolve[] 5593e5c31af7Sopenharmony_ciThese pipeline stage and access types are used whether the attachments are 5594e5c31af7Sopenharmony_cicolor or depth/stencil attachments. 5595e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_KHR_depth_stencil_resolve[] 5596e5c31af7Sopenharmony_ci 5597e5c31af7Sopenharmony_ciWhen using render pass objects, a subpass dependency specified with the 5598e5c31af7Sopenharmony_ciabove pipeline stages and access flags will ensure synchronization with 5599e5c31af7Sopenharmony_cimultisample resolve operations for any attachments that were last accessed 5600e5c31af7Sopenharmony_ciby that subpass. 5601e5c31af7Sopenharmony_ciThis allows later subpasses to read resolved values as input attachments. 5602e5c31af7Sopenharmony_ci 5603e5c31af7Sopenharmony_ciResolve operations only update values within the defined render area for the 5604e5c31af7Sopenharmony_cirender pass instance. 5605e5c31af7Sopenharmony_ciHowever, any writes performed by a resolve operation (as defined by its 5606e5c31af7Sopenharmony_ciaccess masks) to a given attachment may: read and write back any memory 5607e5c31af7Sopenharmony_cilocations within the image subresource bound for that attachment. 5608e5c31af7Sopenharmony_ciFor depth/stencil images writes to one aspect may: also result in 5609e5c31af7Sopenharmony_ciread-modify-write operations for the other aspect. 5610e5c31af7Sopenharmony_ciifdef::VK_EXT_attachment_feedback_loop_layout[] 5611e5c31af7Sopenharmony_ciIf the subresource is in the 5612e5c31af7Sopenharmony_ciename:VK_IMAGE_LAYOUT_ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT layout, 5613e5c31af7Sopenharmony_ciimplementations must: not access pixels outside of the render area. 5614e5c31af7Sopenharmony_ciendif::VK_EXT_attachment_feedback_loop_layout[] 5615e5c31af7Sopenharmony_ci 5616e5c31af7Sopenharmony_ci[NOTE] 5617e5c31af7Sopenharmony_ci.Note 5618e5c31af7Sopenharmony_ci==== 5619e5c31af7Sopenharmony_ciAs entire subresources could be accessed by multisample resolve operations, 5620e5c31af7Sopenharmony_ciapplications cannot safely access values outside of the render area via 5621e5c31af7Sopenharmony_cialiased resources during a render pass instance when a multisample resolve 5622e5c31af7Sopenharmony_cioperation is performed. 5623e5c31af7Sopenharmony_ci==== 5624e5c31af7Sopenharmony_ci 5625e5c31af7Sopenharmony_ciifndef::VK_VERSION_1_2,VK_KHR_depth_stencil_resolve[] 5626e5c31af7Sopenharmony_ciThe average value of samples for a given pixel in the multisample attachment 5627e5c31af7Sopenharmony_ciis taken and written to the single sample attachment. 5628e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_KHR_depth_stencil_resolve[] 5629e5c31af7Sopenharmony_ci 5630e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_KHR_depth_stencil_resolve[] 5631e5c31af7Sopenharmony_ci[open,refpage='VkResolveModeFlagBits',desc='Bitmask indicating supported depth and stencil resolve modes',type='enums',alias='VkResolveModeFlagBitsKHR'] 5632e5c31af7Sopenharmony_ci-- 5633e5c31af7Sopenharmony_ciMultisample values in a multisample attachment are combined according to the 5634e5c31af7Sopenharmony_ciresolve mode used: 5635e5c31af7Sopenharmony_ci 5636e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkResolveModeFlagBits.adoc[] 5637e5c31af7Sopenharmony_ci 5638e5c31af7Sopenharmony_ciifdef::VK_KHR_depth_stencil_resolve[] 5639e5c31af7Sopenharmony_cior the equivalent 5640e5c31af7Sopenharmony_ci 5641e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkResolveModeFlagBitsKHR.adoc[] 5642e5c31af7Sopenharmony_ciendif::VK_KHR_depth_stencil_resolve[] 5643e5c31af7Sopenharmony_ci 5644e5c31af7Sopenharmony_ci * ename:VK_RESOLVE_MODE_NONE indicates that no resolve operation is done. 5645e5c31af7Sopenharmony_ci * ename:VK_RESOLVE_MODE_SAMPLE_ZERO_BIT indicates that result of the 5646e5c31af7Sopenharmony_ci resolve operation is equal to the value of sample 0. 5647e5c31af7Sopenharmony_ci * ename:VK_RESOLVE_MODE_AVERAGE_BIT indicates that result of the resolve 5648e5c31af7Sopenharmony_ci operation is the average of the sample values. 5649e5c31af7Sopenharmony_ci * ename:VK_RESOLVE_MODE_MIN_BIT indicates that result of the resolve 5650e5c31af7Sopenharmony_ci operation is the minimum of the sample values. 5651e5c31af7Sopenharmony_ci * ename:VK_RESOLVE_MODE_MAX_BIT indicates that result of the resolve 5652e5c31af7Sopenharmony_ci operation is the maximum of the sample values. 5653e5c31af7Sopenharmony_ciifdef::VK_ANDROID_external_format_resolve[] 5654e5c31af7Sopenharmony_ci * ename:VK_RESOLVE_MODE_EXTERNAL_FORMAT_DOWNSAMPLE_ANDROID indicates that 5655e5c31af7Sopenharmony_ci rather than a multisample resolve, a single sampled color attachment 5656e5c31af7Sopenharmony_ci will be downsampled into a {YCbCr} format image specified by an external 5657e5c31af7Sopenharmony_ci Android format. 5658e5c31af7Sopenharmony_ci Unlike other resolve modes, implementations can resolve multiple times 5659e5c31af7Sopenharmony_ci during rendering, or even bypass writing to the color attachment 5660e5c31af7Sopenharmony_ci altogether, as long as the final value is resolved to the resolve 5661e5c31af7Sopenharmony_ci attachment. 5662e5c31af7Sopenharmony_ci Values in the [eq]#G#, [eq]#B#, and [eq]#R# channels of the color 5663e5c31af7Sopenharmony_ci attachment will be written to the [eq]#Y#, [eq]#C~B~#, and [eq]#C~R~# 5664e5c31af7Sopenharmony_ci channels of the external format image, respectively. 5665e5c31af7Sopenharmony_ci Chroma values are calculated as if sampling with a linear filter from 5666e5c31af7Sopenharmony_ci the color attachment at full rate, at the location the chroma values sit 5667e5c31af7Sopenharmony_ci according to 5668e5c31af7Sopenharmony_ci slink:VkPhysicalDeviceExternalFormatResolvePropertiesANDROID::pname:chromaOffsetX, 5669e5c31af7Sopenharmony_ci slink:VkPhysicalDeviceExternalFormatResolvePropertiesANDROID::pname:chromaOffsetY, 5670e5c31af7Sopenharmony_ci and the chroma sample rate of the resolved image. 5671e5c31af7Sopenharmony_ciendif::VK_ANDROID_external_format_resolve[] 5672e5c31af7Sopenharmony_ci 5673e5c31af7Sopenharmony_ciIf no resolve mode is otherwise specified, ename:VK_RESOLVE_MODE_AVERAGE_BIT 5674e5c31af7Sopenharmony_ciis used. 5675e5c31af7Sopenharmony_ci 5676e5c31af7Sopenharmony_ciifdef::VK_ANDROID_external_format_resolve[] 5677e5c31af7Sopenharmony_ci[NOTE] 5678e5c31af7Sopenharmony_ci.Note 5679e5c31af7Sopenharmony_ci==== 5680e5c31af7Sopenharmony_ciNo range compression or {YCbCr} model conversion is performed by 5681e5c31af7Sopenharmony_ciename:VK_RESOLVE_MODE_EXTERNAL_FORMAT_DOWNSAMPLE_ANDROID; applications have 5682e5c31af7Sopenharmony_cito do these conversions themselves. 5683e5c31af7Sopenharmony_ciValue outputs are expected to match those that would be read through a 5684e5c31af7Sopenharmony_ci<<textures-sampler-YCbCr-conversion-modelconversion, {YCbCr} sampler using 5685e5c31af7Sopenharmony_ciename:VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY>>. 5686e5c31af7Sopenharmony_ciThe color space that the values should be in is defined by the platform and 5687e5c31af7Sopenharmony_ciis not exposed via Vulkan. 5688e5c31af7Sopenharmony_ci==== 5689e5c31af7Sopenharmony_ciendif::VK_ANDROID_external_format_resolve[] 5690e5c31af7Sopenharmony_ci-- 5691e5c31af7Sopenharmony_ci 5692e5c31af7Sopenharmony_ci[open,refpage='VkResolveModeFlags',desc='Bitmask of VkResolveModeFlagBits',type='flags',alias='VkResolveModeFlagsKHR'] 5693e5c31af7Sopenharmony_ci-- 5694e5c31af7Sopenharmony_ciinclude::{generated}/api/flags/VkResolveModeFlags.adoc[] 5695e5c31af7Sopenharmony_ci 5696e5c31af7Sopenharmony_ciifdef::VK_KHR_depth_stencil_resolve[] 5697e5c31af7Sopenharmony_cior the equivalent 5698e5c31af7Sopenharmony_ci 5699e5c31af7Sopenharmony_ciinclude::{generated}/api/flags/VkResolveModeFlagsKHR.adoc[] 5700e5c31af7Sopenharmony_ciendif::VK_KHR_depth_stencil_resolve[] 5701e5c31af7Sopenharmony_ci 5702e5c31af7Sopenharmony_citname:VkResolveModeFlags is a bitmask type for setting a mask of zero or 5703e5c31af7Sopenharmony_cimore elink:VkResolveModeFlagBits. 5704e5c31af7Sopenharmony_ci-- 5705e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_KHR_depth_stencil_resolve[] 5706e5c31af7Sopenharmony_ci 5707e5c31af7Sopenharmony_ci 5708e5c31af7Sopenharmony_ci[[renderpass-commands]] 5709e5c31af7Sopenharmony_ci== Render Pass Commands 5710e5c31af7Sopenharmony_ci 5711e5c31af7Sopenharmony_ciAn application records the commands for a render pass instance one subpass 5712e5c31af7Sopenharmony_ciat a time, by beginning a render pass instance, iterating over the subpasses 5713e5c31af7Sopenharmony_cito record commands for that subpass, and then ending the render pass 5714e5c31af7Sopenharmony_ciinstance. 5715e5c31af7Sopenharmony_ci 5716e5c31af7Sopenharmony_ci[open,refpage='vkCmdBeginRenderPass',desc='Begin a new render pass',type='protos'] 5717e5c31af7Sopenharmony_ci-- 5718e5c31af7Sopenharmony_ciTo begin a render pass instance, call: 5719e5c31af7Sopenharmony_ci 5720e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCmdBeginRenderPass.adoc[] 5721e5c31af7Sopenharmony_ci 5722e5c31af7Sopenharmony_ci * pname:commandBuffer is the command buffer in which to record the 5723e5c31af7Sopenharmony_ci command. 5724e5c31af7Sopenharmony_ci * pname:pRenderPassBegin is a pointer to a slink:VkRenderPassBeginInfo 5725e5c31af7Sopenharmony_ci structure specifying the render pass to begin an instance of, and the 5726e5c31af7Sopenharmony_ci framebuffer the instance uses. 5727e5c31af7Sopenharmony_ci * pname:contents is a elink:VkSubpassContents value specifying how the 5728e5c31af7Sopenharmony_ci commands in the first subpass will be provided. 5729e5c31af7Sopenharmony_ci 5730e5c31af7Sopenharmony_ciAfter beginning a render pass instance, the command buffer is ready to 5731e5c31af7Sopenharmony_cirecord the commands for the first subpass of that render pass. 5732e5c31af7Sopenharmony_ci 5733e5c31af7Sopenharmony_ci.Valid Usage 5734e5c31af7Sopenharmony_ci**** 5735e5c31af7Sopenharmony_ci * [[VUID-vkCmdBeginRenderPass-initialLayout-00895]] 5736e5c31af7Sopenharmony_ci If any of the pname:initialLayout or pname:finalLayout member of the 5737e5c31af7Sopenharmony_ci sname:VkAttachmentDescription structures or the pname:layout member of 5738e5c31af7Sopenharmony_ci the sname:VkAttachmentReference structures specified when creating the 5739e5c31af7Sopenharmony_ci render pass specified in the pname:renderPass member of 5740e5c31af7Sopenharmony_ci pname:pRenderPassBegin is ename:VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL 5741e5c31af7Sopenharmony_ci then the corresponding attachment image view of the framebuffer 5742e5c31af7Sopenharmony_ci specified in the pname:framebuffer member of pname:pRenderPassBegin 5743e5c31af7Sopenharmony_ci must: have been created with a pname:usage value including 5744e5c31af7Sopenharmony_ci ename:VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT 5745e5c31af7Sopenharmony_ci * [[VUID-vkCmdBeginRenderPass-initialLayout-01758]] 5746e5c31af7Sopenharmony_ci If any of the pname:initialLayout or pname:finalLayout member of the 5747e5c31af7Sopenharmony_ci sname:VkAttachmentDescription structures or the pname:layout member of 5748e5c31af7Sopenharmony_ci the sname:VkAttachmentReference structures specified when creating the 5749e5c31af7Sopenharmony_ci render pass specified in the pname:renderPass member of 5750e5c31af7Sopenharmony_ci pname:pRenderPassBegin is 5751e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_maintenance2[] 5752e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL, 5753e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL, 5754e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_maintenance2[] 5755e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, or 5756e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL then the 5757e5c31af7Sopenharmony_ci corresponding attachment image view of the framebuffer specified in the 5758e5c31af7Sopenharmony_ci pname:framebuffer member of pname:pRenderPassBegin must: have been 5759e5c31af7Sopenharmony_ci created with a pname:usage value including 5760e5c31af7Sopenharmony_ci ename:VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT 5761e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_maintenance2[] 5762e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_KHR_separate_depth_stencil_layouts[] 5763e5c31af7Sopenharmony_ci * [[VUID-vkCmdBeginRenderPass-initialLayout-02842]] 5764e5c31af7Sopenharmony_ci If any of the pname:initialLayout or pname:finalLayout member of the 5765e5c31af7Sopenharmony_ci sname:VkAttachmentDescription structures or the pname:layout member of 5766e5c31af7Sopenharmony_ci the sname:VkAttachmentReference structures specified when creating the 5767e5c31af7Sopenharmony_ci render pass specified in the pname:renderPass member of 5768e5c31af7Sopenharmony_ci pname:pRenderPassBegin is 5769e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL, or 5770e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL, 5771e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL, or 5772e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL then the corresponding 5773e5c31af7Sopenharmony_ci attachment image view of the framebuffer specified in the 5774e5c31af7Sopenharmony_ci pname:framebuffer member of pname:pRenderPassBegin must: have been 5775e5c31af7Sopenharmony_ci created with a pname:usage value including 5776e5c31af7Sopenharmony_ci ename:VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT 5777e5c31af7Sopenharmony_ci * [[VUID-vkCmdBeginRenderPass-stencilInitialLayout-02843]] 5778e5c31af7Sopenharmony_ci If any of the pname:stencilInitialLayout or pname:stencilFinalLayout 5779e5c31af7Sopenharmony_ci member of the sname:VkAttachmentDescriptionStencilLayout structures or 5780e5c31af7Sopenharmony_ci the pname:stencilLayout member of the 5781e5c31af7Sopenharmony_ci sname:VkAttachmentReferenceStencilLayout structures specified when 5782e5c31af7Sopenharmony_ci creating the render pass specified in the pname:renderPass member of 5783e5c31af7Sopenharmony_ci pname:pRenderPassBegin is 5784e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL, or 5785e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL then the corresponding 5786e5c31af7Sopenharmony_ci attachment image view of the framebuffer specified in the 5787e5c31af7Sopenharmony_ci pname:framebuffer member of pname:pRenderPassBegin must: have been 5788e5c31af7Sopenharmony_ci created with a pname:usage value including 5789e5c31af7Sopenharmony_ci ename:VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT 5790e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_KHR_separate_depth_stencil_layouts[] 5791e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_maintenance2[] 5792e5c31af7Sopenharmony_ci * [[VUID-vkCmdBeginRenderPass-initialLayout-00897]] 5793e5c31af7Sopenharmony_ci If any of the pname:initialLayout or pname:finalLayout member of the 5794e5c31af7Sopenharmony_ci sname:VkAttachmentDescription structures or the pname:layout member of 5795e5c31af7Sopenharmony_ci the sname:VkAttachmentReference structures specified when creating the 5796e5c31af7Sopenharmony_ci render pass specified in the pname:renderPass member of 5797e5c31af7Sopenharmony_ci pname:pRenderPassBegin is ename:VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL 5798e5c31af7Sopenharmony_ci then the corresponding attachment image view of the framebuffer 5799e5c31af7Sopenharmony_ci specified in the pname:framebuffer member of pname:pRenderPassBegin 5800e5c31af7Sopenharmony_ci must: have been created with a pname:usage value including 5801e5c31af7Sopenharmony_ci ename:VK_IMAGE_USAGE_SAMPLED_BIT or 5802e5c31af7Sopenharmony_ci ename:VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT 5803e5c31af7Sopenharmony_ci * [[VUID-vkCmdBeginRenderPass-initialLayout-00898]] 5804e5c31af7Sopenharmony_ci If any of the pname:initialLayout or pname:finalLayout member of the 5805e5c31af7Sopenharmony_ci sname:VkAttachmentDescription structures or the pname:layout member of 5806e5c31af7Sopenharmony_ci the sname:VkAttachmentReference structures specified when creating the 5807e5c31af7Sopenharmony_ci render pass specified in the pname:renderPass member of 5808e5c31af7Sopenharmony_ci pname:pRenderPassBegin is ename:VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL 5809e5c31af7Sopenharmony_ci then the corresponding attachment image view of the framebuffer 5810e5c31af7Sopenharmony_ci specified in the pname:framebuffer member of pname:pRenderPassBegin 5811e5c31af7Sopenharmony_ci must: have been created with a pname:usage value including 5812e5c31af7Sopenharmony_ci ename:VK_IMAGE_USAGE_TRANSFER_SRC_BIT 5813e5c31af7Sopenharmony_ci * [[VUID-vkCmdBeginRenderPass-initialLayout-00899]] 5814e5c31af7Sopenharmony_ci If any of the pname:initialLayout or pname:finalLayout member of the 5815e5c31af7Sopenharmony_ci sname:VkAttachmentDescription structures or the pname:layout member of 5816e5c31af7Sopenharmony_ci the sname:VkAttachmentReference structures specified when creating the 5817e5c31af7Sopenharmony_ci render pass specified in the pname:renderPass member of 5818e5c31af7Sopenharmony_ci pname:pRenderPassBegin is ename:VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL 5819e5c31af7Sopenharmony_ci then the corresponding attachment image view of the framebuffer 5820e5c31af7Sopenharmony_ci specified in the pname:framebuffer member of pname:pRenderPassBegin 5821e5c31af7Sopenharmony_ci must: have been created with a pname:usage value including 5822e5c31af7Sopenharmony_ci ename:VK_IMAGE_USAGE_TRANSFER_DST_BIT 5823e5c31af7Sopenharmony_ci * [[VUID-vkCmdBeginRenderPass-initialLayout-00900]] 5824e5c31af7Sopenharmony_ci If the pname:initialLayout member of any of the 5825e5c31af7Sopenharmony_ci sname:VkAttachmentDescription structures specified when creating the 5826e5c31af7Sopenharmony_ci render pass specified in the pname:renderPass member of 5827e5c31af7Sopenharmony_ci pname:pRenderPassBegin is not ename:VK_IMAGE_LAYOUT_UNDEFINED, then each 5828e5c31af7Sopenharmony_ci such pname:initialLayout must: be equal to the current layout of the 5829e5c31af7Sopenharmony_ci corresponding attachment image subresource of the framebuffer specified 5830e5c31af7Sopenharmony_ci in the pname:framebuffer member of pname:pRenderPassBegin 5831e5c31af7Sopenharmony_ci * [[VUID-vkCmdBeginRenderPass-srcStageMask-06451]] 5832e5c31af7Sopenharmony_ci The pname:srcStageMask members of any element of the pname:pDependencies 5833e5c31af7Sopenharmony_ci member of slink:VkRenderPassCreateInfo used to create pname:renderPass 5834e5c31af7Sopenharmony_ci must: be supported by the capabilities of the queue family identified by 5835e5c31af7Sopenharmony_ci the pname:queueFamilyIndex member of the slink:VkCommandPoolCreateInfo 5836e5c31af7Sopenharmony_ci used to create the command pool which pname:commandBuffer was allocated 5837e5c31af7Sopenharmony_ci from 5838e5c31af7Sopenharmony_ci * [[VUID-vkCmdBeginRenderPass-dstStageMask-06452]] 5839e5c31af7Sopenharmony_ci The pname:dstStageMask members of any element of the pname:pDependencies 5840e5c31af7Sopenharmony_ci member of slink:VkRenderPassCreateInfo used to create pname:renderPass 5841e5c31af7Sopenharmony_ci must: be supported by the capabilities of the queue family identified by 5842e5c31af7Sopenharmony_ci the pname:queueFamilyIndex member of the slink:VkCommandPoolCreateInfo 5843e5c31af7Sopenharmony_ci used to create the command pool which pname:commandBuffer was allocated 5844e5c31af7Sopenharmony_ci from 5845e5c31af7Sopenharmony_ci * [[VUID-vkCmdBeginRenderPass-framebuffer-02532]] 5846e5c31af7Sopenharmony_ci For any attachment in pname:framebuffer that is used by pname:renderPass 5847e5c31af7Sopenharmony_ci and is bound to memory locations that are also bound to another 5848e5c31af7Sopenharmony_ci attachment used by pname:renderPass, and if at least one of those uses 5849e5c31af7Sopenharmony_ci causes either attachment to be written to, both attachments must: have 5850e5c31af7Sopenharmony_ci had the ename:VK_ATTACHMENT_DESCRIPTION_MAY_ALIAS_BIT set 5851e5c31af7Sopenharmony_ci * [[VUID-vkCmdBeginRenderPass-framebuffer-09045]] 5852e5c31af7Sopenharmony_ci If any attachments specified in pname:framebuffer are used by 5853e5c31af7Sopenharmony_ci pname:renderPass and are bound to overlapping memory locations, there 5854e5c31af7Sopenharmony_ci must: be only one that is used as a color attachment, depth/stencil, or 5855e5c31af7Sopenharmony_ci resolve attachment in any subpass 5856e5c31af7Sopenharmony_ciifdef::VK_EXT_attachment_feedback_loop_layout[] 5857e5c31af7Sopenharmony_ci * [[VUID-vkCmdBeginRenderPass-initialLayout-07000]] 5858e5c31af7Sopenharmony_ci If any of the pname:initialLayout or pname:finalLayout member of the 5859e5c31af7Sopenharmony_ci sname:VkAttachmentDescription structures or the pname:layout member of 5860e5c31af7Sopenharmony_ci the sname:VkAttachmentReference structures specified when creating the 5861e5c31af7Sopenharmony_ci render pass specified in the pname:renderPass member of 5862e5c31af7Sopenharmony_ci pname:pRenderPassBegin is 5863e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT then the 5864e5c31af7Sopenharmony_ci corresponding attachment image view of the framebuffer specified in the 5865e5c31af7Sopenharmony_ci pname:framebuffer member of pname:pRenderPassBegin must: have been 5866e5c31af7Sopenharmony_ci created with a pname:usage value including either the 5867e5c31af7Sopenharmony_ci ename:VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT or 5868e5c31af7Sopenharmony_ci ename:VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT and either the 5869e5c31af7Sopenharmony_ci ename:VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT or 5870e5c31af7Sopenharmony_ci ename:VK_IMAGE_USAGE_SAMPLED_BIT usage bits 5871e5c31af7Sopenharmony_ci * [[VUID-vkCmdBeginRenderPass-initialLayout-07001]] 5872e5c31af7Sopenharmony_ci If any of the pname:initialLayout or pname:finalLayout member of the 5873e5c31af7Sopenharmony_ci sname:VkAttachmentDescription structures or the pname:layout member of 5874e5c31af7Sopenharmony_ci the sname:VkAttachmentReference structures specified when creating the 5875e5c31af7Sopenharmony_ci render pass specified in the pname:renderPass member of 5876e5c31af7Sopenharmony_ci pname:pRenderPassBegin is 5877e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT then the 5878e5c31af7Sopenharmony_ci corresponding attachment image view of the framebuffer specified in the 5879e5c31af7Sopenharmony_ci pname:framebuffer member of pname:pRenderPassBegin must: have been 5880e5c31af7Sopenharmony_ci created with a pname:usage value the 5881e5c31af7Sopenharmony_ci ename:VK_IMAGE_USAGE_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT usage bit 5882e5c31af7Sopenharmony_ciendif::VK_EXT_attachment_feedback_loop_layout[] 5883e5c31af7Sopenharmony_ci**** 5884e5c31af7Sopenharmony_ci 5885e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCmdBeginRenderPass.adoc[] 5886e5c31af7Sopenharmony_ci-- 5887e5c31af7Sopenharmony_ci 5888e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_KHR_create_renderpass2[] 5889e5c31af7Sopenharmony_ci[open,refpage='vkCmdBeginRenderPass2',desc='Begin a new render pass',type='protos',alias='vkCmdBeginRenderPass2KHR'] 5890e5c31af7Sopenharmony_ci-- 5891e5c31af7Sopenharmony_ciAlternatively to begin a render pass, call: 5892e5c31af7Sopenharmony_ci 5893e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2[] 5894e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCmdBeginRenderPass2.adoc[] 5895e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2[] 5896e5c31af7Sopenharmony_ci 5897e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2+VK_KHR_create_renderpass2[or the equivalent command] 5898e5c31af7Sopenharmony_ci 5899e5c31af7Sopenharmony_ciifdef::VK_KHR_create_renderpass2[] 5900e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCmdBeginRenderPass2KHR.adoc[] 5901e5c31af7Sopenharmony_ciendif::VK_KHR_create_renderpass2[] 5902e5c31af7Sopenharmony_ci 5903e5c31af7Sopenharmony_ci * pname:commandBuffer is the command buffer in which to record the 5904e5c31af7Sopenharmony_ci command. 5905e5c31af7Sopenharmony_ci * pname:pRenderPassBegin is a pointer to a slink:VkRenderPassBeginInfo 5906e5c31af7Sopenharmony_ci structure specifying the render pass to begin an instance of, and the 5907e5c31af7Sopenharmony_ci framebuffer the instance uses. 5908e5c31af7Sopenharmony_ci * pname:pSubpassBeginInfo is a pointer to a slink:VkSubpassBeginInfo 5909e5c31af7Sopenharmony_ci structure containing information about the subpass which is about to 5910e5c31af7Sopenharmony_ci begin rendering. 5911e5c31af7Sopenharmony_ci 5912e5c31af7Sopenharmony_ciAfter beginning a render pass instance, the command buffer is ready to 5913e5c31af7Sopenharmony_cirecord the commands for the first subpass of that render pass. 5914e5c31af7Sopenharmony_ci 5915e5c31af7Sopenharmony_ci.Valid Usage 5916e5c31af7Sopenharmony_ci**** 5917e5c31af7Sopenharmony_ci * [[VUID-vkCmdBeginRenderPass2-framebuffer-02779]] 5918e5c31af7Sopenharmony_ci Both the pname:framebuffer and pname:renderPass members of 5919e5c31af7Sopenharmony_ci pname:pRenderPassBegin must: have been created on the same 5920e5c31af7Sopenharmony_ci slink:VkDevice that pname:commandBuffer was allocated on 5921e5c31af7Sopenharmony_ci * [[VUID-vkCmdBeginRenderPass2-initialLayout-03094]] 5922e5c31af7Sopenharmony_ci If any of the pname:initialLayout or pname:finalLayout member of the 5923e5c31af7Sopenharmony_ci sname:VkAttachmentDescription structures or the pname:layout member of 5924e5c31af7Sopenharmony_ci the sname:VkAttachmentReference structures specified when creating the 5925e5c31af7Sopenharmony_ci render pass specified in the pname:renderPass member of 5926e5c31af7Sopenharmony_ci pname:pRenderPassBegin is ename:VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL 5927e5c31af7Sopenharmony_ci then the corresponding attachment image view of the framebuffer 5928e5c31af7Sopenharmony_ci specified in the pname:framebuffer member of pname:pRenderPassBegin 5929e5c31af7Sopenharmony_ci must: have been created with a pname:usage value including 5930e5c31af7Sopenharmony_ci ename:VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT 5931e5c31af7Sopenharmony_ci * [[VUID-vkCmdBeginRenderPass2-initialLayout-03096]] 5932e5c31af7Sopenharmony_ci If any of the pname:initialLayout or pname:finalLayout member of the 5933e5c31af7Sopenharmony_ci sname:VkAttachmentDescription structures or the pname:layout member of 5934e5c31af7Sopenharmony_ci the sname:VkAttachmentReference structures specified when creating the 5935e5c31af7Sopenharmony_ci render pass specified in the pname:renderPass member of 5936e5c31af7Sopenharmony_ci pname:pRenderPassBegin is 5937e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL, 5938e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL, 5939e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, or 5940e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL then the 5941e5c31af7Sopenharmony_ci corresponding attachment image view of the framebuffer specified in the 5942e5c31af7Sopenharmony_ci pname:framebuffer member of pname:pRenderPassBegin must: have been 5943e5c31af7Sopenharmony_ci created with a pname:usage value including 5944e5c31af7Sopenharmony_ci ename:VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT 5945e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_KHR_separate_depth_stencil_layouts[] 5946e5c31af7Sopenharmony_ci * [[VUID-vkCmdBeginRenderPass2-initialLayout-02844]] 5947e5c31af7Sopenharmony_ci If any of the pname:initialLayout or pname:finalLayout member of the 5948e5c31af7Sopenharmony_ci sname:VkAttachmentDescription structures or the pname:layout member of 5949e5c31af7Sopenharmony_ci the sname:VkAttachmentReference structures specified when creating the 5950e5c31af7Sopenharmony_ci render pass specified in the pname:renderPass member of 5951e5c31af7Sopenharmony_ci pname:pRenderPassBegin is 5952e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL, or 5953e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL, 5954e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL, or 5955e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL then the corresponding 5956e5c31af7Sopenharmony_ci attachment image view of the framebuffer specified in the 5957e5c31af7Sopenharmony_ci pname:framebuffer member of pname:pRenderPassBegin must: have been 5958e5c31af7Sopenharmony_ci created with a pname:usage value including 5959e5c31af7Sopenharmony_ci ename:VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT 5960e5c31af7Sopenharmony_ci * [[VUID-vkCmdBeginRenderPass2-stencilInitialLayout-02845]] 5961e5c31af7Sopenharmony_ci If any of the pname:stencilInitialLayout or pname:stencilFinalLayout 5962e5c31af7Sopenharmony_ci member of the sname:VkAttachmentDescriptionStencilLayout structures or 5963e5c31af7Sopenharmony_ci the pname:stencilLayout member of the 5964e5c31af7Sopenharmony_ci sname:VkAttachmentReferenceStencilLayout structures specified when 5965e5c31af7Sopenharmony_ci creating the render pass specified in the pname:renderPass member of 5966e5c31af7Sopenharmony_ci pname:pRenderPassBegin is 5967e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL, or 5968e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL then the corresponding 5969e5c31af7Sopenharmony_ci attachment image view of the framebuffer specified in the 5970e5c31af7Sopenharmony_ci pname:framebuffer member of pname:pRenderPassBegin must: have been 5971e5c31af7Sopenharmony_ci created with a pname:usage value including 5972e5c31af7Sopenharmony_ci ename:VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT 5973e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_KHR_separate_depth_stencil_layouts[] 5974e5c31af7Sopenharmony_ci * [[VUID-vkCmdBeginRenderPass2-initialLayout-03097]] 5975e5c31af7Sopenharmony_ci If any of the pname:initialLayout or pname:finalLayout member of the 5976e5c31af7Sopenharmony_ci sname:VkAttachmentDescription structures or the pname:layout member of 5977e5c31af7Sopenharmony_ci the sname:VkAttachmentReference structures specified when creating the 5978e5c31af7Sopenharmony_ci render pass specified in the pname:renderPass member of 5979e5c31af7Sopenharmony_ci pname:pRenderPassBegin is ename:VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL 5980e5c31af7Sopenharmony_ci then the corresponding attachment image view of the framebuffer 5981e5c31af7Sopenharmony_ci specified in the pname:framebuffer member of pname:pRenderPassBegin 5982e5c31af7Sopenharmony_ci must: have been created with a pname:usage value including 5983e5c31af7Sopenharmony_ci ename:VK_IMAGE_USAGE_SAMPLED_BIT or 5984e5c31af7Sopenharmony_ci ename:VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT 5985e5c31af7Sopenharmony_ci * [[VUID-vkCmdBeginRenderPass2-initialLayout-03098]] 5986e5c31af7Sopenharmony_ci If any of the pname:initialLayout or pname:finalLayout member of the 5987e5c31af7Sopenharmony_ci sname:VkAttachmentDescription structures or the pname:layout member of 5988e5c31af7Sopenharmony_ci the sname:VkAttachmentReference structures specified when creating the 5989e5c31af7Sopenharmony_ci render pass specified in the pname:renderPass member of 5990e5c31af7Sopenharmony_ci pname:pRenderPassBegin is ename:VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL 5991e5c31af7Sopenharmony_ci then the corresponding attachment image view of the framebuffer 5992e5c31af7Sopenharmony_ci specified in the pname:framebuffer member of pname:pRenderPassBegin 5993e5c31af7Sopenharmony_ci must: have been created with a pname:usage value including 5994e5c31af7Sopenharmony_ci ename:VK_IMAGE_USAGE_TRANSFER_SRC_BIT 5995e5c31af7Sopenharmony_ci * [[VUID-vkCmdBeginRenderPass2-initialLayout-03099]] 5996e5c31af7Sopenharmony_ci If any of the pname:initialLayout or pname:finalLayout member of the 5997e5c31af7Sopenharmony_ci sname:VkAttachmentDescription structures or the pname:layout member of 5998e5c31af7Sopenharmony_ci the sname:VkAttachmentReference structures specified when creating the 5999e5c31af7Sopenharmony_ci render pass specified in the pname:renderPass member of 6000e5c31af7Sopenharmony_ci pname:pRenderPassBegin is ename:VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL 6001e5c31af7Sopenharmony_ci then the corresponding attachment image view of the framebuffer 6002e5c31af7Sopenharmony_ci specified in the pname:framebuffer member of pname:pRenderPassBegin 6003e5c31af7Sopenharmony_ci must: have been created with a pname:usage value including 6004e5c31af7Sopenharmony_ci ename:VK_IMAGE_USAGE_TRANSFER_DST_BIT 6005e5c31af7Sopenharmony_ci * [[VUID-vkCmdBeginRenderPass2-initialLayout-03100]] 6006e5c31af7Sopenharmony_ci If the pname:initialLayout member of any of the 6007e5c31af7Sopenharmony_ci sname:VkAttachmentDescription structures specified when creating the 6008e5c31af7Sopenharmony_ci render pass specified in the pname:renderPass member of 6009e5c31af7Sopenharmony_ci pname:pRenderPassBegin is not ename:VK_IMAGE_LAYOUT_UNDEFINED, then each 6010e5c31af7Sopenharmony_ci such pname:initialLayout must: be equal to the current layout of the 6011e5c31af7Sopenharmony_ci corresponding attachment image subresource of the framebuffer specified 6012e5c31af7Sopenharmony_ci in the pname:framebuffer member of pname:pRenderPassBegin 6013e5c31af7Sopenharmony_ci * [[VUID-vkCmdBeginRenderPass2-srcStageMask-06453]] 6014e5c31af7Sopenharmony_ci The pname:srcStageMask members of any element of the pname:pDependencies 6015e5c31af7Sopenharmony_ci member of slink:VkRenderPassCreateInfo used to create pname:renderPass 6016e5c31af7Sopenharmony_ci must: be supported by the capabilities of the queue family identified by 6017e5c31af7Sopenharmony_ci the pname:queueFamilyIndex member of the slink:VkCommandPoolCreateInfo 6018e5c31af7Sopenharmony_ci used to create the command pool which pname:commandBuffer was allocated 6019e5c31af7Sopenharmony_ci from 6020e5c31af7Sopenharmony_ci * [[VUID-vkCmdBeginRenderPass2-dstStageMask-06454]] 6021e5c31af7Sopenharmony_ci The pname:dstStageMask members of any element of the pname:pDependencies 6022e5c31af7Sopenharmony_ci member of slink:VkRenderPassCreateInfo used to create pname:renderPass 6023e5c31af7Sopenharmony_ci must: be supported by the capabilities of the queue family identified by 6024e5c31af7Sopenharmony_ci the pname:queueFamilyIndex member of the slink:VkCommandPoolCreateInfo 6025e5c31af7Sopenharmony_ci used to create the command pool which pname:commandBuffer was allocated 6026e5c31af7Sopenharmony_ci from 6027e5c31af7Sopenharmony_ci * [[VUID-vkCmdBeginRenderPass2-framebuffer-02533]] 6028e5c31af7Sopenharmony_ci For any attachment in pname:framebuffer that is used by pname:renderPass 6029e5c31af7Sopenharmony_ci and is bound to memory locations that are also bound to another 6030e5c31af7Sopenharmony_ci attachment used by pname:renderPass, and if at least one of those uses 6031e5c31af7Sopenharmony_ci causes either attachment to be written to, both attachments must: have 6032e5c31af7Sopenharmony_ci had the ename:VK_ATTACHMENT_DESCRIPTION_MAY_ALIAS_BIT set 6033e5c31af7Sopenharmony_ci * [[VUID-vkCmdBeginRenderPass2-framebuffer-09046]] 6034e5c31af7Sopenharmony_ci If any attachments specified in pname:framebuffer are used by 6035e5c31af7Sopenharmony_ci pname:renderPass and are bound to overlapping memory locations, there 6036e5c31af7Sopenharmony_ci must: be only one that is used as a color attachment, depth/stencil, or 6037e5c31af7Sopenharmony_ci resolve attachment in any subpass 6038e5c31af7Sopenharmony_ciifdef::VK_EXT_attachment_feedback_loop_layout[] 6039e5c31af7Sopenharmony_ci * [[VUID-vkCmdBeginRenderPass2-initialLayout-07002]] 6040e5c31af7Sopenharmony_ci If any of the pname:initialLayout or pname:finalLayout member of the 6041e5c31af7Sopenharmony_ci sname:VkAttachmentDescription structures or the pname:layout member of 6042e5c31af7Sopenharmony_ci the sname:VkAttachmentReference structures specified when creating the 6043e5c31af7Sopenharmony_ci render pass specified in the pname:renderPass member of 6044e5c31af7Sopenharmony_ci pname:pRenderPassBegin is 6045e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT then the 6046e5c31af7Sopenharmony_ci corresponding attachment image view of the framebuffer specified in the 6047e5c31af7Sopenharmony_ci pname:framebuffer member of pname:pRenderPassBegin must: have been 6048e5c31af7Sopenharmony_ci created with a pname:usage value including either the 6049e5c31af7Sopenharmony_ci ename:VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT or 6050e5c31af7Sopenharmony_ci ename:VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT and either the 6051e5c31af7Sopenharmony_ci ename:VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT or 6052e5c31af7Sopenharmony_ci ename:VK_IMAGE_USAGE_SAMPLED_BIT usage bits 6053e5c31af7Sopenharmony_ci * [[VUID-vkCmdBeginRenderPass2-initialLayout-07003]] 6054e5c31af7Sopenharmony_ci If any of the pname:initialLayout or pname:finalLayout member of the 6055e5c31af7Sopenharmony_ci sname:VkAttachmentDescription structures or the pname:layout member of 6056e5c31af7Sopenharmony_ci the sname:VkAttachmentReference structures specified when creating the 6057e5c31af7Sopenharmony_ci render pass specified in the pname:renderPass member of 6058e5c31af7Sopenharmony_ci pname:pRenderPassBegin is 6059e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT then the 6060e5c31af7Sopenharmony_ci corresponding attachment image view of the framebuffer specified in the 6061e5c31af7Sopenharmony_ci pname:framebuffer member of pname:pRenderPassBegin must: have been 6062e5c31af7Sopenharmony_ci created with a pname:usage value the 6063e5c31af7Sopenharmony_ci ename:VK_IMAGE_USAGE_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT usage bit 6064e5c31af7Sopenharmony_ciendif::VK_EXT_attachment_feedback_loop_layout[] 6065e5c31af7Sopenharmony_ci**** 6066e5c31af7Sopenharmony_ci 6067e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCmdBeginRenderPass2.adoc[] 6068e5c31af7Sopenharmony_ci-- 6069e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_KHR_create_renderpass2[] 6070e5c31af7Sopenharmony_ci 6071e5c31af7Sopenharmony_ci[open,refpage='VkRenderPassBeginInfo',desc='Structure specifying render pass begin information',type='structs'] 6072e5c31af7Sopenharmony_ci-- 6073e5c31af7Sopenharmony_ciThe sname:VkRenderPassBeginInfo structure is defined as: 6074e5c31af7Sopenharmony_ci 6075e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkRenderPassBeginInfo.adoc[] 6076e5c31af7Sopenharmony_ci 6077e5c31af7Sopenharmony_ci * pname:sType is a elink:VkStructureType value identifying this structure. 6078e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 6079e5c31af7Sopenharmony_ci structure. 6080e5c31af7Sopenharmony_ci * pname:renderPass is the render pass to begin an instance of. 6081e5c31af7Sopenharmony_ci * pname:framebuffer is the framebuffer containing the attachments that are 6082e5c31af7Sopenharmony_ci used with the render pass. 6083e5c31af7Sopenharmony_ci * pname:renderArea is the render area that is affected by the render pass 6084e5c31af7Sopenharmony_ci instance, and is described in more detail below. 6085e5c31af7Sopenharmony_ci * pname:clearValueCount is the number of elements in pname:pClearValues. 6086e5c31af7Sopenharmony_ci * pname:pClearValues is a pointer to an array of pname:clearValueCount 6087e5c31af7Sopenharmony_ci slink:VkClearValue structures containing clear values for each 6088e5c31af7Sopenharmony_ci attachment, if the attachment uses a pname:loadOp value of 6089e5c31af7Sopenharmony_ci ename:VK_ATTACHMENT_LOAD_OP_CLEAR or if the attachment has a 6090e5c31af7Sopenharmony_ci depth/stencil format and uses a pname:stencilLoadOp value of 6091e5c31af7Sopenharmony_ci ename:VK_ATTACHMENT_LOAD_OP_CLEAR. 6092e5c31af7Sopenharmony_ci The array is indexed by attachment number. 6093e5c31af7Sopenharmony_ci Only elements corresponding to cleared attachments are used. 6094e5c31af7Sopenharmony_ci Other elements of pname:pClearValues are ignored. 6095e5c31af7Sopenharmony_ci 6096e5c31af7Sopenharmony_cipname:renderArea is the render area that is affected by the render pass 6097e5c31af7Sopenharmony_ciinstance. 6098e5c31af7Sopenharmony_ciThe effects of attachment load, store and multisample resolve operations are 6099e5c31af7Sopenharmony_cirestricted to the pixels whose x and y coordinates fall within the render 6100e5c31af7Sopenharmony_ciarea on all attachments. 6101e5c31af7Sopenharmony_ciThe render area extends to all layers of pname:framebuffer. 6102e5c31af7Sopenharmony_ciThe application must: ensure (using scissor if necessary) that all rendering 6103e5c31af7Sopenharmony_ciis contained within the render area. 6104e5c31af7Sopenharmony_ciifndef::VK_QCOM_render_pass_transform[] 6105e5c31af7Sopenharmony_ciThe render area must: be contained within the framebuffer dimensions. 6106e5c31af7Sopenharmony_ciendif::VK_QCOM_render_pass_transform[] 6107e5c31af7Sopenharmony_ciifdef::VK_QCOM_render_pass_transform[] 6108e5c31af7Sopenharmony_ciThe render area, after any transform specified by 6109e5c31af7Sopenharmony_cislink:VkRenderPassTransformBeginInfoQCOM::pname:transform is applied, must: 6110e5c31af7Sopenharmony_cibe contained within the framebuffer dimensions. 6111e5c31af7Sopenharmony_ciendif::VK_QCOM_render_pass_transform[] 6112e5c31af7Sopenharmony_ci 6113e5c31af7Sopenharmony_ciifdef::VK_QCOM_render_pass_transform[] 6114e5c31af7Sopenharmony_ciIf <<vertexpostproc-renderpass-transform, render pass transform>> is 6115e5c31af7Sopenharmony_cienabled, then pname:renderArea must: equal the framebuffer pre-transformed 6116e5c31af7Sopenharmony_cidimensions. 6117e5c31af7Sopenharmony_ciAfter pname:renderArea has been transformed by 6118e5c31af7Sopenharmony_cislink:VkRenderPassTransformBeginInfoQCOM::pname:transform, the resulting 6119e5c31af7Sopenharmony_cirender area must: be equal to the framebuffer dimensions. 6120e5c31af7Sopenharmony_ciendif::VK_QCOM_render_pass_transform[] 6121e5c31af7Sopenharmony_ci 6122e5c31af7Sopenharmony_ciifdef::VK_QCOM_multiview_per_view_render_areas[] 6123e5c31af7Sopenharmony_ciIf multiview is enabled in pname:renderPass, and 6124e5c31af7Sopenharmony_ci<<features-multiview-per-view-render-areas, 6125e5c31af7Sopenharmony_cipname:multiviewPerViewRenderAreas>> feature is enabled, and there is an 6126e5c31af7Sopenharmony_ciinstance of slink:VkMultiviewPerViewRenderAreasRenderPassBeginInfoQCOM 6127e5c31af7Sopenharmony_ciincluded in the pname:pNext chain with pname:perViewRenderAreaCount not 6128e5c31af7Sopenharmony_ciequal to `0`, then the elements of 6129e5c31af7Sopenharmony_cislink:VkMultiviewPerViewRenderAreasRenderPassBeginInfoQCOM::pname:pPerViewRenderAreas 6130e5c31af7Sopenharmony_cioverride pname:renderArea and define a render area for each view. 6131e5c31af7Sopenharmony_ciIn this case, pname:renderArea must: be set to an area at least as large as 6132e5c31af7Sopenharmony_cithe union of all the per-view render areas. 6133e5c31af7Sopenharmony_ciendif::VK_QCOM_multiview_per_view_render_areas[] 6134e5c31af7Sopenharmony_ci 6135e5c31af7Sopenharmony_ciifdef::VK_HUAWEI_subpass_shading[] 6136e5c31af7Sopenharmony_ciIf the <<features-subpassShading, pname:subpassShading>> feature is enabled, 6137e5c31af7Sopenharmony_cithen pname:renderArea must: equal the framebuffer dimensions. 6138e5c31af7Sopenharmony_ciendif::VK_HUAWEI_subpass_shading[] 6139e5c31af7Sopenharmony_ci 6140e5c31af7Sopenharmony_ci[NOTE] 6141e5c31af7Sopenharmony_ci.Note 6142e5c31af7Sopenharmony_ci==== 6143e5c31af7Sopenharmony_ciThere may: be a performance cost for using a render area smaller than the 6144e5c31af7Sopenharmony_ciframebuffer, unless it matches the render area granularity for the render 6145e5c31af7Sopenharmony_cipass. 6146e5c31af7Sopenharmony_ci==== 6147e5c31af7Sopenharmony_ci 6148e5c31af7Sopenharmony_ci.Valid Usage 6149e5c31af7Sopenharmony_ci**** 6150e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassBeginInfo-clearValueCount-00902]] 6151e5c31af7Sopenharmony_ci pname:clearValueCount must: be greater than the largest attachment index 6152e5c31af7Sopenharmony_ci in pname:renderPass specifying a pname:loadOp (or pname:stencilLoadOp, 6153e5c31af7Sopenharmony_ci if the attachment has a depth/stencil format) of 6154e5c31af7Sopenharmony_ci ename:VK_ATTACHMENT_LOAD_OP_CLEAR 6155e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassBeginInfo-clearValueCount-04962]] 6156e5c31af7Sopenharmony_ci If pname:clearValueCount is not `0`, pname:pClearValues must: be a valid 6157e5c31af7Sopenharmony_ci pointer to an array of pname:clearValueCount slink:VkClearValue unions 6158e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassBeginInfo-renderPass-00904]] 6159e5c31af7Sopenharmony_ci pname:renderPass must: be <<renderpass-compatibility,compatible>> with 6160e5c31af7Sopenharmony_ci the pname:renderPass member of the slink:VkFramebufferCreateInfo 6161e5c31af7Sopenharmony_ci structure specified when creating pname:framebuffer 6162e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassBeginInfo-None-08996]] 6163e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_device_group[] 6164e5c31af7Sopenharmony_ci If the pname:pNext chain does not contain 6165e5c31af7Sopenharmony_ci slink:VkDeviceGroupRenderPassBeginInfo or its 6166e5c31af7Sopenharmony_ci pname:deviceRenderAreaCount member is equal to 0, 6167e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_device_group[] 6168e5c31af7Sopenharmony_ci pname:renderArea.extent.width must: be greater than 0 6169e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassBeginInfo-None-08997]] 6170e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_device_group[] 6171e5c31af7Sopenharmony_ci If the pname:pNext chain does not contain 6172e5c31af7Sopenharmony_ci slink:VkDeviceGroupRenderPassBeginInfo or its 6173e5c31af7Sopenharmony_ci pname:deviceRenderAreaCount member is equal to 0, 6174e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_device_group[] 6175e5c31af7Sopenharmony_ci pname:renderArea.extent.height must: be greater than 0 6176e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassBeginInfo-pNext-02850]] 6177e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_device_group[] 6178e5c31af7Sopenharmony_ci If the pname:pNext chain does not contain 6179e5c31af7Sopenharmony_ci slink:VkDeviceGroupRenderPassBeginInfo or its 6180e5c31af7Sopenharmony_ci pname:deviceRenderAreaCount member is equal to 0, 6181e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_device_group[] 6182e5c31af7Sopenharmony_ci pname:renderArea.offset.x must: be greater than or equal to 0 6183e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassBeginInfo-pNext-02851]] 6184e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_device_group[] 6185e5c31af7Sopenharmony_ci If the pname:pNext chain does not contain 6186e5c31af7Sopenharmony_ci slink:VkDeviceGroupRenderPassBeginInfo or its 6187e5c31af7Sopenharmony_ci pname:deviceRenderAreaCount member is equal to 0, 6188e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_device_group[] 6189e5c31af7Sopenharmony_ci pname:renderArea.offset.y must: be greater than or equal to 0 6190e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassBeginInfo-pNext-02852]] 6191e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_device_group[] 6192e5c31af7Sopenharmony_ci If the pname:pNext chain does not contain 6193e5c31af7Sopenharmony_ci slink:VkDeviceGroupRenderPassBeginInfo or its 6194e5c31af7Sopenharmony_ci pname:deviceRenderAreaCount member is equal to 0, 6195e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_device_group[] 6196e5c31af7Sopenharmony_ci [eq]#pname:renderArea.offset.x {plus} pname:renderArea.extent.width# 6197e5c31af7Sopenharmony_ci must: be less than or equal to 6198e5c31af7Sopenharmony_ci slink:VkFramebufferCreateInfo::pname:width the pname:framebuffer was 6199e5c31af7Sopenharmony_ci created with 6200e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassBeginInfo-pNext-02853]] 6201e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_device_group[] 6202e5c31af7Sopenharmony_ci If the pname:pNext chain does not contain 6203e5c31af7Sopenharmony_ci slink:VkDeviceGroupRenderPassBeginInfo or its 6204e5c31af7Sopenharmony_ci pname:deviceRenderAreaCount member is equal to 0, 6205e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_device_group[] 6206e5c31af7Sopenharmony_ci [eq]#pname:renderArea.offset.y {plus} pname:renderArea.extent.height# 6207e5c31af7Sopenharmony_ci must: be less than or equal to 6208e5c31af7Sopenharmony_ci slink:VkFramebufferCreateInfo::pname:height the pname:framebuffer was 6209e5c31af7Sopenharmony_ci created with 6210e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_device_group[] 6211e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassBeginInfo-pNext-02856]] 6212e5c31af7Sopenharmony_ci If the pname:pNext chain contains 6213e5c31af7Sopenharmony_ci slink:VkDeviceGroupRenderPassBeginInfo, [eq]#pname:offset.x {plus} 6214e5c31af7Sopenharmony_ci pname:extent.width# of each element of pname:pDeviceRenderAreas must: be 6215e5c31af7Sopenharmony_ci less than or equal to slink:VkFramebufferCreateInfo::pname:width the 6216e5c31af7Sopenharmony_ci pname:framebuffer was created with 6217e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassBeginInfo-pNext-02857]] 6218e5c31af7Sopenharmony_ci If the pname:pNext chain contains 6219e5c31af7Sopenharmony_ci slink:VkDeviceGroupRenderPassBeginInfo, [eq]#pname:offset.y {plus} 6220e5c31af7Sopenharmony_ci pname:extent.height# of each element of pname:pDeviceRenderAreas must: 6221e5c31af7Sopenharmony_ci be less than or equal to slink:VkFramebufferCreateInfo::pname:height the 6222e5c31af7Sopenharmony_ci pname:framebuffer was created with 6223e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_device_group[] 6224e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_KHR_imageless_framebuffer[] 6225e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassBeginInfo-framebuffer-03207]] 6226e5c31af7Sopenharmony_ci If pname:framebuffer was created with a 6227e5c31af7Sopenharmony_ci slink:VkFramebufferCreateInfo::pname:flags value that did not include 6228e5c31af7Sopenharmony_ci ename:VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT, and the pname:pNext chain 6229e5c31af7Sopenharmony_ci includes a slink:VkRenderPassAttachmentBeginInfo structure, its 6230e5c31af7Sopenharmony_ci pname:attachmentCount must: be zero 6231e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassBeginInfo-framebuffer-03208]] 6232e5c31af7Sopenharmony_ci If pname:framebuffer was created with a 6233e5c31af7Sopenharmony_ci slink:VkFramebufferCreateInfo::pname:flags value that included 6234e5c31af7Sopenharmony_ci ename:VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT, the pname:attachmentCount of 6235e5c31af7Sopenharmony_ci a slink:VkRenderPassAttachmentBeginInfo structure included in the 6236e5c31af7Sopenharmony_ci pname:pNext chain must: be equal to the value of 6237e5c31af7Sopenharmony_ci slink:VkFramebufferAttachmentsCreateInfo::pname:attachmentImageInfoCount 6238e5c31af7Sopenharmony_ci used to create pname:framebuffer 6239e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassBeginInfo-framebuffer-02780]] 6240e5c31af7Sopenharmony_ci If pname:framebuffer was created with a 6241e5c31af7Sopenharmony_ci slink:VkFramebufferCreateInfo::pname:flags value that included 6242e5c31af7Sopenharmony_ci ename:VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT, each element of the 6243e5c31af7Sopenharmony_ci pname:pAttachments member of a slink:VkRenderPassAttachmentBeginInfo 6244e5c31af7Sopenharmony_ci structure included in the pname:pNext chain must: have been created on 6245e5c31af7Sopenharmony_ci the same slink:VkDevice as pname:framebuffer and pname:renderPass 6246e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassBeginInfo-framebuffer-03209]] 6247e5c31af7Sopenharmony_ci If pname:framebuffer was created with a 6248e5c31af7Sopenharmony_ci slink:VkFramebufferCreateInfo::pname:flags value that included 6249e5c31af7Sopenharmony_ci ename:VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT, each element of the 6250e5c31af7Sopenharmony_ci pname:pAttachments member of a slink:VkRenderPassAttachmentBeginInfo 6251e5c31af7Sopenharmony_ci structure included in the pname:pNext chain must: be a slink:VkImageView 6252e5c31af7Sopenharmony_ci of an image created with a value of slink:VkImageCreateInfo::pname:flags 6253e5c31af7Sopenharmony_ci equal to the pname:flags member of the corresponding element of 6254e5c31af7Sopenharmony_ci slink:VkFramebufferAttachmentsCreateInfo::pname:pAttachmentImageInfos 6255e5c31af7Sopenharmony_ci used to create pname:framebuffer 6256e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassBeginInfo-framebuffer-04627]] 6257e5c31af7Sopenharmony_ci If pname:framebuffer was created with a 6258e5c31af7Sopenharmony_ci slink:VkFramebufferCreateInfo::pname:flags value that included 6259e5c31af7Sopenharmony_ci ename:VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT, each element of the 6260e5c31af7Sopenharmony_ci pname:pAttachments member of a slink:VkRenderPassAttachmentBeginInfo 6261e5c31af7Sopenharmony_ci structure included in the pname:pNext chain must: be a slink:VkImageView 6262e5c31af7Sopenharmony_ci with <<resources-image-inherited-usage, an inherited usage>> equal to 6263e5c31af7Sopenharmony_ci the pname:usage member of the corresponding element of 6264e5c31af7Sopenharmony_ci slink:VkFramebufferAttachmentsCreateInfo::pname:pAttachmentImageInfos 6265e5c31af7Sopenharmony_ci used to create pname:framebuffer 6266e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassBeginInfo-framebuffer-03211]] 6267e5c31af7Sopenharmony_ci If pname:framebuffer was created with a 6268e5c31af7Sopenharmony_ci slink:VkFramebufferCreateInfo::pname:flags value that included 6269e5c31af7Sopenharmony_ci ename:VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT, each element of the 6270e5c31af7Sopenharmony_ci pname:pAttachments member of a slink:VkRenderPassAttachmentBeginInfo 6271e5c31af7Sopenharmony_ci structure included in the pname:pNext chain must: be a slink:VkImageView 6272e5c31af7Sopenharmony_ci with a width equal to the pname:width member of the corresponding 6273e5c31af7Sopenharmony_ci element of 6274e5c31af7Sopenharmony_ci slink:VkFramebufferAttachmentsCreateInfo::pname:pAttachmentImageInfos 6275e5c31af7Sopenharmony_ci used to create pname:framebuffer 6276e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassBeginInfo-framebuffer-03212]] 6277e5c31af7Sopenharmony_ci If pname:framebuffer was created with a 6278e5c31af7Sopenharmony_ci slink:VkFramebufferCreateInfo::pname:flags value that included 6279e5c31af7Sopenharmony_ci ename:VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT, each element of the 6280e5c31af7Sopenharmony_ci pname:pAttachments member of a slink:VkRenderPassAttachmentBeginInfo 6281e5c31af7Sopenharmony_ci structure included in the pname:pNext chain must: be a slink:VkImageView 6282e5c31af7Sopenharmony_ci with a height equal to the pname:height member of the corresponding 6283e5c31af7Sopenharmony_ci element of 6284e5c31af7Sopenharmony_ci slink:VkFramebufferAttachmentsCreateInfo::pname:pAttachmentImageInfos 6285e5c31af7Sopenharmony_ci used to create pname:framebuffer 6286e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassBeginInfo-framebuffer-03213]] 6287e5c31af7Sopenharmony_ci If pname:framebuffer was created with a 6288e5c31af7Sopenharmony_ci slink:VkFramebufferCreateInfo::pname:flags value that included 6289e5c31af7Sopenharmony_ci ename:VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT, each element of the 6290e5c31af7Sopenharmony_ci pname:pAttachments member of a slink:VkRenderPassAttachmentBeginInfo 6291e5c31af7Sopenharmony_ci structure included in the pname:pNext chain must: be a slink:VkImageView 6292e5c31af7Sopenharmony_ci of an image created with a value of 6293e5c31af7Sopenharmony_ci slink:VkImageViewCreateInfo::pname:subresourceRange.layerCount equal to 6294e5c31af7Sopenharmony_ci the pname:layerCount member of the corresponding element of 6295e5c31af7Sopenharmony_ci slink:VkFramebufferAttachmentsCreateInfo::pname:pAttachmentImageInfos 6296e5c31af7Sopenharmony_ci used to create pname:framebuffer 6297e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassBeginInfo-framebuffer-03214]] 6298e5c31af7Sopenharmony_ci If pname:framebuffer was created with a 6299e5c31af7Sopenharmony_ci slink:VkFramebufferCreateInfo::pname:flags value that included 6300e5c31af7Sopenharmony_ci ename:VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT, each element of the 6301e5c31af7Sopenharmony_ci pname:pAttachments member of a slink:VkRenderPassAttachmentBeginInfo 6302e5c31af7Sopenharmony_ci structure included in the pname:pNext chain must: be a slink:VkImageView 6303e5c31af7Sopenharmony_ci of an image created with a value of 6304e5c31af7Sopenharmony_ci slink:VkImageFormatListCreateInfo::pname:viewFormatCount equal to the 6305e5c31af7Sopenharmony_ci pname:viewFormatCount member of the corresponding element of 6306e5c31af7Sopenharmony_ci slink:VkFramebufferAttachmentsCreateInfo::pname:pAttachmentImageInfos 6307e5c31af7Sopenharmony_ci used to create pname:framebuffer 6308e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassBeginInfo-framebuffer-03215]] 6309e5c31af7Sopenharmony_ci If pname:framebuffer was created with a 6310e5c31af7Sopenharmony_ci slink:VkFramebufferCreateInfo::pname:flags value that included 6311e5c31af7Sopenharmony_ci ename:VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT, each element of the 6312e5c31af7Sopenharmony_ci pname:pAttachments member of a slink:VkRenderPassAttachmentBeginInfo 6313e5c31af7Sopenharmony_ci structure included in the pname:pNext chain must: be a slink:VkImageView 6314e5c31af7Sopenharmony_ci of an image created with a set of elements in 6315e5c31af7Sopenharmony_ci slink:VkImageFormatListCreateInfo::pname:pViewFormats equal to the set 6316e5c31af7Sopenharmony_ci of elements in the pname:pViewFormats member of the corresponding 6317e5c31af7Sopenharmony_ci element of 6318e5c31af7Sopenharmony_ci slink:VkFramebufferAttachmentsCreateInfo::pname:pAttachmentImageInfos 6319e5c31af7Sopenharmony_ci used to create pname:framebuffer 6320e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassBeginInfo-framebuffer-03216]] 6321e5c31af7Sopenharmony_ci If pname:framebuffer was created with a 6322e5c31af7Sopenharmony_ci slink:VkFramebufferCreateInfo::pname:flags value that included 6323e5c31af7Sopenharmony_ci ename:VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT, each element of the 6324e5c31af7Sopenharmony_ci pname:pAttachments member of a slink:VkRenderPassAttachmentBeginInfo 6325e5c31af7Sopenharmony_ci structure included in the pname:pNext chain must: be a slink:VkImageView 6326e5c31af7Sopenharmony_ci of an image created with a value of 6327e5c31af7Sopenharmony_ci slink:VkImageViewCreateInfo::pname:format equal to the corresponding 6328e5c31af7Sopenharmony_ci value of slink:VkAttachmentDescription::pname:format in pname:renderPass 6329e5c31af7Sopenharmony_ciifdef::VK_ANDROID_external_format_resolve[] 6330e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassBeginInfo-framebuffer-09353]] 6331e5c31af7Sopenharmony_ci If pname:framebuffer was created with a 6332e5c31af7Sopenharmony_ci slink:VkFramebufferCreateInfo::pname:flags value that included 6333e5c31af7Sopenharmony_ci ename:VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT, and the 6334e5c31af7Sopenharmony_ci <<limits-nullColorAttachmentWithExternalFormatResolve, 6335e5c31af7Sopenharmony_ci pname:nullColorAttachmentWithExternalFormatResolve>> is ename:VK_FALSE, 6336e5c31af7Sopenharmony_ci the format of the color attachment for each subpass that includes an 6337e5c31af7Sopenharmony_ci external format image as a resolve attachment must: have a format equal 6338e5c31af7Sopenharmony_ci to the value of 6339e5c31af7Sopenharmony_ci slink:VkAndroidHardwareBufferFormatResolvePropertiesANDROID::pname:colorAttachmentFormat 6340e5c31af7Sopenharmony_ci as returned by a call to 6341e5c31af7Sopenharmony_ci flink:vkGetAndroidHardwareBufferPropertiesANDROID for the Android 6342e5c31af7Sopenharmony_ci hardware buffer that was used to create the image view use as its 6343e5c31af7Sopenharmony_ci resolve attachment 6344e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassBeginInfo-framebuffer-09354]] 6345e5c31af7Sopenharmony_ci If pname:framebuffer was created with a 6346e5c31af7Sopenharmony_ci slink:VkFramebufferCreateInfo::pname:flags value that included 6347e5c31af7Sopenharmony_ci ename:VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT, each element of the 6348e5c31af7Sopenharmony_ci pname:pAttachments member of a slink:VkRenderPassAttachmentBeginInfo 6349e5c31af7Sopenharmony_ci structure included in the pname:pNext chain must: be a slink:VkImageView 6350e5c31af7Sopenharmony_ci of an image created with a value of 6351e5c31af7Sopenharmony_ci slink:VkExternalFormatANDROID::pname:externalFormat equal to 6352e5c31af7Sopenharmony_ci slink:VkExternalFormatANDROID::pname:externalFormat in the pname:pNext 6353e5c31af7Sopenharmony_ci chain of the corresponding slink:VkAttachmentDescription2 structure used 6354e5c31af7Sopenharmony_ci to create pname:renderPass 6355e5c31af7Sopenharmony_ciendif::VK_ANDROID_external_format_resolve[] 6356e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassBeginInfo-framebuffer-09047]] 6357e5c31af7Sopenharmony_ci If pname:framebuffer was created with a 6358e5c31af7Sopenharmony_ci slink:VkFramebufferCreateInfo::pname:flags value that included 6359e5c31af7Sopenharmony_ci ename:VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT, each element of the 6360e5c31af7Sopenharmony_ci pname:pAttachments member of a slink:VkRenderPassAttachmentBeginInfo 6361e5c31af7Sopenharmony_ci structure included in the pname:pNext chain must: be a slink:VkImageView 6362e5c31af7Sopenharmony_ci of an image created with a value of 6363e5c31af7Sopenharmony_ci slink:VkImageCreateInfo::pname:samples equal to the corresponding value 6364e5c31af7Sopenharmony_ci of slink:VkAttachmentDescription::pname:samples in pname:renderPass 6365e5c31af7Sopenharmony_ciifdef::VK_EXT_multisampled_render_to_single_sampled[] 6366e5c31af7Sopenharmony_ci , or ename:VK_SAMPLE_COUNT_1_BIT if pname:renderPass was created with 6367e5c31af7Sopenharmony_ci slink:VkMultisampledRenderToSingleSampledInfoEXT structure in the 6368e5c31af7Sopenharmony_ci pname:pNext chain with pname:multisampledRenderToSingleSampledEnable 6369e5c31af7Sopenharmony_ci equal to ename:VK_TRUE 6370e5c31af7Sopenharmony_ciendif::VK_EXT_multisampled_render_to_single_sampled[] 6371e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_KHR_imageless_framebuffer[] 6372e5c31af7Sopenharmony_ciifdef::VK_QCOM_render_pass_transform[] 6373e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassBeginInfo-pNext-02869]] 6374e5c31af7Sopenharmony_ci If the pname:pNext chain includes 6375e5c31af7Sopenharmony_ci slink:VkRenderPassTransformBeginInfoQCOM, pname:renderArea.offset must: 6376e5c31af7Sopenharmony_ci equal [eq]#(0,0)# 6377e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassBeginInfo-pNext-02870]] 6378e5c31af7Sopenharmony_ci If the pname:pNext chain includes 6379e5c31af7Sopenharmony_ci slink:VkRenderPassTransformBeginInfoQCOM, pname:renderArea.extent 6380e5c31af7Sopenharmony_ci transformed by slink:VkRenderPassTransformBeginInfoQCOM::pname:transform 6381e5c31af7Sopenharmony_ci must: equal the pname:framebuffer dimensions 6382e5c31af7Sopenharmony_ciendif::VK_QCOM_render_pass_transform[] 6383e5c31af7Sopenharmony_ciifdef::VK_QCOM_multiview_per_view_render_areas[] 6384e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassBeginInfo-perViewRenderAreaCount-07859]] 6385e5c31af7Sopenharmony_ci If the pname:perViewRenderAreaCount member of a 6386e5c31af7Sopenharmony_ci slink:VkMultiviewPerViewRenderAreasRenderPassBeginInfoQCOM structure 6387e5c31af7Sopenharmony_ci included in the pname:pNext chain is not `0`, then the 6388e5c31af7Sopenharmony_ci <<features-multiview-per-view-render-areas, 6389e5c31af7Sopenharmony_ci pname:multiviewPerViewRenderAreas>> feature must: be enabled. 6390e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassBeginInfo-perViewRenderAreaCount-07860]] 6391e5c31af7Sopenharmony_ci If the pname:perViewRenderAreaCount member of a 6392e5c31af7Sopenharmony_ci slink:VkMultiviewPerViewRenderAreasRenderPassBeginInfoQCOM structure 6393e5c31af7Sopenharmony_ci included in the pname:pNext chain is not `0`, then pname:renderArea 6394e5c31af7Sopenharmony_ci must: specify a render area that includes the union of all per view 6395e5c31af7Sopenharmony_ci render areas. 6396e5c31af7Sopenharmony_ciendif::VK_QCOM_multiview_per_view_render_areas[] 6397e5c31af7Sopenharmony_ciifdef::VK_ARM_render_pass_striped[] 6398e5c31af7Sopenharmony_ci If the pname:pNext chain contains a slink:VkRenderPassStripeBeginInfoARM 6399e5c31af7Sopenharmony_ci structure, the union of stripe areas defined by the elements of 6400e5c31af7Sopenharmony_ci slink:VkRenderPassStripeInfoARM::pname:pStripeInfos must: cover the 6401e5c31af7Sopenharmony_ci pname:renderArea 6402e5c31af7Sopenharmony_ciendif::VK_ARM_render_pass_striped[] 6403e5c31af7Sopenharmony_ci**** 6404e5c31af7Sopenharmony_ci 6405e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkRenderPassBeginInfo.adoc[] 6406e5c31af7Sopenharmony_ci-- 6407e5c31af7Sopenharmony_ci 6408e5c31af7Sopenharmony_ciifdef::VK_EXT_sample_locations[] 6409e5c31af7Sopenharmony_ci[open,refpage='VkRenderPassSampleLocationsBeginInfoEXT',desc='Structure specifying sample locations to use for the layout transition of custom sample locations compatible depth/stencil attachments',type='structs'] 6410e5c31af7Sopenharmony_ci-- 6411e5c31af7Sopenharmony_ciThe image layout of the depth aspect of a depth/stencil attachment referring 6412e5c31af7Sopenharmony_cito an image created with 6413e5c31af7Sopenharmony_ciename:VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT is dependent 6414e5c31af7Sopenharmony_cion the last sample locations used to render to the image subresource, thus 6415e5c31af7Sopenharmony_cipreserving the contents of such depth/stencil attachments across subpass 6416e5c31af7Sopenharmony_ciboundaries requires the application to specify these sample locations 6417e5c31af7Sopenharmony_ciwhenever a layout transition of the attachment may: occur. 6418e5c31af7Sopenharmony_ciThis information can: be provided by adding a 6419e5c31af7Sopenharmony_cisname:VkRenderPassSampleLocationsBeginInfoEXT structure to the pname:pNext 6420e5c31af7Sopenharmony_cichain of sname:VkRenderPassBeginInfo. 6421e5c31af7Sopenharmony_ci 6422e5c31af7Sopenharmony_ciThe sname:VkRenderPassSampleLocationsBeginInfoEXT structure is defined as: 6423e5c31af7Sopenharmony_ci 6424e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkRenderPassSampleLocationsBeginInfoEXT.adoc[] 6425e5c31af7Sopenharmony_ci 6426e5c31af7Sopenharmony_ci * pname:sType is a elink:VkStructureType value identifying this structure. 6427e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 6428e5c31af7Sopenharmony_ci structure. 6429e5c31af7Sopenharmony_ci * pname:attachmentInitialSampleLocationsCount is the number of elements in 6430e5c31af7Sopenharmony_ci the pname:pAttachmentInitialSampleLocations array. 6431e5c31af7Sopenharmony_ci * pname:pAttachmentInitialSampleLocations is a pointer to an array of 6432e5c31af7Sopenharmony_ci pname:attachmentInitialSampleLocationsCount 6433e5c31af7Sopenharmony_ci slink:VkAttachmentSampleLocationsEXT structures specifying the 6434e5c31af7Sopenharmony_ci attachment indices and their corresponding sample location state. 6435e5c31af7Sopenharmony_ci Each element of pname:pAttachmentInitialSampleLocations can: specify the 6436e5c31af7Sopenharmony_ci sample location state to use in the automatic layout transition 6437e5c31af7Sopenharmony_ci performed to transition a depth/stencil attachment from the initial 6438e5c31af7Sopenharmony_ci layout of the attachment to the image layout specified for the 6439e5c31af7Sopenharmony_ci attachment in the first subpass using it. 6440e5c31af7Sopenharmony_ci * pname:postSubpassSampleLocationsCount is the number of elements in the 6441e5c31af7Sopenharmony_ci pname:pPostSubpassSampleLocations array. 6442e5c31af7Sopenharmony_ci * pname:pPostSubpassSampleLocations is a pointer to an array of 6443e5c31af7Sopenharmony_ci pname:postSubpassSampleLocationsCount slink:VkSubpassSampleLocationsEXT 6444e5c31af7Sopenharmony_ci structures specifying the subpass indices and their corresponding sample 6445e5c31af7Sopenharmony_ci location state. 6446e5c31af7Sopenharmony_ci Each element of pname:pPostSubpassSampleLocations can: specify the 6447e5c31af7Sopenharmony_ci sample location state to use in the automatic layout transition 6448e5c31af7Sopenharmony_ci performed to transition the depth/stencil attachment used by the 6449e5c31af7Sopenharmony_ci specified subpass to the image layout specified in a dependent subpass 6450e5c31af7Sopenharmony_ci or to the final layout of the attachment in case the specified subpass 6451e5c31af7Sopenharmony_ci is the last subpass using that attachment. 6452e5c31af7Sopenharmony_ci In addition, if 6453e5c31af7Sopenharmony_ci slink:VkPhysicalDeviceSampleLocationsPropertiesEXT::pname:variableSampleLocations 6454e5c31af7Sopenharmony_ci is ename:VK_FALSE, each element of pname:pPostSubpassSampleLocations 6455e5c31af7Sopenharmony_ci must: specify the sample location state that matches the sample 6456e5c31af7Sopenharmony_ci locations used by all pipelines that will be bound to a command buffer 6457e5c31af7Sopenharmony_ci during the specified subpass. 6458e5c31af7Sopenharmony_ci If pname:variableSampleLocations is ename:VK_TRUE, the sample locations 6459e5c31af7Sopenharmony_ci used for rasterization do not depend on 6460e5c31af7Sopenharmony_ci pname:pPostSubpassSampleLocations. 6461e5c31af7Sopenharmony_ci 6462e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkRenderPassSampleLocationsBeginInfoEXT.adoc[] 6463e5c31af7Sopenharmony_ci-- 6464e5c31af7Sopenharmony_ci 6465e5c31af7Sopenharmony_ci[open,refpage='VkAttachmentSampleLocationsEXT',desc='Structure specifying the sample locations state to use in the initial layout transition of attachments',type='structs'] 6466e5c31af7Sopenharmony_ci-- 6467e5c31af7Sopenharmony_ciThe sname:VkAttachmentSampleLocationsEXT structure is defined as: 6468e5c31af7Sopenharmony_ci 6469e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkAttachmentSampleLocationsEXT.adoc[] 6470e5c31af7Sopenharmony_ci 6471e5c31af7Sopenharmony_ci * pname:attachmentIndex is the index of the attachment for which the 6472e5c31af7Sopenharmony_ci sample locations state is provided. 6473e5c31af7Sopenharmony_ci * pname:sampleLocationsInfo is the sample locations state to use for the 6474e5c31af7Sopenharmony_ci layout transition of the given attachment from the initial layout of the 6475e5c31af7Sopenharmony_ci attachment to the image layout specified for the attachment in the first 6476e5c31af7Sopenharmony_ci subpass using it. 6477e5c31af7Sopenharmony_ci 6478e5c31af7Sopenharmony_ciIf the image referenced by the framebuffer attachment at index 6479e5c31af7Sopenharmony_cipname:attachmentIndex was not created with 6480e5c31af7Sopenharmony_ciename:VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT then the 6481e5c31af7Sopenharmony_civalues specified in pname:sampleLocationsInfo are ignored. 6482e5c31af7Sopenharmony_ci 6483e5c31af7Sopenharmony_ci.Valid Usage 6484e5c31af7Sopenharmony_ci**** 6485e5c31af7Sopenharmony_ci * [[VUID-VkAttachmentSampleLocationsEXT-attachmentIndex-01531]] 6486e5c31af7Sopenharmony_ci pname:attachmentIndex must: be less than the pname:attachmentCount 6487e5c31af7Sopenharmony_ci specified in slink:VkRenderPassCreateInfo the render pass specified by 6488e5c31af7Sopenharmony_ci slink:VkRenderPassBeginInfo::pname:renderPass was created with 6489e5c31af7Sopenharmony_ci**** 6490e5c31af7Sopenharmony_ci 6491e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkAttachmentSampleLocationsEXT.adoc[] 6492e5c31af7Sopenharmony_ci-- 6493e5c31af7Sopenharmony_ci 6494e5c31af7Sopenharmony_ci[open,refpage='VkSubpassSampleLocationsEXT',desc='Structure specifying the sample locations state to use for layout transitions of attachments performed after a given subpass',type='structs'] 6495e5c31af7Sopenharmony_ci-- 6496e5c31af7Sopenharmony_ciThe sname:VkSubpassSampleLocationsEXT structure is defined as: 6497e5c31af7Sopenharmony_ci 6498e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkSubpassSampleLocationsEXT.adoc[] 6499e5c31af7Sopenharmony_ci 6500e5c31af7Sopenharmony_ci * pname:subpassIndex is the index of the subpass for which the sample 6501e5c31af7Sopenharmony_ci locations state is provided. 6502e5c31af7Sopenharmony_ci * pname:sampleLocationsInfo is the sample locations state to use for the 6503e5c31af7Sopenharmony_ci layout transition of the depth/stencil attachment away from the image 6504e5c31af7Sopenharmony_ci layout the attachment is used with in the subpass specified in 6505e5c31af7Sopenharmony_ci pname:subpassIndex. 6506e5c31af7Sopenharmony_ci 6507e5c31af7Sopenharmony_ciIf the image referenced by the depth/stencil attachment used in the subpass 6508e5c31af7Sopenharmony_ciidentified by pname:subpassIndex was not created with 6509e5c31af7Sopenharmony_ciename:VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT or if the 6510e5c31af7Sopenharmony_cisubpass does not use a depth/stencil attachment, and 6511e5c31af7Sopenharmony_cislink:VkPhysicalDeviceSampleLocationsPropertiesEXT::pname:variableSampleLocations 6512e5c31af7Sopenharmony_ciis ename:VK_TRUE then the values specified in pname:sampleLocationsInfo are 6513e5c31af7Sopenharmony_ciignored. 6514e5c31af7Sopenharmony_ci 6515e5c31af7Sopenharmony_ci.Valid Usage 6516e5c31af7Sopenharmony_ci**** 6517e5c31af7Sopenharmony_ci * [[VUID-VkSubpassSampleLocationsEXT-subpassIndex-01532]] 6518e5c31af7Sopenharmony_ci pname:subpassIndex must: be less than the pname:subpassCount specified 6519e5c31af7Sopenharmony_ci in slink:VkRenderPassCreateInfo the render pass specified by 6520e5c31af7Sopenharmony_ci slink:VkRenderPassBeginInfo::pname:renderPass was created with 6521e5c31af7Sopenharmony_ci**** 6522e5c31af7Sopenharmony_ci 6523e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkSubpassSampleLocationsEXT.adoc[] 6524e5c31af7Sopenharmony_ci-- 6525e5c31af7Sopenharmony_ciendif::VK_EXT_sample_locations[] 6526e5c31af7Sopenharmony_ci 6527e5c31af7Sopenharmony_ciifdef::VK_QCOM_render_pass_transform[] 6528e5c31af7Sopenharmony_ci[open,refpage='VkRenderPassTransformBeginInfoQCOM',desc='Structure describing transform parameters of a render pass instance',type='structs'] 6529e5c31af7Sopenharmony_ci-- 6530e5c31af7Sopenharmony_ciTo begin a render pass instance with <<vertexpostproc-renderpass-transform, 6531e5c31af7Sopenharmony_cirender pass transform>> enabled, add the 6532e5c31af7Sopenharmony_cislink:VkRenderPassTransformBeginInfoQCOM to the pname:pNext chain of 6533e5c31af7Sopenharmony_cislink:VkRenderPassBeginInfo structure passed to the 6534e5c31af7Sopenharmony_ciflink:vkCmdBeginRenderPass command specifying the render pass transform. 6535e5c31af7Sopenharmony_ci 6536e5c31af7Sopenharmony_ciThe sname:VkRenderPassTransformBeginInfoQCOM structure is defined as: 6537e5c31af7Sopenharmony_ci 6538e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkRenderPassTransformBeginInfoQCOM.adoc[] 6539e5c31af7Sopenharmony_ci 6540e5c31af7Sopenharmony_ci * pname:sType is a elink:VkStructureType value identifying this structure. 6541e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 6542e5c31af7Sopenharmony_ci structure. 6543e5c31af7Sopenharmony_ci * pname:transform is a elink:VkSurfaceTransformFlagBitsKHR value 6544e5c31af7Sopenharmony_ci describing the transform to be applied to rasterization. 6545e5c31af7Sopenharmony_ci 6546e5c31af7Sopenharmony_ci.Valid Usage 6547e5c31af7Sopenharmony_ci**** 6548e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassTransformBeginInfoQCOM-transform-02871]] 6549e5c31af7Sopenharmony_ci pname:transform must: be ename:VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR, 6550e5c31af7Sopenharmony_ci ename:VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR, 6551e5c31af7Sopenharmony_ci ename:VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR, or 6552e5c31af7Sopenharmony_ci ename:VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR 6553e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassTransformBeginInfoQCOM-flags-02872]] 6554e5c31af7Sopenharmony_ci The pname:renderpass must: have been created with 6555e5c31af7Sopenharmony_ci slink:VkRenderPassCreateInfo::pname:flags containing 6556e5c31af7Sopenharmony_ci ename:VK_RENDER_PASS_CREATE_TRANSFORM_BIT_QCOM 6557e5c31af7Sopenharmony_ci**** 6558e5c31af7Sopenharmony_ci 6559e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkRenderPassTransformBeginInfoQCOM.adoc[] 6560e5c31af7Sopenharmony_ci-- 6561e5c31af7Sopenharmony_ciendif::VK_QCOM_render_pass_transform[] 6562e5c31af7Sopenharmony_ci 6563e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_KHR_create_renderpass2[] 6564e5c31af7Sopenharmony_ci[open,refpage='VkSubpassBeginInfo',desc='Structure specifying subpass begin information',type='structs',alias='VkSubpassBeginInfoKHR'] 6565e5c31af7Sopenharmony_ci-- 6566e5c31af7Sopenharmony_ciThe sname:VkSubpassBeginInfo structure is defined as: 6567e5c31af7Sopenharmony_ci 6568e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkSubpassBeginInfo.adoc[] 6569e5c31af7Sopenharmony_ci 6570e5c31af7Sopenharmony_ciifdef::VK_KHR_create_renderpass2[] 6571e5c31af7Sopenharmony_cior the equivalent 6572e5c31af7Sopenharmony_ci 6573e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkSubpassBeginInfoKHR.adoc[] 6574e5c31af7Sopenharmony_ciendif::VK_KHR_create_renderpass2[] 6575e5c31af7Sopenharmony_ci 6576e5c31af7Sopenharmony_ci * pname:sType is a elink:VkStructureType value identifying this structure. 6577e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 6578e5c31af7Sopenharmony_ci structure. 6579e5c31af7Sopenharmony_ci * pname:contents is a elink:VkSubpassContents value specifying how the 6580e5c31af7Sopenharmony_ci commands in the next subpass will be provided. 6581e5c31af7Sopenharmony_ci 6582e5c31af7Sopenharmony_ciifdef::VK_EXT_nested_command_buffer[] 6583e5c31af7Sopenharmony_ci.Valid Usage 6584e5c31af7Sopenharmony_ci**** 6585e5c31af7Sopenharmony_ci * [[VUID-VkSubpassBeginInfo-contents-09382]] 6586e5c31af7Sopenharmony_ci If pname:contents is 6587e5c31af7Sopenharmony_ci ename:VK_SUBPASS_CONTENTS_INLINE_AND_SECONDARY_COMMAND_BUFFERS_EXT, then 6588e5c31af7Sopenharmony_ci <<features-nestedCommandBuffer, pname:nestedCommandBuffer>> must: be 6589e5c31af7Sopenharmony_ci enabled 6590e5c31af7Sopenharmony_ci**** 6591e5c31af7Sopenharmony_ciendif::VK_EXT_nested_command_buffer[] 6592e5c31af7Sopenharmony_ci 6593e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkSubpassBeginInfo.adoc[] 6594e5c31af7Sopenharmony_ci 6595e5c31af7Sopenharmony_ci-- 6596e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_KHR_create_renderpass2[] 6597e5c31af7Sopenharmony_ci 6598e5c31af7Sopenharmony_ci[open,refpage='VkSubpassContents',desc='Specify how commands in the first subpass of a render pass are provided',type='enums'] 6599e5c31af7Sopenharmony_ci-- 6600e5c31af7Sopenharmony_ciPossible values of flink:vkCmdBeginRenderPass::pname:contents, specifying 6601e5c31af7Sopenharmony_cihow the commands in the first subpass will be provided, are: 6602e5c31af7Sopenharmony_ci 6603e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkSubpassContents.adoc[] 6604e5c31af7Sopenharmony_ci 6605e5c31af7Sopenharmony_ci * ename:VK_SUBPASS_CONTENTS_INLINE specifies that the contents of the 6606e5c31af7Sopenharmony_ci subpass will be recorded inline in the primary command buffer, and 6607e5c31af7Sopenharmony_ci secondary command buffers must: not be executed within the subpass. 6608e5c31af7Sopenharmony_ci * ename:VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS specifies that the 6609e5c31af7Sopenharmony_ci contents are recorded in secondary command buffers that will be called 6610e5c31af7Sopenharmony_ci from the primary command buffer, and flink:vkCmdExecuteCommands is the 6611e5c31af7Sopenharmony_ci only valid command in the command buffer until flink:vkCmdNextSubpass or 6612e5c31af7Sopenharmony_ci flink:vkCmdEndRenderPass. 6613e5c31af7Sopenharmony_ciifdef::VK_EXT_nested_command_buffer[] 6614e5c31af7Sopenharmony_ci * ename:VK_SUBPASS_CONTENTS_INLINE_AND_SECONDARY_COMMAND_BUFFERS_EXT 6615e5c31af7Sopenharmony_ci specifies that the contents of the subpass can: be recorded both inline 6616e5c31af7Sopenharmony_ci and in secondary command buffers executed from this command buffer with 6617e5c31af7Sopenharmony_ci flink:vkCmdExecuteCommands. 6618e5c31af7Sopenharmony_ciendif::VK_EXT_nested_command_buffer[] 6619e5c31af7Sopenharmony_ci-- 6620e5c31af7Sopenharmony_ci 6621e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_device_group[] 6622e5c31af7Sopenharmony_ci[open,refpage='VkDeviceGroupRenderPassBeginInfo',desc='Set the initial device mask and render areas for a render pass instance',type='structs'] 6623e5c31af7Sopenharmony_ci-- 6624e5c31af7Sopenharmony_ciIf the pname:pNext chain of slink:VkRenderPassBeginInfo 6625e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_3,VK_KHR_dynamic_rendering[or slink:VkRenderingInfo] 6626e5c31af7Sopenharmony_ciincludes a sname:VkDeviceGroupRenderPassBeginInfo structure, then that 6627e5c31af7Sopenharmony_cistructure includes a device mask and set of render areas for the render pass 6628e5c31af7Sopenharmony_ciinstance. 6629e5c31af7Sopenharmony_ci 6630e5c31af7Sopenharmony_ciThe sname:VkDeviceGroupRenderPassBeginInfo structure is defined as: 6631e5c31af7Sopenharmony_ci 6632e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkDeviceGroupRenderPassBeginInfo.adoc[] 6633e5c31af7Sopenharmony_ci 6634e5c31af7Sopenharmony_ciifdef::VK_KHR_device_group[] 6635e5c31af7Sopenharmony_cior the equivalent 6636e5c31af7Sopenharmony_ci 6637e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkDeviceGroupRenderPassBeginInfoKHR.adoc[] 6638e5c31af7Sopenharmony_ciendif::VK_KHR_device_group[] 6639e5c31af7Sopenharmony_ci 6640e5c31af7Sopenharmony_ci * pname:sType is a elink:VkStructureType value identifying this structure. 6641e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 6642e5c31af7Sopenharmony_ci structure. 6643e5c31af7Sopenharmony_ci * pname:deviceMask is the device mask for the render pass instance. 6644e5c31af7Sopenharmony_ci * pname:deviceRenderAreaCount is the number of elements in the 6645e5c31af7Sopenharmony_ci pname:pDeviceRenderAreas array. 6646e5c31af7Sopenharmony_ci * pname:pDeviceRenderAreas is a pointer to an array of slink:VkRect2D 6647e5c31af7Sopenharmony_ci structures defining the render area for each physical device. 6648e5c31af7Sopenharmony_ci 6649e5c31af7Sopenharmony_ciThe pname:deviceMask serves several purposes. 6650e5c31af7Sopenharmony_ciIt is an upper bound on the set of physical devices that can: be used during 6651e5c31af7Sopenharmony_cithe render pass instance, and the initial device mask when the render pass 6652e5c31af7Sopenharmony_ciinstance begins. 6653e5c31af7Sopenharmony_ciIn addition, commands transitioning to the next subpass in a render pass 6654e5c31af7Sopenharmony_ciinstance and commands ending the render pass instance, and, accordingly 6655e5c31af7Sopenharmony_cirender pass <<renderpass-load-operations, load>>, 6656e5c31af7Sopenharmony_ci<<renderpass-store-operations, store>>, and <<renderpass-resolve-operations, 6657e5c31af7Sopenharmony_cimultisample resolve>> operations and subpass dependencies corresponding to 6658e5c31af7Sopenharmony_cithe render pass instance, are executed on the physical devices included in 6659e5c31af7Sopenharmony_cithe device mask provided here. 6660e5c31af7Sopenharmony_ci 6661e5c31af7Sopenharmony_ciIf pname:deviceRenderAreaCount is not zero, then the elements of 6662e5c31af7Sopenharmony_cipname:pDeviceRenderAreas override the value of 6663e5c31af7Sopenharmony_cislink:VkRenderPassBeginInfo::pname:renderArea, and provide a render area 6664e5c31af7Sopenharmony_cispecific to each physical device. 6665e5c31af7Sopenharmony_ciThese render areas serve the same purpose as 6666e5c31af7Sopenharmony_cislink:VkRenderPassBeginInfo::pname:renderArea, including controlling the 6667e5c31af7Sopenharmony_ciregion of attachments that are cleared by ename:VK_ATTACHMENT_LOAD_OP_CLEAR 6668e5c31af7Sopenharmony_ciand that are resolved into resolve attachments. 6669e5c31af7Sopenharmony_ci 6670e5c31af7Sopenharmony_ciIf this structure is not present, the render pass instance's device mask is 6671e5c31af7Sopenharmony_cithe value of slink:VkDeviceGroupCommandBufferBeginInfo::pname:deviceMask. 6672e5c31af7Sopenharmony_ciIf this structure is not present or if pname:deviceRenderAreaCount is zero, 6673e5c31af7Sopenharmony_cislink:VkRenderPassBeginInfo::pname:renderArea is used for all physical 6674e5c31af7Sopenharmony_cidevices. 6675e5c31af7Sopenharmony_ci 6676e5c31af7Sopenharmony_ci.Valid Usage 6677e5c31af7Sopenharmony_ci**** 6678e5c31af7Sopenharmony_ci * [[VUID-VkDeviceGroupRenderPassBeginInfo-deviceMask-00905]] 6679e5c31af7Sopenharmony_ci pname:deviceMask must: be a valid device mask value 6680e5c31af7Sopenharmony_ci * [[VUID-VkDeviceGroupRenderPassBeginInfo-deviceMask-00906]] 6681e5c31af7Sopenharmony_ci pname:deviceMask must: not be zero 6682e5c31af7Sopenharmony_ci * [[VUID-VkDeviceGroupRenderPassBeginInfo-deviceMask-00907]] 6683e5c31af7Sopenharmony_ci pname:deviceMask must: be a subset of the command buffer's initial 6684e5c31af7Sopenharmony_ci device mask 6685e5c31af7Sopenharmony_ci * [[VUID-VkDeviceGroupRenderPassBeginInfo-deviceRenderAreaCount-00908]] 6686e5c31af7Sopenharmony_ci pname:deviceRenderAreaCount must: either be zero or equal to the number 6687e5c31af7Sopenharmony_ci of physical devices in the logical device 6688e5c31af7Sopenharmony_ci * [[VUID-VkDeviceGroupRenderPassBeginInfo-offset-06166]] 6689e5c31af7Sopenharmony_ci The pname:offset.x member of any element of pname:pDeviceRenderAreas 6690e5c31af7Sopenharmony_ci must: be greater than or equal to 0 6691e5c31af7Sopenharmony_ci * [[VUID-VkDeviceGroupRenderPassBeginInfo-offset-06167]] 6692e5c31af7Sopenharmony_ci The pname:offset.y member of any element of pname:pDeviceRenderAreas 6693e5c31af7Sopenharmony_ci must: be greater than or equal to 0 6694e5c31af7Sopenharmony_ci * [[VUID-VkDeviceGroupRenderPassBeginInfo-offset-06168]] 6695e5c31af7Sopenharmony_ci The sum of the pname:offset.x and pname:extent.width members of any 6696e5c31af7Sopenharmony_ci element of pname:pDeviceRenderAreas must: be less than or equal to 6697e5c31af7Sopenharmony_ci <<limits-maxFramebufferWidth, pname:maxFramebufferWidth>> 6698e5c31af7Sopenharmony_ci * [[VUID-VkDeviceGroupRenderPassBeginInfo-offset-06169]] 6699e5c31af7Sopenharmony_ci The sum of the pname:offset.y and pname:extent.height members of any 6700e5c31af7Sopenharmony_ci element of pname:pDeviceRenderAreas must: be less than or equal to 6701e5c31af7Sopenharmony_ci <<limits-maxFramebufferHeight, pname:maxFramebufferHeight>> 6702e5c31af7Sopenharmony_ci * [[VUID-VkDeviceGroupRenderPassBeginInfo-extent-08998]] 6703e5c31af7Sopenharmony_ci The pname:extent.width member of any element of pname:pDeviceRenderAreas 6704e5c31af7Sopenharmony_ci must: be greater than 0 6705e5c31af7Sopenharmony_ci * [[VUID-VkDeviceGroupRenderPassBeginInfo-extent-08999]] 6706e5c31af7Sopenharmony_ci The pname:extent.height member of any element of 6707e5c31af7Sopenharmony_ci pname:pDeviceRenderAreas must: be greater than 0 6708e5c31af7Sopenharmony_ci**** 6709e5c31af7Sopenharmony_ci 6710e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkDeviceGroupRenderPassBeginInfo.adoc[] 6711e5c31af7Sopenharmony_ci-- 6712e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_device_group[] 6713e5c31af7Sopenharmony_ci 6714e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_KHR_imageless_framebuffer[] 6715e5c31af7Sopenharmony_ci[open,refpage='VkRenderPassAttachmentBeginInfo',desc='Structure specifying images to be used as framebuffer attachments',type='structs',alias='VkRenderPassAttachmentBeginInfoKHR'] 6716e5c31af7Sopenharmony_ci-- 6717e5c31af7Sopenharmony_ciThe sname:VkRenderPassAttachmentBeginInfo structure is defined as: 6718e5c31af7Sopenharmony_ci 6719e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkRenderPassAttachmentBeginInfo.adoc[] 6720e5c31af7Sopenharmony_ci 6721e5c31af7Sopenharmony_ciifdef::VK_KHR_imageless_framebuffer[] 6722e5c31af7Sopenharmony_cior the equivalent 6723e5c31af7Sopenharmony_ci 6724e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkRenderPassAttachmentBeginInfoKHR.adoc[] 6725e5c31af7Sopenharmony_ciendif::VK_KHR_imageless_framebuffer[] 6726e5c31af7Sopenharmony_ci 6727e5c31af7Sopenharmony_ci * pname:sType is a elink:VkStructureType value identifying this structure. 6728e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 6729e5c31af7Sopenharmony_ci structure. 6730e5c31af7Sopenharmony_ci * pname:attachmentCount is the number of attachments. 6731e5c31af7Sopenharmony_ci * pname:pAttachments is a pointer to an array of sname:VkImageView 6732e5c31af7Sopenharmony_ci handles, each of which will be used as the corresponding attachment in 6733e5c31af7Sopenharmony_ci the render pass instance. 6734e5c31af7Sopenharmony_ci 6735e5c31af7Sopenharmony_ci.Valid Usage 6736e5c31af7Sopenharmony_ci**** 6737e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassAttachmentBeginInfo-pAttachments-03218]] 6738e5c31af7Sopenharmony_ci Each element of pname:pAttachments must: only specify a single mip level 6739e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassAttachmentBeginInfo-pAttachments-03219]] 6740e5c31af7Sopenharmony_ci Each element of pname:pAttachments must: have been created with the 6741e5c31af7Sopenharmony_ci <<resources-image-views-identity-mappings,identity swizzle>> 6742e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassAttachmentBeginInfo-pAttachments-04114]] 6743e5c31af7Sopenharmony_ci Each element of pname:pAttachments must: have been created with 6744e5c31af7Sopenharmony_ci slink:VkImageViewCreateInfo::pname:viewType not equal to 6745e5c31af7Sopenharmony_ci ename:VK_IMAGE_VIEW_TYPE_3D 6746e5c31af7Sopenharmony_ciifdef::VK_EXT_multisampled_render_to_single_sampled[] 6747e5c31af7Sopenharmony_ci * [[VUID-VkRenderPassAttachmentBeginInfo-pAttachments-07010]] 6748e5c31af7Sopenharmony_ci If 6749e5c31af7Sopenharmony_ci <<subpass-multisampledrendertosinglesampled,multisampled-render-to-single-sampled>> 6750e5c31af7Sopenharmony_ci is enabled for any subpass, all element of pname:pAttachments which have 6751e5c31af7Sopenharmony_ci a sample count equal to ename:VK_SAMPLE_COUNT_1_BIT must: have a format 6752e5c31af7Sopenharmony_ci that supports the sample count specified in 6753e5c31af7Sopenharmony_ci slink:VkMultisampledRenderToSingleSampledInfoEXT::pname:rasterizationSamples 6754e5c31af7Sopenharmony_ciendif::VK_EXT_multisampled_render_to_single_sampled[] 6755e5c31af7Sopenharmony_ci**** 6756e5c31af7Sopenharmony_ci 6757e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkRenderPassAttachmentBeginInfo.adoc[] 6758e5c31af7Sopenharmony_ci-- 6759e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_KHR_imageless_framebuffer[] 6760e5c31af7Sopenharmony_ci 6761e5c31af7Sopenharmony_ciifdef::VK_QCOM_multiview_per_view_render_areas[] 6762e5c31af7Sopenharmony_ci[open,refpage='VkMultiviewPerViewRenderAreasRenderPassBeginInfoQCOM',desc='Set the multiview per view render areas for a render pass instance',type='structs'] 6763e5c31af7Sopenharmony_ci-- 6764e5c31af7Sopenharmony_ciIf a render pass instance enables multiview and if the 6765e5c31af7Sopenharmony_ci<<features-multiview-per-view-render-areas,pname:multiviewPerViewRenderAreas>> 6766e5c31af7Sopenharmony_cifeature is enabled, the 6767e5c31af7Sopenharmony_cisname:VkMultiviewPerViewRenderAreasRenderPassBeginInfoQCOM structure can: be 6768e5c31af7Sopenharmony_ciincluded in the pname:pNext chain of slink:VkRenderPassBeginInfo 6769e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_3,VK_KHR_dynamic_rendering[or slink:VkRenderingInfo] 6770e5c31af7Sopenharmony_ci 6771e5c31af7Sopenharmony_ciThe sname:VkMultiviewPerViewRenderAreasRenderPassBeginInfoQCOM structure is 6772e5c31af7Sopenharmony_cidefined as: 6773e5c31af7Sopenharmony_ci 6774e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkMultiviewPerViewRenderAreasRenderPassBeginInfoQCOM.adoc[] 6775e5c31af7Sopenharmony_ci 6776e5c31af7Sopenharmony_ci * pname:sType is a elink:VkStructureType value identifying this structure. 6777e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 6778e5c31af7Sopenharmony_ci structure. 6779e5c31af7Sopenharmony_ci * pname:perViewRenderAreaCount is the number of elements in the 6780e5c31af7Sopenharmony_ci pname:pPerViewRenderAreas array. 6781e5c31af7Sopenharmony_ci * pname:pPerViewRenderAreas is a pointer to an array of slink:VkRect2D 6782e5c31af7Sopenharmony_ci structures defining the render area for each view. 6783e5c31af7Sopenharmony_ci 6784e5c31af7Sopenharmony_ciIf pname:perViewRenderAreaCount is not zero, then the elements of 6785e5c31af7Sopenharmony_cipname:pPerViewRenderAreas override the value of 6786e5c31af7Sopenharmony_cislink:VkRenderPassBeginInfo::pname:renderArea 6787e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_3,VK_KHR_dynamic_rendering[or slink:VkRenderingInfo::pname:renderArea] 6788e5c31af7Sopenharmony_ciand define per-view render areas for the individual views of a multiview 6789e5c31af7Sopenharmony_cirender pass. 6790e5c31af7Sopenharmony_ciThe render area for the view with _view index_ `i` is specified by 6791e5c31af7Sopenharmony_cipname:pPerViewRenderAreas[i]. 6792e5c31af7Sopenharmony_ci 6793e5c31af7Sopenharmony_ciThe per-view render areas define per-view regions of attachments that are 6794e5c31af7Sopenharmony_ciloaded, stored, and resolved according to the pname:loadOp, pname:storeOp, 6795e5c31af7Sopenharmony_ciand pname:resolveMode values of the render pass instance. 6796e5c31af7Sopenharmony_ciWhen per-view render areas are defined, the value of 6797e5c31af7Sopenharmony_cislink:VkRenderPassBeginInfo::pname:renderArea 6798e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_3,VK_KHR_dynamic_rendering[or slink:VkRenderingInfo::pname:renderArea] 6799e5c31af7Sopenharmony_cimust: be set to a render area that includes the union of all per-view render 6800e5c31af7Sopenharmony_ciareas, may: be used by the implementation for optimizations, but does not 6801e5c31af7Sopenharmony_ciaffect loads, stores, or resolves. 6802e5c31af7Sopenharmony_ci 6803e5c31af7Sopenharmony_ciIf this structure is present and if pname:perViewRenderAreaCount is not 6804e5c31af7Sopenharmony_cizero, then pname:perViewRenderAreaCount must: be at least least one greater 6805e5c31af7Sopenharmony_cithan the most significant bit set in any any element of 6806e5c31af7Sopenharmony_cislink:VkRenderPassMultiviewCreateInfo::pname:pViewMasks. 6807e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_3,VK_KHR_dynamic_rendering[or slink:VkRenderingInfo::pname:viewMask] 6808e5c31af7Sopenharmony_ci 6809e5c31af7Sopenharmony_ciIf this structure is not present or if pname:perViewRenderAreaCount is zero, 6810e5c31af7Sopenharmony_cislink:VkRenderPassBeginInfo::pname:renderArea 6811e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_3,VK_KHR_dynamic_rendering[or slink:VkRenderingInfo::pname:renderArea] 6812e5c31af7Sopenharmony_ciis used for all views. 6813e5c31af7Sopenharmony_ci 6814e5c31af7Sopenharmony_ci.Valid Usage 6815e5c31af7Sopenharmony_ci**** 6816e5c31af7Sopenharmony_ci * [[VUID-VkMultiviewPerViewRenderAreasRenderPassBeginInfoQCOM-offset-07861]] 6817e5c31af7Sopenharmony_ci The pname:offset.x member of any element of pname:pPerViewRenderAreas 6818e5c31af7Sopenharmony_ci must: be greater than or equal to 0 6819e5c31af7Sopenharmony_ci * [[VUID-VkMultiviewPerViewRenderAreasRenderPassBeginInfoQCOM-offset-07862]] 6820e5c31af7Sopenharmony_ci The pname:offset.y member of any element of pname:pPerViewRenderAreas 6821e5c31af7Sopenharmony_ci must: be greater than or equal to 0 6822e5c31af7Sopenharmony_ci * [[VUID-VkMultiviewPerViewRenderAreasRenderPassBeginInfoQCOM-offset-07863]] 6823e5c31af7Sopenharmony_ci The sum of the pname:offset.x and pname:extent.width members of any 6824e5c31af7Sopenharmony_ci element of pname:pPerViewRenderAreas must: be less than or equal to 6825e5c31af7Sopenharmony_ci <<limits-maxFramebufferWidth, pname:maxFramebufferWidth>> 6826e5c31af7Sopenharmony_ci * [[VUID-VkMultiviewPerViewRenderAreasRenderPassBeginInfoQCOM-offset-07864]] 6827e5c31af7Sopenharmony_ci The sum of the pname:offset.y and pname:extent.height members of any 6828e5c31af7Sopenharmony_ci element of pname:pPerViewRenderAreas must: be less than or equal to 6829e5c31af7Sopenharmony_ci <<limits-maxFramebufferHeight, pname:maxFramebufferHeight>> 6830e5c31af7Sopenharmony_ci * [[VUID-VkMultiviewPerViewRenderAreasRenderPassBeginInfoQCOM-pNext-07865]] 6831e5c31af7Sopenharmony_ci If this structure is in the pname:pNext chain of 6832e5c31af7Sopenharmony_ci slink:VkRenderPassBeginInfo and if the render pass object included an 6833e5c31af7Sopenharmony_ci element in slink:VkRenderPassMultiviewCreateInfo::pname:pViewMasks that 6834e5c31af7Sopenharmony_ci set bit `n`, then pname:perViewRenderAreaCount must: be at least equal 6835e5c31af7Sopenharmony_ci to `n+1`. 6836e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_3,VK_KHR_dynamic_rendering[] 6837e5c31af7Sopenharmony_ci * [[VUID-VkMultiviewPerViewRenderAreasRenderPassBeginInfoQCOM-pNext-07866]] 6838e5c31af7Sopenharmony_ci If this structure is in the pname:pNext chain of slink:VkRenderingInfo 6839e5c31af7Sopenharmony_ci and if slink:VkRenderingInfo::pname:viewMask set bit `n`, then 6840e5c31af7Sopenharmony_ci pname:perViewRenderAreaCount must: be at least equal to `n+1`. 6841e5c31af7Sopenharmony_ciendif::VK_VERSION_1_3,VK_KHR_dynamic_rendering[] 6842e5c31af7Sopenharmony_ci**** 6843e5c31af7Sopenharmony_ci 6844e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkMultiviewPerViewRenderAreasRenderPassBeginInfoQCOM.adoc[] 6845e5c31af7Sopenharmony_ci-- 6846e5c31af7Sopenharmony_ciendif::VK_QCOM_multiview_per_view_render_areas[] 6847e5c31af7Sopenharmony_ci 6848e5c31af7Sopenharmony_ci 6849e5c31af7Sopenharmony_ci[open,refpage='vkGetRenderAreaGranularity',desc='Returns the granularity for optimal render area',type='protos'] 6850e5c31af7Sopenharmony_ci-- 6851e5c31af7Sopenharmony_ciTo query the render area granularity, call: 6852e5c31af7Sopenharmony_ci 6853e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkGetRenderAreaGranularity.adoc[] 6854e5c31af7Sopenharmony_ci 6855e5c31af7Sopenharmony_ci * pname:device is the logical device that owns the render pass. 6856e5c31af7Sopenharmony_ci * pname:renderPass is a handle to a render pass. 6857e5c31af7Sopenharmony_ci * pname:pGranularity is a pointer to a slink:VkExtent2D structure in which 6858e5c31af7Sopenharmony_ci the granularity is returned. 6859e5c31af7Sopenharmony_ci 6860e5c31af7Sopenharmony_ciThe conditions leading to an optimal pname:renderArea are: 6861e5c31af7Sopenharmony_ci 6862e5c31af7Sopenharmony_ci * the pname:offset.x member in pname:renderArea is a multiple of the 6863e5c31af7Sopenharmony_ci pname:width member of the returned slink:VkExtent2D (the horizontal 6864e5c31af7Sopenharmony_ci granularity). 6865e5c31af7Sopenharmony_ci * the pname:offset.y member in pname:renderArea is a multiple of the 6866e5c31af7Sopenharmony_ci pname:height member of the returned slink:VkExtent2D (the vertical 6867e5c31af7Sopenharmony_ci granularity). 6868e5c31af7Sopenharmony_ci * either the pname:extent.width member in pname:renderArea is a multiple 6869e5c31af7Sopenharmony_ci of the horizontal granularity or pname:offset.x+pname:extent.width is 6870e5c31af7Sopenharmony_ci equal to the pname:width of the pname:framebuffer in the 6871e5c31af7Sopenharmony_ci slink:VkRenderPassBeginInfo. 6872e5c31af7Sopenharmony_ci * either the pname:extent.height member in pname:renderArea is a multiple 6873e5c31af7Sopenharmony_ci of the vertical granularity or pname:offset.y+pname:extent.height is 6874e5c31af7Sopenharmony_ci equal to the pname:height of the pname:framebuffer in the 6875e5c31af7Sopenharmony_ci slink:VkRenderPassBeginInfo. 6876e5c31af7Sopenharmony_ci 6877e5c31af7Sopenharmony_ciSubpass dependencies are not affected by the render area, and apply to the 6878e5c31af7Sopenharmony_cientire image subresources attached to the framebuffer as specified in the 6879e5c31af7Sopenharmony_cidescription of <<renderpass-layout-transitions,automatic layout 6880e5c31af7Sopenharmony_citransitions>>. 6881e5c31af7Sopenharmony_ciSimilarly, pipeline barriers are valid even if their effect extends outside 6882e5c31af7Sopenharmony_cithe render area. 6883e5c31af7Sopenharmony_ci 6884e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkGetRenderAreaGranularity.adoc[] 6885e5c31af7Sopenharmony_ci-- 6886e5c31af7Sopenharmony_ci 6887e5c31af7Sopenharmony_ci[open,refpage='vkCmdNextSubpass',desc='Transition to the next subpass of a render pass',type='protos'] 6888e5c31af7Sopenharmony_ci-- 6889e5c31af7Sopenharmony_ciTo transition to the next subpass in the render pass instance after 6890e5c31af7Sopenharmony_cirecording the commands for a subpass, call: 6891e5c31af7Sopenharmony_ci 6892e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCmdNextSubpass.adoc[] 6893e5c31af7Sopenharmony_ci 6894e5c31af7Sopenharmony_ci * pname:commandBuffer is the command buffer in which to record the 6895e5c31af7Sopenharmony_ci command. 6896e5c31af7Sopenharmony_ci * pname:contents specifies how the commands in the next subpass will be 6897e5c31af7Sopenharmony_ci provided, in the same fashion as the corresponding parameter of 6898e5c31af7Sopenharmony_ci flink:vkCmdBeginRenderPass. 6899e5c31af7Sopenharmony_ci 6900e5c31af7Sopenharmony_ciThe subpass index for a render pass begins at zero when 6901e5c31af7Sopenharmony_cifname:vkCmdBeginRenderPass is recorded, and increments each time 6902e5c31af7Sopenharmony_cifname:vkCmdNextSubpass is recorded. 6903e5c31af7Sopenharmony_ci 6904e5c31af7Sopenharmony_ciAfter transitioning to the next subpass, the application can: record the 6905e5c31af7Sopenharmony_cicommands for that subpass. 6906e5c31af7Sopenharmony_ci 6907e5c31af7Sopenharmony_ci.Valid Usage 6908e5c31af7Sopenharmony_ci**** 6909e5c31af7Sopenharmony_ci * [[VUID-vkCmdNextSubpass-None-00909]] 6910e5c31af7Sopenharmony_ci The current subpass index must: be less than the number of subpasses in 6911e5c31af7Sopenharmony_ci the render pass minus one 6912e5c31af7Sopenharmony_ciifdef::VK_EXT_transform_feedback[] 6913e5c31af7Sopenharmony_ci * [[VUID-vkCmdNextSubpass-None-02349]] 6914e5c31af7Sopenharmony_ci This command must: not be recorded when transform feedback is active 6915e5c31af7Sopenharmony_ciendif::VK_EXT_transform_feedback[] 6916e5c31af7Sopenharmony_ci**** 6917e5c31af7Sopenharmony_ci 6918e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCmdNextSubpass.adoc[] 6919e5c31af7Sopenharmony_ci-- 6920e5c31af7Sopenharmony_ci 6921e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_KHR_create_renderpass2[] 6922e5c31af7Sopenharmony_ci[open,refpage='vkCmdNextSubpass2',desc='Transition to the next subpass of a render pass',type='protos',alias='vkCmdNextSubpass2KHR'] 6923e5c31af7Sopenharmony_ci-- 6924e5c31af7Sopenharmony_ciTo transition to the next subpass in the render pass instance after 6925e5c31af7Sopenharmony_cirecording the commands for a subpass, call: 6926e5c31af7Sopenharmony_ci 6927e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2[] 6928e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCmdNextSubpass2.adoc[] 6929e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2[] 6930e5c31af7Sopenharmony_ci 6931e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2+VK_KHR_create_renderpass2[or the equivalent command] 6932e5c31af7Sopenharmony_ci 6933e5c31af7Sopenharmony_ciifdef::VK_KHR_create_renderpass2[] 6934e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCmdNextSubpass2KHR.adoc[] 6935e5c31af7Sopenharmony_ciendif::VK_KHR_create_renderpass2[] 6936e5c31af7Sopenharmony_ci 6937e5c31af7Sopenharmony_ci * pname:commandBuffer is the command buffer in which to record the 6938e5c31af7Sopenharmony_ci command. 6939e5c31af7Sopenharmony_ci * pname:pSubpassBeginInfo is a pointer to a slink:VkSubpassBeginInfo 6940e5c31af7Sopenharmony_ci structure containing information about the subpass which is about to 6941e5c31af7Sopenharmony_ci begin rendering. 6942e5c31af7Sopenharmony_ci * pname:pSubpassEndInfo is a pointer to a slink:VkSubpassEndInfo structure 6943e5c31af7Sopenharmony_ci containing information about how the previous subpass will be ended. 6944e5c31af7Sopenharmony_ci 6945e5c31af7Sopenharmony_cifname:vkCmdNextSubpass2 is semantically identical to flink:vkCmdNextSubpass, 6946e5c31af7Sopenharmony_ciexcept that it is extensible, and that pname:contents is provided as part of 6947e5c31af7Sopenharmony_cian extensible structure instead of as a flat parameter. 6948e5c31af7Sopenharmony_ci 6949e5c31af7Sopenharmony_ci.Valid Usage 6950e5c31af7Sopenharmony_ci**** 6951e5c31af7Sopenharmony_ci * [[VUID-vkCmdNextSubpass2-None-03102]] 6952e5c31af7Sopenharmony_ci The current subpass index must: be less than the number of subpasses in 6953e5c31af7Sopenharmony_ci the render pass minus one 6954e5c31af7Sopenharmony_ciifdef::VK_EXT_transform_feedback[] 6955e5c31af7Sopenharmony_ci * [[VUID-vkCmdNextSubpass2-None-02350]] 6956e5c31af7Sopenharmony_ci This command must: not be recorded when transform feedback is active 6957e5c31af7Sopenharmony_ciendif::VK_EXT_transform_feedback[] 6958e5c31af7Sopenharmony_ci**** 6959e5c31af7Sopenharmony_ci 6960e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCmdNextSubpass2.adoc[] 6961e5c31af7Sopenharmony_ci-- 6962e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_KHR_create_renderpass2[] 6963e5c31af7Sopenharmony_ci 6964e5c31af7Sopenharmony_ci[open,refpage='vkCmdEndRenderPass',desc='End the current render pass',type='protos'] 6965e5c31af7Sopenharmony_ci-- 6966e5c31af7Sopenharmony_ciTo record a command to end a render pass instance after recording the 6967e5c31af7Sopenharmony_cicommands for the last subpass, call: 6968e5c31af7Sopenharmony_ci 6969e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCmdEndRenderPass.adoc[] 6970e5c31af7Sopenharmony_ci 6971e5c31af7Sopenharmony_ci * pname:commandBuffer is the command buffer in which to end the current 6972e5c31af7Sopenharmony_ci render pass instance. 6973e5c31af7Sopenharmony_ci 6974e5c31af7Sopenharmony_ciEnding a render pass instance performs any multisample resolve operations on 6975e5c31af7Sopenharmony_cithe final subpass. 6976e5c31af7Sopenharmony_ci 6977e5c31af7Sopenharmony_ci.Valid Usage 6978e5c31af7Sopenharmony_ci**** 6979e5c31af7Sopenharmony_ci * [[VUID-vkCmdEndRenderPass-None-00910]] 6980e5c31af7Sopenharmony_ci The current subpass index must: be equal to the number of subpasses in 6981e5c31af7Sopenharmony_ci the render pass minus one 6982e5c31af7Sopenharmony_ciifdef::VK_EXT_transform_feedback[] 6983e5c31af7Sopenharmony_ci * [[VUID-vkCmdEndRenderPass-None-02351]] 6984e5c31af7Sopenharmony_ci This command must: not be recorded when transform feedback is active 6985e5c31af7Sopenharmony_ciendif::VK_EXT_transform_feedback[] 6986e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_3,VK_KHR_dynamic_rendering[] 6987e5c31af7Sopenharmony_ci * [[VUID-vkCmdEndRenderPass-None-06170]] 6988e5c31af7Sopenharmony_ci The current render pass instance must: not have been begun with 6989e5c31af7Sopenharmony_ci flink:vkCmdBeginRendering 6990e5c31af7Sopenharmony_ciendif::VK_VERSION_1_3,VK_KHR_dynamic_rendering[] 6991e5c31af7Sopenharmony_ci * [[VUID-vkCmdEndRenderPass-None-07004]] 6992e5c31af7Sopenharmony_ci If fname:vkCmdBeginQuery* was called within a subpass of the render 6993e5c31af7Sopenharmony_ci pass, the corresponding fname:vkCmdEndQuery* must: have been called 6994e5c31af7Sopenharmony_ci subsequently within the same subpass 6995e5c31af7Sopenharmony_ci**** 6996e5c31af7Sopenharmony_ci 6997e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCmdEndRenderPass.adoc[] 6998e5c31af7Sopenharmony_ci-- 6999e5c31af7Sopenharmony_ci 7000e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_KHR_create_renderpass2[] 7001e5c31af7Sopenharmony_ci[open,refpage='vkCmdEndRenderPass2',desc='End the current render pass',type='protos',alias='vkCmdEndRenderPass2KHR'] 7002e5c31af7Sopenharmony_ci-- 7003e5c31af7Sopenharmony_ciTo record a command to end a render pass instance after recording the 7004e5c31af7Sopenharmony_cicommands for the last subpass, call: 7005e5c31af7Sopenharmony_ci 7006e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2[] 7007e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCmdEndRenderPass2.adoc[] 7008e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2[] 7009e5c31af7Sopenharmony_ci 7010e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2+VK_KHR_create_renderpass2[or the equivalent command] 7011e5c31af7Sopenharmony_ci 7012e5c31af7Sopenharmony_ciifdef::VK_KHR_create_renderpass2[] 7013e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCmdEndRenderPass2KHR.adoc[] 7014e5c31af7Sopenharmony_ciendif::VK_KHR_create_renderpass2[] 7015e5c31af7Sopenharmony_ci 7016e5c31af7Sopenharmony_ci * pname:commandBuffer is the command buffer in which to end the current 7017e5c31af7Sopenharmony_ci render pass instance. 7018e5c31af7Sopenharmony_ci * pname:pSubpassEndInfo is a pointer to a slink:VkSubpassEndInfo structure 7019e5c31af7Sopenharmony_ci containing information about how the last subpass will be ended. 7020e5c31af7Sopenharmony_ci 7021e5c31af7Sopenharmony_cifname:vkCmdEndRenderPass2 is semantically identical to 7022e5c31af7Sopenharmony_ciflink:vkCmdEndRenderPass, except that it is extensible. 7023e5c31af7Sopenharmony_ci 7024e5c31af7Sopenharmony_ci.Valid Usage 7025e5c31af7Sopenharmony_ci**** 7026e5c31af7Sopenharmony_ci * [[VUID-vkCmdEndRenderPass2-None-03103]] 7027e5c31af7Sopenharmony_ci The current subpass index must: be equal to the number of subpasses in 7028e5c31af7Sopenharmony_ci the render pass minus one 7029e5c31af7Sopenharmony_ciifdef::VK_EXT_transform_feedback[] 7030e5c31af7Sopenharmony_ci * [[VUID-vkCmdEndRenderPass2-None-02352]] 7031e5c31af7Sopenharmony_ci This command must: not be recorded when transform feedback is active 7032e5c31af7Sopenharmony_ciendif::VK_EXT_transform_feedback[] 7033e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_3,VK_KHR_dynamic_rendering[] 7034e5c31af7Sopenharmony_ci * [[VUID-vkCmdEndRenderPass2-None-06171]] 7035e5c31af7Sopenharmony_ci The current render pass instance must: not have been begun with 7036e5c31af7Sopenharmony_ci flink:vkCmdBeginRendering 7037e5c31af7Sopenharmony_ciendif::VK_VERSION_1_3,VK_KHR_dynamic_rendering[] 7038e5c31af7Sopenharmony_ci * [[VUID-vkCmdEndRenderPass2-None-07005]] 7039e5c31af7Sopenharmony_ci If fname:vkCmdBeginQuery* was called within a subpass of the render 7040e5c31af7Sopenharmony_ci pass, the corresponding fname:vkCmdEndQuery* must: have been called 7041e5c31af7Sopenharmony_ci subsequently within the same subpass 7042e5c31af7Sopenharmony_ci**** 7043e5c31af7Sopenharmony_ci 7044e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCmdEndRenderPass2.adoc[] 7045e5c31af7Sopenharmony_ci-- 7046e5c31af7Sopenharmony_ci 7047e5c31af7Sopenharmony_ci[open,refpage='VkSubpassEndInfo',desc='Structure specifying subpass end information',type='structs',alias='VkSubpassEndInfoKHR'] 7048e5c31af7Sopenharmony_ci-- 7049e5c31af7Sopenharmony_ciThe sname:VkSubpassEndInfo structure is defined as: 7050e5c31af7Sopenharmony_ci 7051e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkSubpassEndInfo.adoc[] 7052e5c31af7Sopenharmony_ci 7053e5c31af7Sopenharmony_ciifdef::VK_KHR_create_renderpass2[] 7054e5c31af7Sopenharmony_cior the equivalent 7055e5c31af7Sopenharmony_ci 7056e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkSubpassEndInfoKHR.adoc[] 7057e5c31af7Sopenharmony_ciendif::VK_KHR_create_renderpass2[] 7058e5c31af7Sopenharmony_ci 7059e5c31af7Sopenharmony_ci * pname:sType is a elink:VkStructureType value identifying this structure. 7060e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 7061e5c31af7Sopenharmony_ci structure. 7062e5c31af7Sopenharmony_ci 7063e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkSubpassEndInfo.adoc[] 7064e5c31af7Sopenharmony_ci-- 7065e5c31af7Sopenharmony_ci 7066e5c31af7Sopenharmony_ciifdef::VK_QCOM_fragment_density_map_offset[] 7067e5c31af7Sopenharmony_ci[open,refpage='VkSubpassFragmentDensityMapOffsetEndInfoQCOM',desc='Structure specifying fragment density map offset subpass end information',type='structs'] 7068e5c31af7Sopenharmony_ci-- 7069e5c31af7Sopenharmony_ci[[renderpass-fragmentdensitymapoffsets]] 7070e5c31af7Sopenharmony_ciIf the slink:VkSubpassEndInfo::pname:pNext chain includes a 7071e5c31af7Sopenharmony_cisname:VkSubpassFragmentDensityMapOffsetEndInfoQCOM structure, then that 7072e5c31af7Sopenharmony_cistructure includes an array of fragment density map offsets per layer for 7073e5c31af7Sopenharmony_cithe render pass. 7074e5c31af7Sopenharmony_ci 7075e5c31af7Sopenharmony_ciThe sname:VkSubpassFragmentDensityMapOffsetEndInfoQCOM structure is defined 7076e5c31af7Sopenharmony_cias: 7077e5c31af7Sopenharmony_ci 7078e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkSubpassFragmentDensityMapOffsetEndInfoQCOM.adoc[] 7079e5c31af7Sopenharmony_ci 7080e5c31af7Sopenharmony_ci * pname:sType is a elink:VkStructureType value identifying this structure. 7081e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 7082e5c31af7Sopenharmony_ci structure. 7083e5c31af7Sopenharmony_ci * pname:fragmentDensityOffsetCount is the number of offsets being 7084e5c31af7Sopenharmony_ci specified. 7085e5c31af7Sopenharmony_ci * pname:pFragmentDensityOffsets is a pointer to an array of 7086e5c31af7Sopenharmony_ci slink:VkOffset2D structs, each of which describes the offset per layer. 7087e5c31af7Sopenharmony_ci 7088e5c31af7Sopenharmony_ciThe array elements are given per pname:layer as defined by 7089e5c31af7Sopenharmony_ci<<fragmentdensitymap-fetch-density-value,Fetch Density Value>>, where 7090e5c31af7Sopenharmony_ci[eq]#index = layer#. 7091e5c31af7Sopenharmony_ciEach [eq]#(x,y)# offset is in framebuffer pixels and shifts the fetch of the 7092e5c31af7Sopenharmony_cifragment density map by that amount. 7093e5c31af7Sopenharmony_ciOffsets can be positive or negative. 7094e5c31af7Sopenharmony_ci 7095e5c31af7Sopenharmony_ciOffset values specified for any subpass that is not the last subpass in the 7096e5c31af7Sopenharmony_cirender pass are ignored. 7097e5c31af7Sopenharmony_ciIf the slink:VkSubpassEndInfo::pname:pNext chain for the last subpass of a 7098e5c31af7Sopenharmony_cirender pass does not include 7099e5c31af7Sopenharmony_cisname:VkSubpassFragmentDensityMapOffsetEndInfoQCOM, or if 7100e5c31af7Sopenharmony_cipname:fragmentDensityOffsetCount is zero, then the offset [eq]#(0,0)# is 7101e5c31af7Sopenharmony_ciused for <<fragmentdensitymap-fetch-density-value,Fetch Density Value>>. 7102e5c31af7Sopenharmony_ci 7103e5c31af7Sopenharmony_ci.Valid Usage 7104e5c31af7Sopenharmony_ci**** 7105e5c31af7Sopenharmony_ci * [[VUID-VkSubpassFragmentDensityMapOffsetEndInfoQCOM-fragmentDensityMapOffsets-06503]] 7106e5c31af7Sopenharmony_ci If the <<features-fragmentDensityMapOffsets, 7107e5c31af7Sopenharmony_ci pname:fragmentDensityMapOffsets>> feature is not enabled or fragment 7108e5c31af7Sopenharmony_ci density map is not enabled in the render pass, 7109e5c31af7Sopenharmony_ci pname:fragmentDensityOffsetCount must: equal `0` 7110e5c31af7Sopenharmony_ci * [[VUID-VkSubpassFragmentDensityMapOffsetEndInfoQCOM-fragmentDensityMapAttachment-06504]] 7111e5c31af7Sopenharmony_ci If sname:VkSubpassDescription::pname:fragmentDensityMapAttachment is not 7112e5c31af7Sopenharmony_ci is not ename:VK_ATTACHMENT_UNUSED and was not created with 7113e5c31af7Sopenharmony_ci ename:VK_IMAGE_CREATE_FRAGMENT_DENSITY_MAP_OFFSET_BIT_QCOM, 7114e5c31af7Sopenharmony_ci pname:fragmentDensityOffsetCount must: equal `0` 7115e5c31af7Sopenharmony_ci * [[VUID-VkSubpassFragmentDensityMapOffsetEndInfoQCOM-pDepthStencilAttachment-06505]] 7116e5c31af7Sopenharmony_ci If sname:VkSubpassDescription::pname:pDepthStencilAttachment is not is 7117e5c31af7Sopenharmony_ci not ename:VK_ATTACHMENT_UNUSED and was not created with 7118e5c31af7Sopenharmony_ci ename:VK_IMAGE_CREATE_FRAGMENT_DENSITY_MAP_OFFSET_BIT_QCOM, 7119e5c31af7Sopenharmony_ci pname:fragmentDensityOffsetCount must: equal `0` 7120e5c31af7Sopenharmony_ci * [[VUID-VkSubpassFragmentDensityMapOffsetEndInfoQCOM-pInputAttachments-06506]] 7121e5c31af7Sopenharmony_ci If any element of sname:VkSubpassDescription::pname:pInputAttachments is 7122e5c31af7Sopenharmony_ci not is not ename:VK_ATTACHMENT_UNUSED and was not created with 7123e5c31af7Sopenharmony_ci ename:VK_IMAGE_CREATE_FRAGMENT_DENSITY_MAP_OFFSET_BIT_QCOM, 7124e5c31af7Sopenharmony_ci pname:fragmentDensityOffsetCount must: equal `0` 7125e5c31af7Sopenharmony_ci * [[VUID-VkSubpassFragmentDensityMapOffsetEndInfoQCOM-pColorAttachments-06507]] 7126e5c31af7Sopenharmony_ci If any element of sname:VkSubpassDescription::pname:pColorAttachments is 7127e5c31af7Sopenharmony_ci not is not ename:VK_ATTACHMENT_UNUSED and was not created with 7128e5c31af7Sopenharmony_ci ename:VK_IMAGE_CREATE_FRAGMENT_DENSITY_MAP_OFFSET_BIT_QCOM, 7129e5c31af7Sopenharmony_ci pname:fragmentDensityOffsetCount must: equal `0` 7130e5c31af7Sopenharmony_ci * [[VUID-VkSubpassFragmentDensityMapOffsetEndInfoQCOM-pResolveAttachments-06508]] 7131e5c31af7Sopenharmony_ci If any element of sname:VkSubpassDescription::pname:pResolveAttachments 7132e5c31af7Sopenharmony_ci is not is not ename:VK_ATTACHMENT_UNUSED and was not created with 7133e5c31af7Sopenharmony_ci ename:VK_IMAGE_CREATE_FRAGMENT_DENSITY_MAP_OFFSET_BIT_QCOM, 7134e5c31af7Sopenharmony_ci pname:fragmentDensityOffsetCount must: equal `0` 7135e5c31af7Sopenharmony_ci * [[VUID-VkSubpassFragmentDensityMapOffsetEndInfoQCOM-pPreserveAttachments-06509]] 7136e5c31af7Sopenharmony_ci If any element of sname:VkSubpassDescription::pname:pPreserveAttachments 7137e5c31af7Sopenharmony_ci is not is not ename:VK_ATTACHMENT_UNUSED and was not created with 7138e5c31af7Sopenharmony_ci ename:VK_IMAGE_CREATE_FRAGMENT_DENSITY_MAP_OFFSET_BIT_QCOM, 7139e5c31af7Sopenharmony_ci pname:fragmentDensityOffsetCount must: equal `0` 7140e5c31af7Sopenharmony_ci * [[VUID-VkSubpassFragmentDensityMapOffsetEndInfoQCOM-fragmentDensityOffsetCount-06510]] 7141e5c31af7Sopenharmony_ci If pname:fragmentDensityOffsetCount is not `0` and multiview is enabled 7142e5c31af7Sopenharmony_ci for the render pass, pname:fragmentDensityOffsetCount must: equal the 7143e5c31af7Sopenharmony_ci pname:layerCount that was specified in creating the fragment density map 7144e5c31af7Sopenharmony_ci attachment view 7145e5c31af7Sopenharmony_ci * [[VUID-VkSubpassFragmentDensityMapOffsetEndInfoQCOM-fragmentDensityOffsetCount-06511]] 7146e5c31af7Sopenharmony_ci If pname:fragmentDensityOffsetCount is not `0` and multiview is not 7147e5c31af7Sopenharmony_ci enabled for the render pass, pname:fragmentDensityOffsetCount must: 7148e5c31af7Sopenharmony_ci equal `1` 7149e5c31af7Sopenharmony_ci * [[VUID-VkSubpassFragmentDensityMapOffsetEndInfoQCOM-x-06512]] 7150e5c31af7Sopenharmony_ci The pname:x component of each element of pname:pFragmentDensityOffsets 7151e5c31af7Sopenharmony_ci must: be an integer multiple of 7152e5c31af7Sopenharmony_ci pname:fragmentDensityOffsetGranularity.width 7153e5c31af7Sopenharmony_ci * [[VUID-VkSubpassFragmentDensityMapOffsetEndInfoQCOM-y-06513]] 7154e5c31af7Sopenharmony_ci The pname:y component of each element of pname:pFragmentDensityOffsets 7155e5c31af7Sopenharmony_ci must: be an integer multiple of 7156e5c31af7Sopenharmony_ci pname:fragmentDensityOffsetGranularity.height 7157e5c31af7Sopenharmony_ci**** 7158e5c31af7Sopenharmony_ci 7159e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkSubpassFragmentDensityMapOffsetEndInfoQCOM.adoc[] 7160e5c31af7Sopenharmony_ci-- 7161e5c31af7Sopenharmony_ciendif::VK_QCOM_fragment_density_map_offset[] 7162e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_KHR_create_renderpass2[] 7163e5c31af7Sopenharmony_ci 7164e5c31af7Sopenharmony_ciifdef::VK_EXT_subpass_merge_feedback[] 7165e5c31af7Sopenharmony_ciinclude::{chapters}/VK_EXT_subpass_merge_feedback/renderpass.adoc[] 7166e5c31af7Sopenharmony_ciendif::VK_EXT_subpass_merge_feedback[] 7167e5c31af7Sopenharmony_ci 7168e5c31af7Sopenharmony_ci 7169e5c31af7Sopenharmony_ci 7170e5c31af7Sopenharmony_ci== Common Render Pass Data Races (Informative) 7171e5c31af7Sopenharmony_ci 7172e5c31af7Sopenharmony_ciDue to the complexity of how rendering is performed, there are several ways 7173e5c31af7Sopenharmony_cian application can accidentally introduce a data race, usually by doing 7174e5c31af7Sopenharmony_cisomething that may seem benign but actually cannot be supported. 7175e5c31af7Sopenharmony_ciThis section indicates a number of the more common cases as guidelines to 7176e5c31af7Sopenharmony_cihelp avoid them. 7177e5c31af7Sopenharmony_ci 7178e5c31af7Sopenharmony_ci 7179e5c31af7Sopenharmony_ci=== Sampling From a Read-only Attachment 7180e5c31af7Sopenharmony_ci 7181e5c31af7Sopenharmony_ciVulkan includes read-only layouts for depth/stencil images, that allow the 7182e5c31af7Sopenharmony_ciimages to be both read during a render pass for the purposes of 7183e5c31af7Sopenharmony_cidepth/stencil tests, and read as a non-attachment. 7184e5c31af7Sopenharmony_ci 7185e5c31af7Sopenharmony_ciHowever, because ename:VK_ATTACHMENT_STORE_OP_STORE and 7186e5c31af7Sopenharmony_ciename:VK_ATTACHMENT_STORE_OP_DONT_CARE may perform write operations, even if 7187e5c31af7Sopenharmony_cino recorded command writes to an attachment, reading from an image while 7188e5c31af7Sopenharmony_cialso using it as an attachment with these store operations can result in a 7189e5c31af7Sopenharmony_cidata race. 7190e5c31af7Sopenharmony_ciIf the reads from the non-attachment are performed in a fragment shader 7191e5c31af7Sopenharmony_ciwhere the accessed samples match those covered by the fragment shader, no 7192e5c31af7Sopenharmony_cidata race will occur as store operations are guaranteed to operate after 7193e5c31af7Sopenharmony_cifragment shader execution for the set of samples the fragment covers. 7194e5c31af7Sopenharmony_ciNotably, input attachments can also be used for this case. 7195e5c31af7Sopenharmony_ciReading other samples or in any other shader stage can result in unexpected 7196e5c31af7Sopenharmony_cibehavior due to the potential for a data race, and validation errors should 7197e5c31af7Sopenharmony_cibe generated for doing so. 7198e5c31af7Sopenharmony_ciIn practice, many applications have shipped reading samples outside of the 7199e5c31af7Sopenharmony_cicovered fragment without any observable issue, but there is no guarantee 7200e5c31af7Sopenharmony_cithat this will always work, and it is not advisable to rely on this in new 7201e5c31af7Sopenharmony_cior re-worked code bases. 7202e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_3,VK_EXT_load_store_op_none,VK_QCOM_render_pass_store_ops,VK_KHR_dynamic_rendering[] 7203e5c31af7Sopenharmony_ciAs ename:VK_ATTACHMENT_STORE_OP_NONE is guaranteed to perform no writes, 7204e5c31af7Sopenharmony_ciapplications wishing to read an image as both an attachment and a 7205e5c31af7Sopenharmony_cinon-attachment should make use of this store operation, coupled with a load 7206e5c31af7Sopenharmony_cioperation that also performs no writes. 7207e5c31af7Sopenharmony_ciendif::VK_VERSION_1_3,VK_EXT_load_store_op_none,VK_QCOM_render_pass_store_ops,VK_KHR_dynamic_rendering[] 7208e5c31af7Sopenharmony_ci 7209e5c31af7Sopenharmony_ci 7210e5c31af7Sopenharmony_ci=== Non-overlapping Access Between Resources 7211e5c31af7Sopenharmony_ci 7212e5c31af7Sopenharmony_ciWhen relying on non-overlapping accesses between attachments and other 7213e5c31af7Sopenharmony_ciresources, it is important to note that <<renderpass-load-operations, load>> 7214e5c31af7Sopenharmony_ciand <<renderpass-store-operations, store>> operations have fairly wide 7215e5c31af7Sopenharmony_cialignment requirements - potentially affecting entire subresources and 7216e5c31af7Sopenharmony_ciadjacent depth/stencil aspects. 7217e5c31af7Sopenharmony_ciThis makes it invalid to access a non-attachment subresource that is 7218e5c31af7Sopenharmony_cisimultaneously being used as an attachment where either access performs a 7219e5c31af7Sopenharmony_ciwrite operation. 7220e5c31af7Sopenharmony_ci 7221e5c31af7Sopenharmony_ciifdef::VK_EXT_attachment_feedback_loop_layout[] 7222e5c31af7Sopenharmony_ciThe only exception to this is if a subresource is in the 7223e5c31af7Sopenharmony_ciename:VK_IMAGE_LAYOUT_ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT image layout, in 7224e5c31af7Sopenharmony_ciwhich case the overlap is defined to occur at a per-pixel granularity, and 7225e5c31af7Sopenharmony_ciapplications can read data from pixels outside the render area without 7226e5c31af7Sopenharmony_ciintroducing a data race. 7227e5c31af7Sopenharmony_ciendif::VK_EXT_attachment_feedback_loop_layout[] 7228e5c31af7Sopenharmony_ci 7229e5c31af7Sopenharmony_ci 7230e5c31af7Sopenharmony_ci=== Depth/Stencil and Input Attachments 7231e5c31af7Sopenharmony_ci 7232e5c31af7Sopenharmony_ciWhen rendering to only the depth OR stencil aspect of an image, an input 7233e5c31af7Sopenharmony_ciattachment accessing the other aspect will 7234e5c31af7Sopenharmony_ciifndef::VK_KHR_maintenance2[] 7235e5c31af7Sopenharmony_cialways result in a data race. 7236e5c31af7Sopenharmony_ciendif::VK_KHR_maintenance2[] 7237e5c31af7Sopenharmony_ciifdef::VK_KHR_maintenance2[] 7238e5c31af7Sopenharmony_cinot cause a data race only under very specific conditions. 7239e5c31af7Sopenharmony_ciTo avoid a data race, the aspect not being written must be in a read-only 7240e5c31af7Sopenharmony_cilayout, and writes to it must be disabled in the draw state. 7241e5c31af7Sopenharmony_ciFor example, to read from stencil while writing depth, the attachment must 7242e5c31af7Sopenharmony_cibe in ename:VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL (or 7243e5c31af7Sopenharmony_ciequivalent), and the stencil write mask must be set to 0. 7244e5c31af7Sopenharmony_ciSimilarly to read from depth while writing stencil, the attachment must be 7245e5c31af7Sopenharmony_ciin ename:VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL (or 7246e5c31af7Sopenharmony_ciequivalent), and depth write enable must be set to ename:VK_FALSE. 7247e5c31af7Sopenharmony_ciendif::VK_KHR_maintenance2[] 7248e5c31af7Sopenharmony_ci 7249e5c31af7Sopenharmony_ci 7250e5c31af7Sopenharmony_ci=== Synchronization Options 7251e5c31af7Sopenharmony_ci 7252e5c31af7Sopenharmony_ciThere are several synchronization options available to synchronize between 7253e5c31af7Sopenharmony_ciaccesses to resources within a render pass. 7254e5c31af7Sopenharmony_ciSome of the options are outlined below: 7255e5c31af7Sopenharmony_ci 7256e5c31af7Sopenharmony_ci * A slink:VkSubpassDependency in a render pass object can synchronize 7257e5c31af7Sopenharmony_ci attachment writes and <<renderpass-resolve-operations, multisample 7258e5c31af7Sopenharmony_ci resolve operations>> from a prior subpass for subsequent input 7259e5c31af7Sopenharmony_ci attachment reads. 7260e5c31af7Sopenharmony_ci * A flink:vkCmdPipelineBarrier inside a subpass can synchronize prior 7261e5c31af7Sopenharmony_ci attachment writes in the subpass with subsequent input attachment reads. 7262e5c31af7Sopenharmony_ciifdef::VK_EXT_attachment_feedback_loop_layout[] 7263e5c31af7Sopenharmony_ci * A flink:vkCmdPipelineBarrier inside a subpass can synchronize prior 7264e5c31af7Sopenharmony_ci attachment writes in the subpass with subsequent non-attachment reads if 7265e5c31af7Sopenharmony_ci the attachment is in the 7266e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT image layout. 7267e5c31af7Sopenharmony_ciendif::VK_EXT_attachment_feedback_loop_layout[] 7268e5c31af7Sopenharmony_ciifdef::VK_EXT_rasterization_order_attachment_access,VK_ARM_rasterization_order_attachment_access[] 7269e5c31af7Sopenharmony_ci * If a subresource is used as a color and input attachment, and the 7270e5c31af7Sopenharmony_ci pipeline performing the read was created with 7271e5c31af7Sopenharmony_ci ename:VK_PIPELINE_COLOR_BLEND_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_BIT_EXT 7272e5c31af7Sopenharmony_ci * If a subresource is used as a depth and input attachment, and the 7273e5c31af7Sopenharmony_ci pipeline performing the read was created with 7274e5c31af7Sopenharmony_ci ename:VK_PIPELINE_DEPTH_STENCIL_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_DEPTH_ACCESS_BIT_EXT 7275e5c31af7Sopenharmony_ci * If a subresource is used as a stencil and input attachment, and the 7276e5c31af7Sopenharmony_ci pipeline performing the read was created with 7277e5c31af7Sopenharmony_ci ename:VK_PIPELINE_DEPTH_STENCIL_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_STENCIL_ACCESS_BIT_EXT 7278e5c31af7Sopenharmony_ciendif::VK_EXT_rasterization_order_attachment_access,VK_ARM_rasterization_order_attachment_access[] 7279e5c31af7Sopenharmony_ciifdef::VK_EXT_fragment_shader_interlock[] 7280e5c31af7Sopenharmony_ci * If a subresource is used as two separate non-attachment resources, 7281e5c31af7Sopenharmony_ci writes to a pixel or individual sample in a fragment shader can be 7282e5c31af7Sopenharmony_ci synchronized with access to the same pixel or sample in another fragment 7283e5c31af7Sopenharmony_ci shader by using one of the <<shaders-scope-fragment-interlock, fragment 7284e5c31af7Sopenharmony_ci interlock>> execution modes. 7285e5c31af7Sopenharmony_ciendif::VK_EXT_fragment_shader_interlock[] 7286