1e5c31af7Sopenharmony_ci// Copyright 2015-2021 The Khronos Group, Inc. 2e5c31af7Sopenharmony_ci// 3e5c31af7Sopenharmony_ci// SPDX-License-Identifier: CC-BY-4.0 4e5c31af7Sopenharmony_ci 5e5c31af7Sopenharmony_ci[[pipelines]] 6e5c31af7Sopenharmony_ci= Pipelines 7e5c31af7Sopenharmony_ci 8e5c31af7Sopenharmony_ciThe following <<pipelines-block-diagram,figure>> shows a block diagram of 9e5c31af7Sopenharmony_cithe Vulkan pipelines. 10e5c31af7Sopenharmony_ciSome Vulkan commands specify geometric objects to be drawn or computational 11e5c31af7Sopenharmony_ciwork to be performed, while others specify state controlling how objects are 12e5c31af7Sopenharmony_cihandled by the various pipeline stages, or control data transfer between 13e5c31af7Sopenharmony_cimemory organized as images and buffers. 14e5c31af7Sopenharmony_ciCommands are effectively sent through a processing pipeline, either a 15e5c31af7Sopenharmony_ci_graphics pipeline_, 16e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing,VK_KHR_ray_tracing_pipeline[] 17e5c31af7Sopenharmony_cia _ray tracing pipeline_, 18e5c31af7Sopenharmony_ciendif::VK_NV_ray_tracing,VK_KHR_ray_tracing_pipeline[] 19e5c31af7Sopenharmony_cior a _compute pipeline_. 20e5c31af7Sopenharmony_ci 21e5c31af7Sopenharmony_ciifdef::VK_NV_mesh_shader[] 22e5c31af7Sopenharmony_ciThe graphics pipeline can be operated in two modes, as either _primitive 23e5c31af7Sopenharmony_cishading_ or _mesh shading_ pipeline. 24e5c31af7Sopenharmony_ci 25e5c31af7Sopenharmony_ci*Primitive Shading* 26e5c31af7Sopenharmony_ci 27e5c31af7Sopenharmony_ciendif::VK_NV_mesh_shader[] 28e5c31af7Sopenharmony_ci 29e5c31af7Sopenharmony_ciThe first stage of the <<pipelines-graphics,graphics pipeline>> 30e5c31af7Sopenharmony_ci(<<drawing,Input Assembler>>) assembles vertices to form geometric 31e5c31af7Sopenharmony_ciprimitives such as points, lines, and triangles, based on a requested 32e5c31af7Sopenharmony_ciprimitive topology. 33e5c31af7Sopenharmony_ciIn the next stage (<<shaders-vertex,Vertex Shader>>) vertices can: be 34e5c31af7Sopenharmony_citransformed, computing positions and attributes for each vertex. 35e5c31af7Sopenharmony_ciIf <<tessellation,tessellation>> and/or <<geometry,geometry>> shaders are 36e5c31af7Sopenharmony_cisupported, they can: then generate multiple primitives from a single input 37e5c31af7Sopenharmony_ciprimitive, possibly changing the primitive topology or generating additional 38e5c31af7Sopenharmony_ciattribute data in the process. 39e5c31af7Sopenharmony_ci 40e5c31af7Sopenharmony_ciifdef::VK_NV_mesh_shader[] 41e5c31af7Sopenharmony_ci*Mesh Shading* 42e5c31af7Sopenharmony_ci 43e5c31af7Sopenharmony_ciWhen using the <<mesh,_mesh shading_>> pipeline input primitives are not 44e5c31af7Sopenharmony_ciassembled implicitly, but explicitly through the (<<shaders-mesh,Mesh 45e5c31af7Sopenharmony_ciShader>>). 46e5c31af7Sopenharmony_ciThe work on the mesh pipeline is initiated by the application 47e5c31af7Sopenharmony_ci<<drawing-mesh-shading,drawing>> a set of mesh tasks. 48e5c31af7Sopenharmony_ci 49e5c31af7Sopenharmony_ciIf an optional (<<shaders-task,Task Shader>>) is active, each task triggers 50e5c31af7Sopenharmony_cithe execution of a task shader workgroup that will generate a new set of 51e5c31af7Sopenharmony_citasks upon completion. 52e5c31af7Sopenharmony_ciEach of these spawned tasks, or each of the original dispatched tasks if no 53e5c31af7Sopenharmony_citask shader is present, triggers the execution of a mesh shader workgroup 54e5c31af7Sopenharmony_cithat produces an output mesh with a variable-sized number of primitives 55e5c31af7Sopenharmony_ciassembled from vertices stored in the output mesh. 56e5c31af7Sopenharmony_ci 57e5c31af7Sopenharmony_ci*Common* 58e5c31af7Sopenharmony_ciendif::VK_NV_mesh_shader[] 59e5c31af7Sopenharmony_ci 60e5c31af7Sopenharmony_ciThe final resulting primitives are <<vertexpostproc-clipping,clipped>> to a 61e5c31af7Sopenharmony_ciclip volume in preparation for the next stage, <<primsrast,Rasterization>>. 62e5c31af7Sopenharmony_ciThe rasterizer produces a series of _fragments_ associated with a region of 63e5c31af7Sopenharmony_cithe framebuffer, from a two-dimensional description of a point, line 64e5c31af7Sopenharmony_cisegment, or triangle. 65e5c31af7Sopenharmony_ciThese fragments are processed by <<fragops,fragment operations>> to 66e5c31af7Sopenharmony_cidetermine whether generated values will be written to the framebuffer. 67e5c31af7Sopenharmony_ci<<fragops-shader, Fragment shading>> determines the values to be written to 68e5c31af7Sopenharmony_cithe framebuffer attachments. 69e5c31af7Sopenharmony_ciFramebuffer operations then read and write the color and depth/stencil 70e5c31af7Sopenharmony_ciattachments of the framebuffer for a given subpass of a <<renderpass,render 71e5c31af7Sopenharmony_cipass instance>>. 72e5c31af7Sopenharmony_ciThe attachments can: be used as input attachments in the fragment shader in 73e5c31af7Sopenharmony_cia later subpass of the same render pass. 74e5c31af7Sopenharmony_ci 75e5c31af7Sopenharmony_ciThe <<pipelines-compute,compute pipeline>> is a separate pipeline from the 76e5c31af7Sopenharmony_cigraphics pipeline, which operates on one-, two-, or three-dimensional 77e5c31af7Sopenharmony_ciworkgroups which can: read from and write to buffer and image memory. 78e5c31af7Sopenharmony_ci 79e5c31af7Sopenharmony_ciThis ordering is meant only as a tool for describing Vulkan, not as a strict 80e5c31af7Sopenharmony_cirule of how Vulkan is implemented, and we present it only as a means to 81e5c31af7Sopenharmony_ciorganize the various operations of the pipelines. 82e5c31af7Sopenharmony_ciActual ordering guarantees between pipeline stages are explained in detail 83e5c31af7Sopenharmony_ciin the <<synchronization-pipeline-stages-order, synchronization chapter>>. 84e5c31af7Sopenharmony_ci 85e5c31af7Sopenharmony_ci[[pipelines-block-diagram]] 86e5c31af7Sopenharmony_ciifndef::VK_NV_mesh_shader[] 87e5c31af7Sopenharmony_ciimage::{images}/pipeline.svg[title="Block diagram of the Vulkan pipeline",align="center",opts="{imageopts}"] 88e5c31af7Sopenharmony_ciendif::VK_NV_mesh_shader[] 89e5c31af7Sopenharmony_ciifdef::VK_NV_mesh_shader[] 90e5c31af7Sopenharmony_ciimage::{images}/pipelinemesh.svg[title="Block diagram of the Vulkan pipeline",align="center",opts="{imageopts}"] 91e5c31af7Sopenharmony_ciendif::VK_NV_mesh_shader[] 92e5c31af7Sopenharmony_ci 93e5c31af7Sopenharmony_ciEach pipeline is controlled by a monolithic object created from a 94e5c31af7Sopenharmony_cidescription of all of the shader stages and any relevant fixed-function 95e5c31af7Sopenharmony_cistages. 96e5c31af7Sopenharmony_ci<<interfaces,Linking>> the whole pipeline together allows the optimization 97e5c31af7Sopenharmony_ciof shaders based on their input/outputs and eliminates expensive draw time 98e5c31af7Sopenharmony_cistate validation. 99e5c31af7Sopenharmony_ci 100e5c31af7Sopenharmony_ciA pipeline object is bound to the current state using 101e5c31af7Sopenharmony_ciflink:vkCmdBindPipeline. 102e5c31af7Sopenharmony_ciAny pipeline object state that is specified as <<pipelines-dynamic-state, 103e5c31af7Sopenharmony_cidynamic>> is not applied to the current state when the pipeline object is 104e5c31af7Sopenharmony_cibound, but is instead set by dynamic state setting commands. 105e5c31af7Sopenharmony_ci 106e5c31af7Sopenharmony_ciNo state, including dynamic state, is inherited from one command buffer to 107e5c31af7Sopenharmony_cianother. 108e5c31af7Sopenharmony_ci 109e5c31af7Sopenharmony_ci 110e5c31af7Sopenharmony_ci[open,refpage='VkPipeline',desc='Opaque handle to a pipeline object',type='handles'] 111e5c31af7Sopenharmony_ci-- 112e5c31af7Sopenharmony_ciCompute, 113e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing,VK_KHR_ray_tracing_pipeline[] 114e5c31af7Sopenharmony_ciray tracing, 115e5c31af7Sopenharmony_ciendif::VK_NV_ray_tracing,VK_KHR_ray_tracing_pipeline[] 116e5c31af7Sopenharmony_ciand graphics pipelines are each represented by sname:VkPipeline handles: 117e5c31af7Sopenharmony_ci 118e5c31af7Sopenharmony_ciinclude::{generated}/api/handles/VkPipeline.txt[] 119e5c31af7Sopenharmony_ci-- 120e5c31af7Sopenharmony_ci 121e5c31af7Sopenharmony_ci 122e5c31af7Sopenharmony_ci[[pipelines-compute]] 123e5c31af7Sopenharmony_ci== Compute Pipelines 124e5c31af7Sopenharmony_ci 125e5c31af7Sopenharmony_ciCompute pipelines consist of a single static compute shader stage and the 126e5c31af7Sopenharmony_cipipeline layout. 127e5c31af7Sopenharmony_ci 128e5c31af7Sopenharmony_ciThe compute pipeline represents a compute shader and is created by calling 129e5c31af7Sopenharmony_cifname:vkCreateComputePipelines with pname:module and pname:pName selecting 130e5c31af7Sopenharmony_cian entry point from a shader module, where that entry point defines a valid 131e5c31af7Sopenharmony_cicompute shader, in the slink:VkPipelineShaderStageCreateInfo structure 132e5c31af7Sopenharmony_cicontained within the slink:VkComputePipelineCreateInfo structure. 133e5c31af7Sopenharmony_ci 134e5c31af7Sopenharmony_ci[open,refpage='vkCreateComputePipelines',desc='Creates a new compute pipeline object',type='protos'] 135e5c31af7Sopenharmony_ci-- 136e5c31af7Sopenharmony_ciTo create compute pipelines, call: 137e5c31af7Sopenharmony_ci 138e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCreateComputePipelines.txt[] 139e5c31af7Sopenharmony_ci 140e5c31af7Sopenharmony_ci * pname:device is the logical device that creates the compute pipelines. 141e5c31af7Sopenharmony_ci * pname:pipelineCache is either dlink:VK_NULL_HANDLE, indicating that 142e5c31af7Sopenharmony_ci pipeline caching is disabled; or the handle of a valid 143e5c31af7Sopenharmony_ci <<pipelines-cache,pipeline cache>> object, in which case use of that 144e5c31af7Sopenharmony_ci cache is enabled for the duration of the command. 145e5c31af7Sopenharmony_ci * pname:createInfoCount is the length of the pname:pCreateInfos and 146e5c31af7Sopenharmony_ci pname:pPipelines arrays. 147e5c31af7Sopenharmony_ci * pname:pCreateInfos is a pointer to an array of 148e5c31af7Sopenharmony_ci slink:VkComputePipelineCreateInfo structures. 149e5c31af7Sopenharmony_ci * pname:pAllocator controls host memory allocation as described in the 150e5c31af7Sopenharmony_ci <<memory-allocation, Memory Allocation>> chapter. 151e5c31af7Sopenharmony_ci * pname:pPipelines is a pointer to an array of slink:VkPipeline handles in 152e5c31af7Sopenharmony_ci which the resulting compute pipeline objects are returned. 153e5c31af7Sopenharmony_ciifdef::editing-notes[] 154e5c31af7Sopenharmony_ci+ 155e5c31af7Sopenharmony_ci[NOTE] 156e5c31af7Sopenharmony_ci.editing-note 157e5c31af7Sopenharmony_ci==== 158e5c31af7Sopenharmony_ciTODO (Jon) - Should we say something like "`the i'th element of the 159e5c31af7Sopenharmony_cipname:pPipelines array is created based on the corresponding element of the 160e5c31af7Sopenharmony_cipname:pCreateInfos array`"? Also for flink:vkCreateGraphicsPipelines below. 161e5c31af7Sopenharmony_ci==== 162e5c31af7Sopenharmony_ciendif::editing-notes[] 163e5c31af7Sopenharmony_ci 164e5c31af7Sopenharmony_ci.Valid Usage 165e5c31af7Sopenharmony_ci**** 166e5c31af7Sopenharmony_ci * [[VUID-vkCreateComputePipelines-flags-00695]] 167e5c31af7Sopenharmony_ci If the pname:flags member of any element of pname:pCreateInfos contains 168e5c31af7Sopenharmony_ci the ename:VK_PIPELINE_CREATE_DERIVATIVE_BIT flag, and the 169e5c31af7Sopenharmony_ci pname:basePipelineIndex member of that same element is not `-1`, 170e5c31af7Sopenharmony_ci pname:basePipelineIndex must: be less than the index into 171e5c31af7Sopenharmony_ci pname:pCreateInfos that corresponds to that element 172e5c31af7Sopenharmony_ci * [[VUID-vkCreateComputePipelines-flags-00696]] 173e5c31af7Sopenharmony_ci If the pname:flags member of any element of pname:pCreateInfos contains 174e5c31af7Sopenharmony_ci the ename:VK_PIPELINE_CREATE_DERIVATIVE_BIT flag, the base pipeline 175e5c31af7Sopenharmony_ci must: have been created with the 176e5c31af7Sopenharmony_ci ename:VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT flag set 177e5c31af7Sopenharmony_ciifdef::VK_EXT_pipeline_creation_cache_control[] 178e5c31af7Sopenharmony_ci * [[VUID-vkCreateComputePipelines-pipelineCache-02873]] 179e5c31af7Sopenharmony_ci If pname:pipelineCache was created with 180e5c31af7Sopenharmony_ci ename:VK_PIPELINE_CACHE_CREATE_EXTERNALLY_SYNCHRONIZED_BIT_EXT, host 181e5c31af7Sopenharmony_ci access to pname:pipelineCache must: be 182e5c31af7Sopenharmony_ci <<fundamentals-threadingbehavior,externally synchronized>> 183e5c31af7Sopenharmony_ciendif::VK_EXT_pipeline_creation_cache_control[] 184e5c31af7Sopenharmony_ci**** 185e5c31af7Sopenharmony_ci 186e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCreateComputePipelines.txt[] 187e5c31af7Sopenharmony_ci-- 188e5c31af7Sopenharmony_ci 189e5c31af7Sopenharmony_ci[open,refpage='VkComputePipelineCreateInfo',desc='Structure specifying parameters of a newly created compute pipeline',type='structs'] 190e5c31af7Sopenharmony_ci-- 191e5c31af7Sopenharmony_ciThe sname:VkComputePipelineCreateInfo structure is defined as: 192e5c31af7Sopenharmony_ci 193e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkComputePipelineCreateInfo.txt[] 194e5c31af7Sopenharmony_ci 195e5c31af7Sopenharmony_ci * pname:sType is the type of this structure. 196e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 197e5c31af7Sopenharmony_ci structure. 198e5c31af7Sopenharmony_ci * pname:flags is a bitmask of elink:VkPipelineCreateFlagBits specifying 199e5c31af7Sopenharmony_ci how the pipeline will be generated. 200e5c31af7Sopenharmony_ci * pname:stage is a slink:VkPipelineShaderStageCreateInfo structure 201e5c31af7Sopenharmony_ci describing the compute shader. 202e5c31af7Sopenharmony_ci * pname:layout is the description of binding locations used by both the 203e5c31af7Sopenharmony_ci pipeline and descriptor sets used with the pipeline. 204e5c31af7Sopenharmony_ci * pname:basePipelineHandle is a pipeline to derive from 205e5c31af7Sopenharmony_ci * pname:basePipelineIndex is an index into the pname:pCreateInfos 206e5c31af7Sopenharmony_ci parameter to use as a pipeline to derive from 207e5c31af7Sopenharmony_ci 208e5c31af7Sopenharmony_ciThe parameters pname:basePipelineHandle and pname:basePipelineIndex are 209e5c31af7Sopenharmony_cidescribed in more detail in <<pipelines-pipeline-derivatives,Pipeline 210e5c31af7Sopenharmony_ciDerivatives>>. 211e5c31af7Sopenharmony_ci 212e5c31af7Sopenharmony_ci.Valid Usage 213e5c31af7Sopenharmony_ci**** 214e5c31af7Sopenharmony_ci * [[VUID-VkComputePipelineCreateInfo-flags-00697]] 215e5c31af7Sopenharmony_ci If pname:flags contains the ename:VK_PIPELINE_CREATE_DERIVATIVE_BIT 216e5c31af7Sopenharmony_ci flag, and pname:basePipelineIndex is -1, pname:basePipelineHandle must: 217e5c31af7Sopenharmony_ci be a valid handle to a compute sname:VkPipeline 218e5c31af7Sopenharmony_ci * [[VUID-VkComputePipelineCreateInfo-flags-00698]] 219e5c31af7Sopenharmony_ci If pname:flags contains the ename:VK_PIPELINE_CREATE_DERIVATIVE_BIT 220e5c31af7Sopenharmony_ci flag, and pname:basePipelineHandle is dlink:VK_NULL_HANDLE, 221e5c31af7Sopenharmony_ci pname:basePipelineIndex must: be a valid index into the calling 222e5c31af7Sopenharmony_ci command's pname:pCreateInfos parameter 223e5c31af7Sopenharmony_ci * [[VUID-VkComputePipelineCreateInfo-flags-00699]] 224e5c31af7Sopenharmony_ci If pname:flags contains the ename:VK_PIPELINE_CREATE_DERIVATIVE_BIT 225e5c31af7Sopenharmony_ci flag, and pname:basePipelineIndex is not -1, pname:basePipelineHandle 226e5c31af7Sopenharmony_ci must: be dlink:VK_NULL_HANDLE 227e5c31af7Sopenharmony_ci * [[VUID-VkComputePipelineCreateInfo-flags-00700]] 228e5c31af7Sopenharmony_ci If pname:flags contains the ename:VK_PIPELINE_CREATE_DERIVATIVE_BIT 229e5c31af7Sopenharmony_ci flag, and pname:basePipelineHandle is not dlink:VK_NULL_HANDLE, 230e5c31af7Sopenharmony_ci pname:basePipelineIndex must: be -1 231e5c31af7Sopenharmony_ci * [[VUID-VkComputePipelineCreateInfo-stage-00701]] 232e5c31af7Sopenharmony_ci The pname:stage member of pname:stage must: be 233e5c31af7Sopenharmony_ci ename:VK_SHADER_STAGE_COMPUTE_BIT 234e5c31af7Sopenharmony_ci * [[VUID-VkComputePipelineCreateInfo-stage-00702]] 235e5c31af7Sopenharmony_ci The shader code for the entry point identified by pname:stage and the 236e5c31af7Sopenharmony_ci rest of the state identified by this structure must: adhere to the 237e5c31af7Sopenharmony_ci pipeline linking rules described in the <<interfaces,Shader Interfaces>> 238e5c31af7Sopenharmony_ci chapter 239e5c31af7Sopenharmony_ci * [[VUID-VkComputePipelineCreateInfo-layout-00703]] 240e5c31af7Sopenharmony_ci pname:layout must: be 241e5c31af7Sopenharmony_ci <<descriptorsets-pipelinelayout-consistency,consistent>> with the layout 242e5c31af7Sopenharmony_ci of the compute shader specified in pname:stage 243e5c31af7Sopenharmony_ci * [[VUID-VkComputePipelineCreateInfo-layout-01687]] 244e5c31af7Sopenharmony_ci The number of resources in pname:layout accessible to the compute shader 245e5c31af7Sopenharmony_ci stage must: be less than or equal to 246e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceLimits::pname:maxPerStageResources 247e5c31af7Sopenharmony_ciifdef::VK_KHR_pipeline_library[] 248e5c31af7Sopenharmony_ci * [[VUID-VkComputePipelineCreateInfo-flags-03364]] 249e5c31af7Sopenharmony_ci pname:flags must: not include ename:VK_PIPELINE_CREATE_LIBRARY_BIT_KHR 250e5c31af7Sopenharmony_ciendif::VK_KHR_pipeline_library[] 251e5c31af7Sopenharmony_ciifdef::VK_KHR_ray_tracing_pipeline[] 252e5c31af7Sopenharmony_ci * [[VUID-VkComputePipelineCreateInfo-flags-03365]] 253e5c31af7Sopenharmony_ci pname:flags must: not include 254e5c31af7Sopenharmony_ci ename:VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_ANY_HIT_SHADERS_BIT_KHR 255e5c31af7Sopenharmony_ci * [[VUID-VkComputePipelineCreateInfo-flags-03366]] 256e5c31af7Sopenharmony_ci pname:flags must: not include 257e5c31af7Sopenharmony_ci ename:VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_CLOSEST_HIT_SHADERS_BIT_KHR 258e5c31af7Sopenharmony_ci * [[VUID-VkComputePipelineCreateInfo-flags-03367]] 259e5c31af7Sopenharmony_ci pname:flags must: not include 260e5c31af7Sopenharmony_ci ename:VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_MISS_SHADERS_BIT_KHR 261e5c31af7Sopenharmony_ci * [[VUID-VkComputePipelineCreateInfo-flags-03368]] 262e5c31af7Sopenharmony_ci pname:flags must: not include 263e5c31af7Sopenharmony_ci ename:VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_INTERSECTION_SHADERS_BIT_KHR 264e5c31af7Sopenharmony_ci * [[VUID-VkComputePipelineCreateInfo-flags-03369]] 265e5c31af7Sopenharmony_ci pname:flags must: not include 266e5c31af7Sopenharmony_ci ename:VK_PIPELINE_CREATE_RAY_TRACING_SKIP_TRIANGLES_BIT_KHR 267e5c31af7Sopenharmony_ci * [[VUID-VkComputePipelineCreateInfo-flags-03370]] 268e5c31af7Sopenharmony_ci pname:flags must: not include 269e5c31af7Sopenharmony_ci ename:VK_PIPELINE_CREATE_RAY_TRACING_SKIP_AABBS_BIT_KHR 270e5c31af7Sopenharmony_ci * [[VUID-VkComputePipelineCreateInfo-flags-03576]] 271e5c31af7Sopenharmony_ci pname:flags must: not include 272e5c31af7Sopenharmony_ci ename:VK_PIPELINE_CREATE_RAY_TRACING_SHADER_GROUP_HANDLE_CAPTURE_REPLAY_BIT_KHR 273e5c31af7Sopenharmony_ciendif::VK_KHR_ray_tracing_pipeline[] 274e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing_motion_blur[] 275e5c31af7Sopenharmony_ci * [[VUID-VkComputePipelineCreateInfo-flags-04945]] 276e5c31af7Sopenharmony_ci pname:flags must: not include 277e5c31af7Sopenharmony_ci ename:VK_PIPELINE_CREATE_RAY_TRACING_ALLOW_MOTION_BIT_NV 278e5c31af7Sopenharmony_ciendif::VK_NV_ray_tracing_motion_blur[] 279e5c31af7Sopenharmony_ciifdef::VK_NV_device_generated_commands[] 280e5c31af7Sopenharmony_ci * [[VUID-VkComputePipelineCreateInfo-flags-02874]] 281e5c31af7Sopenharmony_ci pname:flags must: not include 282e5c31af7Sopenharmony_ci ename:VK_PIPELINE_CREATE_INDIRECT_BINDABLE_BIT_NV 283e5c31af7Sopenharmony_ciendif::VK_NV_device_generated_commands[] 284e5c31af7Sopenharmony_ciifdef::VK_EXT_pipeline_creation_cache_control[] 285e5c31af7Sopenharmony_ci * [[VUID-VkComputePipelineCreateInfo-pipelineCreationCacheControl-02875]] 286e5c31af7Sopenharmony_ci If the <<features-pipelineCreationCacheControl, 287e5c31af7Sopenharmony_ci pname:pipelineCreationCacheControl>> feature is not enabled, pname:flags 288e5c31af7Sopenharmony_ci must: not include 289e5c31af7Sopenharmony_ci ename:VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT_EXT or 290e5c31af7Sopenharmony_ci ename:VK_PIPELINE_CREATE_EARLY_RETURN_ON_FAILURE_BIT_EXT 291e5c31af7Sopenharmony_ciendif::VK_EXT_pipeline_creation_cache_control[] 292e5c31af7Sopenharmony_ci**** 293e5c31af7Sopenharmony_ci 294e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkComputePipelineCreateInfo.txt[] 295e5c31af7Sopenharmony_ci-- 296e5c31af7Sopenharmony_ci 297e5c31af7Sopenharmony_ci[open,refpage='VkPipelineShaderStageCreateInfo',desc='Structure specifying parameters of a newly created pipeline shader stage',type='structs'] 298e5c31af7Sopenharmony_ci-- 299e5c31af7Sopenharmony_ciThe sname:VkPipelineShaderStageCreateInfo structure is defined as: 300e5c31af7Sopenharmony_ci 301e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkPipelineShaderStageCreateInfo.txt[] 302e5c31af7Sopenharmony_ci 303e5c31af7Sopenharmony_ci * pname:sType is the type of this structure. 304e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 305e5c31af7Sopenharmony_ci structure. 306e5c31af7Sopenharmony_ci * pname:flags is a bitmask of elink:VkPipelineShaderStageCreateFlagBits 307e5c31af7Sopenharmony_ci specifying how the pipeline shader stage will be generated. 308e5c31af7Sopenharmony_ci * pname:stage is a elink:VkShaderStageFlagBits value specifying a single 309e5c31af7Sopenharmony_ci pipeline stage. 310e5c31af7Sopenharmony_ci * pname:module is a slink:VkShaderModule object containing the shader for 311e5c31af7Sopenharmony_ci this stage. 312e5c31af7Sopenharmony_ci * pname:pName is a pointer to a null-terminated UTF-8 string specifying 313e5c31af7Sopenharmony_ci the entry point name of the shader for this stage. 314e5c31af7Sopenharmony_ci * pname:pSpecializationInfo is a pointer to a slink:VkSpecializationInfo 315e5c31af7Sopenharmony_ci structure, as described in 316e5c31af7Sopenharmony_ci <<pipelines-specialization-constants,Specialization Constants>>, or 317e5c31af7Sopenharmony_ci `NULL`. 318e5c31af7Sopenharmony_ci 319e5c31af7Sopenharmony_ci.Valid Usage 320e5c31af7Sopenharmony_ci**** 321e5c31af7Sopenharmony_ci * [[VUID-VkPipelineShaderStageCreateInfo-stage-00704]] 322e5c31af7Sopenharmony_ci If the <<features-geometryShader,geometry shaders>> feature is not 323e5c31af7Sopenharmony_ci enabled, pname:stage must: not be ename:VK_SHADER_STAGE_GEOMETRY_BIT 324e5c31af7Sopenharmony_ci * [[VUID-VkPipelineShaderStageCreateInfo-stage-00705]] 325e5c31af7Sopenharmony_ci If the <<features-tessellationShader,tessellation shaders>> feature is 326e5c31af7Sopenharmony_ci not enabled, pname:stage must: not be 327e5c31af7Sopenharmony_ci ename:VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT or 328e5c31af7Sopenharmony_ci ename:VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT 329e5c31af7Sopenharmony_ciifdef::VK_NV_mesh_shader[] 330e5c31af7Sopenharmony_ci * [[VUID-VkPipelineShaderStageCreateInfo-stage-02091]] 331e5c31af7Sopenharmony_ci If the <<features-meshShader,mesh shader>> feature is not enabled, 332e5c31af7Sopenharmony_ci pname:stage must: not be ename:VK_SHADER_STAGE_MESH_BIT_NV 333e5c31af7Sopenharmony_ci * [[VUID-VkPipelineShaderStageCreateInfo-stage-02092]] 334e5c31af7Sopenharmony_ci If the <<features-taskShader,task shader>> feature is not enabled, 335e5c31af7Sopenharmony_ci pname:stage must: not be ename:VK_SHADER_STAGE_TASK_BIT_NV 336e5c31af7Sopenharmony_ciendif::VK_NV_mesh_shader[] 337e5c31af7Sopenharmony_ci * [[VUID-VkPipelineShaderStageCreateInfo-stage-00706]] 338e5c31af7Sopenharmony_ci pname:stage must: not be ename:VK_SHADER_STAGE_ALL_GRAPHICS, or 339e5c31af7Sopenharmony_ci ename:VK_SHADER_STAGE_ALL 340e5c31af7Sopenharmony_ci * [[VUID-VkPipelineShaderStageCreateInfo-pName-00707]] 341e5c31af7Sopenharmony_ci pname:pName must: be the name of an code:OpEntryPoint in pname:module 342e5c31af7Sopenharmony_ci with an execution model that matches pname:stage 343e5c31af7Sopenharmony_ci * [[VUID-VkPipelineShaderStageCreateInfo-maxClipDistances-00708]] 344e5c31af7Sopenharmony_ci If the identified entry point includes any variable in its interface 345e5c31af7Sopenharmony_ci that is declared with the code:ClipDistance code:BuiltIn decoration, 346e5c31af7Sopenharmony_ci that variable must: not have an array size greater than 347e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceLimits::pname:maxClipDistances 348e5c31af7Sopenharmony_ci * [[VUID-VkPipelineShaderStageCreateInfo-maxCullDistances-00709]] 349e5c31af7Sopenharmony_ci If the identified entry point includes any variable in its interface 350e5c31af7Sopenharmony_ci that is declared with the code:CullDistance code:BuiltIn decoration, 351e5c31af7Sopenharmony_ci that variable must: not have an array size greater than 352e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceLimits::pname:maxCullDistances 353e5c31af7Sopenharmony_ci * [[VUID-VkPipelineShaderStageCreateInfo-maxCombinedClipAndCullDistances-00710]] 354e5c31af7Sopenharmony_ci If the identified entry point includes any variables in its interface 355e5c31af7Sopenharmony_ci that are declared with the code:ClipDistance or code:CullDistance 356e5c31af7Sopenharmony_ci code:BuiltIn decoration, those variables must: not have array sizes 357e5c31af7Sopenharmony_ci which sum to more than 358e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceLimits::pname:maxCombinedClipAndCullDistances 359e5c31af7Sopenharmony_ci * [[VUID-VkPipelineShaderStageCreateInfo-maxSampleMaskWords-00711]] 360e5c31af7Sopenharmony_ci If the identified entry point includes any variable in its interface 361e5c31af7Sopenharmony_ci that is declared with the code:SampleMask code:BuiltIn decoration, that 362e5c31af7Sopenharmony_ci variable must: not have an array size greater than 363e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceLimits::pname:maxSampleMaskWords 364e5c31af7Sopenharmony_ci * [[VUID-VkPipelineShaderStageCreateInfo-stage-00712]] 365e5c31af7Sopenharmony_ci If pname:stage is ename:VK_SHADER_STAGE_VERTEX_BIT, the identified entry 366e5c31af7Sopenharmony_ci point must: not include any input variable in its interface that is 367e5c31af7Sopenharmony_ci decorated with code:CullDistance 368e5c31af7Sopenharmony_ci * [[VUID-VkPipelineShaderStageCreateInfo-stage-00713]] 369e5c31af7Sopenharmony_ci If pname:stage is ename:VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT or 370e5c31af7Sopenharmony_ci ename:VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT, and the identified 371e5c31af7Sopenharmony_ci entry point has an code:OpExecutionMode instruction specifying a patch 372e5c31af7Sopenharmony_ci size with code:OutputVertices, the patch size must: be greater than `0` 373e5c31af7Sopenharmony_ci and less than or equal to 374e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceLimits::pname:maxTessellationPatchSize 375e5c31af7Sopenharmony_ci * [[VUID-VkPipelineShaderStageCreateInfo-stage-00714]] 376e5c31af7Sopenharmony_ci If pname:stage is ename:VK_SHADER_STAGE_GEOMETRY_BIT, the identified 377e5c31af7Sopenharmony_ci entry point must: have an code:OpExecutionMode instruction specifying a 378e5c31af7Sopenharmony_ci maximum output vertex count that is greater than `0` and less than or 379e5c31af7Sopenharmony_ci equal to sname:VkPhysicalDeviceLimits::pname:maxGeometryOutputVertices 380e5c31af7Sopenharmony_ci * [[VUID-VkPipelineShaderStageCreateInfo-stage-00715]] 381e5c31af7Sopenharmony_ci If pname:stage is ename:VK_SHADER_STAGE_GEOMETRY_BIT, the identified 382e5c31af7Sopenharmony_ci entry point must: have an code:OpExecutionMode instruction specifying an 383e5c31af7Sopenharmony_ci invocation count that is greater than `0` and less than or equal to 384e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceLimits::pname:maxGeometryShaderInvocations 385e5c31af7Sopenharmony_ci * [[VUID-VkPipelineShaderStageCreateInfo-stage-02596]] 386e5c31af7Sopenharmony_ci If pname:stage is a 387e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-pre-rasterization,pre-rasterization shader 388e5c31af7Sopenharmony_ci stage>>, and the identified entry point writes to code:Layer for any 389e5c31af7Sopenharmony_ci primitive, it must: write the same value to code:Layer for all vertices 390e5c31af7Sopenharmony_ci of a given primitive 391e5c31af7Sopenharmony_ci * [[VUID-VkPipelineShaderStageCreateInfo-stage-02597]] 392e5c31af7Sopenharmony_ci If pname:stage is a 393e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-pre-rasterization,pre-rasterization shader 394e5c31af7Sopenharmony_ci stage>>, and the identified entry point writes to code:ViewportIndex for 395e5c31af7Sopenharmony_ci any primitive, it must: write the same value to code:ViewportIndex for 396e5c31af7Sopenharmony_ci all vertices of a given primitive 397e5c31af7Sopenharmony_ci * [[VUID-VkPipelineShaderStageCreateInfo-stage-00718]] 398e5c31af7Sopenharmony_ci If pname:stage is ename:VK_SHADER_STAGE_FRAGMENT_BIT, the identified 399e5c31af7Sopenharmony_ci entry point must: not include any output variables in its interface 400e5c31af7Sopenharmony_ci decorated with code:CullDistance 401e5c31af7Sopenharmony_ci * [[VUID-VkPipelineShaderStageCreateInfo-stage-00719]] 402e5c31af7Sopenharmony_ci If pname:stage is ename:VK_SHADER_STAGE_FRAGMENT_BIT, and the identified 403e5c31af7Sopenharmony_ci entry point writes to code:FragDepth in any execution path, it must: 404e5c31af7Sopenharmony_ci write to code:FragDepth in all execution paths 405e5c31af7Sopenharmony_ciifdef::VK_EXT_shader_stencil_export[] 406e5c31af7Sopenharmony_ci * [[VUID-VkPipelineShaderStageCreateInfo-stage-01511]] 407e5c31af7Sopenharmony_ci If pname:stage is ename:VK_SHADER_STAGE_FRAGMENT_BIT, and the identified 408e5c31af7Sopenharmony_ci entry point writes to code:FragStencilRefEXT in any execution path, it 409e5c31af7Sopenharmony_ci must: write to code:FragStencilRefEXT in all execution paths 410e5c31af7Sopenharmony_ciendif::VK_EXT_shader_stencil_export[] 411e5c31af7Sopenharmony_ciifdef::VK_NV_mesh_shader[] 412e5c31af7Sopenharmony_ci * [[VUID-VkPipelineShaderStageCreateInfo-stage-02093]] 413e5c31af7Sopenharmony_ci If pname:stage is ename:VK_SHADER_STAGE_MESH_BIT_NV, the identified 414e5c31af7Sopenharmony_ci entry point must: have an code:OpExecutionMode instruction specifying a 415e5c31af7Sopenharmony_ci maximum output vertex count, code:OutputVertices, that is greater than 416e5c31af7Sopenharmony_ci `0` and less than or equal to 417e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceMeshShaderPropertiesNV::pname:maxMeshOutputVertices 418e5c31af7Sopenharmony_ci * [[VUID-VkPipelineShaderStageCreateInfo-stage-02094]] 419e5c31af7Sopenharmony_ci If pname:stage is ename:VK_SHADER_STAGE_MESH_BIT_NV, the identified 420e5c31af7Sopenharmony_ci entry point must: have an code:OpExecutionMode instruction specifying a 421e5c31af7Sopenharmony_ci maximum output primitive count, code:OutputPrimitivesNV, that is greater 422e5c31af7Sopenharmony_ci than `0` and less than or equal to 423e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceMeshShaderPropertiesNV::pname:maxMeshOutputPrimitives 424e5c31af7Sopenharmony_ciendif::VK_NV_mesh_shader[] 425e5c31af7Sopenharmony_ciifdef::VK_EXT_subgroup_size_control[] 426e5c31af7Sopenharmony_ci * [[VUID-VkPipelineShaderStageCreateInfo-flags-02784]] 427e5c31af7Sopenharmony_ci If pname:flags has the 428e5c31af7Sopenharmony_ci ename:VK_PIPELINE_SHADER_STAGE_CREATE_ALLOW_VARYING_SUBGROUP_SIZE_BIT_EXT 429e5c31af7Sopenharmony_ci flag set, the <<features-subgroupSizeControl, 430e5c31af7Sopenharmony_ci pname:subgroupSizeControl>> feature must: be enabled 431e5c31af7Sopenharmony_ci * [[VUID-VkPipelineShaderStageCreateInfo-flags-02785]] 432e5c31af7Sopenharmony_ci If pname:flags has the 433e5c31af7Sopenharmony_ci ename:VK_PIPELINE_SHADER_STAGE_CREATE_REQUIRE_FULL_SUBGROUPS_BIT_EXT 434e5c31af7Sopenharmony_ci flag set, the <<features-computeFullSubgroups, 435e5c31af7Sopenharmony_ci pname:computeFullSubgroups>> feature must: be enabled 436e5c31af7Sopenharmony_ci * [[VUID-VkPipelineShaderStageCreateInfo-pNext-02754]] 437e5c31af7Sopenharmony_ci If a slink:VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT 438e5c31af7Sopenharmony_ci structure is included in the pname:pNext chain, pname:flags must: not 439e5c31af7Sopenharmony_ci have the 440e5c31af7Sopenharmony_ci ename:VK_PIPELINE_SHADER_STAGE_CREATE_ALLOW_VARYING_SUBGROUP_SIZE_BIT_EXT 441e5c31af7Sopenharmony_ci flag set 442e5c31af7Sopenharmony_ci * [[VUID-VkPipelineShaderStageCreateInfo-pNext-02755]] 443e5c31af7Sopenharmony_ci If a slink:VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT 444e5c31af7Sopenharmony_ci structure is included in the pname:pNext chain, the 445e5c31af7Sopenharmony_ci <<features-subgroupSizeControl, pname:subgroupSizeControl>> feature 446e5c31af7Sopenharmony_ci must: be enabled, and pname:stage must: be a valid bit specified in 447e5c31af7Sopenharmony_ci <<limits-required-subgroup-size-stages, 448e5c31af7Sopenharmony_ci pname:requiredSubgroupSizeStages>> 449e5c31af7Sopenharmony_ci * [[VUID-VkPipelineShaderStageCreateInfo-pNext-02756]] 450e5c31af7Sopenharmony_ci If a slink:VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT 451e5c31af7Sopenharmony_ci structure is included in the pname:pNext chain and pname:stage is 452e5c31af7Sopenharmony_ci ename:VK_SHADER_STAGE_COMPUTE_BIT, the local workgroup size of the 453e5c31af7Sopenharmony_ci shader must: be less than or equal to the product of 454e5c31af7Sopenharmony_ci slink:VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT::pname:requiredSubgroupSize 455e5c31af7Sopenharmony_ci and 456e5c31af7Sopenharmony_ci <<limits-max-subgroups-per-workgroup,pname:maxComputeWorkgroupSubgroups>> 457e5c31af7Sopenharmony_ci * [[VUID-VkPipelineShaderStageCreateInfo-pNext-02757]] 458e5c31af7Sopenharmony_ci If a slink:VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT 459e5c31af7Sopenharmony_ci structure is included in the pname:pNext chain, and pname:flags has the 460e5c31af7Sopenharmony_ci ename:VK_PIPELINE_SHADER_STAGE_CREATE_REQUIRE_FULL_SUBGROUPS_BIT_EXT 461e5c31af7Sopenharmony_ci flag set, the local workgroup size in the X dimension of the pipeline 462e5c31af7Sopenharmony_ci must: be a multiple of 463e5c31af7Sopenharmony_ci slink:VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT::pname:requiredSubgroupSize 464e5c31af7Sopenharmony_ci * [[VUID-VkPipelineShaderStageCreateInfo-flags-02758]] 465e5c31af7Sopenharmony_ci If pname:flags has both the 466e5c31af7Sopenharmony_ci ename:VK_PIPELINE_SHADER_STAGE_CREATE_REQUIRE_FULL_SUBGROUPS_BIT_EXT and 467e5c31af7Sopenharmony_ci ename:VK_PIPELINE_SHADER_STAGE_CREATE_ALLOW_VARYING_SUBGROUP_SIZE_BIT_EXT 468e5c31af7Sopenharmony_ci flags set, the local workgroup size in the X dimension of the pipeline 469e5c31af7Sopenharmony_ci must: be a multiple of 470e5c31af7Sopenharmony_ci <<limits-max-subgroup-size,pname:maxSubgroupSize>> 471e5c31af7Sopenharmony_ci * [[VUID-VkPipelineShaderStageCreateInfo-flags-02759]] 472e5c31af7Sopenharmony_ci If pname:flags has the 473e5c31af7Sopenharmony_ci ename:VK_PIPELINE_SHADER_STAGE_CREATE_REQUIRE_FULL_SUBGROUPS_BIT_EXT 474e5c31af7Sopenharmony_ci flag set and pname:flags does not have the 475e5c31af7Sopenharmony_ci ename:VK_PIPELINE_SHADER_STAGE_CREATE_ALLOW_VARYING_SUBGROUP_SIZE_BIT_EXT 476e5c31af7Sopenharmony_ci flag set and no 477e5c31af7Sopenharmony_ci slink:VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT structure 478e5c31af7Sopenharmony_ci is included in the pname:pNext chain, the local workgroup size in the X 479e5c31af7Sopenharmony_ci dimension of the pipeline must: be a multiple of 480e5c31af7Sopenharmony_ci <<limits-subgroup-size,pname:subgroupSize>> 481e5c31af7Sopenharmony_ciendif::VK_EXT_subgroup_size_control[] 482e5c31af7Sopenharmony_ci * [[VUID-VkPipelineShaderStageCreateInfo-module-04145]] 483e5c31af7Sopenharmony_ci The SPIR-V code that was used to create pname:module must: be valid as 484e5c31af7Sopenharmony_ci described by the <<spirv-spec,Khronos SPIR-V Specification>> after 485e5c31af7Sopenharmony_ci applying the specializations provided in pname:pSpecializationInfo, if 486e5c31af7Sopenharmony_ci any, and then converting all specialization constants into fixed 487e5c31af7Sopenharmony_ci constants 488e5c31af7Sopenharmony_ci**** 489e5c31af7Sopenharmony_ci 490e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkPipelineShaderStageCreateInfo.txt[] 491e5c31af7Sopenharmony_ci-- 492e5c31af7Sopenharmony_ci 493e5c31af7Sopenharmony_ci[open,refpage='VkPipelineShaderStageCreateFlags',desc='Bitmask of VkPipelineShaderStageCreateFlagBits',type='flags'] 494e5c31af7Sopenharmony_ci-- 495e5c31af7Sopenharmony_ciinclude::{generated}/api/flags/VkPipelineShaderStageCreateFlags.txt[] 496e5c31af7Sopenharmony_ci 497e5c31af7Sopenharmony_citname:VkPipelineShaderStageCreateFlags is a bitmask type for setting a mask 498e5c31af7Sopenharmony_ciof zero or more elink:VkPipelineShaderStageCreateFlagBits. 499e5c31af7Sopenharmony_ci-- 500e5c31af7Sopenharmony_ci 501e5c31af7Sopenharmony_ci[open,refpage='VkPipelineShaderStageCreateFlagBits',desc='Bitmask controlling how a pipeline shader stage is created',type='enums'] 502e5c31af7Sopenharmony_ci-- 503e5c31af7Sopenharmony_ciPossible values of the pname:flags member of 504e5c31af7Sopenharmony_cislink:VkPipelineShaderStageCreateInfo specifying how a pipeline shader stage 505e5c31af7Sopenharmony_ciis created, are: 506e5c31af7Sopenharmony_ci 507e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkPipelineShaderStageCreateFlagBits.txt[] 508e5c31af7Sopenharmony_ci 509e5c31af7Sopenharmony_ciifdef::VK_EXT_subgroup_size_control[] 510e5c31af7Sopenharmony_ci * ename:VK_PIPELINE_SHADER_STAGE_CREATE_ALLOW_VARYING_SUBGROUP_SIZE_BIT_EXT 511e5c31af7Sopenharmony_ci specifies that the 512e5c31af7Sopenharmony_ci <<interfaces-builtin-variables-sgs,code:SubgroupSize>> may: vary in the 513e5c31af7Sopenharmony_ci shader stage. 514e5c31af7Sopenharmony_ci * ename:VK_PIPELINE_SHADER_STAGE_CREATE_REQUIRE_FULL_SUBGROUPS_BIT_EXT 515e5c31af7Sopenharmony_ci specifies that the subgroup sizes must: be launched with all invocations 516e5c31af7Sopenharmony_ci active in the compute stage. 517e5c31af7Sopenharmony_ci 518e5c31af7Sopenharmony_ci[NOTE] 519e5c31af7Sopenharmony_ci.Note 520e5c31af7Sopenharmony_ci==== 521e5c31af7Sopenharmony_ciIf ename:VK_PIPELINE_SHADER_STAGE_CREATE_ALLOW_VARYING_SUBGROUP_SIZE_BIT_EXT 522e5c31af7Sopenharmony_ciand ename:VK_PIPELINE_SHADER_STAGE_CREATE_REQUIRE_FULL_SUBGROUPS_BIT_EXT are 523e5c31af7Sopenharmony_cispecified and <<limits-max-subgroup-size,pname:minSubgroupSize>> does not 524e5c31af7Sopenharmony_ciequal <<limits-max-subgroup-size,pname:maxSubgroupSize>> and no 525e5c31af7Sopenharmony_ci<<pipelines-required-subgroup-size, required subgroup size>> is specified, 526e5c31af7Sopenharmony_cithen the only way to guarantee that the 'X' dimension of the local workgroup 527e5c31af7Sopenharmony_cisize is a multiple of <<interfaces-builtin-variables-sgs,code:SubgroupSize>> 528e5c31af7Sopenharmony_ciis to make it a multiple of pname:maxSubgroupSize. 529e5c31af7Sopenharmony_ciUnder these conditions, you are guaranteed full subgroups but not any 530e5c31af7Sopenharmony_ciparticular subgroup size. 531e5c31af7Sopenharmony_ci==== 532e5c31af7Sopenharmony_ci 533e5c31af7Sopenharmony_ciendif::VK_EXT_subgroup_size_control[] 534e5c31af7Sopenharmony_ci-- 535e5c31af7Sopenharmony_ci 536e5c31af7Sopenharmony_ci[open,refpage='VkShaderStageFlagBits',desc='Bitmask specifying a pipeline stage',type='enums'] 537e5c31af7Sopenharmony_ci-- 538e5c31af7Sopenharmony_ciCommands and structures which need to specify one or more shader stages do 539e5c31af7Sopenharmony_ciso using a bitmask whose bits correspond to stages. 540e5c31af7Sopenharmony_ciBits which can: be set to specify shader stages are: 541e5c31af7Sopenharmony_ci 542e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkShaderStageFlagBits.txt[] 543e5c31af7Sopenharmony_ci 544e5c31af7Sopenharmony_ci * ename:VK_SHADER_STAGE_VERTEX_BIT specifies the vertex stage. 545e5c31af7Sopenharmony_ci * ename:VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT specifies the 546e5c31af7Sopenharmony_ci tessellation control stage. 547e5c31af7Sopenharmony_ci * ename:VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT specifies the 548e5c31af7Sopenharmony_ci tessellation evaluation stage. 549e5c31af7Sopenharmony_ci * ename:VK_SHADER_STAGE_GEOMETRY_BIT specifies the geometry stage. 550e5c31af7Sopenharmony_ci * ename:VK_SHADER_STAGE_FRAGMENT_BIT specifies the fragment stage. 551e5c31af7Sopenharmony_ci * ename:VK_SHADER_STAGE_COMPUTE_BIT specifies the compute stage. 552e5c31af7Sopenharmony_ci * ename:VK_SHADER_STAGE_ALL_GRAPHICS is a combination of bits used as 553e5c31af7Sopenharmony_ci shorthand to specify all graphics stages defined above (excluding the 554e5c31af7Sopenharmony_ci compute stage). 555e5c31af7Sopenharmony_ci * ename:VK_SHADER_STAGE_ALL is a combination of bits used as shorthand to 556e5c31af7Sopenharmony_ci specify all shader stages supported by the device, including all 557e5c31af7Sopenharmony_ci additional stages which are introduced by extensions. 558e5c31af7Sopenharmony_ciifdef::VK_NV_mesh_shader[] 559e5c31af7Sopenharmony_ci * ename:VK_SHADER_STAGE_TASK_BIT_NV specifies the task stage. 560e5c31af7Sopenharmony_ci * ename:VK_SHADER_STAGE_MESH_BIT_NV specifies the mesh stage. 561e5c31af7Sopenharmony_ciendif::VK_NV_mesh_shader[] 562e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing,VK_KHR_ray_tracing_pipeline[] 563e5c31af7Sopenharmony_ci * ename:VK_SHADER_STAGE_RAYGEN_BIT_KHR specifies the ray generation stage. 564e5c31af7Sopenharmony_ci * ename:VK_SHADER_STAGE_ANY_HIT_BIT_KHR specifies the any-hit stage. 565e5c31af7Sopenharmony_ci * ename:VK_SHADER_STAGE_CLOSEST_HIT_BIT_KHR specifies the closest hit 566e5c31af7Sopenharmony_ci stage. 567e5c31af7Sopenharmony_ci * ename:VK_SHADER_STAGE_MISS_BIT_KHR specifies the miss stage. 568e5c31af7Sopenharmony_ci * ename:VK_SHADER_STAGE_INTERSECTION_BIT_KHR specifies the intersection 569e5c31af7Sopenharmony_ci stage. 570e5c31af7Sopenharmony_ci * ename:VK_SHADER_STAGE_CALLABLE_BIT_KHR specifies the callable stage. 571e5c31af7Sopenharmony_ciendif::VK_NV_ray_tracing,VK_KHR_ray_tracing_pipeline[] 572e5c31af7Sopenharmony_ci 573e5c31af7Sopenharmony_ci[NOTE] 574e5c31af7Sopenharmony_ci.Note 575e5c31af7Sopenharmony_ci==== 576e5c31af7Sopenharmony_ciename:VK_SHADER_STAGE_ALL_GRAPHICS only includes the original five graphics 577e5c31af7Sopenharmony_cistages included in Vulkan 1.0, and not any stages added by extensions. 578e5c31af7Sopenharmony_ciThus, it may not have the desired effect in all cases. 579e5c31af7Sopenharmony_ci==== 580e5c31af7Sopenharmony_ci-- 581e5c31af7Sopenharmony_ci 582e5c31af7Sopenharmony_ci[open,refpage='VkShaderStageFlags',desc='Bitmask of VkShaderStageFlagBits',type='flags'] 583e5c31af7Sopenharmony_ci-- 584e5c31af7Sopenharmony_ciinclude::{generated}/api/flags/VkShaderStageFlags.txt[] 585e5c31af7Sopenharmony_ci 586e5c31af7Sopenharmony_citname:VkShaderStageFlags is a bitmask type for setting a mask of zero or 587e5c31af7Sopenharmony_cimore elink:VkShaderStageFlagBits. 588e5c31af7Sopenharmony_ci-- 589e5c31af7Sopenharmony_ci 590e5c31af7Sopenharmony_ciifdef::VK_EXT_subgroup_size_control[] 591e5c31af7Sopenharmony_ci[open,refpage='VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT',desc='Structure specifying the required subgroup size of a newly created pipeline shader stage',type='structs'] 592e5c31af7Sopenharmony_ci-- 593e5c31af7Sopenharmony_ciThe sname:VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT structure 594e5c31af7Sopenharmony_ciis defined as: 595e5c31af7Sopenharmony_ci 596e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT.txt[] 597e5c31af7Sopenharmony_ci * pname:sType is the type of this structure. 598e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 599e5c31af7Sopenharmony_ci structure. 600e5c31af7Sopenharmony_ci * [[pipelines-required-subgroup-size]] pname:requiredSubgroupSize is an 601e5c31af7Sopenharmony_ci unsigned integer value specifying the required subgroup size for the 602e5c31af7Sopenharmony_ci newly created pipeline shader stage. 603e5c31af7Sopenharmony_ci 604e5c31af7Sopenharmony_ci.Valid Usage 605e5c31af7Sopenharmony_ci**** 606e5c31af7Sopenharmony_ci * [[VUID-VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT-requiredSubgroupSize-02760]] 607e5c31af7Sopenharmony_ci pname:requiredSubgroupSize must: be a power-of-two integer 608e5c31af7Sopenharmony_ci * [[VUID-VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT-requiredSubgroupSize-02761]] 609e5c31af7Sopenharmony_ci pname:requiredSubgroupSize must: be greater or equal to 610e5c31af7Sopenharmony_ci <<limits-min-subgroup-size,minSubgroupSize>> 611e5c31af7Sopenharmony_ci * [[VUID-VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT-requiredSubgroupSize-02762]] 612e5c31af7Sopenharmony_ci pname:requiredSubgroupSize must: be less than or equal to 613e5c31af7Sopenharmony_ci <<limits-max-subgroup-size,maxSubgroupSize>> 614e5c31af7Sopenharmony_ci**** 615e5c31af7Sopenharmony_ci 616e5c31af7Sopenharmony_ci 617e5c31af7Sopenharmony_ciIf a sname:VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT structure 618e5c31af7Sopenharmony_ciis included in the pname:pNext chain of 619e5c31af7Sopenharmony_cislink:VkPipelineShaderStageCreateInfo, it specifies that the pipeline shader 620e5c31af7Sopenharmony_cistage being compiled has a required subgroup size. 621e5c31af7Sopenharmony_ci 622e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT.txt[] 623e5c31af7Sopenharmony_ci-- 624e5c31af7Sopenharmony_ciendif::VK_EXT_subgroup_size_control[] 625e5c31af7Sopenharmony_ci 626e5c31af7Sopenharmony_ciifdef::VK_HUAWEI_subpass_shading[] 627e5c31af7Sopenharmony_ci[open,refpage='VkSubpassShadingPipelineCreateInfoHUAWEI',desc='Structure specifying parameters of a newly created subpass shading pipeline',type='structs'] 628e5c31af7Sopenharmony_ci-- 629e5c31af7Sopenharmony_ciA subpass shading pipeline is a compute pipeline which must: be called only 630e5c31af7Sopenharmony_ciin a subpass of a render pass with work dimensions specified by render area 631e5c31af7Sopenharmony_cisize. 632e5c31af7Sopenharmony_ciThe subpass shading pipeline shader is a compute shader allowed to access 633e5c31af7Sopenharmony_ciinput attachments specified in the calling subpass. 634e5c31af7Sopenharmony_ciTo create a subpass shading pipeline, call flink:vkCreateComputePipelines 635e5c31af7Sopenharmony_ciwith slink:VkSubpassShadingPipelineCreateInfoHUAWEI in the pname:pNext chain 636e5c31af7Sopenharmony_ciof slink:VkComputePipelineCreateInfo. 637e5c31af7Sopenharmony_ci 638e5c31af7Sopenharmony_ciThe sname:VkSubpassShadingPipelineCreateInfoHUAWEI structure is defined as: 639e5c31af7Sopenharmony_ci 640e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkSubpassShadingPipelineCreateInfoHUAWEI.txt[] 641e5c31af7Sopenharmony_ci 642e5c31af7Sopenharmony_ci * pname:sType is the type of this structure. 643e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 644e5c31af7Sopenharmony_ci structure. 645e5c31af7Sopenharmony_ci * pname:renderPass is a handle to a render pass object describing the 646e5c31af7Sopenharmony_ci environment in which the pipeline will be used. 647e5c31af7Sopenharmony_ci The pipeline must: only be used with a render pass instance compatible 648e5c31af7Sopenharmony_ci with the one provided. 649e5c31af7Sopenharmony_ci See <<renderpass-compatibility,Render Pass Compatibility>> for more 650e5c31af7Sopenharmony_ci information. 651e5c31af7Sopenharmony_ci * pname:subpass is the index of the subpass in the render pass where this 652e5c31af7Sopenharmony_ci pipeline will be used. 653e5c31af7Sopenharmony_ci 654e5c31af7Sopenharmony_ci.Valid Usage 655e5c31af7Sopenharmony_ci**** 656e5c31af7Sopenharmony_ci * [[VUID-VkSubpassShadingPipelineCreateInfoHUAWEI-subpass-04946]] 657e5c31af7Sopenharmony_ci pname:subpass must: be created with 658e5c31af7Sopenharmony_ci ename:VK_PIPELINE_BIND_POINT_SUBPASS_SHADING_HUAWEI bind point 659e5c31af7Sopenharmony_ci**** 660e5c31af7Sopenharmony_ci 661e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkSubpassShadingPipelineCreateInfoHUAWEI.txt[] 662e5c31af7Sopenharmony_ci-- 663e5c31af7Sopenharmony_ci 664e5c31af7Sopenharmony_ci[open,refpage='vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI',desc='Query maximum supported subpass shading workgroup size for a give render pass',type='protos'] 665e5c31af7Sopenharmony_ci-- 666e5c31af7Sopenharmony_ciA subpass shading pipeline's workgroup size is a 2D vector with number of 667e5c31af7Sopenharmony_cipower-of-two in width and height. 668e5c31af7Sopenharmony_ciThe maximum number of width and height is implementation dependent, and may: 669e5c31af7Sopenharmony_civary for different formats and sample counts of attachments in a render 670e5c31af7Sopenharmony_cipass. 671e5c31af7Sopenharmony_ci 672e5c31af7Sopenharmony_ciTo query the maximum workgroup size, call: 673e5c31af7Sopenharmony_ci 674e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI.txt[] 675e5c31af7Sopenharmony_ci 676e5c31af7Sopenharmony_ci * pname:device is a handle to a local device object that was used to 677e5c31af7Sopenharmony_ci create the given render pass. 678e5c31af7Sopenharmony_ci * pname:renderPass is a handle to a render pass object describing the 679e5c31af7Sopenharmony_ci environment in which the pipeline will be used. 680e5c31af7Sopenharmony_ci The pipeline must: only be used with a render pass instance compatible 681e5c31af7Sopenharmony_ci with the one provided. 682e5c31af7Sopenharmony_ci See <<renderpass-compatibility,Render Pass Compatibility>> for more 683e5c31af7Sopenharmony_ci information. 684e5c31af7Sopenharmony_ci * pname:pMaxWorkgroupSize is a pointer to a slink:VkExtent2D structure. 685e5c31af7Sopenharmony_ci 686e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI.txt[] 687e5c31af7Sopenharmony_ci-- 688e5c31af7Sopenharmony_ciendif::VK_HUAWEI_subpass_shading[] 689e5c31af7Sopenharmony_ci 690e5c31af7Sopenharmony_ci 691e5c31af7Sopenharmony_ci[[pipelines-graphics]] 692e5c31af7Sopenharmony_ci== Graphics Pipelines 693e5c31af7Sopenharmony_ci 694e5c31af7Sopenharmony_ciGraphics pipelines consist of multiple shader stages, multiple 695e5c31af7Sopenharmony_cifixed-function pipeline stages, and a pipeline layout. 696e5c31af7Sopenharmony_ci 697e5c31af7Sopenharmony_ci[open,refpage='vkCreateGraphicsPipelines',desc='Create graphics pipelines',type='protos'] 698e5c31af7Sopenharmony_ci-- 699e5c31af7Sopenharmony_ciTo create graphics pipelines, call: 700e5c31af7Sopenharmony_ci 701e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCreateGraphicsPipelines.txt[] 702e5c31af7Sopenharmony_ci 703e5c31af7Sopenharmony_ci * pname:device is the logical device that creates the graphics pipelines. 704e5c31af7Sopenharmony_ci * pname:pipelineCache is either dlink:VK_NULL_HANDLE, indicating that 705e5c31af7Sopenharmony_ci pipeline caching is disabled; or the handle of a valid 706e5c31af7Sopenharmony_ci <<pipelines-cache,pipeline cache>> object, in which case use of that 707e5c31af7Sopenharmony_ci cache is enabled for the duration of the command. 708e5c31af7Sopenharmony_ci * pname:createInfoCount is the length of the pname:pCreateInfos and 709e5c31af7Sopenharmony_ci pname:pPipelines arrays. 710e5c31af7Sopenharmony_ci * pname:pCreateInfos is a pointer to an array of 711e5c31af7Sopenharmony_ci slink:VkGraphicsPipelineCreateInfo structures. 712e5c31af7Sopenharmony_ci * pname:pAllocator controls host memory allocation as described in the 713e5c31af7Sopenharmony_ci <<memory-allocation, Memory Allocation>> chapter. 714e5c31af7Sopenharmony_ci * pname:pPipelines is a pointer to an array of slink:VkPipeline handles in 715e5c31af7Sopenharmony_ci which the resulting graphics pipeline objects are returned. 716e5c31af7Sopenharmony_ci 717e5c31af7Sopenharmony_ciThe slink:VkGraphicsPipelineCreateInfo structure includes an array of 718e5c31af7Sopenharmony_cislink:VkPipelineShaderStageCreateInfo structures for each of the desired 719e5c31af7Sopenharmony_ciactive shader stages, as well as creation information for all relevant 720e5c31af7Sopenharmony_cifixed-function stages, and a pipeline layout. 721e5c31af7Sopenharmony_ci 722e5c31af7Sopenharmony_ci.Valid Usage 723e5c31af7Sopenharmony_ci**** 724e5c31af7Sopenharmony_ci * [[VUID-vkCreateGraphicsPipelines-flags-00720]] 725e5c31af7Sopenharmony_ci If the pname:flags member of any element of pname:pCreateInfos contains 726e5c31af7Sopenharmony_ci the ename:VK_PIPELINE_CREATE_DERIVATIVE_BIT flag, and the 727e5c31af7Sopenharmony_ci pname:basePipelineIndex member of that same element is not `-1`, 728e5c31af7Sopenharmony_ci pname:basePipelineIndex must: be less than the index into 729e5c31af7Sopenharmony_ci pname:pCreateInfos that corresponds to that element 730e5c31af7Sopenharmony_ci * [[VUID-vkCreateGraphicsPipelines-flags-00721]] 731e5c31af7Sopenharmony_ci If the pname:flags member of any element of pname:pCreateInfos contains 732e5c31af7Sopenharmony_ci the ename:VK_PIPELINE_CREATE_DERIVATIVE_BIT flag, the base pipeline 733e5c31af7Sopenharmony_ci must: have been created with the 734e5c31af7Sopenharmony_ci ename:VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT flag set 735e5c31af7Sopenharmony_ciifdef::VK_EXT_pipeline_creation_cache_control[] 736e5c31af7Sopenharmony_ci * [[VUID-vkCreateGraphicsPipelines-pipelineCache-02876]] 737e5c31af7Sopenharmony_ci If pname:pipelineCache was created with 738e5c31af7Sopenharmony_ci ename:VK_PIPELINE_CACHE_CREATE_EXTERNALLY_SYNCHRONIZED_BIT_EXT, host 739e5c31af7Sopenharmony_ci access to pname:pipelineCache must: be 740e5c31af7Sopenharmony_ci <<fundamentals-threadingbehavior,externally synchronized>> 741e5c31af7Sopenharmony_ciendif::VK_EXT_pipeline_creation_cache_control[] 742e5c31af7Sopenharmony_ci**** 743e5c31af7Sopenharmony_ci 744e5c31af7Sopenharmony_ciifdef::VK_EXT_pipeline_creation_cache_control[] 745e5c31af7Sopenharmony_ci[NOTE] 746e5c31af7Sopenharmony_ci.Note 747e5c31af7Sopenharmony_ci==== 748e5c31af7Sopenharmony_ciAn implicit cache may be provided by the implementation or a layer. 749e5c31af7Sopenharmony_ciFor this reason, it is still valid to set 750e5c31af7Sopenharmony_ciename:VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT_EXT on 751e5c31af7Sopenharmony_cipname:flags for any element of pname:pCreateInfos while passing 752e5c31af7Sopenharmony_cidlink:VK_NULL_HANDLE for pname:pipelineCache. 753e5c31af7Sopenharmony_ci==== 754e5c31af7Sopenharmony_ciendif::VK_EXT_pipeline_creation_cache_control[] 755e5c31af7Sopenharmony_ci 756e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCreateGraphicsPipelines.txt[] 757e5c31af7Sopenharmony_ci-- 758e5c31af7Sopenharmony_ci 759e5c31af7Sopenharmony_ci[open,refpage='VkGraphicsPipelineCreateInfo',desc='Structure specifying parameters of a newly created graphics pipeline',type='structs'] 760e5c31af7Sopenharmony_ci-- 761e5c31af7Sopenharmony_ciThe sname:VkGraphicsPipelineCreateInfo structure is defined as: 762e5c31af7Sopenharmony_ci 763e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkGraphicsPipelineCreateInfo.txt[] 764e5c31af7Sopenharmony_ci 765e5c31af7Sopenharmony_ci * pname:sType is the type of this structure. 766e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 767e5c31af7Sopenharmony_ci structure. 768e5c31af7Sopenharmony_ci * pname:flags is a bitmask of elink:VkPipelineCreateFlagBits specifying 769e5c31af7Sopenharmony_ci how the pipeline will be generated. 770e5c31af7Sopenharmony_ci * pname:stageCount is the number of entries in the pname:pStages array. 771e5c31af7Sopenharmony_ci * pname:pStages is a pointer to an array of pname:stageCount 772e5c31af7Sopenharmony_ci slink:VkPipelineShaderStageCreateInfo structures describing the set of 773e5c31af7Sopenharmony_ci the shader stages to be included in the graphics pipeline. 774e5c31af7Sopenharmony_ci * pname:pVertexInputState is a pointer to a 775e5c31af7Sopenharmony_ci slink:VkPipelineVertexInputStateCreateInfo structure. 776e5c31af7Sopenharmony_ciifdef::VK_NV_mesh_shader[] 777e5c31af7Sopenharmony_ci It is ignored if the pipeline includes a mesh shader stage. 778e5c31af7Sopenharmony_ciendif::VK_NV_mesh_shader[] 779e5c31af7Sopenharmony_ciifdef::VK_EXT_vertex_input_dynamic_state[] 780e5c31af7Sopenharmony_ci It is ignored if the pipeline is created with the 781e5c31af7Sopenharmony_ci ename:VK_DYNAMIC_STATE_VERTEX_INPUT_EXT dynamic state set. 782e5c31af7Sopenharmony_ciendif::VK_EXT_vertex_input_dynamic_state[] 783e5c31af7Sopenharmony_ci * pname:pInputAssemblyState is a pointer to a 784e5c31af7Sopenharmony_ci slink:VkPipelineInputAssemblyStateCreateInfo structure which determines 785e5c31af7Sopenharmony_ci input assembly behavior, as described in <<drawing, Drawing Commands>>. 786e5c31af7Sopenharmony_ciifdef::VK_NV_mesh_shader[] 787e5c31af7Sopenharmony_ci It is ignored if the pipeline includes a mesh shader stage. 788e5c31af7Sopenharmony_ciendif::VK_NV_mesh_shader[] 789e5c31af7Sopenharmony_ci * pname:pTessellationState is a pointer to a 790e5c31af7Sopenharmony_ci slink:VkPipelineTessellationStateCreateInfo structure, and is ignored if 791e5c31af7Sopenharmony_ci the pipeline does not include a tessellation control shader stage and 792e5c31af7Sopenharmony_ci tessellation evaluation shader stage. 793e5c31af7Sopenharmony_ci * pname:pViewportState is a pointer to a 794e5c31af7Sopenharmony_ci slink:VkPipelineViewportStateCreateInfo structure, and is ignored if the 795e5c31af7Sopenharmony_ci pipeline has rasterization disabled. 796e5c31af7Sopenharmony_ci * pname:pRasterizationState is a pointer to a 797e5c31af7Sopenharmony_ci slink:VkPipelineRasterizationStateCreateInfo structure. 798e5c31af7Sopenharmony_ci * pname:pMultisampleState is a pointer to a 799e5c31af7Sopenharmony_ci slink:VkPipelineMultisampleStateCreateInfo structure, and is ignored if 800e5c31af7Sopenharmony_ci the pipeline has rasterization disabled. 801e5c31af7Sopenharmony_ci * pname:pDepthStencilState is a pointer to a 802e5c31af7Sopenharmony_ci slink:VkPipelineDepthStencilStateCreateInfo structure, and is ignored if 803e5c31af7Sopenharmony_ci the pipeline has rasterization disabled or if no depth/stencil 804e5c31af7Sopenharmony_ci attachment is used. 805e5c31af7Sopenharmony_ci * pname:pColorBlendState is a pointer to a 806e5c31af7Sopenharmony_ci slink:VkPipelineColorBlendStateCreateInfo structure, and is ignored if 807e5c31af7Sopenharmony_ci the pipeline has rasterization disabled or if no color attachments are 808e5c31af7Sopenharmony_ci used. 809e5c31af7Sopenharmony_ci * pname:pDynamicState is a pointer to a 810e5c31af7Sopenharmony_ci slink:VkPipelineDynamicStateCreateInfo structure, and is used to 811e5c31af7Sopenharmony_ci indicate which properties of the pipeline state object are dynamic and 812e5c31af7Sopenharmony_ci can: be changed independently of the pipeline state. 813e5c31af7Sopenharmony_ci This can: be `NULL`, which means no state in the pipeline is considered 814e5c31af7Sopenharmony_ci dynamic. 815e5c31af7Sopenharmony_ci * pname:layout is the description of binding locations used by both the 816e5c31af7Sopenharmony_ci pipeline and descriptor sets used with the pipeline. 817e5c31af7Sopenharmony_ci * pname:renderPass is a handle to a render pass object describing the 818e5c31af7Sopenharmony_ci environment in which the pipeline will be used. 819e5c31af7Sopenharmony_ci The pipeline must: only be used with a render pass instance compatible 820e5c31af7Sopenharmony_ci with the one provided. 821e5c31af7Sopenharmony_ci See <<renderpass-compatibility,Render Pass Compatibility>> for more 822e5c31af7Sopenharmony_ci information. 823e5c31af7Sopenharmony_ci * pname:subpass is the index of the subpass in the render pass where this 824e5c31af7Sopenharmony_ci pipeline will be used. 825e5c31af7Sopenharmony_ci * pname:basePipelineHandle is a pipeline to derive from. 826e5c31af7Sopenharmony_ci * pname:basePipelineIndex is an index into the pname:pCreateInfos 827e5c31af7Sopenharmony_ci parameter to use as a pipeline to derive from. 828e5c31af7Sopenharmony_ci 829e5c31af7Sopenharmony_ciThe parameters pname:basePipelineHandle and pname:basePipelineIndex are 830e5c31af7Sopenharmony_cidescribed in more detail in <<pipelines-pipeline-derivatives,Pipeline 831e5c31af7Sopenharmony_ciDerivatives>>. 832e5c31af7Sopenharmony_ci 833e5c31af7Sopenharmony_ciifdef::VK_NV_glsl_shader[] 834e5c31af7Sopenharmony_ciIf any shader stage fails to compile, 835e5c31af7Sopenharmony_ciifdef::VK_EXT_debug_report[] 836e5c31af7Sopenharmony_cithe compile log will be reported back to the application, and 837e5c31af7Sopenharmony_ciendif::VK_EXT_debug_report[] 838e5c31af7Sopenharmony_ciename:VK_ERROR_INVALID_SHADER_NV will be generated. 839e5c31af7Sopenharmony_ciendif::VK_NV_glsl_shader[] 840e5c31af7Sopenharmony_ci 841e5c31af7Sopenharmony_ci[[pipeline-graphics-subsets]] 842e5c31af7Sopenharmony_ciThe state required for a graphics pipeline is divided into 843e5c31af7Sopenharmony_ci<<pipeline-graphics-subsets-vertex-input, vertex input state>>, 844e5c31af7Sopenharmony_ci<<pipeline-graphics-subsets-pre-rasterization,pre-rasterization shader 845e5c31af7Sopenharmony_cistate>>, <<pipeline-graphics-subsets-fragment-shader,fragment shader 846e5c31af7Sopenharmony_cistate>>, and <<pipeline-graphics-subsets-fragment-output,fragment output 847e5c31af7Sopenharmony_cistate>>. 848e5c31af7Sopenharmony_ci 849e5c31af7Sopenharmony_ci[[pipeline-graphics-subsets-vertex-input]] 850e5c31af7Sopenharmony_ciVertex input state is defined by: 851e5c31af7Sopenharmony_ci 852e5c31af7Sopenharmony_ci * slink:VkPipelineVertexInputStateCreateInfo 853e5c31af7Sopenharmony_ci * slink:VkPipelineInputAssemblyStateCreateInfo 854e5c31af7Sopenharmony_ci 855e5c31af7Sopenharmony_ci[[pipeline-graphics-subsets-pre-rasterization]] 856e5c31af7Sopenharmony_ciPre-rasterization shader state is defined by: 857e5c31af7Sopenharmony_ci 858e5c31af7Sopenharmony_ci * slink:VkPipelineShaderStageCreateInfo entries for: 859e5c31af7Sopenharmony_ci ** Vertex shaders 860e5c31af7Sopenharmony_ci ** Tessellation control shaders 861e5c31af7Sopenharmony_ci ** Tessellation evaluation shaders 862e5c31af7Sopenharmony_ci ** Geometry shaders 863e5c31af7Sopenharmony_ciifdef::VK_NV_mesh_shader[] 864e5c31af7Sopenharmony_ci ** Task shaders 865e5c31af7Sopenharmony_ci ** Mesh shaders 866e5c31af7Sopenharmony_ciendif::VK_NV_mesh_shader[] 867e5c31af7Sopenharmony_ci * Within the slink:VkPipelineLayout, all bindings that affect the 868e5c31af7Sopenharmony_ci specified shader stages 869e5c31af7Sopenharmony_ci * slink:VkPipelineViewportStateCreateInfo 870e5c31af7Sopenharmony_ci * slink:VkPipelineRasterizationStateCreateInfo 871e5c31af7Sopenharmony_ci * slink:VkPipelineTessellationStateCreateInfo if tessellation stages are 872e5c31af7Sopenharmony_ci included. 873e5c31af7Sopenharmony_ci * slink:VkRenderPass and pname:subpass parameter 874e5c31af7Sopenharmony_ciifdef::VK_EXT_discard_rectangles[] 875e5c31af7Sopenharmony_ci * slink:VkPipelineDiscardRectangleStateCreateInfoEXT 876e5c31af7Sopenharmony_ciendif::VK_EXT_discard_rectangles[] 877e5c31af7Sopenharmony_ciifdef::VK_KHR_fragment_shading_rate[] 878e5c31af7Sopenharmony_ci * slink:VkPipelineFragmentShadingRateStateCreateInfoKHR 879e5c31af7Sopenharmony_ciifdef::VK_NV_fragment_shading_rate_enums[] 880e5c31af7Sopenharmony_ci * slink:VkPipelineFragmentShadingRateEnumStateCreateInfoNV 881e5c31af7Sopenharmony_ciendif::VK_NV_fragment_shading_rate_enums[] 882e5c31af7Sopenharmony_ciendif::VK_KHR_fragment_shading_rate[] 883e5c31af7Sopenharmony_ci 884e5c31af7Sopenharmony_ci[[pipeline-graphics-subsets-fragment-shader]] 885e5c31af7Sopenharmony_ciFragment shader state is defined by: 886e5c31af7Sopenharmony_ci 887e5c31af7Sopenharmony_ci * A slink:VkPipelineShaderStageCreateInfo entry for the fragment shader 888e5c31af7Sopenharmony_ci * Within the slink:VkPipelineLayout, all bindings that affect the fragment 889e5c31af7Sopenharmony_ci shader 890e5c31af7Sopenharmony_ci * slink:VkPipelineMultisampleStateCreateInfo 891e5c31af7Sopenharmony_ci * slink:VkPipelineDepthStencilStateCreateInfo 892e5c31af7Sopenharmony_ci * slink:VkRenderPass and pname:subpass parameter 893e5c31af7Sopenharmony_ciifdef::VK_KHR_fragment_shading_rate[] 894e5c31af7Sopenharmony_ci * slink:VkPipelineFragmentShadingRateStateCreateInfoKHR 895e5c31af7Sopenharmony_ciifdef::VK_NV_fragment_shading_rate_enums[] 896e5c31af7Sopenharmony_ci * slink:VkPipelineFragmentShadingRateEnumStateCreateInfoNV 897e5c31af7Sopenharmony_ciendif::VK_NV_fragment_shading_rate_enums[] 898e5c31af7Sopenharmony_ciendif::VK_KHR_fragment_shading_rate[] 899e5c31af7Sopenharmony_ci 900e5c31af7Sopenharmony_ci[[pipeline-graphics-subsets-fragment-output]] 901e5c31af7Sopenharmony_ciFragment output state is defined by: 902e5c31af7Sopenharmony_ci 903e5c31af7Sopenharmony_ci * slink:VkPipelineColorBlendStateCreateInfo 904e5c31af7Sopenharmony_ci * The pname:alphaToCoverageEnable and pname:alphaToOneEnable members of 905e5c31af7Sopenharmony_ci slink:VkPipelineMultisampleStateCreateInfo. 906e5c31af7Sopenharmony_ci * slink:VkRenderPass and pname:subpass parameter 907e5c31af7Sopenharmony_ci 908e5c31af7Sopenharmony_ci[[pipeline-graphics-subsets-complete]] 909e5c31af7Sopenharmony_ciA complete graphics pipeline always includes 910e5c31af7Sopenharmony_ci<<pipeline-graphics-subsets-pre-rasterization, pre-rasterization shader 911e5c31af7Sopenharmony_cistate>>, with other subsets included depending on that state. 912e5c31af7Sopenharmony_ciIf the <<pipeline-graphics-subsets-pre-rasterization, pre-rasterization 913e5c31af7Sopenharmony_cishader state>> includes a vertex shader, then 914e5c31af7Sopenharmony_ci<<pipeline-graphics-subsets-vertex-input, vertex input state>> is included 915e5c31af7Sopenharmony_ciin a complete graphics pipeline. 916e5c31af7Sopenharmony_ciIf the value of 917e5c31af7Sopenharmony_cislink:VkPipelineRasterizationStateCreateInfo::pname:rasterizerDiscardEnable 918e5c31af7Sopenharmony_ciin the <<pipeline-graphics-subsets-pre-rasterization, pre-rasterization 919e5c31af7Sopenharmony_cishader state>> is ename:VK_FALSE 920e5c31af7Sopenharmony_ciifdef::VK_EXT_extended_dynamic_state2[] 921e5c31af7Sopenharmony_cior the ename:VK_DYNAMIC_STATE_RASTERIZER_DISCARD_ENABLE_EXT dynamic state is 922e5c31af7Sopenharmony_cienabled 923e5c31af7Sopenharmony_ciendif::VK_EXT_extended_dynamic_state2[] 924e5c31af7Sopenharmony_ci<<pipeline-graphics-subsets-fragment-shader, fragment shader state>> and 925e5c31af7Sopenharmony_ci<<pipeline-graphics-subsets-fragment-output, fragment output interface 926e5c31af7Sopenharmony_cistate>> is included in a complete graphics pipeline. 927e5c31af7Sopenharmony_ci 928e5c31af7Sopenharmony_ciPipelines must: be created with a complete set of pipeline state. 929e5c31af7Sopenharmony_ci 930e5c31af7Sopenharmony_ci.Valid Usage 931e5c31af7Sopenharmony_ci**** 932e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-flags-00722]] 933e5c31af7Sopenharmony_ci If pname:flags contains the ename:VK_PIPELINE_CREATE_DERIVATIVE_BIT 934e5c31af7Sopenharmony_ci flag, and pname:basePipelineIndex is -1, pname:basePipelineHandle must: 935e5c31af7Sopenharmony_ci be a valid handle to a graphics sname:VkPipeline 936e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-flags-00723]] 937e5c31af7Sopenharmony_ci If pname:flags contains the ename:VK_PIPELINE_CREATE_DERIVATIVE_BIT 938e5c31af7Sopenharmony_ci flag, and pname:basePipelineHandle is dlink:VK_NULL_HANDLE, 939e5c31af7Sopenharmony_ci pname:basePipelineIndex must: be a valid index into the calling 940e5c31af7Sopenharmony_ci command's pname:pCreateInfos parameter 941e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-flags-00724]] 942e5c31af7Sopenharmony_ci If pname:flags contains the ename:VK_PIPELINE_CREATE_DERIVATIVE_BIT 943e5c31af7Sopenharmony_ci flag, and pname:basePipelineIndex is not -1, pname:basePipelineHandle 944e5c31af7Sopenharmony_ci must: be dlink:VK_NULL_HANDLE 945e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-flags-00725]] 946e5c31af7Sopenharmony_ci If pname:flags contains the ename:VK_PIPELINE_CREATE_DERIVATIVE_BIT 947e5c31af7Sopenharmony_ci flag, and pname:basePipelineHandle is not dlink:VK_NULL_HANDLE, 948e5c31af7Sopenharmony_ci pname:basePipelineIndex must: be -1 949e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-stage-00726]] 950e5c31af7Sopenharmony_ci The pname:stage member of each element of pname:pStages must: be unique 951e5c31af7Sopenharmony_ciifndef::VK_NV_mesh_shader[] 952e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-stage-00727]] 953e5c31af7Sopenharmony_ci If the pipeline is being created with 954e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-pre-rasterization, pre-rasterization shader 955e5c31af7Sopenharmony_ci state>> the pname:stage member of one element of pname:pStages must: be 956e5c31af7Sopenharmony_ci ename:VK_SHADER_STAGE_VERTEX_BIT 957e5c31af7Sopenharmony_ciendif::VK_NV_mesh_shader[] 958e5c31af7Sopenharmony_ciifdef::VK_NV_mesh_shader[] 959e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-pStages-02095]] 960e5c31af7Sopenharmony_ci If the pipeline is being created with 961e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-pre-rasterization, pre-rasterization shader 962e5c31af7Sopenharmony_ci state>> the geometric shader stages provided in pname:pStages must: be 963e5c31af7Sopenharmony_ci either from the mesh shading pipeline (pname:stage is 964e5c31af7Sopenharmony_ci ename:VK_SHADER_STAGE_TASK_BIT_NV or ename:VK_SHADER_STAGE_MESH_BIT_NV) 965e5c31af7Sopenharmony_ci or from the primitive shading pipeline (pname:stage is 966e5c31af7Sopenharmony_ci ename:VK_SHADER_STAGE_VERTEX_BIT, 967e5c31af7Sopenharmony_ci ename:VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT, 968e5c31af7Sopenharmony_ci ename:VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT, or 969e5c31af7Sopenharmony_ci ename:VK_SHADER_STAGE_GEOMETRY_BIT) 970e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-stage-02096]] 971e5c31af7Sopenharmony_ci If the pipeline is being created with 972e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-pre-rasterization, pre-rasterization shader 973e5c31af7Sopenharmony_ci state>> the pname:stage member of one element of pname:pStages must: be 974e5c31af7Sopenharmony_ci either ename:VK_SHADER_STAGE_VERTEX_BIT or 975e5c31af7Sopenharmony_ci ename:VK_SHADER_STAGE_MESH_BIT_NV 976e5c31af7Sopenharmony_ciendif::VK_NV_mesh_shader[] 977e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-stage-00728]] 978e5c31af7Sopenharmony_ci The pname:stage member of each element of pname:pStages must: not be 979e5c31af7Sopenharmony_ci ename:VK_SHADER_STAGE_COMPUTE_BIT 980e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-pStages-00729]] 981e5c31af7Sopenharmony_ci If the pipeline is being created with 982e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-pre-rasterization, pre-rasterization shader 983e5c31af7Sopenharmony_ci state>> and pname:pStages includes a tessellation control shader stage, 984e5c31af7Sopenharmony_ci it must: include a tessellation evaluation shader stage 985e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-pStages-00730]] 986e5c31af7Sopenharmony_ci If the pipeline is being created with 987e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-pre-rasterization, pre-rasterization shader 988e5c31af7Sopenharmony_ci state>> and pname:pStages includes a tessellation evaluation shader 989e5c31af7Sopenharmony_ci stage, it must: include a tessellation control shader stage 990e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-pStages-00731]] 991e5c31af7Sopenharmony_ci If the pipeline is being created with 992e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-pre-rasterization, pre-rasterization shader 993e5c31af7Sopenharmony_ci state>> and pname:pStages includes a tessellation control shader stage 994e5c31af7Sopenharmony_ci and a tessellation evaluation shader stage, pname:pTessellationState 995e5c31af7Sopenharmony_ci must: be a valid pointer to a valid 996e5c31af7Sopenharmony_ci slink:VkPipelineTessellationStateCreateInfo structure 997e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-pStages-00732]] 998e5c31af7Sopenharmony_ci If the pipeline is being created with 999e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-pre-rasterization, pre-rasterization shader 1000e5c31af7Sopenharmony_ci state>> and pname:pStages includes tessellation shader stages, the 1001e5c31af7Sopenharmony_ci shader code of at least one stage must: contain an code:OpExecutionMode 1002e5c31af7Sopenharmony_ci instruction specifying the type of subdivision in the pipeline 1003e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-pStages-00733]] 1004e5c31af7Sopenharmony_ci If the pipeline is being created with 1005e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-pre-rasterization, pre-rasterization shader 1006e5c31af7Sopenharmony_ci state>> and pname:pStages includes tessellation shader stages, and the 1007e5c31af7Sopenharmony_ci shader code of both stages contain an code:OpExecutionMode instruction 1008e5c31af7Sopenharmony_ci specifying the type of subdivision in the pipeline, they must: both 1009e5c31af7Sopenharmony_ci specify the same subdivision mode 1010e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-pStages-00734]] 1011e5c31af7Sopenharmony_ci If the pipeline is being created with 1012e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-pre-rasterization, pre-rasterization shader 1013e5c31af7Sopenharmony_ci state>> and pname:pStages includes tessellation shader stages, the 1014e5c31af7Sopenharmony_ci shader code of at least one stage must: contain an code:OpExecutionMode 1015e5c31af7Sopenharmony_ci instruction specifying the output patch size in the pipeline 1016e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-pStages-00735]] 1017e5c31af7Sopenharmony_ci If the pipeline is being created with 1018e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-pre-rasterization, pre-rasterization shader 1019e5c31af7Sopenharmony_ci state>> and pname:pStages includes tessellation shader stages, and the 1020e5c31af7Sopenharmony_ci shader code of both contain an code:OpExecutionMode instruction 1021e5c31af7Sopenharmony_ci specifying the out patch size in the pipeline, they must: both specify 1022e5c31af7Sopenharmony_ci the same patch size 1023e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-pStages-00736]] 1024e5c31af7Sopenharmony_ci If the pipeline is being created with 1025e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-pre-rasterization, pre-rasterization shader 1026e5c31af7Sopenharmony_ci state>> and pname:pStages includes tessellation shader stages, the 1027e5c31af7Sopenharmony_ci pname:topology member of pname:pInputAssembly must: be 1028e5c31af7Sopenharmony_ci ename:VK_PRIMITIVE_TOPOLOGY_PATCH_LIST 1029e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-topology-00737]] 1030e5c31af7Sopenharmony_ci If the pipeline is being created with 1031e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-pre-rasterization, pre-rasterization shader 1032e5c31af7Sopenharmony_ci state>> and the pname:topology member of pname:pInputAssembly is 1033e5c31af7Sopenharmony_ci ename:VK_PRIMITIVE_TOPOLOGY_PATCH_LIST, pname:pStages must: include 1034e5c31af7Sopenharmony_ci tessellation shader stages 1035e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-pStages-00738]] 1036e5c31af7Sopenharmony_ci If the pipeline is being created with 1037e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-pre-rasterization, pre-rasterization shader 1038e5c31af7Sopenharmony_ci state>> and pname:pStages includes a geometry shader stage, and does not 1039e5c31af7Sopenharmony_ci include any tessellation shader stages, its shader code must: contain an 1040e5c31af7Sopenharmony_ci code:OpExecutionMode instruction specifying an input primitive type that 1041e5c31af7Sopenharmony_ci is <<shaders-geometry-execution, compatible>> with the primitive 1042e5c31af7Sopenharmony_ci topology specified in pname:pInputAssembly 1043e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-pStages-00739]] 1044e5c31af7Sopenharmony_ci If the pipeline is being created with 1045e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-pre-rasterization, pre-rasterization shader 1046e5c31af7Sopenharmony_ci state>> and pname:pStages includes a geometry shader stage, and also 1047e5c31af7Sopenharmony_ci includes tessellation shader stages, its shader code must: contain an 1048e5c31af7Sopenharmony_ci code:OpExecutionMode instruction specifying an input primitive type that 1049e5c31af7Sopenharmony_ci is <<shaders-geometry-execution, compatible>> with the primitive 1050e5c31af7Sopenharmony_ci topology that is output by the tessellation stages 1051e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-pStages-00740]] 1052e5c31af7Sopenharmony_ci If the pipeline is being created with 1053e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-pre-rasterization, pre-rasterization shader 1054e5c31af7Sopenharmony_ci state>> and <<pipeline-graphics-subsets-fragment-shader, fragment shader 1055e5c31af7Sopenharmony_ci state>>, it includes both a fragment shader and a geometry shader, and 1056e5c31af7Sopenharmony_ci the fragment shader code reads from an input variable that is decorated 1057e5c31af7Sopenharmony_ci with code:PrimitiveId, then the geometry shader code must: write to a 1058e5c31af7Sopenharmony_ci matching output variable, decorated with code:PrimitiveId, in all 1059e5c31af7Sopenharmony_ci execution paths 1060e5c31af7Sopenharmony_ciifdef::VK_NV_mesh_shader[] 1061e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-PrimitiveId-06264]] 1062e5c31af7Sopenharmony_ci If the pipeline is being created with 1063e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-pre-rasterization, pre-rasterization shader 1064e5c31af7Sopenharmony_ci state>>, it includes a mesh shader and the fragment shader code reads 1065e5c31af7Sopenharmony_ci from an input variable that is decorated with code:PrimitiveId, then the 1066e5c31af7Sopenharmony_ci mesh shader code must: write to a matching output variable, decorated 1067e5c31af7Sopenharmony_ci with code:PrimitiveId, in all execution paths 1068e5c31af7Sopenharmony_ciendif::VK_NV_mesh_shader[] 1069e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-renderPass-06038]] 1070e5c31af7Sopenharmony_ci If pname:renderPass is not dlink:VK_NULL_HANDLE and the pipeline is 1071e5c31af7Sopenharmony_ci being created with <<pipeline-graphics-subsets-fragment-shader, fragment 1072e5c31af7Sopenharmony_ci shader state>> the fragment shader must: not read from any input 1073e5c31af7Sopenharmony_ci attachment that is defined as ename:VK_ATTACHMENT_UNUSED in 1074e5c31af7Sopenharmony_ci pname:subpass 1075e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-pStages-00742]] 1076e5c31af7Sopenharmony_ci If the pipeline is being created with 1077e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-pre-rasterization, pre-rasterization shader 1078e5c31af7Sopenharmony_ci state>> and multiple pre-rasterization shader stages are included in 1079e5c31af7Sopenharmony_ci pname:pStages, the shader code for the entry points identified by those 1080e5c31af7Sopenharmony_ci pname:pStages and the rest of the state identified by this structure 1081e5c31af7Sopenharmony_ci must: adhere to the pipeline linking rules described in the 1082e5c31af7Sopenharmony_ci <<interfaces,Shader Interfaces>> chapter 1083e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-None-04889]] 1084e5c31af7Sopenharmony_ci If the pipeline is being created with 1085e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-pre-rasterization, pre-rasterization shader 1086e5c31af7Sopenharmony_ci state>> and <<pipeline-graphics-subsets-fragment-shader, fragment shader 1087e5c31af7Sopenharmony_ci state>>, the fragment shader and last 1088e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-pre-rasterization,pre-rasterization shader 1089e5c31af7Sopenharmony_ci stage>> and any relevant state must: adhere to the pipeline linking 1090e5c31af7Sopenharmony_ci rules described in the <<interfaces,Shader Interfaces>> chapter 1091e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-renderPass-06039]] 1092e5c31af7Sopenharmony_ci If pname:renderPass is not dlink:VK_NULL_HANDLE, the pipeline is being 1093e5c31af7Sopenharmony_ci created with <<pipeline-graphics-subsets-fragment-shader, fragment 1094e5c31af7Sopenharmony_ci shader state>>, and pname:subpass uses a depth/stencil attachment in 1095e5c31af7Sopenharmony_ci pname:renderPass with a read-only layout for the depth aspect in the 1096e5c31af7Sopenharmony_ci slink:VkAttachmentReference defined by pname:subpass, the 1097e5c31af7Sopenharmony_ci pname:depthWriteEnable member of pname:pDepthStencilState must: be 1098e5c31af7Sopenharmony_ci ename:VK_FALSE 1099e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-renderPass-06040]] 1100e5c31af7Sopenharmony_ci If pname:renderPass is not dlink:VK_NULL_HANDLE, the pipeline is being 1101e5c31af7Sopenharmony_ci created with <<pipeline-graphics-subsets-fragment-shader, fragment 1102e5c31af7Sopenharmony_ci shader state>>, and pname:subpass uses a depth/stencil attachment in 1103e5c31af7Sopenharmony_ci pname:renderPass with a read-only layout for the stencil aspect in the 1104e5c31af7Sopenharmony_ci slink:VkAttachmentReference defined by pname:subpass, the pname:failOp, 1105e5c31af7Sopenharmony_ci pname:passOp and pname:depthFailOp members of each of the pname:front 1106e5c31af7Sopenharmony_ci and pname:back members of pname:pDepthStencilState must: be 1107e5c31af7Sopenharmony_ci ename:VK_STENCIL_OP_KEEP 1108e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-renderPass-06041]] 1109e5c31af7Sopenharmony_ci If pname:renderPass is not dlink:VK_NULL_HANDLE, and the pipeline is 1110e5c31af7Sopenharmony_ci being created with <<pipeline-graphics-subsets-fragment-output, fragment 1111e5c31af7Sopenharmony_ci output interface state>>, then for each color attachment in the subpass, 1112e5c31af7Sopenharmony_ci if the <<potential-format-features,potential format features>> of the 1113e5c31af7Sopenharmony_ci format of the corresponding attachment description do not contain 1114e5c31af7Sopenharmony_ci ename:VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT, then the 1115e5c31af7Sopenharmony_ci pname:blendEnable member of the corresponding element of the 1116e5c31af7Sopenharmony_ci pname:pAttachments member of pname:pColorBlendState must: be 1117e5c31af7Sopenharmony_ci ename:VK_FALSE 1118e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-renderPass-06042]] 1119e5c31af7Sopenharmony_ci If pname:renderPass is not dlink:VK_NULL_HANDLE, and the pipeline is 1120e5c31af7Sopenharmony_ci being created with <<pipeline-graphics-subsets-fragment-output, fragment 1121e5c31af7Sopenharmony_ci output interface state>>, and the subpass uses color attachments, the 1122e5c31af7Sopenharmony_ci pname:attachmentCount member of pname:pColorBlendState must: be equal to 1123e5c31af7Sopenharmony_ci the pname:colorAttachmentCount used to create pname:subpass 1124e5c31af7Sopenharmony_ciifndef::VK_EXT_extended_dynamic_state[] 1125e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-00747]] 1126e5c31af7Sopenharmony_ci If the pipeline is being created with 1127e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-pre-rasterization, pre-rasterization shader 1128e5c31af7Sopenharmony_ci state>>, and no element of the pname:pDynamicStates member of 1129e5c31af7Sopenharmony_ci pname:pDynamicState is ename:VK_DYNAMIC_STATE_VIEWPORT, the 1130e5c31af7Sopenharmony_ci pname:pViewports member of pname:pViewportState must: be a valid pointer 1131e5c31af7Sopenharmony_ci to an array of pname:pViewportState->viewportCount valid 1132e5c31af7Sopenharmony_ci sname:VkViewport structures 1133e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-00748]] 1134e5c31af7Sopenharmony_ci If the pipeline is being created with 1135e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-pre-rasterization, pre-rasterization shader 1136e5c31af7Sopenharmony_ci state>>, and no element of the pname:pDynamicStates member of 1137e5c31af7Sopenharmony_ci pname:pDynamicState is ename:VK_DYNAMIC_STATE_SCISSOR, the 1138e5c31af7Sopenharmony_ci pname:pScissors member of pname:pViewportState must: be a valid pointer 1139e5c31af7Sopenharmony_ci to an array of pname:pViewportState->scissorCount sname:VkRect2D 1140e5c31af7Sopenharmony_ci structures 1141e5c31af7Sopenharmony_ciendif::VK_EXT_extended_dynamic_state[] 1142e5c31af7Sopenharmony_ciifdef::VK_EXT_extended_dynamic_state[] 1143e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-04130]] 1144e5c31af7Sopenharmony_ci If the pipeline is being created with 1145e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-pre-rasterization, pre-rasterization shader 1146e5c31af7Sopenharmony_ci state>>, and no element of the pname:pDynamicStates member of 1147e5c31af7Sopenharmony_ci pname:pDynamicState is ename:VK_DYNAMIC_STATE_VIEWPORT or 1148e5c31af7Sopenharmony_ci ename:VK_DYNAMIC_STATE_VIEWPORT_WITH_COUNT_EXT, the pname:pViewports 1149e5c31af7Sopenharmony_ci member of pname:pViewportState must: be a valid pointer to an array of 1150e5c31af7Sopenharmony_ci pname:pViewportState->viewportCount valid sname:VkViewport structures 1151e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-04131]] 1152e5c31af7Sopenharmony_ci If the pipeline is being created with 1153e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-pre-rasterization, pre-rasterization shader 1154e5c31af7Sopenharmony_ci state>>, and no element of the pname:pDynamicStates member of 1155e5c31af7Sopenharmony_ci pname:pDynamicState is ename:VK_DYNAMIC_STATE_SCISSOR or 1156e5c31af7Sopenharmony_ci ename:VK_DYNAMIC_STATE_SCISSOR_WITH_COUNT_EXT, the pname:pScissors 1157e5c31af7Sopenharmony_ci member of pname:pViewportState must: be a valid pointer to an array of 1158e5c31af7Sopenharmony_ci pname:pViewportState->scissorCount sname:VkRect2D structures 1159e5c31af7Sopenharmony_ciendif::VK_EXT_extended_dynamic_state[] 1160e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-00749]] 1161e5c31af7Sopenharmony_ci If the pipeline is being created with 1162e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-pre-rasterization, pre-rasterization shader 1163e5c31af7Sopenharmony_ci state>>, and the wide lines feature is not enabled, and no element of 1164e5c31af7Sopenharmony_ci the pname:pDynamicStates member of pname:pDynamicState is 1165e5c31af7Sopenharmony_ci ename:VK_DYNAMIC_STATE_LINE_WIDTH, the pname:lineWidth member of 1166e5c31af7Sopenharmony_ci pname:pRasterizationState must: be `1.0` 1167e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-rasterizerDiscardEnable-00750]] 1168e5c31af7Sopenharmony_ci If the pipeline is being created with 1169e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-pre-rasterization, pre-rasterization shader 1170e5c31af7Sopenharmony_ci state>>, and the pname:rasterizerDiscardEnable member of 1171e5c31af7Sopenharmony_ci pname:pRasterizationState is ename:VK_FALSE, pname:pViewportState must: 1172e5c31af7Sopenharmony_ci be a valid pointer to a valid slink:VkPipelineViewportStateCreateInfo 1173e5c31af7Sopenharmony_ci structure 1174e5c31af7Sopenharmony_ciifdef::VK_EXT_extended_dynamic_state2[] 1175e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-pViewportState-04892]] 1176e5c31af7Sopenharmony_ci If the pipeline is being created with 1177e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-pre-rasterization, pre-rasterization shader 1178e5c31af7Sopenharmony_ci state>>, and the graphics pipeline state was created with the 1179e5c31af7Sopenharmony_ci ename:VK_DYNAMIC_STATE_RASTERIZER_DISCARD_ENABLE_EXT dynamic state 1180e5c31af7Sopenharmony_ci enabled, pname:pViewportState must: be a valid pointer to a valid 1181e5c31af7Sopenharmony_ci slink:VkPipelineViewportStateCreateInfo structure 1182e5c31af7Sopenharmony_ciendif::VK_EXT_extended_dynamic_state2[] 1183e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-rasterizerDiscardEnable-00751]] 1184e5c31af7Sopenharmony_ci If the pipeline is being created with 1185e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-fragment-shader, fragment shader state>>, 1186e5c31af7Sopenharmony_ci pname:pMultisampleState must: be a valid pointer to a valid 1187e5c31af7Sopenharmony_ci slink:VkPipelineMultisampleStateCreateInfo structure 1188e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-renderPass-06043]] 1189e5c31af7Sopenharmony_ci If pname:renderPass is not dlink:VK_NULL_HANDLE, the pipeline is being 1190e5c31af7Sopenharmony_ci created with <<pipeline-graphics-subsets-fragment-shader, fragment 1191e5c31af7Sopenharmony_ci shader state>>, and pname:subpass uses a depth/stencil attachment, 1192e5c31af7Sopenharmony_ci pname:pDepthStencilState must: be a valid pointer to a valid 1193e5c31af7Sopenharmony_ci slink:VkPipelineDepthStencilStateCreateInfo structure 1194e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-renderPass-06044]] 1195e5c31af7Sopenharmony_ci If pname:renderPass is not dlink:VK_NULL_HANDLE, the pipeline is being 1196e5c31af7Sopenharmony_ci created with <<pipeline-graphics-subsets-fragment-output, fragment 1197e5c31af7Sopenharmony_ci output interface state>>, and pname:subpass uses color attachments, 1198e5c31af7Sopenharmony_ci pname:pColorBlendState must: be a valid pointer to a valid 1199e5c31af7Sopenharmony_ci slink:VkPipelineColorBlendStateCreateInfo structure 1200e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-renderPass-06045]] 1201e5c31af7Sopenharmony_ci If pname:renderPass is not dlink:VK_NULL_HANDLE and the pipeline is 1202e5c31af7Sopenharmony_ci being created with <<pipeline-graphics-subsets-fragment-output, fragment 1203e5c31af7Sopenharmony_ci output interface state>>, pname:pColorBlendState->attachmentCount must: 1204e5c31af7Sopenharmony_ci be greater than the index of all color attachments that are not 1205e5c31af7Sopenharmony_ci ename:VK_ATTACHMENT_UNUSED for the pname:subpass index in 1206e5c31af7Sopenharmony_ci pname:renderPass 1207e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-00754]] 1208e5c31af7Sopenharmony_ci If the pipeline is being created with 1209e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-pre-rasterization, pre-rasterization shader 1210e5c31af7Sopenharmony_ci state>>, the depth bias clamping feature is not enabled, no element of 1211e5c31af7Sopenharmony_ci the pname:pDynamicStates member of pname:pDynamicState is 1212e5c31af7Sopenharmony_ci ename:VK_DYNAMIC_STATE_DEPTH_BIAS, and the pname:depthBiasEnable member 1213e5c31af7Sopenharmony_ci of pname:pRasterizationState is ename:VK_TRUE, the pname:depthBiasClamp 1214e5c31af7Sopenharmony_ci member of pname:pRasterizationState must: be `0.0` 1215e5c31af7Sopenharmony_ciifndef::VK_EXT_depth_range_unrestricted[] 1216e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-00755]] 1217e5c31af7Sopenharmony_ci If the pipeline is being created with 1218e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-fragment-shader, fragment shader state>>, 1219e5c31af7Sopenharmony_ci and no element of the pname:pDynamicStates member of pname:pDynamicState 1220e5c31af7Sopenharmony_ci is ename:VK_DYNAMIC_STATE_DEPTH_BOUNDS, and the 1221e5c31af7Sopenharmony_ci pname:depthBoundsTestEnable member of pname:pDepthStencilState is 1222e5c31af7Sopenharmony_ci ename:VK_TRUE, the pname:minDepthBounds and pname:maxDepthBounds members 1223e5c31af7Sopenharmony_ci of pname:pDepthStencilState must: be between `0.0` and `1.0`, inclusive 1224e5c31af7Sopenharmony_ciendif::VK_EXT_depth_range_unrestricted[] 1225e5c31af7Sopenharmony_ciifdef::VK_EXT_depth_range_unrestricted[] 1226e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-02510]] 1227e5c31af7Sopenharmony_ci If the pipeline is being created with 1228e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-fragment-shader, fragment shader state>>, 1229e5c31af7Sopenharmony_ci and the `apiext:VK_EXT_depth_range_unrestricted` extension is not 1230e5c31af7Sopenharmony_ci enabled and no element of the pname:pDynamicStates member of 1231e5c31af7Sopenharmony_ci pname:pDynamicState is ename:VK_DYNAMIC_STATE_DEPTH_BOUNDS, and the 1232e5c31af7Sopenharmony_ci pname:depthBoundsTestEnable member of pname:pDepthStencilState is 1233e5c31af7Sopenharmony_ci ename:VK_TRUE, the pname:minDepthBounds and pname:maxDepthBounds members 1234e5c31af7Sopenharmony_ci of pname:pDepthStencilState must: be between `0.0` and `1.0`, inclusive 1235e5c31af7Sopenharmony_ciendif::VK_EXT_depth_range_unrestricted[] 1236e5c31af7Sopenharmony_ciifdef::VK_EXT_sample_locations[] 1237e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-01521]] 1238e5c31af7Sopenharmony_ci If the pipeline is being created with 1239e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-fragment-shader, fragment shader state>>, 1240e5c31af7Sopenharmony_ci and no element of the pname:pDynamicStates member of pname:pDynamicState 1241e5c31af7Sopenharmony_ci is ename:VK_DYNAMIC_STATE_SAMPLE_LOCATIONS_EXT, and the 1242e5c31af7Sopenharmony_ci pname:sampleLocationsEnable member of a 1243e5c31af7Sopenharmony_ci slink:VkPipelineSampleLocationsStateCreateInfoEXT structure included in 1244e5c31af7Sopenharmony_ci the pname:pNext chain of pname:pMultisampleState is ename:VK_TRUE, 1245e5c31af7Sopenharmony_ci pname:sampleLocationsInfo.sampleLocationGridSize.width must: evenly 1246e5c31af7Sopenharmony_ci divide 1247e5c31af7Sopenharmony_ci slink:VkMultisamplePropertiesEXT::pname:sampleLocationGridSize.width as 1248e5c31af7Sopenharmony_ci returned by flink:vkGetPhysicalDeviceMultisamplePropertiesEXT with a 1249e5c31af7Sopenharmony_ci pname:samples parameter equaling pname:rasterizationSamples 1250e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-01522]] 1251e5c31af7Sopenharmony_ci If the pipeline is being created with 1252e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-fragment-shader, fragment shader state>>, 1253e5c31af7Sopenharmony_ci and no element of the pname:pDynamicStates member of pname:pDynamicState 1254e5c31af7Sopenharmony_ci is ename:VK_DYNAMIC_STATE_SAMPLE_LOCATIONS_EXT, and the 1255e5c31af7Sopenharmony_ci pname:sampleLocationsEnable member of a 1256e5c31af7Sopenharmony_ci slink:VkPipelineSampleLocationsStateCreateInfoEXT structure included in 1257e5c31af7Sopenharmony_ci the pname:pNext chain of pname:pMultisampleState is ename:VK_TRUE, 1258e5c31af7Sopenharmony_ci pname:sampleLocationsInfo.sampleLocationGridSize.height must: evenly 1259e5c31af7Sopenharmony_ci divide 1260e5c31af7Sopenharmony_ci slink:VkMultisamplePropertiesEXT::pname:sampleLocationGridSize.height as 1261e5c31af7Sopenharmony_ci returned by flink:vkGetPhysicalDeviceMultisamplePropertiesEXT with a 1262e5c31af7Sopenharmony_ci pname:samples parameter equaling pname:rasterizationSamples 1263e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-01523]] 1264e5c31af7Sopenharmony_ci If the pipeline is being created with 1265e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-fragment-shader, fragment shader state>>, 1266e5c31af7Sopenharmony_ci and no element of the pname:pDynamicStates member of pname:pDynamicState 1267e5c31af7Sopenharmony_ci is ename:VK_DYNAMIC_STATE_SAMPLE_LOCATIONS_EXT, and the 1268e5c31af7Sopenharmony_ci pname:sampleLocationsEnable member of a 1269e5c31af7Sopenharmony_ci slink:VkPipelineSampleLocationsStateCreateInfoEXT structure included in 1270e5c31af7Sopenharmony_ci the pname:pNext chain of pname:pMultisampleState is ename:VK_TRUE, 1271e5c31af7Sopenharmony_ci pname:sampleLocationsInfo.sampleLocationsPerPixel must: equal 1272e5c31af7Sopenharmony_ci pname:rasterizationSamples 1273e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-sampleLocationsEnable-01524]] 1274e5c31af7Sopenharmony_ci If the pipeline is being created with 1275e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-fragment-shader, fragment shader state>>, 1276e5c31af7Sopenharmony_ci and the pname:sampleLocationsEnable member of a 1277e5c31af7Sopenharmony_ci slink:VkPipelineSampleLocationsStateCreateInfoEXT structure included in 1278e5c31af7Sopenharmony_ci the pname:pNext chain of pname:pMultisampleState is ename:VK_TRUE, the 1279e5c31af7Sopenharmony_ci fragment shader code must: not statically use the extended instruction 1280e5c31af7Sopenharmony_ci code:InterpolateAtSample 1281e5c31af7Sopenharmony_ciendif::VK_EXT_sample_locations[] 1282e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-layout-00756]] 1283e5c31af7Sopenharmony_ci pname:layout must: be 1284e5c31af7Sopenharmony_ci <<descriptorsets-pipelinelayout-consistency,consistent>> with all 1285e5c31af7Sopenharmony_ci shaders specified in pname:pStages 1286e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-subpass-00757]] 1287e5c31af7Sopenharmony_ci If the pipeline is being created with 1288e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-fragment-shader, fragment shader state>>, 1289e5c31af7Sopenharmony_ci and neither the `apiext:VK_AMD_mixed_attachment_samples` nor the 1290e5c31af7Sopenharmony_ci `apiext:VK_NV_framebuffer_mixed_samples` extensions are enabled, and if 1291e5c31af7Sopenharmony_ci pname:subpass uses color and/or depth/stencil attachments, then the 1292e5c31af7Sopenharmony_ci pname:rasterizationSamples member of pname:pMultisampleState must: be 1293e5c31af7Sopenharmony_ci the same as the sample count for those subpass attachments 1294e5c31af7Sopenharmony_ciifdef::VK_AMD_mixed_attachment_samples[] 1295e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-subpass-01505]] 1296e5c31af7Sopenharmony_ci If the pipeline is being created with 1297e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-fragment-shader, fragment shader state>>, 1298e5c31af7Sopenharmony_ci and the `apiext:VK_AMD_mixed_attachment_samples` extension is enabled, 1299e5c31af7Sopenharmony_ci and if pname:subpass uses color and/or depth/stencil attachments, then 1300e5c31af7Sopenharmony_ci the pname:rasterizationSamples member of pname:pMultisampleState must: 1301e5c31af7Sopenharmony_ci equal the maximum of the sample counts of those subpass attachments 1302e5c31af7Sopenharmony_ciendif::VK_AMD_mixed_attachment_samples[] 1303e5c31af7Sopenharmony_ciifdef::VK_NV_framebuffer_mixed_samples[] 1304e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-subpass-01411]] 1305e5c31af7Sopenharmony_ci If the pipeline is being created with 1306e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-fragment-shader, fragment shader state>>, 1307e5c31af7Sopenharmony_ci and the `apiext:VK_NV_framebuffer_mixed_samples` extension is enabled, 1308e5c31af7Sopenharmony_ci and if pname:subpass has a depth/stencil attachment and depth test, 1309e5c31af7Sopenharmony_ci stencil test, or depth bounds test are enabled, then the 1310e5c31af7Sopenharmony_ci pname:rasterizationSamples member of pname:pMultisampleState must: be 1311e5c31af7Sopenharmony_ci the same as the sample count of the depth/stencil attachment 1312e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-subpass-01412]] 1313e5c31af7Sopenharmony_ci If the pipeline is being created with 1314e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-fragment-shader, fragment shader state>>, 1315e5c31af7Sopenharmony_ci and the `apiext:VK_NV_framebuffer_mixed_samples` extension is enabled, 1316e5c31af7Sopenharmony_ci and if pname:subpass has any color attachments, then the 1317e5c31af7Sopenharmony_ci pname:rasterizationSamples member of pname:pMultisampleState must: be 1318e5c31af7Sopenharmony_ci greater than or equal to the sample count for those subpass attachments 1319e5c31af7Sopenharmony_ciendif::VK_NV_framebuffer_mixed_samples[] 1320e5c31af7Sopenharmony_ciifdef::VK_NV_coverage_reduction_mode[] 1321e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-coverageReductionMode-02722]] 1322e5c31af7Sopenharmony_ci If the pipeline is being created with 1323e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-fragment-shader, fragment shader state>>, 1324e5c31af7Sopenharmony_ci and the `apiext:VK_NV_coverage_reduction_mode` extension is enabled, the 1325e5c31af7Sopenharmony_ci coverage reduction mode specified by 1326e5c31af7Sopenharmony_ci slink:VkPipelineCoverageReductionStateCreateInfoNV::pname:coverageReductionMode, 1327e5c31af7Sopenharmony_ci the pname:rasterizationSamples member of pname:pMultisampleState and the 1328e5c31af7Sopenharmony_ci sample counts for the color and depth/stencil attachments (if the 1329e5c31af7Sopenharmony_ci subpass has them) must: be a valid combination returned by 1330e5c31af7Sopenharmony_ci fname:vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV 1331e5c31af7Sopenharmony_ciendif::VK_NV_coverage_reduction_mode[] 1332e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-subpass-00758]] 1333e5c31af7Sopenharmony_ci If the pipeline is being created with 1334e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-fragment-shader, fragment shader state>> and 1335e5c31af7Sopenharmony_ci pname:subpass does not use any color and/or depth/stencil attachments, 1336e5c31af7Sopenharmony_ci then the pname:rasterizationSamples member of pname:pMultisampleState 1337e5c31af7Sopenharmony_ci must: follow the rules for a <<renderpass-noattachments, zero-attachment 1338e5c31af7Sopenharmony_ci subpass>> 1339e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-renderPass-06046]] 1340e5c31af7Sopenharmony_ci If pname:renderPass is a valid renderPass, pname:subpass must: be a 1341e5c31af7Sopenharmony_ci valid subpass within pname:renderPass 1342e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_multiview[] 1343e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-renderPass-06047]] 1344e5c31af7Sopenharmony_ci If pname:renderPass is a valid renderPass, the pipeline is being created 1345e5c31af7Sopenharmony_ci with <<pipeline-graphics-subsets-pre-rasterization, pre-rasterization 1346e5c31af7Sopenharmony_ci shader state>>, and the pname:renderPass has multiview enabled and 1347e5c31af7Sopenharmony_ci pname:subpass has more than one bit set in the view mask and 1348e5c31af7Sopenharmony_ci pname:multiviewTessellationShader is not enabled, then pname:pStages 1349e5c31af7Sopenharmony_ci must: not include tessellation shaders 1350e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-renderPass-06048]] 1351e5c31af7Sopenharmony_ci If pname:renderPass is a valid renderPass, the pipeline is being created 1352e5c31af7Sopenharmony_ci with <<pipeline-graphics-subsets-pre-rasterization, pre-rasterization 1353e5c31af7Sopenharmony_ci shader state>>, and the pname:renderPass has multiview enabled and 1354e5c31af7Sopenharmony_ci pname:subpass has more than one bit set in the view mask and 1355e5c31af7Sopenharmony_ci pname:multiviewGeometryShader is not enabled, then pname:pStages must: 1356e5c31af7Sopenharmony_ci not include a geometry shader 1357e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-renderPass-06049]] 1358e5c31af7Sopenharmony_ci If pname:renderPass is a valid renderPass, the pipeline is being created 1359e5c31af7Sopenharmony_ci with <<pipeline-graphics-subsets-pre-rasterization, pre-rasterization 1360e5c31af7Sopenharmony_ci shader state>>, and the pname:renderPass has multiview enabled and 1361e5c31af7Sopenharmony_ci pname:subpass has more than one bit set in the view mask, shaders in the 1362e5c31af7Sopenharmony_ci pipeline must: not write to the code:Layer built-in output 1363e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-renderPass-06050]] 1364e5c31af7Sopenharmony_ci If pname:renderPass is a valid renderPass and the pipeline is being 1365e5c31af7Sopenharmony_ci created with <<pipeline-graphics-subsets-pre-rasterization, 1366e5c31af7Sopenharmony_ci pre-rasterization shader state>>, and the pname:renderPass has multiview 1367e5c31af7Sopenharmony_ci enabled, then all shaders must: not include variables decorated with the 1368e5c31af7Sopenharmony_ci code:Layer built-in decoration in their interfaces 1369e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_multiview[] 1370e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_device_group[] 1371e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-flags-00764]] 1372e5c31af7Sopenharmony_ci pname:flags must: not contain the ename:VK_PIPELINE_CREATE_DISPATCH_BASE 1373e5c31af7Sopenharmony_ci flag 1374e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_device_group[] 1375e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_maintenance2,VK_KHR_create_renderpass2[] 1376e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-pStages-01565]] 1377e5c31af7Sopenharmony_ci If the pipeline is being created with 1378e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-fragment-shader, fragment shader state>> and 1379e5c31af7Sopenharmony_ci an input attachment was referenced by an pname:aspectMask at 1380e5c31af7Sopenharmony_ci pname:renderPass creation time, the fragment shader must: only read from 1381e5c31af7Sopenharmony_ci the aspects that were specified for that input attachment 1382e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_maintenance2,VK_KHR_create_renderpass2[] 1383e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-layout-01688]] 1384e5c31af7Sopenharmony_ci The number of resources in pname:layout accessible to each shader stage 1385e5c31af7Sopenharmony_ci that is used by the pipeline must: be less than or equal to 1386e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceLimits::pname:maxPerStageResources 1387e5c31af7Sopenharmony_ciifdef::VK_NV_clip_space_w_scaling[] 1388e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-01715]] 1389e5c31af7Sopenharmony_ci If the pipeline is being created with 1390e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-pre-rasterization, pre-rasterization shader 1391e5c31af7Sopenharmony_ci state>>, and no element of the pname:pDynamicStates member of 1392e5c31af7Sopenharmony_ci pname:pDynamicState is ename:VK_DYNAMIC_STATE_VIEWPORT_W_SCALING_NV, and 1393e5c31af7Sopenharmony_ci the pname:viewportWScalingEnable member of a 1394e5c31af7Sopenharmony_ci slink:VkPipelineViewportWScalingStateCreateInfoNV structure, included in 1395e5c31af7Sopenharmony_ci the pname:pNext chain of pname:pViewportState, is ename:VK_TRUE, the 1396e5c31af7Sopenharmony_ci pname:pViewportWScalings member of the 1397e5c31af7Sopenharmony_ci slink:VkPipelineViewportWScalingStateCreateInfoNV must: be a pointer to 1398e5c31af7Sopenharmony_ci an array of 1399e5c31af7Sopenharmony_ci slink:VkPipelineViewportWScalingStateCreateInfoNV::pname:viewportCount 1400e5c31af7Sopenharmony_ci valid slink:VkViewportWScalingNV structures 1401e5c31af7Sopenharmony_ciendif::VK_NV_clip_space_w_scaling[] 1402e5c31af7Sopenharmony_ciifdef::VK_NV_scissor_exclusive[] 1403e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-04056]] 1404e5c31af7Sopenharmony_ci If the pipeline is being created with 1405e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-pre-rasterization, pre-rasterization shader 1406e5c31af7Sopenharmony_ci state>>, and no element of the pname:pDynamicStates member of 1407e5c31af7Sopenharmony_ci pname:pDynamicState is ename:VK_DYNAMIC_STATE_EXCLUSIVE_SCISSOR_NV, and 1408e5c31af7Sopenharmony_ci if pname:pViewportState->pNext chain includes a 1409e5c31af7Sopenharmony_ci slink:VkPipelineViewportExclusiveScissorStateCreateInfoNV structure, and 1410e5c31af7Sopenharmony_ci if its pname:exclusiveScissorCount member is not `0`, then its 1411e5c31af7Sopenharmony_ci pname:pExclusiveScissors member must: be a valid pointer to an array of 1412e5c31af7Sopenharmony_ci pname:exclusiveScissorCount slink:VkRect2D structures 1413e5c31af7Sopenharmony_ciendif::VK_NV_scissor_exclusive[] 1414e5c31af7Sopenharmony_ciifdef::VK_NV_shading_rate_image[] 1415e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-04057]] 1416e5c31af7Sopenharmony_ci If the pipeline is being created with 1417e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-pre-rasterization, pre-rasterization shader 1418e5c31af7Sopenharmony_ci state>>, and no element of the pname:pDynamicStates member of 1419e5c31af7Sopenharmony_ci pname:pDynamicState is 1420e5c31af7Sopenharmony_ci ename:VK_DYNAMIC_STATE_VIEWPORT_SHADING_RATE_PALETTE_NV, and if 1421e5c31af7Sopenharmony_ci pname:pViewportState->pNext chain includes a 1422e5c31af7Sopenharmony_ci slink:VkPipelineViewportShadingRateImageStateCreateInfoNV structure, 1423e5c31af7Sopenharmony_ci then its pname:pShadingRatePalettes member must: be a valid pointer to 1424e5c31af7Sopenharmony_ci an array of pname:viewportCount valid slink:VkShadingRatePaletteNV 1425e5c31af7Sopenharmony_ci structures 1426e5c31af7Sopenharmony_ciendif::VK_NV_shading_rate_image[] 1427e5c31af7Sopenharmony_ciifdef::VK_EXT_discard_rectangles[] 1428e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-04058]] 1429e5c31af7Sopenharmony_ci If the pipeline is being created with 1430e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-pre-rasterization, pre-rasterization shader 1431e5c31af7Sopenharmony_ci state>>, and no element of the pname:pDynamicStates member of 1432e5c31af7Sopenharmony_ci pname:pDynamicState is ename:VK_DYNAMIC_STATE_DISCARD_RECTANGLE_EXT, and 1433e5c31af7Sopenharmony_ci if pname:pNext chain includes a 1434e5c31af7Sopenharmony_ci slink:VkPipelineDiscardRectangleStateCreateInfoEXT structure, and if its 1435e5c31af7Sopenharmony_ci pname:discardRectangleCount member is not `0`, then its 1436e5c31af7Sopenharmony_ci pname:pDiscardRectangles member must: be a valid pointer to an array of 1437e5c31af7Sopenharmony_ci pname:discardRectangleCount slink:VkRect2D structures 1438e5c31af7Sopenharmony_ciendif::VK_EXT_discard_rectangles[] 1439e5c31af7Sopenharmony_ciifndef::VK_EXT_vertex_input_dynamic_state[] 1440e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-pStages-02097]] 1441e5c31af7Sopenharmony_ci If the pipeline is being created with 1442e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-vertex-input, vertex input state>>, 1443e5c31af7Sopenharmony_ci pname:pVertexInputState must: be a valid pointer to a valid 1444e5c31af7Sopenharmony_ci slink:VkPipelineVertexInputStateCreateInfo structure 1445e5c31af7Sopenharmony_ciendif::VK_EXT_vertex_input_dynamic_state[] 1446e5c31af7Sopenharmony_ciifndef::VK_EXT_vertex_input_dynamic_state[] 1447e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-pVertexInputState-04910]] 1448e5c31af7Sopenharmony_ci If the pipeline is being created with 1449e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-vertex-input, vertex input state>>, and 1450e5c31af7Sopenharmony_ci ename:VK_DYNAMIC_STATE_VERTEX_INPUT_EXT is not set, 1451e5c31af7Sopenharmony_ci pname:pVertexInputState must: be a valid pointer to a valid 1452e5c31af7Sopenharmony_ci slink:VkPipelineVertexInputStateCreateInfo structure 1453e5c31af7Sopenharmony_ciendif::VK_EXT_vertex_input_dynamic_state[] 1454e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-pStages-02098]] 1455e5c31af7Sopenharmony_ci If the pipeline is being created with 1456e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-vertex-input, vertex input state>>, 1457e5c31af7Sopenharmony_ci pname:pInputAssemblyState must: be a valid pointer to a valid 1458e5c31af7Sopenharmony_ci slink:VkPipelineInputAssemblyStateCreateInfo structure 1459e5c31af7Sopenharmony_ciifdef::VK_EXT_transform_feedback[] 1460e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-pStages-02317]] 1461e5c31af7Sopenharmony_ci If the pipeline is being created with 1462e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-pre-rasterization, pre-rasterization shader 1463e5c31af7Sopenharmony_ci state>>, the code:Xfb execution mode can: be specified by no more than 1464e5c31af7Sopenharmony_ci one shader stage in pname:pStages 1465e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-pStages-02318]] 1466e5c31af7Sopenharmony_ci If the pipeline is being created with 1467e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-pre-rasterization, pre-rasterization shader 1468e5c31af7Sopenharmony_ci state>>, and any shader stage in pname:pStages specifies code:Xfb 1469e5c31af7Sopenharmony_ci execution mode it must: be the last 1470e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-pre-rasterization,pre-rasterization shader 1471e5c31af7Sopenharmony_ci stage>> 1472e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-rasterizationStream-02319]] 1473e5c31af7Sopenharmony_ci If the pipeline is being created with 1474e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-pre-rasterization, pre-rasterization shader 1475e5c31af7Sopenharmony_ci state>>, and a 1476e5c31af7Sopenharmony_ci slink:VkPipelineRasterizationStateStreamCreateInfoEXT::pname:rasterizationStream 1477e5c31af7Sopenharmony_ci value other than zero is specified, all variables in the output 1478e5c31af7Sopenharmony_ci interface of the entry point being compiled decorated with 1479e5c31af7Sopenharmony_ci code:Position, code:PointSize, code:ClipDistance, or code:CullDistance 1480e5c31af7Sopenharmony_ci must: be decorated with identical code:Stream values that match the 1481e5c31af7Sopenharmony_ci pname:rasterizationStream 1482e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-rasterizationStream-02320]] 1483e5c31af7Sopenharmony_ci If the pipeline is being created with 1484e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-pre-rasterization, pre-rasterization shader 1485e5c31af7Sopenharmony_ci state>>, and 1486e5c31af7Sopenharmony_ci slink:VkPipelineRasterizationStateStreamCreateInfoEXT::pname:rasterizationStream 1487e5c31af7Sopenharmony_ci is zero, or not specified, all variables in the output interface of the 1488e5c31af7Sopenharmony_ci entry point being compiled decorated with code:Position, code:PointSize, 1489e5c31af7Sopenharmony_ci code:ClipDistance, or code:CullDistance must: be decorated with a 1490e5c31af7Sopenharmony_ci code:Stream value of zero, or must: not specify the code:Stream 1491e5c31af7Sopenharmony_ci decoration 1492e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-geometryStreams-02321]] 1493e5c31af7Sopenharmony_ci If the pipeline is being created with 1494e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-pre-rasterization, pre-rasterization shader 1495e5c31af7Sopenharmony_ci state>>, and the last 1496e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-pre-rasterization,pre-rasterization shader 1497e5c31af7Sopenharmony_ci stage>> is a geometry shader, and that geometry shader uses the 1498e5c31af7Sopenharmony_ci code:GeometryStreams capability, then 1499e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceTransformFeedbackFeaturesEXT::pname:geometryStreams 1500e5c31af7Sopenharmony_ci feature must: be enabled 1501e5c31af7Sopenharmony_ciifdef::VK_NV_mesh_shader[] 1502e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-None-02322]] 1503e5c31af7Sopenharmony_ci If the pipeline is being created with 1504e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-pre-rasterization, pre-rasterization shader 1505e5c31af7Sopenharmony_ci state>>, and there are any mesh shader stages in the pipeline there 1506e5c31af7Sopenharmony_ci must: not be any shader stage in the pipeline with a code:Xfb execution 1507e5c31af7Sopenharmony_ci mode 1508e5c31af7Sopenharmony_ciendif::VK_NV_mesh_shader[] 1509e5c31af7Sopenharmony_ciendif::VK_EXT_transform_feedback[] 1510e5c31af7Sopenharmony_ciifdef::VK_EXT_line_rasterization[] 1511e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-lineRasterizationMode-02766]] 1512e5c31af7Sopenharmony_ci If the pipeline is being created with 1513e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-pre-rasterization, pre-rasterization shader 1514e5c31af7Sopenharmony_ci state>> and at least one of <<pipeline-graphics-subsets-fragment-output, 1515e5c31af7Sopenharmony_ci fragment output interface state>> or 1516e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-fragment-shader, fragment shader state>>, 1517e5c31af7Sopenharmony_ci the pname:lineRasterizationMode member of a 1518e5c31af7Sopenharmony_ci slink:VkPipelineRasterizationLineStateCreateInfoEXT structure included 1519e5c31af7Sopenharmony_ci in the pname:pNext chain of pname:pRasterizationState is 1520e5c31af7Sopenharmony_ci ename:VK_LINE_RASTERIZATION_MODE_BRESENHAM_EXT or 1521e5c31af7Sopenharmony_ci ename:VK_LINE_RASTERIZATION_MODE_RECTANGULAR_SMOOTH_EXT, then the 1522e5c31af7Sopenharmony_ci pname:alphaToCoverageEnable, pname:alphaToOneEnable, and 1523e5c31af7Sopenharmony_ci pname:sampleShadingEnable members of pname:pMultisampleState must: all 1524e5c31af7Sopenharmony_ci be ename:VK_FALSE 1525e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-stippledLineEnable-02767]] 1526e5c31af7Sopenharmony_ci If the pipeline is being created with 1527e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-pre-rasterization, pre-rasterization shader 1528e5c31af7Sopenharmony_ci state>>, the pname:stippledLineEnable member of 1529e5c31af7Sopenharmony_ci slink:VkPipelineRasterizationLineStateCreateInfoEXT is ename:VK_TRUE, 1530e5c31af7Sopenharmony_ci and no element of the pname:pDynamicStates member of pname:pDynamicState 1531e5c31af7Sopenharmony_ci is ename:VK_DYNAMIC_STATE_LINE_STIPPLE_EXT, then the 1532e5c31af7Sopenharmony_ci pname:lineStippleFactor member of 1533e5c31af7Sopenharmony_ci slink:VkPipelineRasterizationLineStateCreateInfoEXT must: be in the 1534e5c31af7Sopenharmony_ci range [eq]#[1,256]# 1535e5c31af7Sopenharmony_ciendif::VK_EXT_line_rasterization[] 1536e5c31af7Sopenharmony_ciifdef::VK_KHR_pipeline_library[] 1537e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-flags-03371]] 1538e5c31af7Sopenharmony_ci pname:flags must: not include ename:VK_PIPELINE_CREATE_LIBRARY_BIT_KHR 1539e5c31af7Sopenharmony_ciendif::VK_KHR_pipeline_library[] 1540e5c31af7Sopenharmony_ciifdef::VK_KHR_ray_tracing_pipeline[] 1541e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-flags-03372]] 1542e5c31af7Sopenharmony_ci pname:flags must: not include 1543e5c31af7Sopenharmony_ci ename:VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_ANY_HIT_SHADERS_BIT_KHR 1544e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-flags-03373]] 1545e5c31af7Sopenharmony_ci pname:flags must: not include 1546e5c31af7Sopenharmony_ci ename:VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_CLOSEST_HIT_SHADERS_BIT_KHR 1547e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-flags-03374]] 1548e5c31af7Sopenharmony_ci pname:flags must: not include 1549e5c31af7Sopenharmony_ci ename:VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_MISS_SHADERS_BIT_KHR 1550e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-flags-03375]] 1551e5c31af7Sopenharmony_ci pname:flags must: not include 1552e5c31af7Sopenharmony_ci ename:VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_INTERSECTION_SHADERS_BIT_KHR 1553e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-flags-03376]] 1554e5c31af7Sopenharmony_ci pname:flags must: not include 1555e5c31af7Sopenharmony_ci ename:VK_PIPELINE_CREATE_RAY_TRACING_SKIP_TRIANGLES_BIT_KHR 1556e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-flags-03377]] 1557e5c31af7Sopenharmony_ci pname:flags must: not include 1558e5c31af7Sopenharmony_ci ename:VK_PIPELINE_CREATE_RAY_TRACING_SKIP_AABBS_BIT_KHR 1559e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-flags-03577]] 1560e5c31af7Sopenharmony_ci pname:flags must: not include 1561e5c31af7Sopenharmony_ci ename:VK_PIPELINE_CREATE_RAY_TRACING_SHADER_GROUP_HANDLE_CAPTURE_REPLAY_BIT_KHR 1562e5c31af7Sopenharmony_ciendif::VK_KHR_ray_tracing_pipeline[] 1563e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing_motion_blur[] 1564e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-flags-04947]] 1565e5c31af7Sopenharmony_ci pname:flags must: not include 1566e5c31af7Sopenharmony_ci ename:VK_PIPELINE_CREATE_RAY_TRACING_ALLOW_MOTION_BIT_NV 1567e5c31af7Sopenharmony_ciendif::VK_NV_ray_tracing_motion_blur[] 1568e5c31af7Sopenharmony_ciifdef::VK_EXT_extended_dynamic_state[] 1569e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-03378]] 1570e5c31af7Sopenharmony_ci If the <<features-extendedDynamicState, extendedDynamicState>> feature 1571e5c31af7Sopenharmony_ci is not enabled, there must: be no element of the pname:pDynamicStates 1572e5c31af7Sopenharmony_ci member of pname:pDynamicState set to 1573e5c31af7Sopenharmony_ci ename:VK_DYNAMIC_STATE_CULL_MODE_EXT, 1574e5c31af7Sopenharmony_ci ename:VK_DYNAMIC_STATE_FRONT_FACE_EXT, 1575e5c31af7Sopenharmony_ci ename:VK_DYNAMIC_STATE_PRIMITIVE_TOPOLOGY_EXT, 1576e5c31af7Sopenharmony_ci ename:VK_DYNAMIC_STATE_VIEWPORT_WITH_COUNT_EXT, 1577e5c31af7Sopenharmony_ci ename:VK_DYNAMIC_STATE_SCISSOR_WITH_COUNT_EXT, 1578e5c31af7Sopenharmony_ci ename:VK_DYNAMIC_STATE_VERTEX_INPUT_BINDING_STRIDE_EXT, 1579e5c31af7Sopenharmony_ci ename:VK_DYNAMIC_STATE_DEPTH_TEST_ENABLE_EXT, 1580e5c31af7Sopenharmony_ci ename:VK_DYNAMIC_STATE_DEPTH_WRITE_ENABLE_EXT, 1581e5c31af7Sopenharmony_ci ename:VK_DYNAMIC_STATE_DEPTH_COMPARE_OP_EXT, 1582e5c31af7Sopenharmony_ci ename:VK_DYNAMIC_STATE_DEPTH_BOUNDS_TEST_ENABLE_EXT, 1583e5c31af7Sopenharmony_ci ename:VK_DYNAMIC_STATE_STENCIL_TEST_ENABLE_EXT, or 1584e5c31af7Sopenharmony_ci ename:VK_DYNAMIC_STATE_STENCIL_OP_EXT 1585e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-03379]] 1586e5c31af7Sopenharmony_ci If the pipeline is being created with 1587e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-pre-rasterization, pre-rasterization shader 1588e5c31af7Sopenharmony_ci state>>, and ename:VK_DYNAMIC_STATE_VIEWPORT_WITH_COUNT_EXT is included 1589e5c31af7Sopenharmony_ci in the pname:pDynamicStates array then pname:viewportCount must: be zero 1590e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-03380]] 1591e5c31af7Sopenharmony_ci If the pipeline is being created with 1592e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-pre-rasterization, pre-rasterization shader 1593e5c31af7Sopenharmony_ci state>>, and ename:VK_DYNAMIC_STATE_SCISSOR_WITH_COUNT_EXT is included 1594e5c31af7Sopenharmony_ci in the pname:pDynamicStates array then pname:scissorCount must: be zero 1595e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-04132]] 1596e5c31af7Sopenharmony_ci If the pipeline is being created with 1597e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-pre-rasterization, pre-rasterization shader 1598e5c31af7Sopenharmony_ci state>>, and ename:VK_DYNAMIC_STATE_VIEWPORT_WITH_COUNT_EXT is included 1599e5c31af7Sopenharmony_ci in the pname:pDynamicStates array then ename:VK_DYNAMIC_STATE_VIEWPORT 1600e5c31af7Sopenharmony_ci must: not be present 1601e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-04133]] 1602e5c31af7Sopenharmony_ci If the pipeline is being created with 1603e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-pre-rasterization, pre-rasterization shader 1604e5c31af7Sopenharmony_ci state>>, and ename:VK_DYNAMIC_STATE_SCISSOR_WITH_COUNT_EXT is included 1605e5c31af7Sopenharmony_ci in the pname:pDynamicStates array then ename:VK_DYNAMIC_STATE_SCISSOR 1606e5c31af7Sopenharmony_ci must: not be present 1607e5c31af7Sopenharmony_ciendif::VK_EXT_extended_dynamic_state[] 1608e5c31af7Sopenharmony_ciifdef::VK_EXT_extended_dynamic_state2[] 1609e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-04868]] 1610e5c31af7Sopenharmony_ci If the <<features-extendedDynamicState2, extendedDynamicState2>> feature 1611e5c31af7Sopenharmony_ci is not enabled, there must: be no element of the pname:pDynamicStates 1612e5c31af7Sopenharmony_ci member of pname:pDynamicState set to 1613e5c31af7Sopenharmony_ci ename:VK_DYNAMIC_STATE_DEPTH_BIAS_ENABLE_EXT, 1614e5c31af7Sopenharmony_ci ename:VK_DYNAMIC_STATE_PRIMITIVE_RESTART_ENABLE_EXT, or 1615e5c31af7Sopenharmony_ci ename:VK_DYNAMIC_STATE_RASTERIZER_DISCARD_ENABLE_EXT 1616e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-04869]] 1617e5c31af7Sopenharmony_ci If the <<features-extendedDynamicState2LogicOp, 1618e5c31af7Sopenharmony_ci extendedDynamicState2LogicOp>> feature is not enabled, there must: be no 1619e5c31af7Sopenharmony_ci element of the pname:pDynamicStates member of pname:pDynamicState set to 1620e5c31af7Sopenharmony_ci ename:VK_DYNAMIC_STATE_LOGIC_OP_EXT 1621e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-04870]] 1622e5c31af7Sopenharmony_ci If the <<features-extendedDynamicState2PatchControlPoints, 1623e5c31af7Sopenharmony_ci extendedDynamicState2PatchControlPoints>> feature is not enabled, there 1624e5c31af7Sopenharmony_ci must: be no element of the pname:pDynamicStates member of 1625e5c31af7Sopenharmony_ci pname:pDynamicState set to 1626e5c31af7Sopenharmony_ci ename:VK_DYNAMIC_STATE_PATCH_CONTROL_POINTS_EXT 1627e5c31af7Sopenharmony_ciendif::VK_EXT_extended_dynamic_state2[] 1628e5c31af7Sopenharmony_ciifdef::VK_NV_device_generated_commands[] 1629e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-flags-02877]] 1630e5c31af7Sopenharmony_ci If pname:flags includes 1631e5c31af7Sopenharmony_ci ename:VK_PIPELINE_CREATE_INDIRECT_BINDABLE_BIT_NV, then the 1632e5c31af7Sopenharmony_ci <<features-deviceGeneratedCommands, 1633e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV::pname:deviceGeneratedCommands>> 1634e5c31af7Sopenharmony_ci feature must: be enabled 1635e5c31af7Sopenharmony_ciifdef::VK_EXT_transform_feedback[] 1636e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-flags-02966]] 1637e5c31af7Sopenharmony_ci If the pipeline is being created with 1638e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-pre-rasterization, pre-rasterization shader 1639e5c31af7Sopenharmony_ci state>> and pname:flags includes 1640e5c31af7Sopenharmony_ci ename:VK_PIPELINE_CREATE_INDIRECT_BINDABLE_BIT_NV, then all stages must: 1641e5c31af7Sopenharmony_ci not specify code:Xfb execution mode 1642e5c31af7Sopenharmony_ciendif::VK_EXT_transform_feedback[] 1643e5c31af7Sopenharmony_ciendif::VK_NV_device_generated_commands[] 1644e5c31af7Sopenharmony_ciifdef::VK_EXT_pipeline_creation_cache_control[] 1645e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-pipelineCreationCacheControl-02878]] 1646e5c31af7Sopenharmony_ci If the <<features-pipelineCreationCacheControl, 1647e5c31af7Sopenharmony_ci pname:pipelineCreationCacheControl>> feature is not enabled, pname:flags 1648e5c31af7Sopenharmony_ci must: not include 1649e5c31af7Sopenharmony_ci ename:VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT_EXT or 1650e5c31af7Sopenharmony_ci ename:VK_PIPELINE_CREATE_EARLY_RETURN_ON_FAILURE_BIT_EXT 1651e5c31af7Sopenharmony_ciendif::VK_EXT_pipeline_creation_cache_control[] 1652e5c31af7Sopenharmony_ciifdef::VK_KHR_fragment_shading_rate[] 1653e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicState-04494]] 1654e5c31af7Sopenharmony_ci If the pipeline is being created with 1655e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-pre-rasterization, pre-rasterization shader 1656e5c31af7Sopenharmony_ci state>> or <<pipeline-graphics-subsets-fragment-shader, fragment shader 1657e5c31af7Sopenharmony_ci state>> and ename:VK_DYNAMIC_STATE_FRAGMENT_SHADING_RATE_KHR is not 1658e5c31af7Sopenharmony_ci included in pname:pDynamicState->pDynamicStates, 1659e5c31af7Sopenharmony_ci slink:VkPipelineFragmentShadingRateStateCreateInfoKHR::pname:fragmentSize.width 1660e5c31af7Sopenharmony_ci must: be greater than or equal to `1` 1661e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicState-04495]] 1662e5c31af7Sopenharmony_ci If the pipeline is being created with 1663e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-pre-rasterization, pre-rasterization shader 1664e5c31af7Sopenharmony_ci state>> or <<pipeline-graphics-subsets-fragment-shader, fragment shader 1665e5c31af7Sopenharmony_ci state>> and ename:VK_DYNAMIC_STATE_FRAGMENT_SHADING_RATE_KHR is not 1666e5c31af7Sopenharmony_ci included in pname:pDynamicState->pDynamicStates, 1667e5c31af7Sopenharmony_ci slink:VkPipelineFragmentShadingRateStateCreateInfoKHR::pname:fragmentSize.height 1668e5c31af7Sopenharmony_ci must: be greater than or equal to `1` 1669e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicState-04496]] 1670e5c31af7Sopenharmony_ci If the pipeline is being created with 1671e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-pre-rasterization, pre-rasterization shader 1672e5c31af7Sopenharmony_ci state>> or <<pipeline-graphics-subsets-fragment-shader, fragment shader 1673e5c31af7Sopenharmony_ci state>> and ename:VK_DYNAMIC_STATE_FRAGMENT_SHADING_RATE_KHR is not 1674e5c31af7Sopenharmony_ci included in pname:pDynamicState->pDynamicStates, 1675e5c31af7Sopenharmony_ci slink:VkPipelineFragmentShadingRateStateCreateInfoKHR::pname:fragmentSize.width 1676e5c31af7Sopenharmony_ci must: be a power-of-two value 1677e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicState-04497]] 1678e5c31af7Sopenharmony_ci If the pipeline is being created with 1679e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-pre-rasterization, pre-rasterization shader 1680e5c31af7Sopenharmony_ci state>> or <<pipeline-graphics-subsets-fragment-shader, fragment shader 1681e5c31af7Sopenharmony_ci state>> and ename:VK_DYNAMIC_STATE_FRAGMENT_SHADING_RATE_KHR is not 1682e5c31af7Sopenharmony_ci included in pname:pDynamicState->pDynamicStates, 1683e5c31af7Sopenharmony_ci slink:VkPipelineFragmentShadingRateStateCreateInfoKHR::pname:fragmentSize.height 1684e5c31af7Sopenharmony_ci must: be a power-of-two value 1685e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicState-04498]] 1686e5c31af7Sopenharmony_ci If the pipeline is being created with 1687e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-pre-rasterization, pre-rasterization shader 1688e5c31af7Sopenharmony_ci state>> or <<pipeline-graphics-subsets-fragment-shader, fragment shader 1689e5c31af7Sopenharmony_ci state>> and ename:VK_DYNAMIC_STATE_FRAGMENT_SHADING_RATE_KHR is not 1690e5c31af7Sopenharmony_ci included in pname:pDynamicState->pDynamicStates, 1691e5c31af7Sopenharmony_ci slink:VkPipelineFragmentShadingRateStateCreateInfoKHR::pname:fragmentSize.width 1692e5c31af7Sopenharmony_ci must: be less than or equal to `4` 1693e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicState-04499]] 1694e5c31af7Sopenharmony_ci If the pipeline is being created with 1695e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-pre-rasterization, pre-rasterization shader 1696e5c31af7Sopenharmony_ci state>> or <<pipeline-graphics-subsets-fragment-shader, fragment shader 1697e5c31af7Sopenharmony_ci state>> and ename:VK_DYNAMIC_STATE_FRAGMENT_SHADING_RATE_KHR is not 1698e5c31af7Sopenharmony_ci included in pname:pDynamicState->pDynamicStates, 1699e5c31af7Sopenharmony_ci slink:VkPipelineFragmentShadingRateStateCreateInfoKHR::pname:fragmentSize.height 1700e5c31af7Sopenharmony_ci must: be less than or equal to `4` 1701e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicState-04500]] 1702e5c31af7Sopenharmony_ci If the pipeline is being created with 1703e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-pre-rasterization, pre-rasterization shader 1704e5c31af7Sopenharmony_ci state>> or <<pipeline-graphics-subsets-fragment-shader, fragment shader 1705e5c31af7Sopenharmony_ci state>> and ename:VK_DYNAMIC_STATE_FRAGMENT_SHADING_RATE_KHR is not 1706e5c31af7Sopenharmony_ci included in pname:pDynamicState->pDynamicStates, and the 1707e5c31af7Sopenharmony_ci <<features-pipelineFragmentShadingRate, 1708e5c31af7Sopenharmony_ci pname:pipelineFragmentShadingRate feature>> is not enabled, 1709e5c31af7Sopenharmony_ci slink:VkPipelineFragmentShadingRateStateCreateInfoKHR::pname:fragmentSize.width 1710e5c31af7Sopenharmony_ci and 1711e5c31af7Sopenharmony_ci slink:VkPipelineFragmentShadingRateStateCreateInfoKHR::pname:fragmentSize.height 1712e5c31af7Sopenharmony_ci must: both be equal to `1` 1713e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicState-04501]] 1714e5c31af7Sopenharmony_ci If the pipeline is being created with 1715e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-pre-rasterization, pre-rasterization shader 1716e5c31af7Sopenharmony_ci state>> or <<pipeline-graphics-subsets-fragment-shader, fragment shader 1717e5c31af7Sopenharmony_ci state>> and ename:VK_DYNAMIC_STATE_FRAGMENT_SHADING_RATE_KHR is not 1718e5c31af7Sopenharmony_ci included in pname:pDynamicState->pDynamicStates, and the 1719e5c31af7Sopenharmony_ci <<features-primitiveFragmentShadingRate, 1720e5c31af7Sopenharmony_ci pname:primitiveFragmentShadingRate feature>> is not enabled, 1721e5c31af7Sopenharmony_ci slink:VkPipelineFragmentShadingRateStateCreateInfoKHR::pname:combinerOps[0] 1722e5c31af7Sopenharmony_ci must: be ename:VK_FRAGMENT_SHADING_RATE_COMBINER_OP_KEEP_KHR 1723e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicState-04502]] 1724e5c31af7Sopenharmony_ci If the pipeline is being created with 1725e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-pre-rasterization, pre-rasterization shader 1726e5c31af7Sopenharmony_ci state>> or <<pipeline-graphics-subsets-fragment-shader, fragment shader 1727e5c31af7Sopenharmony_ci state>> and ename:VK_DYNAMIC_STATE_FRAGMENT_SHADING_RATE_KHR is not 1728e5c31af7Sopenharmony_ci included in pname:pDynamicState->pDynamicStates, and the 1729e5c31af7Sopenharmony_ci <<features-attachmentFragmentShadingRate, 1730e5c31af7Sopenharmony_ci pname:attachmentFragmentShadingRate feature>> is not enabled, 1731e5c31af7Sopenharmony_ci slink:VkPipelineFragmentShadingRateStateCreateInfoKHR::pname:combinerOps[1] 1732e5c31af7Sopenharmony_ci must: be ename:VK_FRAGMENT_SHADING_RATE_COMBINER_OP_KEEP_KHR 1733e5c31af7Sopenharmony_ciifdef::VK_EXT_extended_dynamic_state[] 1734e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-primitiveFragmentShadingRateWithMultipleViewports-04503]] 1735e5c31af7Sopenharmony_ci If the pipeline is being created with 1736e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-pre-rasterization, pre-rasterization shader 1737e5c31af7Sopenharmony_ci state>> and the 1738e5c31af7Sopenharmony_ci <<limits-primitiveFragmentShadingRateWithMultipleViewports, 1739e5c31af7Sopenharmony_ci pname:primitiveFragmentShadingRateWithMultipleViewports>> limit is not 1740e5c31af7Sopenharmony_ci supported, ename:VK_DYNAMIC_STATE_VIEWPORT_WITH_COUNT_EXT is not 1741e5c31af7Sopenharmony_ci included in pname:pDynamicState->pDynamicStates, and 1742e5c31af7Sopenharmony_ci slink:VkPipelineViewportStateCreateInfo::pname:viewportCount is greater 1743e5c31af7Sopenharmony_ci than `1`, entry points specified in pname:pStages must: not write to the 1744e5c31af7Sopenharmony_ci code:PrimitiveShadingRateKHR built-in 1745e5c31af7Sopenharmony_ciendif::VK_EXT_extended_dynamic_state[] 1746e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-primitiveFragmentShadingRateWithMultipleViewports-04504]] 1747e5c31af7Sopenharmony_ci If the pipeline is being created with 1748e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-pre-rasterization, pre-rasterization shader 1749e5c31af7Sopenharmony_ci state>> and the 1750e5c31af7Sopenharmony_ci <<limits-primitiveFragmentShadingRateWithMultipleViewports, 1751e5c31af7Sopenharmony_ci pname:primitiveFragmentShadingRateWithMultipleViewports>> limit is not 1752e5c31af7Sopenharmony_ci supported, and entry points specified in pname:pStages write to the 1753e5c31af7Sopenharmony_ci code:ViewportIndex built-in, they must: not also write to the 1754e5c31af7Sopenharmony_ci code:PrimitiveShadingRateKHR built-in 1755e5c31af7Sopenharmony_ciifdef::VK_NV_viewport_array2[] 1756e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-primitiveFragmentShadingRateWithMultipleViewports-04505]] 1757e5c31af7Sopenharmony_ci If the pipeline is being created with 1758e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-pre-rasterization, pre-rasterization shader 1759e5c31af7Sopenharmony_ci state>> and the 1760e5c31af7Sopenharmony_ci <<limits-primitiveFragmentShadingRateWithMultipleViewports, 1761e5c31af7Sopenharmony_ci pname:primitiveFragmentShadingRateWithMultipleViewports>> limit is not 1762e5c31af7Sopenharmony_ci supported, and entry points specified in pname:pStages write to the 1763e5c31af7Sopenharmony_ci code:ViewportMaskNV built-in, they must: not also write to the 1764e5c31af7Sopenharmony_ci code:PrimitiveShadingRateKHR built-in 1765e5c31af7Sopenharmony_ciendif::VK_NV_viewport_array2[] 1766e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-fragmentShadingRateNonTrivialCombinerOps-04506]] 1767e5c31af7Sopenharmony_ci If the pipeline is being created with 1768e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-pre-rasterization, pre-rasterization shader 1769e5c31af7Sopenharmony_ci state>> or <<pipeline-graphics-subsets-fragment-shader, fragment shader 1770e5c31af7Sopenharmony_ci state>>, the <<limits-fragmentShadingRateNonTrivialCombinerOps, 1771e5c31af7Sopenharmony_ci pname:fragmentShadingRateNonTrivialCombinerOps>> limit is not supported, 1772e5c31af7Sopenharmony_ci and ename:VK_DYNAMIC_STATE_FRAGMENT_SHADING_RATE_KHR is not included in 1773e5c31af7Sopenharmony_ci pname:pDynamicState->pDynamicStates, elements of 1774e5c31af7Sopenharmony_ci slink:VkPipelineFragmentShadingRateStateCreateInfoKHR::pname:combinerOps 1775e5c31af7Sopenharmony_ci must: be ename:VK_FRAGMENT_SHADING_RATE_COMBINER_OP_KEEP_KHR or 1776e5c31af7Sopenharmony_ci ename:VK_FRAGMENT_SHADING_RATE_COMBINER_OP_REPLACE_KHR 1777e5c31af7Sopenharmony_ciendif::VK_KHR_fragment_shading_rate[] 1778e5c31af7Sopenharmony_ciifdef::VK_NV_fragment_shading_rate_enums[] 1779e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicState-04569]] 1780e5c31af7Sopenharmony_ci If the pipeline is being created with 1781e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-pre-rasterization, pre-rasterization shader 1782e5c31af7Sopenharmony_ci state>> or <<pipeline-graphics-subsets-fragment-shader, fragment shader 1783e5c31af7Sopenharmony_ci state>>, and ename:VK_DYNAMIC_STATE_FRAGMENT_SHADING_RATE_KHR is not 1784e5c31af7Sopenharmony_ci included in pname:pDynamicState->pDynamicStates, and the 1785e5c31af7Sopenharmony_ci <<features-fragmentShadingRateEnums, pname:fragmentShadingRateEnums 1786e5c31af7Sopenharmony_ci feature>> is not enabled, 1787e5c31af7Sopenharmony_ci slink:VkPipelineFragmentShadingRateEnumStateCreateInfoNV::pname:shadingRateType 1788e5c31af7Sopenharmony_ci must: be equal to ename:VK_FRAGMENT_SHADING_RATE_TYPE_FRAGMENT_SIZE_NV 1789e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicState-04570]] 1790e5c31af7Sopenharmony_ci If the pipeline is being created with 1791e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-pre-rasterization, pre-rasterization shader 1792e5c31af7Sopenharmony_ci state>> or <<pipeline-graphics-subsets-fragment-shader, fragment shader 1793e5c31af7Sopenharmony_ci state>>, and ename:VK_DYNAMIC_STATE_FRAGMENT_SHADING_RATE_KHR is not 1794e5c31af7Sopenharmony_ci included in pname:pDynamicState->pDynamicStates, and the 1795e5c31af7Sopenharmony_ci <<features-pipelineFragmentShadingRate, 1796e5c31af7Sopenharmony_ci pname:pipelineFragmentShadingRate feature>> is not enabled, 1797e5c31af7Sopenharmony_ci slink:VkPipelineFragmentShadingRateEnumStateCreateInfoNV::pname:shadingRate 1798e5c31af7Sopenharmony_ci must: be equal to 1799e5c31af7Sopenharmony_ci ename:VK_FRAGMENT_SHADING_RATE_1_INVOCATION_PER_PIXEL_NV 1800e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicState-04571]] 1801e5c31af7Sopenharmony_ci If the pipeline is being created with 1802e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-pre-rasterization, pre-rasterization shader 1803e5c31af7Sopenharmony_ci state>> or <<pipeline-graphics-subsets-fragment-shader, fragment shader 1804e5c31af7Sopenharmony_ci state>>, and ename:VK_DYNAMIC_STATE_FRAGMENT_SHADING_RATE_KHR is not 1805e5c31af7Sopenharmony_ci included in pname:pDynamicState->pDynamicStates, and the 1806e5c31af7Sopenharmony_ci <<features-primitiveFragmentShadingRate, 1807e5c31af7Sopenharmony_ci pname:primitiveFragmentShadingRate feature>> is not enabled, 1808e5c31af7Sopenharmony_ci slink:VkPipelineFragmentShadingRateEnumStateCreateInfoNV::pname:combinerOps[0] 1809e5c31af7Sopenharmony_ci must: be ename:VK_FRAGMENT_SHADING_RATE_COMBINER_OP_KEEP_KHR 1810e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicState-04572]] 1811e5c31af7Sopenharmony_ci If the pipeline is being created with 1812e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-pre-rasterization, pre-rasterization shader 1813e5c31af7Sopenharmony_ci state>> or <<pipeline-graphics-subsets-fragment-shader, fragment shader 1814e5c31af7Sopenharmony_ci state>>, and ename:VK_DYNAMIC_STATE_FRAGMENT_SHADING_RATE_KHR is not 1815e5c31af7Sopenharmony_ci included in pname:pDynamicState->pDynamicStates, and the 1816e5c31af7Sopenharmony_ci <<features-attachmentFragmentShadingRate, 1817e5c31af7Sopenharmony_ci pname:attachmentFragmentShadingRate feature>> is not enabled, 1818e5c31af7Sopenharmony_ci slink:VkPipelineFragmentShadingRateEnumStateCreateInfoNV::pname:combinerOps[1] 1819e5c31af7Sopenharmony_ci must: be ename:VK_FRAGMENT_SHADING_RATE_COMBINER_OP_KEEP_KHR 1820e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-fragmentShadingRateNonTrivialCombinerOps-04573]] 1821e5c31af7Sopenharmony_ci If the pipeline is being created with 1822e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-pre-rasterization, pre-rasterization shader 1823e5c31af7Sopenharmony_ci state>> or <<pipeline-graphics-subsets-fragment-shader, fragment shader 1824e5c31af7Sopenharmony_ci state>>, and the <<limits-fragmentShadingRateNonTrivialCombinerOps, 1825e5c31af7Sopenharmony_ci pname:fragmentShadingRateNonTrivialCombinerOps>> limit is not supported 1826e5c31af7Sopenharmony_ci and ename:VK_DYNAMIC_STATE_FRAGMENT_SHADING_RATE_KHR is not included in 1827e5c31af7Sopenharmony_ci pname:pDynamicState->pDynamicStates, elements of 1828e5c31af7Sopenharmony_ci slink:VkPipelineFragmentShadingRateEnumStateCreateInfoNV::pname:combinerOps 1829e5c31af7Sopenharmony_ci must: be ename:VK_FRAGMENT_SHADING_RATE_COMBINER_OP_KEEP_KHR or 1830e5c31af7Sopenharmony_ci ename:VK_FRAGMENT_SHADING_RATE_COMBINER_OP_REPLACE_KHR 1831e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-None-04574]] 1832e5c31af7Sopenharmony_ci If the pipeline is being created with 1833e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-pre-rasterization, pre-rasterization shader 1834e5c31af7Sopenharmony_ci state>> or <<pipeline-graphics-subsets-fragment-shader, fragment shader 1835e5c31af7Sopenharmony_ci state>>, and the <<features-supersampleFragmentShadingRates, 1836e5c31af7Sopenharmony_ci supersampleFragmentShadingRates feature>> is not enabled, 1837e5c31af7Sopenharmony_ci slink:VkPipelineFragmentShadingRateEnumStateCreateInfoNV::pname:shadingRate 1838e5c31af7Sopenharmony_ci must: not be equal to 1839e5c31af7Sopenharmony_ci ename:VK_FRAGMENT_SHADING_RATE_2_INVOCATIONS_PER_PIXEL_NV, 1840e5c31af7Sopenharmony_ci ename:VK_FRAGMENT_SHADING_RATE_4_INVOCATIONS_PER_PIXEL_NV, 1841e5c31af7Sopenharmony_ci ename:VK_FRAGMENT_SHADING_RATE_8_INVOCATIONS_PER_PIXEL_NV, or 1842e5c31af7Sopenharmony_ci ename:VK_FRAGMENT_SHADING_RATE_16_INVOCATIONS_PER_PIXEL_NV 1843e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-None-04575]] 1844e5c31af7Sopenharmony_ci If the pipeline is being created with 1845e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-pre-rasterization, pre-rasterization shader 1846e5c31af7Sopenharmony_ci state>> or <<pipeline-graphics-subsets-fragment-shader, fragment shader 1847e5c31af7Sopenharmony_ci state>>, and the <<features-noInvocationFragmentShadingRates, 1848e5c31af7Sopenharmony_ci noInvocationFragmentShadingRates feature>> is not enabled, 1849e5c31af7Sopenharmony_ci slink:VkPipelineFragmentShadingRateEnumStateCreateInfoNV::pname:shadingRate 1850e5c31af7Sopenharmony_ci must: not be equal to ename:VK_FRAGMENT_SHADING_RATE_NO_INVOCATIONS_NV 1851e5c31af7Sopenharmony_ciendif::VK_NV_fragment_shading_rate_enums[] 1852e5c31af7Sopenharmony_ciifdef::VK_KHR_ray_tracing_pipeline[] 1853e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-03578]] 1854e5c31af7Sopenharmony_ci All elements of the pname:pDynamicStates member of pname:pDynamicState 1855e5c31af7Sopenharmony_ci must: not be ename:VK_DYNAMIC_STATE_RAY_TRACING_PIPELINE_STACK_SIZE_KHR 1856e5c31af7Sopenharmony_ciendif::VK_KHR_ray_tracing_pipeline[] 1857e5c31af7Sopenharmony_ciifdef::VK_EXT_vertex_input_dynamic_state[] 1858e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-04807]] 1859e5c31af7Sopenharmony_ci If the pipeline is being created with 1860e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-pre-rasterization, pre-rasterization shader 1861e5c31af7Sopenharmony_ci state>> and the <<features-vertexInputDynamicState, 1862e5c31af7Sopenharmony_ci vertexInputDynamicState>> feature is not enabled, there must: be no 1863e5c31af7Sopenharmony_ci element of the pname:pDynamicStates member of pname:pDynamicState set to 1864e5c31af7Sopenharmony_ci ename:VK_DYNAMIC_STATE_VERTEX_INPUT_EXT 1865e5c31af7Sopenharmony_ciendif::VK_EXT_vertex_input_dynamic_state[] 1866e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-None-04893]] 1867e5c31af7Sopenharmony_ci The pipeline must: be created with a 1868e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-complete, complete set of state>> 1869e5c31af7Sopenharmony_ciifdef::VK_EXT_color_write_enable[] 1870e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-04800]] 1871e5c31af7Sopenharmony_ci If the <<features-colorWriteEnable, colorWriteEnable>> feature is not 1872e5c31af7Sopenharmony_ci enabled, there must: be no element of the pname:pDynamicStates member of 1873e5c31af7Sopenharmony_ci pname:pDynamicState set to ename:VK_DYNAMIC_STATE_COLOR_WRITE_ENABLE_EXT 1874e5c31af7Sopenharmony_ciendif::VK_EXT_color_write_enable[] 1875e5c31af7Sopenharmony_ciifdef::VK_QCOM_render_pass_shader_resolve[] 1876e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-rasterizationSamples-04899]] 1877e5c31af7Sopenharmony_ci If the pipeline is being created with fragment shader state, and the 1878e5c31af7Sopenharmony_ci apiext:VK_QCOM_render_pass_shader_resolve extension is enabled, and if 1879e5c31af7Sopenharmony_ci subpass has any input attachments, and if the subpass description 1880e5c31af7Sopenharmony_ci contains ename:VK_SUBPASS_DESCRIPTION_FRAGMENT_REGION_BIT_QCOM, then the 1881e5c31af7Sopenharmony_ci sample count of the input attachments must: equal 1882e5c31af7Sopenharmony_ci pname:rasterizationSamples 1883e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-sampleShadingEnable-04900]] 1884e5c31af7Sopenharmony_ci If the pipeline is being created with fragment shader state, and the 1885e5c31af7Sopenharmony_ci apiext:VK_QCOM_render_pass_shader_resolve extension is enabled, and if 1886e5c31af7Sopenharmony_ci the subpass description contains 1887e5c31af7Sopenharmony_ci ename:VK_SUBPASS_DESCRIPTION_FRAGMENT_REGION_BIT_QCOM, then 1888e5c31af7Sopenharmony_ci pname:sampleShadingEnable must: be false 1889e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-flags-04901]] 1890e5c31af7Sopenharmony_ci If pname:flags includes 1891e5c31af7Sopenharmony_ci ename:VK_SUBPASS_DESCRIPTION_SHADER_RESOLVE_BIT_QCOM, then the subpass 1892e5c31af7Sopenharmony_ci must: be the last subpass in a subpass dependency chain 1893e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-flags-04902]] 1894e5c31af7Sopenharmony_ci If pname:flags includes 1895e5c31af7Sopenharmony_ci ename:VK_SUBPASS_DESCRIPTION_SHADER_RESOLVE_BIT_QCOM, and if 1896e5c31af7Sopenharmony_ci pname:pResolveAttachments is not `NULL`, then each resolve attachment 1897e5c31af7Sopenharmony_ci must: be ename:VK_ATTACHMENT_UNUSED 1898e5c31af7Sopenharmony_ciendif::VK_QCOM_render_pass_shader_resolve[] 1899e5c31af7Sopenharmony_ciifndef::VK_KHR_dynamic_rendering[] 1900e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-renderPass-06051]] 1901e5c31af7Sopenharmony_ci pname:renderPass must: not be dlink:VK_NULL_HANDLE 1902e5c31af7Sopenharmony_ciendif::VK_KHR_dynamic_rendering[] 1903e5c31af7Sopenharmony_ciifdef::VK_KHR_dynamic_rendering[] 1904e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-dynamicRendering-06052]] 1905e5c31af7Sopenharmony_ci If the <<features-dynamicRendering,pname:dynamicRendering>> feature is 1906e5c31af7Sopenharmony_ci not enabled, pname:renderPass must: not be dlink:VK_NULL_HANDLE 1907e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-renderPass-06053]] 1908e5c31af7Sopenharmony_ci If pname:renderPass is dlink:VK_NULL_HANDLE, the pipeline is being 1909e5c31af7Sopenharmony_ci created with <<pipeline-graphics-subsets-fragment-shader, fragment 1910e5c31af7Sopenharmony_ci shader state>>, and either of 1911e5c31af7Sopenharmony_ci slink:VkPipelineRenderingCreateInfoKHR::depthAttachmentFormat or 1912e5c31af7Sopenharmony_ci slink:VkPipelineRenderingCreateInfoKHR::stencilAttachmentFormat are not 1913e5c31af7Sopenharmony_ci ename:VK_FORMAT_UNDEFINED, pname:pDepthStencilState must: be a valid 1914e5c31af7Sopenharmony_ci pointer to a valid slink:VkPipelineDepthStencilStateCreateInfo structure 1915e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-renderPass-06054]] 1916e5c31af7Sopenharmony_ci If pname:renderPass is dlink:VK_NULL_HANDLE, the pipeline is being 1917e5c31af7Sopenharmony_ci created with <<pipeline-graphics-subsets-fragment-output, fragment 1918e5c31af7Sopenharmony_ci output interface state>>, and 1919e5c31af7Sopenharmony_ci slink:VkPipelineRenderingCreateInfoKHR::colorAttachmentCount is not 1920e5c31af7Sopenharmony_ci equal to `0`, pname:pColorBlendState must: be a valid pointer to a valid 1921e5c31af7Sopenharmony_ci slink:VkPipelineColorBlendStateCreateInfo structure 1922e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-renderPass-06055]] 1923e5c31af7Sopenharmony_ci If pname:renderPass is dlink:VK_NULL_HANDLE and the pipeline is being 1924e5c31af7Sopenharmony_ci created with <<pipeline-graphics-subsets-fragment-output, fragment 1925e5c31af7Sopenharmony_ci output interface state>>, pname:pColorBlendState->attachmentCount must: 1926e5c31af7Sopenharmony_ci be equal to slink:VkPipelineRenderingCreateInfoKHR::colorAttachmentCount 1927e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-renderPass-06056]] 1928e5c31af7Sopenharmony_ci If pname:renderPass is dlink:VK_NULL_HANDLE and the pipeline is being 1929e5c31af7Sopenharmony_ci created with <<pipeline-graphics-subsets-fragment-shader, fragment 1930e5c31af7Sopenharmony_ci shader state>> the fragment shader must: not read from any input 1931e5c31af7Sopenharmony_ci attachment 1932e5c31af7Sopenharmony_ciifdef::VK_KHR_multiview,VK_VERSION_1_1[] 1933e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-renderPass-06057]] 1934e5c31af7Sopenharmony_ci If pname:renderPass is dlink:VK_NULL_HANDLE, the pipeline is being 1935e5c31af7Sopenharmony_ci created with <<pipeline-graphics-subsets-pre-rasterization, 1936e5c31af7Sopenharmony_ci pre-rasterization shader state>>, the pname:viewMask member of a 1937e5c31af7Sopenharmony_ci slink:VkPipelineRenderingCreateInfoKHR structure included in the 1938e5c31af7Sopenharmony_ci pname:pNext chain is not `0`, and the 1939e5c31af7Sopenharmony_ci <<features-multiview-tess,pname:multiviewTessellationShader>> feature is 1940e5c31af7Sopenharmony_ci not enabled, then pname:pStages must: not include tessellation shaders 1941e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-renderPass-06058]] 1942e5c31af7Sopenharmony_ci If pname:renderPass is dlink:VK_NULL_HANDLE, the pipeline is being 1943e5c31af7Sopenharmony_ci created with <<pipeline-graphics-subsets-pre-rasterization, 1944e5c31af7Sopenharmony_ci pre-rasterization shader state>>, the pname:viewMask member of a 1945e5c31af7Sopenharmony_ci slink:VkPipelineRenderingCreateInfoKHR structure included in the 1946e5c31af7Sopenharmony_ci pname:pNext chain is not `0`, and the 1947e5c31af7Sopenharmony_ci <<features-multiview-gs,pname:multiviewGeometryShader>> feature is not 1948e5c31af7Sopenharmony_ci enabled, then pname:pStages must: not include a geometry shader 1949e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-renderPass-06059]] 1950e5c31af7Sopenharmony_ci If pname:renderPass is dlink:VK_NULL_HANDLE, the pipeline is being 1951e5c31af7Sopenharmony_ci created with <<pipeline-graphics-subsets-pre-rasterization, 1952e5c31af7Sopenharmony_ci pre-rasterization shader state>>, and the pname:viewMask member of a 1953e5c31af7Sopenharmony_ci slink:VkPipelineRenderingCreateInfoKHR structure included in the 1954e5c31af7Sopenharmony_ci pname:pNext chain is not `0`, shaders in pname:pStages must: not include 1955e5c31af7Sopenharmony_ci variables decorated with the code:Layer built-in decoration in their 1956e5c31af7Sopenharmony_ci interfaces 1957e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-renderPass-06060]] 1958e5c31af7Sopenharmony_ci If the pipeline is being created with 1959e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-fragment-output, fragment output interface 1960e5c31af7Sopenharmony_ci state>> and pname:renderPass is dlink:VK_NULL_HANDLE, 1961e5c31af7Sopenharmony_ci pname:pColorBlendState->attachmentCount must: be equal to the 1962e5c31af7Sopenharmony_ci pname:colorAttachmentCount member of the 1963e5c31af7Sopenharmony_ci slink:VkPipelineRenderingCreateInfoKHR structure included in the 1964e5c31af7Sopenharmony_ci pname:pNext chain 1965e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-renderPass-06061]] 1966e5c31af7Sopenharmony_ci If the pipeline is being created with 1967e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-fragment-shader, fragment shader state>> and 1968e5c31af7Sopenharmony_ci pname:renderPass is dlink:VK_NULL_HANDLE, fragment shaders in 1969e5c31af7Sopenharmony_ci pname:pStages must: not include the code:InputAttachment capability 1970e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-renderPass-06062]] 1971e5c31af7Sopenharmony_ci If the pipeline is being created with 1972e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-fragment-output, fragment output interface 1973e5c31af7Sopenharmony_ci state>> and pname:renderPass is dlink:VK_NULL_HANDLE, for each color 1974e5c31af7Sopenharmony_ci attachment format defined by the pname:pColorAttachmentFormats member of 1975e5c31af7Sopenharmony_ci slink:VkPipelineRenderingCreateInfoKHR, if its 1976e5c31af7Sopenharmony_ci <<potential-format-features,potential format features>> do not contain 1977e5c31af7Sopenharmony_ci ename:VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT, then the 1978e5c31af7Sopenharmony_ci pname:blendEnable member of the corresponding element of the 1979e5c31af7Sopenharmony_ci pname:pAttachments member of pname:pColorBlendState must: be 1980e5c31af7Sopenharmony_ci ename:VK_FALSE 1981e5c31af7Sopenharmony_ciendif::VK_KHR_multiview,VK_VERSION_1_1[] 1982e5c31af7Sopenharmony_ciifdef::VK_AMD_mixed_attachment_samples,VK_NV_framebuffer_mixed_samples[] 1983e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-renderPass-06063]] 1984e5c31af7Sopenharmony_ci If the pipeline is being created with 1985e5c31af7Sopenharmony_ci <<pipeline-graphics-subsets-fragment-output, fragment output interface 1986e5c31af7Sopenharmony_ci state>> and pname:renderPass is dlink:VK_NULL_HANDLE, if the pname:pNext 1987e5c31af7Sopenharmony_ci chain includes slink:VkAttachmentSampleCountInfoAMD or 1988e5c31af7Sopenharmony_ci sname:VkAttachmentSampleCountInfoNV, the pname:colorAttachmentCount 1989e5c31af7Sopenharmony_ci member of that structure must: be equal to the value of 1990e5c31af7Sopenharmony_ci slink:VkPipelineRenderingCreateInfoKHR::pname:colorAttachmentCount 1991e5c31af7Sopenharmony_ciendif::VK_AMD_mixed_attachment_samples,VK_NV_framebuffer_mixed_samples[] 1992e5c31af7Sopenharmony_ciendif::VK_KHR_dynamic_rendering[] 1993e5c31af7Sopenharmony_ciifdef::VK_ARM_rasterization_order_attachment_access[] 1994e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-pStages-06466]] 1995e5c31af7Sopenharmony_ci If pname:pStages includes a fragment shader stage, and the fragment 1996e5c31af7Sopenharmony_ci shader code enables <<shaders-fragment-earlytest, early fragment 1997e5c31af7Sopenharmony_ci tests>>, the pname:flags member of 1998e5c31af7Sopenharmony_ci slink:VkPipelineDepthStencilStateCreateInfo must: not include 1999e5c31af7Sopenharmony_ci ename:VK_PIPELINE_DEPTH_STENCIL_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_DEPTH_ACCESS_BIT_ARM 2000e5c31af7Sopenharmony_ci or 2001e5c31af7Sopenharmony_ci ename:VK_PIPELINE_DEPTH_STENCIL_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_STENCIL_ACCESS_BIT_ARM 2002e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-flags-06467]] 2003e5c31af7Sopenharmony_ci If the pname:flags member of slink:VkPipelineColorBlendStateCreateInfo 2004e5c31af7Sopenharmony_ci includes 2005e5c31af7Sopenharmony_ci ename:VK_PIPELINE_COLOR_BLEND_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_BIT_ARM 2006e5c31af7Sopenharmony_ci pname:subpass must: have been created with 2007e5c31af7Sopenharmony_ci ename:VK_SUBPASS_DESCRIPTION_RASTERIZATION_ORDER_ATTACHMENT_COLOR_ACCESS_BIT_ARM 2008e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-flags-06468]] 2009e5c31af7Sopenharmony_ci If the pname:flags member of slink:VkPipelineDepthStencilStateCreateInfo 2010e5c31af7Sopenharmony_ci includes 2011e5c31af7Sopenharmony_ci ename:VK_PIPELINE_DEPTH_STENCIL_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_DEPTH_ACCESS_BIT_ARM, 2012e5c31af7Sopenharmony_ci pname:subpass must: have been created with 2013e5c31af7Sopenharmony_ci ename:VK_SUBPASS_DESCRIPTION_RASTERIZATION_ORDER_ATTACHMENT_DEPTH_ACCESS_BIT_ARM 2014e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineCreateInfo-flags-06469]] 2015e5c31af7Sopenharmony_ci If the pname:flags member of slink:VkPipelineDepthStencilStateCreateInfo 2016e5c31af7Sopenharmony_ci includes 2017e5c31af7Sopenharmony_ci ename:VK_PIPELINE_DEPTH_STENCIL_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_STENCIL_ACCESS_BIT_ARM, 2018e5c31af7Sopenharmony_ci pname:subpass must: have been created with 2019e5c31af7Sopenharmony_ci ename:VK_SUBPASS_DESCRIPTION_RASTERIZATION_ORDER_ATTACHMENT_STENCIL_ACCESS_BIT_ARM 2020e5c31af7Sopenharmony_ciendif::VK_ARM_rasterization_order_attachment_access[] 2021e5c31af7Sopenharmony_ci**** 2022e5c31af7Sopenharmony_ci 2023e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkGraphicsPipelineCreateInfo.txt[] 2024e5c31af7Sopenharmony_ci-- 2025e5c31af7Sopenharmony_ci 2026e5c31af7Sopenharmony_ciifdef::VK_KHR_dynamic_rendering[] 2027e5c31af7Sopenharmony_ci[open,refpage='VkPipelineRenderingCreateInfoKHR',desc='Structure specifying attachment formats',type='structs'] 2028e5c31af7Sopenharmony_ci-- 2029e5c31af7Sopenharmony_ciThe sname:VkPipelineRenderingCreateInfoKHR structure is defined as: 2030e5c31af7Sopenharmony_ci 2031e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkPipelineRenderingCreateInfoKHR.txt[] 2032e5c31af7Sopenharmony_ci 2033e5c31af7Sopenharmony_ci * pname:sType is the type of this structure. 2034e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 2035e5c31af7Sopenharmony_ci structure. 2036e5c31af7Sopenharmony_ci * pname:viewMask is the viewMask used for rendering. 2037e5c31af7Sopenharmony_ci * pname:colorAttachmentCount is the number of entries in 2038e5c31af7Sopenharmony_ci pname:pColorAttachmentFormats 2039e5c31af7Sopenharmony_ci * pname:pColorAttachmentFormats is a pointer to an array of elink:VkFormat 2040e5c31af7Sopenharmony_ci values defining the format of color attachments used in this pipeline. 2041e5c31af7Sopenharmony_ci * pname:depthAttachmentFormat is a elink:VkFormat value defining the 2042e5c31af7Sopenharmony_ci format of the depth attachment used in this pipeline. 2043e5c31af7Sopenharmony_ci * pname:stencilAttachmentFormat is a elink:VkFormat value defining the 2044e5c31af7Sopenharmony_ci format of the stencil attachment used in this pipeline. 2045e5c31af7Sopenharmony_ci 2046e5c31af7Sopenharmony_ciWhen a pipeline is created without a slink:VkRenderPass, if this structure 2047e5c31af7Sopenharmony_ciis present in the pname:pNext chain of slink:VkGraphicsPipelineCreateInfo, 2048e5c31af7Sopenharmony_ciit specifies the view mask and format of attachments used for rendering. 2049e5c31af7Sopenharmony_ciIf this structure is not specified, and the pipeline does not include a 2050e5c31af7Sopenharmony_cislink:VkRenderPass, pname:viewMask and pname:colorAttachmentCount are `0`, 2051e5c31af7Sopenharmony_ciand pname:depthAttachmentFormat and pname:stencilAttachmentFormat are 2052e5c31af7Sopenharmony_ciename:VK_FORMAT_UNDEFINED. 2053e5c31af7Sopenharmony_ciIf a graphics pipeline is created with a valid slink:VkRenderPass, 2054e5c31af7Sopenharmony_ciparameters of this structure are ignored. 2055e5c31af7Sopenharmony_ci 2056e5c31af7Sopenharmony_ciIf pname:depthAttachmentFormat, pname:stencilAttachmentFormat, or any 2057e5c31af7Sopenharmony_cielement of pname:pColorAttachmentFormats is ename:VK_FORMAT_UNDEFINED, it 2058e5c31af7Sopenharmony_ciindicates that the corresponding attachment is unused within the render 2059e5c31af7Sopenharmony_cipass. 2060e5c31af7Sopenharmony_ciValid formats indicate that an attachment can: be used - but it is still 2061e5c31af7Sopenharmony_civalid to set the attachment to `NULL` when beginning rendering. 2062e5c31af7Sopenharmony_ci 2063e5c31af7Sopenharmony_ci.Valid Usage 2064e5c31af7Sopenharmony_ci**** 2065e5c31af7Sopenharmony_ci * [[VUID-VkPipelineRenderingCreateInfoKHR-pColorAttachmentFormats-06064]] 2066e5c31af7Sopenharmony_ci If any element of pname:pColorAttachmentFormats is not 2067e5c31af7Sopenharmony_ci ename:VK_FORMAT_UNDEFINED, it must: be a format with 2068e5c31af7Sopenharmony_ci <<potential-format-features, potential format features>> that include 2069e5c31af7Sopenharmony_ci ename:VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT 2070e5c31af7Sopenharmony_ci * [[VUID-VkPipelineRenderingCreateInfoKHR-depthAttachmentFormat-06065]] 2071e5c31af7Sopenharmony_ci If pname:depthAttachmentFormat is not ename:VK_FORMAT_UNDEFINED, it 2072e5c31af7Sopenharmony_ci must: be a format with <<potential-format-features, potential format 2073e5c31af7Sopenharmony_ci features>> that include 2074e5c31af7Sopenharmony_ci ename:VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT 2075e5c31af7Sopenharmony_ci * [[VUID-VkPipelineRenderingCreateInfoKHR-stencilAttachmentFormat-06164]] 2076e5c31af7Sopenharmony_ci If pname:stencilAttachmentFormat is not ename:VK_FORMAT_UNDEFINED, it 2077e5c31af7Sopenharmony_ci must: be a format with <<potential-format-features, potential format 2078e5c31af7Sopenharmony_ci features>> that include 2079e5c31af7Sopenharmony_ci ename:VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT 2080e5c31af7Sopenharmony_ci * [[VUID-VkPipelineRenderingCreateInfoKHR-depthAttachmentFormat-06165]] 2081e5c31af7Sopenharmony_ci If pname:depthAttachmentFormat is not ename:VK_FORMAT_UNDEFINED and 2082e5c31af7Sopenharmony_ci pname:stencilAttachmentFormat is not ename:VK_FORMAT_UNDEFINED, 2083e5c31af7Sopenharmony_ci pname:depthAttachmentFormat must: equal pname:stencilAttachmentFormat 2084e5c31af7Sopenharmony_ci * [[VUID-VkPipelineRenderingCreateInfoKHR-multiview-06066]] 2085e5c31af7Sopenharmony_ci If the <<features-multiview,pname:multiview>> feature is not enabled, 2086e5c31af7Sopenharmony_ci pname:viewMask must: be `0` 2087e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_multiview[] 2088e5c31af7Sopenharmony_ci * [[VUID-VkPipelineRenderingCreateInfoKHR-viewMask-06067]] 2089e5c31af7Sopenharmony_ci The index of the most significant bit in pname:viewMask must: be less 2090e5c31af7Sopenharmony_ci than <<limits-maxMultiviewViewCount,pname:maxMultiviewViewCount>> 2091e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_multiview[] 2092e5c31af7Sopenharmony_ci**** 2093e5c31af7Sopenharmony_ci 2094e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkPipelineRenderingCreateInfoKHR.txt[] 2095e5c31af7Sopenharmony_ci-- 2096e5c31af7Sopenharmony_ciendif::VK_KHR_dynamic_rendering[] 2097e5c31af7Sopenharmony_ci 2098e5c31af7Sopenharmony_ci[open,refpage='VkPipelineCreateFlagBits',desc='Bitmask controlling how a pipeline is created',type='enums'] 2099e5c31af7Sopenharmony_ci-- 2100e5c31af7Sopenharmony_ciPossible values of the pname:flags member of 2101e5c31af7Sopenharmony_cislink:VkGraphicsPipelineCreateInfo, 2102e5c31af7Sopenharmony_ciifdef::VK_KHR_ray_tracing_pipeline[slink:VkRayTracingPipelineCreateInfoKHR,] 2103e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing[slink:VkRayTracingPipelineCreateInfoNV,] 2104e5c31af7Sopenharmony_ciand slink:VkComputePipelineCreateInfo, specifying how a pipeline is created, 2105e5c31af7Sopenharmony_ciare: 2106e5c31af7Sopenharmony_ci 2107e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkPipelineCreateFlagBits.txt[] 2108e5c31af7Sopenharmony_ci 2109e5c31af7Sopenharmony_ci * ename:VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT specifies that the 2110e5c31af7Sopenharmony_ci created pipeline will not be optimized. 2111e5c31af7Sopenharmony_ci Using this flag may: reduce the time taken to create the pipeline. 2112e5c31af7Sopenharmony_ci * ename:VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT specifies that the 2113e5c31af7Sopenharmony_ci pipeline to be created is allowed to be the parent of a pipeline that 2114e5c31af7Sopenharmony_ci will be created in a subsequent pipeline creation call. 2115e5c31af7Sopenharmony_ci * ename:VK_PIPELINE_CREATE_DERIVATIVE_BIT specifies that the pipeline to 2116e5c31af7Sopenharmony_ci be created will be a child of a previously created parent pipeline. 2117e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_device_group[] 2118e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_multiview[] 2119e5c31af7Sopenharmony_ci * ename:VK_PIPELINE_CREATE_VIEW_INDEX_FROM_DEVICE_INDEX_BIT specifies that 2120e5c31af7Sopenharmony_ci any shader input variables decorated as code:ViewIndex will be assigned 2121e5c31af7Sopenharmony_ci values as if they were decorated as code:DeviceIndex. 2122e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_multiview[] 2123e5c31af7Sopenharmony_ci * ename:VK_PIPELINE_CREATE_DISPATCH_BASE specifies that a compute pipeline 2124e5c31af7Sopenharmony_ci can: be used with flink:vkCmdDispatchBase with a non-zero base 2125e5c31af7Sopenharmony_ci workgroup. 2126e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_device_group[] 2127e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing[] 2128e5c31af7Sopenharmony_ci * ename:VK_PIPELINE_CREATE_DEFER_COMPILE_BIT_NV specifies that a pipeline 2129e5c31af7Sopenharmony_ci is created with all shaders in the deferred state. 2130e5c31af7Sopenharmony_ci Before using the pipeline the application must: call 2131e5c31af7Sopenharmony_ci flink:vkCompileDeferredNV exactly once on each shader in the pipeline 2132e5c31af7Sopenharmony_ci before using the pipeline. 2133e5c31af7Sopenharmony_ciendif::VK_NV_ray_tracing[] 2134e5c31af7Sopenharmony_ciifdef::VK_KHR_pipeline_executable_properties[] 2135e5c31af7Sopenharmony_ci * ename:VK_PIPELINE_CREATE_CAPTURE_STATISTICS_BIT_KHR specifies that the 2136e5c31af7Sopenharmony_ci shader compiler should capture statistics for the pipeline executables 2137e5c31af7Sopenharmony_ci produced by the compile process which can: later be retrieved by calling 2138e5c31af7Sopenharmony_ci flink:vkGetPipelineExecutableStatisticsKHR. 2139e5c31af7Sopenharmony_ci Enabling this flag must: not affect the final compiled pipeline but may: 2140e5c31af7Sopenharmony_ci disable pipeline caching or otherwise affect pipeline creation time. 2141e5c31af7Sopenharmony_ci * ename:VK_PIPELINE_CREATE_CAPTURE_INTERNAL_REPRESENTATIONS_BIT_KHR 2142e5c31af7Sopenharmony_ci specifies that the shader compiler should capture the internal 2143e5c31af7Sopenharmony_ci representations of pipeline executables produced by the compile process 2144e5c31af7Sopenharmony_ci which can: later be retrieved by calling 2145e5c31af7Sopenharmony_ci flink:vkGetPipelineExecutableInternalRepresentationsKHR. 2146e5c31af7Sopenharmony_ci Enabling this flag must: not affect the final compiled pipeline but may: 2147e5c31af7Sopenharmony_ci disable pipeline caching or otherwise affect pipeline creation time. 2148e5c31af7Sopenharmony_ciendif::VK_KHR_pipeline_executable_properties[] 2149e5c31af7Sopenharmony_ciifdef::VK_KHR_pipeline_library[] 2150e5c31af7Sopenharmony_ci * ename:VK_PIPELINE_CREATE_LIBRARY_BIT_KHR specifies that the pipeline 2151e5c31af7Sopenharmony_ci cannot: be used directly, and instead defines a _pipeline library_ that 2152e5c31af7Sopenharmony_ci can: be combined with other pipelines using the 2153e5c31af7Sopenharmony_ci slink:VkPipelineLibraryCreateInfoKHR structure. 2154e5c31af7Sopenharmony_ciifdef::VK_KHR_ray_tracing_pipeline[] 2155e5c31af7Sopenharmony_ci This is available in ray tracing pipelines. 2156e5c31af7Sopenharmony_ciendif::VK_KHR_ray_tracing_pipeline[] 2157e5c31af7Sopenharmony_ciendif::VK_KHR_pipeline_library[] 2158e5c31af7Sopenharmony_ciifdef::VK_KHR_ray_tracing_pipeline[] 2159e5c31af7Sopenharmony_ci * ename:VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_ANY_HIT_SHADERS_BIT_KHR 2160e5c31af7Sopenharmony_ci specifies that an any-hit shader will always be present when an any-hit 2161e5c31af7Sopenharmony_ci shader would be executed. 2162e5c31af7Sopenharmony_ci A NULL any-hit shader is an any-hit shader which is effectively 2163e5c31af7Sopenharmony_ci ename:VK_SHADER_UNUSED_KHR, such as from a shader group consisting 2164e5c31af7Sopenharmony_ci entirely of zeros. 2165e5c31af7Sopenharmony_ci * ename:VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_CLOSEST_HIT_SHADERS_BIT_KHR 2166e5c31af7Sopenharmony_ci specifies that a closest hit shader will always be present when a 2167e5c31af7Sopenharmony_ci closest hit shader would be executed. 2168e5c31af7Sopenharmony_ci A NULL closest hit shader is a closest hit shader which is effectively 2169e5c31af7Sopenharmony_ci ename:VK_SHADER_UNUSED_KHR, such as from a shader group consisting 2170e5c31af7Sopenharmony_ci entirely of zeros. 2171e5c31af7Sopenharmony_ci * ename:VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_MISS_SHADERS_BIT_KHR 2172e5c31af7Sopenharmony_ci specifies that a miss shader will always be present when a miss shader 2173e5c31af7Sopenharmony_ci would be executed. 2174e5c31af7Sopenharmony_ci A NULL miss shader is a miss shader which is effectively 2175e5c31af7Sopenharmony_ci ename:VK_SHADER_UNUSED_KHR, such as from a shader group consisting 2176e5c31af7Sopenharmony_ci entirely of zeros. 2177e5c31af7Sopenharmony_ci * ename:VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_INTERSECTION_SHADERS_BIT_KHR 2178e5c31af7Sopenharmony_ci specifies that an intersection shader will always be present when an 2179e5c31af7Sopenharmony_ci intersection shader would be executed. 2180e5c31af7Sopenharmony_ci A NULL intersection shader is an intersection shader which is 2181e5c31af7Sopenharmony_ci effectively ename:VK_SHADER_UNUSED_KHR, such as from a shader group 2182e5c31af7Sopenharmony_ci consisting entirely of zeros. 2183e5c31af7Sopenharmony_ci * ename:VK_PIPELINE_CREATE_RAY_TRACING_SKIP_TRIANGLES_BIT_KHR specifies 2184e5c31af7Sopenharmony_ci that triangle primitives will be skipped during traversal using 2185e5c31af7Sopenharmony_ci code:OpTraceRayKHR. 2186e5c31af7Sopenharmony_ci * ename:VK_PIPELINE_CREATE_RAY_TRACING_SKIP_AABBS_BIT_KHR specifies that 2187e5c31af7Sopenharmony_ci AABB primitives will be skipped during traversal using 2188e5c31af7Sopenharmony_ci code:OpTraceRayKHR. 2189e5c31af7Sopenharmony_ci * ename:VK_PIPELINE_CREATE_RAY_TRACING_SHADER_GROUP_HANDLE_CAPTURE_REPLAY_BIT_KHR 2190e5c31af7Sopenharmony_ci specifies that the shader group handles can: be saved and reused on a 2191e5c31af7Sopenharmony_ci subsequent run (e.g. for trace capture and replay). 2192e5c31af7Sopenharmony_ciendif::VK_KHR_ray_tracing_pipeline[] 2193e5c31af7Sopenharmony_ciifdef::VK_NV_device_generated_commands[] 2194e5c31af7Sopenharmony_ci * ename:VK_PIPELINE_CREATE_INDIRECT_BINDABLE_BIT_NV specifies that the 2195e5c31af7Sopenharmony_ci pipeline can be used in combination with <<device-generated-commands>>. 2196e5c31af7Sopenharmony_ciendif::VK_NV_device_generated_commands[] 2197e5c31af7Sopenharmony_ciifdef::VK_EXT_pipeline_creation_cache_control[] 2198e5c31af7Sopenharmony_ci * ename:VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT_EXT 2199e5c31af7Sopenharmony_ci specifies that pipeline creation will fail if a compile is required for 2200e5c31af7Sopenharmony_ci creation of a valid slink:VkPipeline object; 2201e5c31af7Sopenharmony_ci ename:VK_PIPELINE_COMPILE_REQUIRED_EXT will be returned by pipeline 2202e5c31af7Sopenharmony_ci creation, and the slink:VkPipeline will be set to dlink:VK_NULL_HANDLE. 2203e5c31af7Sopenharmony_ci * When creating multiple pipelines, 2204e5c31af7Sopenharmony_ci ename:VK_PIPELINE_CREATE_EARLY_RETURN_ON_FAILURE_BIT_EXT specifies that 2205e5c31af7Sopenharmony_ci control will be returned to the application on failure of the 2206e5c31af7Sopenharmony_ci corresponding pipeline rather than continuing to create additional 2207e5c31af7Sopenharmony_ci pipelines. 2208e5c31af7Sopenharmony_ciendif::VK_EXT_pipeline_creation_cache_control[] 2209e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing_motion_blur[] 2210e5c31af7Sopenharmony_ci * ename:VK_PIPELINE_CREATE_RAY_TRACING_ALLOW_MOTION_BIT_NV specifies that 2211e5c31af7Sopenharmony_ci the pipeline is allowed to use code:OpTraceRayMotionNV. 2212e5c31af7Sopenharmony_ciendif::VK_NV_ray_tracing_motion_blur[] 2213e5c31af7Sopenharmony_ciifdef::VK_KHR_dynamic_rendering[] 2214e5c31af7Sopenharmony_ciifdef::VK_KHR_fragment_shading_rate[] 2215e5c31af7Sopenharmony_ci * ename:VK_PIPELINE_CREATE_RENDERING_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR 2216e5c31af7Sopenharmony_ci specifies that the pipeline will be used with a fragment shading rate 2217e5c31af7Sopenharmony_ci attachment. 2218e5c31af7Sopenharmony_ciendif::VK_KHR_fragment_shading_rate[] 2219e5c31af7Sopenharmony_ciifdef::VK_EXT_fragment_density_map[] 2220e5c31af7Sopenharmony_ci * ename:VK_PIPELINE_CREATE_RENDERING_FRAGMENT_DENSITY_MAP_ATTACHMENT_BIT_EXT 2221e5c31af7Sopenharmony_ci specifies that the pipeline will be used with a fragment density map 2222e5c31af7Sopenharmony_ci attachment. 2223e5c31af7Sopenharmony_ciendif::VK_EXT_fragment_density_map[] 2224e5c31af7Sopenharmony_ciendif::VK_KHR_dynamic_rendering[] 2225e5c31af7Sopenharmony_ci 2226e5c31af7Sopenharmony_ciIt is valid to set both ename:VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT and 2227e5c31af7Sopenharmony_ciename:VK_PIPELINE_CREATE_DERIVATIVE_BIT. 2228e5c31af7Sopenharmony_ciThis allows a pipeline to be both a parent and possibly a child in a 2229e5c31af7Sopenharmony_cipipeline hierarchy. 2230e5c31af7Sopenharmony_ciSee <<pipelines-pipeline-derivatives,Pipeline Derivatives>> for more 2231e5c31af7Sopenharmony_ciinformation. 2232e5c31af7Sopenharmony_ci-- 2233e5c31af7Sopenharmony_ci 2234e5c31af7Sopenharmony_ci[open,refpage='VkPipelineCreateFlags',desc='Bitmask of VkPipelineCreateFlagBits',type='flags'] 2235e5c31af7Sopenharmony_ci-- 2236e5c31af7Sopenharmony_ciinclude::{generated}/api/flags/VkPipelineCreateFlags.txt[] 2237e5c31af7Sopenharmony_ci 2238e5c31af7Sopenharmony_citname:VkPipelineCreateFlags is a bitmask type for setting a mask of zero or 2239e5c31af7Sopenharmony_cimore elink:VkPipelineCreateFlagBits. 2240e5c31af7Sopenharmony_ci-- 2241e5c31af7Sopenharmony_ci 2242e5c31af7Sopenharmony_ci[open,refpage='VkPipelineDynamicStateCreateInfo',desc='Structure specifying parameters of a newly created pipeline dynamic state',type='structs'] 2243e5c31af7Sopenharmony_ci-- 2244e5c31af7Sopenharmony_ciThe sname:VkPipelineDynamicStateCreateInfo structure is defined as: 2245e5c31af7Sopenharmony_ci 2246e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkPipelineDynamicStateCreateInfo.txt[] 2247e5c31af7Sopenharmony_ci 2248e5c31af7Sopenharmony_ci * pname:sType is the type of this structure. 2249e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 2250e5c31af7Sopenharmony_ci structure. 2251e5c31af7Sopenharmony_ci * pname:flags is reserved for future use. 2252e5c31af7Sopenharmony_ci * pname:dynamicStateCount is the number of elements in the 2253e5c31af7Sopenharmony_ci pname:pDynamicStates array. 2254e5c31af7Sopenharmony_ci * pname:pDynamicStates is a pointer to an array of elink:VkDynamicState 2255e5c31af7Sopenharmony_ci values specifying which pieces of pipeline state will use the values 2256e5c31af7Sopenharmony_ci from dynamic state commands rather than from pipeline state creation 2257e5c31af7Sopenharmony_ci information. 2258e5c31af7Sopenharmony_ci 2259e5c31af7Sopenharmony_ci.Valid Usage 2260e5c31af7Sopenharmony_ci**** 2261e5c31af7Sopenharmony_ci * [[VUID-VkPipelineDynamicStateCreateInfo-pDynamicStates-01442]] 2262e5c31af7Sopenharmony_ci Each element of pname:pDynamicStates must: be unique 2263e5c31af7Sopenharmony_ci**** 2264e5c31af7Sopenharmony_ci 2265e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkPipelineDynamicStateCreateInfo.txt[] 2266e5c31af7Sopenharmony_ci-- 2267e5c31af7Sopenharmony_ci 2268e5c31af7Sopenharmony_ci[open,refpage='VkPipelineDynamicStateCreateFlags',desc='Reserved for future use',type='flags'] 2269e5c31af7Sopenharmony_ci-- 2270e5c31af7Sopenharmony_ciinclude::{generated}/api/flags/VkPipelineDynamicStateCreateFlags.txt[] 2271e5c31af7Sopenharmony_ci 2272e5c31af7Sopenharmony_citname:VkPipelineDynamicStateCreateFlags is a bitmask type for setting a 2273e5c31af7Sopenharmony_cimask, but is currently reserved for future use. 2274e5c31af7Sopenharmony_ci-- 2275e5c31af7Sopenharmony_ci 2276e5c31af7Sopenharmony_ci[open,refpage='VkDynamicState',desc='Indicate which dynamic state is taken from dynamic state commands',type='enums'] 2277e5c31af7Sopenharmony_ci-- 2278e5c31af7Sopenharmony_ciThe source of different pieces of dynamic state is specified by the 2279e5c31af7Sopenharmony_cislink:VkPipelineDynamicStateCreateInfo::pname:pDynamicStates property of the 2280e5c31af7Sopenharmony_cicurrently active pipeline, each of whose elements must: be one of the 2281e5c31af7Sopenharmony_civalues: 2282e5c31af7Sopenharmony_ci 2283e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkDynamicState.txt[] 2284e5c31af7Sopenharmony_ci 2285e5c31af7Sopenharmony_ci * ename:VK_DYNAMIC_STATE_VIEWPORT specifies that the pname:pViewports 2286e5c31af7Sopenharmony_ci state in slink:VkPipelineViewportStateCreateInfo will be ignored and 2287e5c31af7Sopenharmony_ci must: be set dynamically with flink:vkCmdSetViewport before any drawing 2288e5c31af7Sopenharmony_ci commands. 2289e5c31af7Sopenharmony_ci The number of viewports used by a pipeline is still specified by the 2290e5c31af7Sopenharmony_ci pname:viewportCount member of slink:VkPipelineViewportStateCreateInfo. 2291e5c31af7Sopenharmony_ci * ename:VK_DYNAMIC_STATE_SCISSOR specifies that the pname:pScissors state 2292e5c31af7Sopenharmony_ci in slink:VkPipelineViewportStateCreateInfo will be ignored and must: be 2293e5c31af7Sopenharmony_ci set dynamically with flink:vkCmdSetScissor before any drawing commands. 2294e5c31af7Sopenharmony_ci The number of scissor rectangles used by a pipeline is still specified 2295e5c31af7Sopenharmony_ci by the pname:scissorCount member of 2296e5c31af7Sopenharmony_ci slink:VkPipelineViewportStateCreateInfo. 2297e5c31af7Sopenharmony_ci * ename:VK_DYNAMIC_STATE_LINE_WIDTH specifies that the pname:lineWidth 2298e5c31af7Sopenharmony_ci state in slink:VkPipelineRasterizationStateCreateInfo will be ignored 2299e5c31af7Sopenharmony_ci and must: be set dynamically with flink:vkCmdSetLineWidth before any 2300e5c31af7Sopenharmony_ci drawing commands that generate line primitives for the rasterizer. 2301e5c31af7Sopenharmony_ci * ename:VK_DYNAMIC_STATE_DEPTH_BIAS specifies that the 2302e5c31af7Sopenharmony_ci pname:depthBiasConstantFactor, pname:depthBiasClamp and 2303e5c31af7Sopenharmony_ci pname:depthBiasSlopeFactor states in 2304e5c31af7Sopenharmony_ci slink:VkPipelineRasterizationStateCreateInfo will be ignored and must: 2305e5c31af7Sopenharmony_ci be set dynamically with flink:vkCmdSetDepthBias before any draws are 2306e5c31af7Sopenharmony_ci performed with pname:depthBiasEnable in 2307e5c31af7Sopenharmony_ci slink:VkPipelineRasterizationStateCreateInfo set to ename:VK_TRUE. 2308e5c31af7Sopenharmony_ci * ename:VK_DYNAMIC_STATE_BLEND_CONSTANTS specifies that the 2309e5c31af7Sopenharmony_ci pname:blendConstants state in slink:VkPipelineColorBlendStateCreateInfo 2310e5c31af7Sopenharmony_ci will be ignored and must: be set dynamically with 2311e5c31af7Sopenharmony_ci flink:vkCmdSetBlendConstants before any draws are performed with a 2312e5c31af7Sopenharmony_ci pipeline state with sname:VkPipelineColorBlendAttachmentState member 2313e5c31af7Sopenharmony_ci pname:blendEnable set to ename:VK_TRUE and any of the blend functions 2314e5c31af7Sopenharmony_ci using a constant blend color. 2315e5c31af7Sopenharmony_ci * ename:VK_DYNAMIC_STATE_DEPTH_BOUNDS specifies that the 2316e5c31af7Sopenharmony_ci pname:minDepthBounds and pname:maxDepthBounds states of 2317e5c31af7Sopenharmony_ci slink:VkPipelineDepthStencilStateCreateInfo will be ignored and must: be 2318e5c31af7Sopenharmony_ci set dynamically with flink:vkCmdSetDepthBounds before any draws are 2319e5c31af7Sopenharmony_ci performed with a pipeline state with 2320e5c31af7Sopenharmony_ci slink:VkPipelineDepthStencilStateCreateInfo member 2321e5c31af7Sopenharmony_ci pname:depthBoundsTestEnable set to ename:VK_TRUE. 2322e5c31af7Sopenharmony_ci * ename:VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK specifies that the 2323e5c31af7Sopenharmony_ci pname:compareMask state in slink:VkPipelineDepthStencilStateCreateInfo 2324e5c31af7Sopenharmony_ci for both pname:front and pname:back will be ignored and must: be set 2325e5c31af7Sopenharmony_ci dynamically with flink:vkCmdSetStencilCompareMask before any draws are 2326e5c31af7Sopenharmony_ci performed with a pipeline state with 2327e5c31af7Sopenharmony_ci slink:VkPipelineDepthStencilStateCreateInfo member 2328e5c31af7Sopenharmony_ci pname:stencilTestEnable set to ename:VK_TRUE 2329e5c31af7Sopenharmony_ci * ename:VK_DYNAMIC_STATE_STENCIL_WRITE_MASK specifies that the 2330e5c31af7Sopenharmony_ci pname:writeMask state in slink:VkPipelineDepthStencilStateCreateInfo for 2331e5c31af7Sopenharmony_ci both pname:front and pname:back will be ignored and must: be set 2332e5c31af7Sopenharmony_ci dynamically with flink:vkCmdSetStencilWriteMask before any draws are 2333e5c31af7Sopenharmony_ci performed with a pipeline state with 2334e5c31af7Sopenharmony_ci slink:VkPipelineDepthStencilStateCreateInfo member 2335e5c31af7Sopenharmony_ci pname:stencilTestEnable set to ename:VK_TRUE 2336e5c31af7Sopenharmony_ci * ename:VK_DYNAMIC_STATE_STENCIL_REFERENCE specifies that the 2337e5c31af7Sopenharmony_ci pname:reference state in slink:VkPipelineDepthStencilStateCreateInfo for 2338e5c31af7Sopenharmony_ci both pname:front and pname:back will be ignored and must: be set 2339e5c31af7Sopenharmony_ci dynamically with flink:vkCmdSetStencilReference before any draws are 2340e5c31af7Sopenharmony_ci performed with a pipeline state with 2341e5c31af7Sopenharmony_ci slink:VkPipelineDepthStencilStateCreateInfo member 2342e5c31af7Sopenharmony_ci pname:stencilTestEnable set to ename:VK_TRUE 2343e5c31af7Sopenharmony_ciifdef::VK_NV_clip_space_w_scaling[] 2344e5c31af7Sopenharmony_ci * ename:VK_DYNAMIC_STATE_VIEWPORT_W_SCALING_NV specifies that the 2345e5c31af7Sopenharmony_ci pname:pViewportScalings state in 2346e5c31af7Sopenharmony_ci slink:VkPipelineViewportWScalingStateCreateInfoNV will be ignored and 2347e5c31af7Sopenharmony_ci must: be set dynamically with flink:vkCmdSetViewportWScalingNV before 2348e5c31af7Sopenharmony_ci any draws are performed with a pipeline state with 2349e5c31af7Sopenharmony_ci slink:VkPipelineViewportWScalingStateCreateInfoNV member 2350e5c31af7Sopenharmony_ci pname:viewportScalingEnable set to ename:VK_TRUE 2351e5c31af7Sopenharmony_ciendif::VK_NV_clip_space_w_scaling[] 2352e5c31af7Sopenharmony_ciifdef::VK_EXT_discard_rectangles[] 2353e5c31af7Sopenharmony_ci * ename:VK_DYNAMIC_STATE_DISCARD_RECTANGLE_EXT specifies that the 2354e5c31af7Sopenharmony_ci pname:pDiscardRectangles state in 2355e5c31af7Sopenharmony_ci slink:VkPipelineDiscardRectangleStateCreateInfoEXT will be ignored and 2356e5c31af7Sopenharmony_ci must: be set dynamically with flink:vkCmdSetDiscardRectangleEXT before 2357e5c31af7Sopenharmony_ci any draw or clear commands. 2358e5c31af7Sopenharmony_ci The elink:VkDiscardRectangleModeEXT and the number of active discard 2359e5c31af7Sopenharmony_ci rectangles is still specified by the pname:discardRectangleMode and 2360e5c31af7Sopenharmony_ci pname:discardRectangleCount members of 2361e5c31af7Sopenharmony_ci slink:VkPipelineDiscardRectangleStateCreateInfoEXT. 2362e5c31af7Sopenharmony_ciendif::VK_EXT_discard_rectangles[] 2363e5c31af7Sopenharmony_ciifdef::VK_EXT_sample_locations[] 2364e5c31af7Sopenharmony_ci * ename:VK_DYNAMIC_STATE_SAMPLE_LOCATIONS_EXT specifies that the 2365e5c31af7Sopenharmony_ci pname:sampleLocationsInfo state in 2366e5c31af7Sopenharmony_ci slink:VkPipelineSampleLocationsStateCreateInfoEXT will be ignored and 2367e5c31af7Sopenharmony_ci must: be set dynamically with flink:vkCmdSetSampleLocationsEXT before 2368e5c31af7Sopenharmony_ci any draw or clear commands. 2369e5c31af7Sopenharmony_ci Enabling custom sample locations is still indicated by the 2370e5c31af7Sopenharmony_ci pname:sampleLocationsEnable member of 2371e5c31af7Sopenharmony_ci slink:VkPipelineSampleLocationsStateCreateInfoEXT. 2372e5c31af7Sopenharmony_ciendif::VK_EXT_sample_locations[] 2373e5c31af7Sopenharmony_ciifdef::VK_NV_scissor_exclusive[] 2374e5c31af7Sopenharmony_ci * ename:VK_DYNAMIC_STATE_EXCLUSIVE_SCISSOR_NV specifies that the 2375e5c31af7Sopenharmony_ci pname:pExclusiveScissors state in 2376e5c31af7Sopenharmony_ci slink:VkPipelineViewportExclusiveScissorStateCreateInfoNV will be 2377e5c31af7Sopenharmony_ci ignored and must: be set dynamically with 2378e5c31af7Sopenharmony_ci flink:vkCmdSetExclusiveScissorNV before any drawing commands. 2379e5c31af7Sopenharmony_ci The number of exclusive scissor rectangles used by a pipeline is still 2380e5c31af7Sopenharmony_ci specified by the pname:exclusiveScissorCount member of 2381e5c31af7Sopenharmony_ci slink:VkPipelineViewportExclusiveScissorStateCreateInfoNV. 2382e5c31af7Sopenharmony_ciendif::VK_NV_scissor_exclusive[] 2383e5c31af7Sopenharmony_ciifdef::VK_NV_shading_rate_image[] 2384e5c31af7Sopenharmony_ci * ename:VK_DYNAMIC_STATE_VIEWPORT_SHADING_RATE_PALETTE_NV specifies that 2385e5c31af7Sopenharmony_ci the pname:pShadingRatePalettes state in 2386e5c31af7Sopenharmony_ci slink:VkPipelineViewportShadingRateImageStateCreateInfoNV will be 2387e5c31af7Sopenharmony_ci ignored and must: be set dynamically with 2388e5c31af7Sopenharmony_ci flink:vkCmdSetViewportShadingRatePaletteNV before any drawing commands. 2389e5c31af7Sopenharmony_ci * ename:VK_DYNAMIC_STATE_VIEWPORT_COARSE_SAMPLE_ORDER_NV specifies that 2390e5c31af7Sopenharmony_ci the coarse sample order state in 2391e5c31af7Sopenharmony_ci slink:VkPipelineViewportCoarseSampleOrderStateCreateInfoNV will be 2392e5c31af7Sopenharmony_ci ignored and must: be set dynamically with 2393e5c31af7Sopenharmony_ci flink:vkCmdSetCoarseSampleOrderNV before any drawing commands. 2394e5c31af7Sopenharmony_ciendif::VK_NV_shading_rate_image[] 2395e5c31af7Sopenharmony_ciifdef::VK_EXT_line_rasterization[] 2396e5c31af7Sopenharmony_ci * ename:VK_DYNAMIC_STATE_LINE_STIPPLE_EXT specifies that the 2397e5c31af7Sopenharmony_ci pname:lineStippleFactor and pname:lineStipplePattern state in 2398e5c31af7Sopenharmony_ci slink:VkPipelineRasterizationLineStateCreateInfoEXT will be ignored and 2399e5c31af7Sopenharmony_ci must: be set dynamically with flink:vkCmdSetLineStippleEXT before any 2400e5c31af7Sopenharmony_ci draws are performed with a pipeline state with 2401e5c31af7Sopenharmony_ci slink:VkPipelineRasterizationLineStateCreateInfoEXT member 2402e5c31af7Sopenharmony_ci pname:stippledLineEnable set to ename:VK_TRUE. 2403e5c31af7Sopenharmony_ciendif::VK_EXT_line_rasterization[] 2404e5c31af7Sopenharmony_ciifdef::VK_EXT_extended_dynamic_state[] 2405e5c31af7Sopenharmony_ci * ename:VK_DYNAMIC_STATE_CULL_MODE_EXT specifies that the pname:cullMode 2406e5c31af7Sopenharmony_ci state in slink:VkPipelineRasterizationStateCreateInfo will be ignored 2407e5c31af7Sopenharmony_ci and must: be set dynamically with flink:vkCmdSetCullModeEXT before any 2408e5c31af7Sopenharmony_ci drawing commands. 2409e5c31af7Sopenharmony_ci * ename:VK_DYNAMIC_STATE_FRONT_FACE_EXT specifies that the pname:frontFace 2410e5c31af7Sopenharmony_ci state in slink:VkPipelineRasterizationStateCreateInfo will be ignored 2411e5c31af7Sopenharmony_ci and must: be set dynamically with flink:vkCmdSetFrontFaceEXT before any 2412e5c31af7Sopenharmony_ci drawing commands. 2413e5c31af7Sopenharmony_ci * ename:VK_DYNAMIC_STATE_PRIMITIVE_TOPOLOGY_EXT specifies that the 2414e5c31af7Sopenharmony_ci pname:topology state in slink:VkPipelineInputAssemblyStateCreateInfo 2415e5c31af7Sopenharmony_ci only specifies the <<drawing-primitive-topology-class, topology class>>, 2416e5c31af7Sopenharmony_ci and the specific topology order and adjacency must: be set dynamically 2417e5c31af7Sopenharmony_ci with flink:vkCmdSetPrimitiveTopologyEXT before any drawing commands. 2418e5c31af7Sopenharmony_ci * ename:VK_DYNAMIC_STATE_VIEWPORT_WITH_COUNT_EXT specifies that the 2419e5c31af7Sopenharmony_ci pname:viewportCount and pname:pViewports state in 2420e5c31af7Sopenharmony_ci slink:VkPipelineViewportStateCreateInfo will be ignored and must: be set 2421e5c31af7Sopenharmony_ci dynamically with flink:vkCmdSetViewportWithCountEXT before any draw 2422e5c31af7Sopenharmony_ci call. 2423e5c31af7Sopenharmony_ci * ename:VK_DYNAMIC_STATE_SCISSOR_WITH_COUNT_EXT specifies that the 2424e5c31af7Sopenharmony_ci pname:scissorCount and pname:pScissors state in 2425e5c31af7Sopenharmony_ci slink:VkPipelineViewportStateCreateInfo will be ignored and must: be set 2426e5c31af7Sopenharmony_ci dynamically with flink:vkCmdSetScissorWithCountEXT before any draw call. 2427e5c31af7Sopenharmony_ci * ename:VK_DYNAMIC_STATE_VERTEX_INPUT_BINDING_STRIDE_EXT specifies that 2428e5c31af7Sopenharmony_ci the pname:stride state in slink:VkVertexInputBindingDescription will be 2429e5c31af7Sopenharmony_ci ignored and must: be set dynamically with 2430e5c31af7Sopenharmony_ci flink:vkCmdBindVertexBuffers2EXT before any draw call. 2431e5c31af7Sopenharmony_ci * ename:VK_DYNAMIC_STATE_DEPTH_TEST_ENABLE_EXT specifies that the 2432e5c31af7Sopenharmony_ci pname:depthTestEnable state in 2433e5c31af7Sopenharmony_ci slink:VkPipelineDepthStencilStateCreateInfo will be ignored and must: be 2434e5c31af7Sopenharmony_ci set dynamically with flink:vkCmdSetDepthTestEnableEXT before any draw 2435e5c31af7Sopenharmony_ci call. 2436e5c31af7Sopenharmony_ci * ename:VK_DYNAMIC_STATE_DEPTH_WRITE_ENABLE_EXT specifies that the 2437e5c31af7Sopenharmony_ci pname:depthWriteEnable state in 2438e5c31af7Sopenharmony_ci slink:VkPipelineDepthStencilStateCreateInfo will be ignored and must: be 2439e5c31af7Sopenharmony_ci set dynamically with flink:vkCmdSetDepthWriteEnableEXT before any draw 2440e5c31af7Sopenharmony_ci call. 2441e5c31af7Sopenharmony_ci * ename:VK_DYNAMIC_STATE_DEPTH_COMPARE_OP_EXT specifies that the 2442e5c31af7Sopenharmony_ci pname:depthCompareOp state in 2443e5c31af7Sopenharmony_ci slink:VkPipelineDepthStencilStateCreateInfo will be ignored and must: be 2444e5c31af7Sopenharmony_ci set dynamically with flink:vkCmdSetDepthCompareOpEXT before any draw 2445e5c31af7Sopenharmony_ci call. 2446e5c31af7Sopenharmony_ci * ename:VK_DYNAMIC_STATE_DEPTH_BOUNDS_TEST_ENABLE_EXT specifies that the 2447e5c31af7Sopenharmony_ci pname:depthBoundsTestEnable state in 2448e5c31af7Sopenharmony_ci slink:VkPipelineDepthStencilStateCreateInfo will be ignored and must: be 2449e5c31af7Sopenharmony_ci set dynamically with flink:vkCmdSetDepthBoundsTestEnableEXT before any 2450e5c31af7Sopenharmony_ci draw call. 2451e5c31af7Sopenharmony_ci * ename:VK_DYNAMIC_STATE_STENCIL_TEST_ENABLE_EXT specifies that the 2452e5c31af7Sopenharmony_ci pname:stencilTestEnable state in 2453e5c31af7Sopenharmony_ci slink:VkPipelineDepthStencilStateCreateInfo will be ignored and must: be 2454e5c31af7Sopenharmony_ci set dynamically with flink:vkCmdSetStencilTestEnableEXT before any draw 2455e5c31af7Sopenharmony_ci call. 2456e5c31af7Sopenharmony_ci * ename:VK_DYNAMIC_STATE_STENCIL_OP_EXT specifies that the pname:failOp, 2457e5c31af7Sopenharmony_ci pname:passOp, pname:depthFailOp, and pname:compareOp states in 2458e5c31af7Sopenharmony_ci sname:VkPipelineDepthStencilStateCreateInfo for both pname:front and 2459e5c31af7Sopenharmony_ci pname:back will be ignored and must: be set dynamically with 2460e5c31af7Sopenharmony_ci flink:vkCmdSetStencilOpEXT before any draws are performed with a 2461e5c31af7Sopenharmony_ci pipeline state with sname:VkPipelineDepthStencilStateCreateInfo member 2462e5c31af7Sopenharmony_ci pname:stencilTestEnable set to ename:VK_TRUE 2463e5c31af7Sopenharmony_ciendif::VK_EXT_extended_dynamic_state[] 2464e5c31af7Sopenharmony_ciifdef::VK_EXT_extended_dynamic_state2[] 2465e5c31af7Sopenharmony_ci * ename:VK_DYNAMIC_STATE_PATCH_CONTROL_POINTS_EXT specifies that the 2466e5c31af7Sopenharmony_ci pname:patchControlPoints state in 2467e5c31af7Sopenharmony_ci slink:VkPipelineTessellationStateCreateInfo will be ignored and must: be 2468e5c31af7Sopenharmony_ci set dynamically with flink:vkCmdSetPatchControlPointsEXT before any 2469e5c31af7Sopenharmony_ci drawing commands. 2470e5c31af7Sopenharmony_ci * ename:VK_DYNAMIC_STATE_RASTERIZER_DISCARD_ENABLE_EXT specifies that the 2471e5c31af7Sopenharmony_ci pname:rasterizerDiscardEnable state in 2472e5c31af7Sopenharmony_ci slink:VkPipelineRasterizationStateCreateInfo will be ignored and must: 2473e5c31af7Sopenharmony_ci be set dynamically with flink:vkCmdSetRasterizerDiscardEnableEXT before 2474e5c31af7Sopenharmony_ci any drawing commands. 2475e5c31af7Sopenharmony_ci * ename:VK_DYNAMIC_STATE_DEPTH_BIAS_ENABLE_EXT specifies that the 2476e5c31af7Sopenharmony_ci pname:depthBiasEnable state in 2477e5c31af7Sopenharmony_ci slink:VkPipelineRasterizationStateCreateInfo will be ignored and must: 2478e5c31af7Sopenharmony_ci be set dynamically with flink:vkCmdSetDepthBiasEnableEXT before any 2479e5c31af7Sopenharmony_ci drawing commands. 2480e5c31af7Sopenharmony_ci * ename:VK_DYNAMIC_STATE_LOGIC_OP_EXT specifies that the pname:logicOp 2481e5c31af7Sopenharmony_ci state in slink:VkPipelineColorBlendStateCreateInfo will be ignored and 2482e5c31af7Sopenharmony_ci must: be set dynamically with flink:vkCmdSetLogicOpEXT before any 2483e5c31af7Sopenharmony_ci drawing commands. 2484e5c31af7Sopenharmony_ci * ename:VK_DYNAMIC_STATE_PRIMITIVE_RESTART_ENABLE_EXT specifies that the 2485e5c31af7Sopenharmony_ci pname:primitiveRestartEnable state in 2486e5c31af7Sopenharmony_ci slink:VkPipelineInputAssemblyStateCreateInfo will be ignored and must: 2487e5c31af7Sopenharmony_ci be set dynamically with flink:vkCmdSetPrimitiveRestartEnableEXT before 2488e5c31af7Sopenharmony_ci any drawing commands. 2489e5c31af7Sopenharmony_ciendif::VK_EXT_extended_dynamic_state2[] 2490e5c31af7Sopenharmony_ciifdef::VK_KHR_fragment_shading_rate[] 2491e5c31af7Sopenharmony_ci * ename:VK_DYNAMIC_STATE_FRAGMENT_SHADING_RATE_KHR specifies that state in 2492e5c31af7Sopenharmony_ci slink:VkPipelineFragmentShadingRateStateCreateInfoKHR 2493e5c31af7Sopenharmony_ciifdef::VK_NV_fragment_shading_rate_enums[] 2494e5c31af7Sopenharmony_ci and slink:VkPipelineFragmentShadingRateEnumStateCreateInfoNV 2495e5c31af7Sopenharmony_ciendif::VK_NV_fragment_shading_rate_enums[] 2496e5c31af7Sopenharmony_ci will be ignored and must: be set dynamically with 2497e5c31af7Sopenharmony_ci flink:vkCmdSetFragmentShadingRateKHR 2498e5c31af7Sopenharmony_ciifdef::VK_NV_fragment_shading_rate_enums[] 2499e5c31af7Sopenharmony_ci or flink:vkCmdSetFragmentShadingRateEnumNV 2500e5c31af7Sopenharmony_ciendif::VK_NV_fragment_shading_rate_enums[] 2501e5c31af7Sopenharmony_ci before any drawing commands. 2502e5c31af7Sopenharmony_ciendif::VK_KHR_fragment_shading_rate[] 2503e5c31af7Sopenharmony_ciifdef::VK_KHR_ray_tracing_pipeline[] 2504e5c31af7Sopenharmony_ci * ename:VK_DYNAMIC_STATE_RAY_TRACING_PIPELINE_STACK_SIZE_KHR specifies 2505e5c31af7Sopenharmony_ci that the default stack size computation for the pipeline will be ignored 2506e5c31af7Sopenharmony_ci and must: be set dynamically with 2507e5c31af7Sopenharmony_ci flink:vkCmdSetRayTracingPipelineStackSizeKHR before any ray tracing 2508e5c31af7Sopenharmony_ci calls are performed. 2509e5c31af7Sopenharmony_ciendif::VK_KHR_ray_tracing_pipeline[] 2510e5c31af7Sopenharmony_ciifdef::VK_EXT_vertex_input_dynamic_state[] 2511e5c31af7Sopenharmony_ci * ename:VK_DYNAMIC_STATE_VERTEX_INPUT_EXT specifies that the 2512e5c31af7Sopenharmony_ci pname:pVertexInputState state will be ignored and must: be set 2513e5c31af7Sopenharmony_ci dynamically with flink:vkCmdSetVertexInputEXT before any drawing 2514e5c31af7Sopenharmony_ci commands 2515e5c31af7Sopenharmony_ciendif::VK_EXT_vertex_input_dynamic_state[] 2516e5c31af7Sopenharmony_ciifdef::VK_EXT_color_write_enable[] 2517e5c31af7Sopenharmony_ci * ename:VK_DYNAMIC_STATE_COLOR_WRITE_ENABLE_EXT specifies that the 2518e5c31af7Sopenharmony_ci pname:pColorWriteEnables state in 2519e5c31af7Sopenharmony_ci slink:VkPipelineColorWriteCreateInfoEXT will be ignored and must: be set 2520e5c31af7Sopenharmony_ci dynamically with flink:vkCmdSetColorWriteEnableEXT before any draw call. 2521e5c31af7Sopenharmony_ciendif::VK_EXT_color_write_enable[] 2522e5c31af7Sopenharmony_ci-- 2523e5c31af7Sopenharmony_ci 2524e5c31af7Sopenharmony_ci 2525e5c31af7Sopenharmony_ci=== Valid Combinations of Stages for Graphics Pipelines 2526e5c31af7Sopenharmony_ci 2527e5c31af7Sopenharmony_ciifdef::VK_NV_mesh_shader[] 2528e5c31af7Sopenharmony_ciThe geometric primitive processing can either be handled on a per primitive 2529e5c31af7Sopenharmony_cibasis by the vertex, tessellation, and geometry shader stages, or on a per 2530e5c31af7Sopenharmony_cimesh basis using task and mesh shader stages. 2531e5c31af7Sopenharmony_ciIf the pipeline includes a mesh shader stage, it uses the mesh pipeline, 2532e5c31af7Sopenharmony_ciotherwise it uses the primitive pipeline. 2533e5c31af7Sopenharmony_ci 2534e5c31af7Sopenharmony_ciIf a task shader is omitted, the task shading stage is skipped. 2535e5c31af7Sopenharmony_ciendif::VK_NV_mesh_shader[] 2536e5c31af7Sopenharmony_ci 2537e5c31af7Sopenharmony_ciIf tessellation shader stages are omitted, the tessellation shading and 2538e5c31af7Sopenharmony_cifixed-function stages of the pipeline are skipped. 2539e5c31af7Sopenharmony_ci 2540e5c31af7Sopenharmony_ciIf a geometry shader is omitted, the geometry shading stage is skipped. 2541e5c31af7Sopenharmony_ci 2542e5c31af7Sopenharmony_ciIf a fragment shader is omitted, fragment color outputs have undefined: 2543e5c31af7Sopenharmony_civalues, and the fragment depth value is unmodified. 2544e5c31af7Sopenharmony_ciThis can: be useful for depth-only rendering. 2545e5c31af7Sopenharmony_ci 2546e5c31af7Sopenharmony_ciPresence of a shader stage in a pipeline is indicated by including a valid 2547e5c31af7Sopenharmony_cislink:VkPipelineShaderStageCreateInfo with pname:module and pname:pName 2548e5c31af7Sopenharmony_ciselecting an entry point from a shader module, where that entry point is 2549e5c31af7Sopenharmony_civalid for the stage specified by pname:stage. 2550e5c31af7Sopenharmony_ci 2551e5c31af7Sopenharmony_ciPresence of some of the fixed-function stages in the pipeline is implicitly 2552e5c31af7Sopenharmony_ciderived from enabled shaders and provided state. 2553e5c31af7Sopenharmony_ciFor example, the fixed-function tessellator is always present when the 2554e5c31af7Sopenharmony_cipipeline has valid Tessellation Control and Tessellation Evaluation shaders. 2555e5c31af7Sopenharmony_ci 2556e5c31af7Sopenharmony_ci.For example: 2557e5c31af7Sopenharmony_ci * Depth/stencil-only rendering in a subpass with no color attachments 2558e5c31af7Sopenharmony_ci ** Active Pipeline Shader Stages 2559e5c31af7Sopenharmony_ci *** Vertex Shader 2560e5c31af7Sopenharmony_ci ** Required: Fixed-Function Pipeline Stages 2561e5c31af7Sopenharmony_ci *** slink:VkPipelineVertexInputStateCreateInfo 2562e5c31af7Sopenharmony_ci *** slink:VkPipelineInputAssemblyStateCreateInfo 2563e5c31af7Sopenharmony_ci *** slink:VkPipelineViewportStateCreateInfo 2564e5c31af7Sopenharmony_ci *** slink:VkPipelineRasterizationStateCreateInfo 2565e5c31af7Sopenharmony_ci *** slink:VkPipelineMultisampleStateCreateInfo 2566e5c31af7Sopenharmony_ci *** slink:VkPipelineDepthStencilStateCreateInfo 2567e5c31af7Sopenharmony_ci * Color-only rendering in a subpass with no depth/stencil attachment 2568e5c31af7Sopenharmony_ci ** Active Pipeline Shader Stages 2569e5c31af7Sopenharmony_ci *** Vertex Shader 2570e5c31af7Sopenharmony_ci *** Fragment Shader 2571e5c31af7Sopenharmony_ci ** Required: Fixed-Function Pipeline Stages 2572e5c31af7Sopenharmony_ci *** slink:VkPipelineVertexInputStateCreateInfo 2573e5c31af7Sopenharmony_ci *** slink:VkPipelineInputAssemblyStateCreateInfo 2574e5c31af7Sopenharmony_ci *** slink:VkPipelineViewportStateCreateInfo 2575e5c31af7Sopenharmony_ci *** slink:VkPipelineRasterizationStateCreateInfo 2576e5c31af7Sopenharmony_ci *** slink:VkPipelineMultisampleStateCreateInfo 2577e5c31af7Sopenharmony_ci *** slink:VkPipelineColorBlendStateCreateInfo 2578e5c31af7Sopenharmony_ci * Rendering pipeline with tessellation and geometry shaders 2579e5c31af7Sopenharmony_ci ** Active Pipeline Shader Stages 2580e5c31af7Sopenharmony_ci *** Vertex Shader 2581e5c31af7Sopenharmony_ci *** Tessellation Control Shader 2582e5c31af7Sopenharmony_ci *** Tessellation Evaluation Shader 2583e5c31af7Sopenharmony_ci *** Geometry Shader 2584e5c31af7Sopenharmony_ci *** Fragment Shader 2585e5c31af7Sopenharmony_ci ** Required: Fixed-Function Pipeline Stages 2586e5c31af7Sopenharmony_ci *** slink:VkPipelineVertexInputStateCreateInfo 2587e5c31af7Sopenharmony_ci *** slink:VkPipelineInputAssemblyStateCreateInfo 2588e5c31af7Sopenharmony_ci *** slink:VkPipelineTessellationStateCreateInfo 2589e5c31af7Sopenharmony_ci *** slink:VkPipelineViewportStateCreateInfo 2590e5c31af7Sopenharmony_ci *** slink:VkPipelineRasterizationStateCreateInfo 2591e5c31af7Sopenharmony_ci *** slink:VkPipelineMultisampleStateCreateInfo 2592e5c31af7Sopenharmony_ci *** slink:VkPipelineDepthStencilStateCreateInfo 2593e5c31af7Sopenharmony_ci *** slink:VkPipelineColorBlendStateCreateInfo 2594e5c31af7Sopenharmony_ciifdef::VK_NV_mesh_shader[] 2595e5c31af7Sopenharmony_ci * Rendering pipeline with task and mesh shaders 2596e5c31af7Sopenharmony_ci ** Active Pipeline Shader Stages 2597e5c31af7Sopenharmony_ci *** Task Shader 2598e5c31af7Sopenharmony_ci *** Mesh Shader 2599e5c31af7Sopenharmony_ci *** Fragment Shader 2600e5c31af7Sopenharmony_ci ** Required: Fixed-Function Pipeline Stages 2601e5c31af7Sopenharmony_ci *** slink:VkPipelineViewportStateCreateInfo 2602e5c31af7Sopenharmony_ci *** slink:VkPipelineRasterizationStateCreateInfo 2603e5c31af7Sopenharmony_ci *** slink:VkPipelineMultisampleStateCreateInfo 2604e5c31af7Sopenharmony_ci *** slink:VkPipelineDepthStencilStateCreateInfo 2605e5c31af7Sopenharmony_ci *** slink:VkPipelineColorBlendStateCreateInfo 2606e5c31af7Sopenharmony_ciendif::VK_NV_mesh_shader[] 2607e5c31af7Sopenharmony_ci 2608e5c31af7Sopenharmony_ci 2609e5c31af7Sopenharmony_ciifdef::VK_NV_device_generated_commands[] 2610e5c31af7Sopenharmony_ci[[graphics-shadergroups]] 2611e5c31af7Sopenharmony_ci=== Graphics Pipeline Shader Groups 2612e5c31af7Sopenharmony_ci 2613e5c31af7Sopenharmony_ciGraphics pipelines can contain multiple shader groups that can be bound 2614e5c31af7Sopenharmony_ciindividually. 2615e5c31af7Sopenharmony_ciEach shader group behaves as if it was a pipeline using the shader group's 2616e5c31af7Sopenharmony_cistate. 2617e5c31af7Sopenharmony_ciWhen the pipeline is bound by regular means, it behaves as if the state of 2618e5c31af7Sopenharmony_cigroup `0` is active, use flink:vkCmdBindPipelineShaderGroupNV to bind an 2619e5c31af7Sopenharmony_ciinvidual shader group. 2620e5c31af7Sopenharmony_ci 2621e5c31af7Sopenharmony_ciThe primary purpose of shader groups is allowing the device to bind 2622e5c31af7Sopenharmony_cidifferent pipeline state using <<device-generated-commands>>. 2623e5c31af7Sopenharmony_ci 2624e5c31af7Sopenharmony_ci[open,refpage='VkGraphicsPipelineShaderGroupsCreateInfoNV',desc='Structure specifying parameters of a newly created multi shader group pipeline',type='structs'] 2625e5c31af7Sopenharmony_ci-- 2626e5c31af7Sopenharmony_ciThe sname:VkGraphicsPipelineShaderGroupsCreateInfoNV structure is defined 2627e5c31af7Sopenharmony_cias: 2628e5c31af7Sopenharmony_ci 2629e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkGraphicsPipelineShaderGroupsCreateInfoNV.txt[] 2630e5c31af7Sopenharmony_ci 2631e5c31af7Sopenharmony_ci * pname:sType is the type of this structure. 2632e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 2633e5c31af7Sopenharmony_ci structure. 2634e5c31af7Sopenharmony_ci * pname:groupCount is the number of elements in the pname:pGroups array. 2635e5c31af7Sopenharmony_ci * pname:pGroups is a pointer to an array of 2636e5c31af7Sopenharmony_ci slink:VkGraphicsShaderGroupCreateInfoNV structures specifying which 2637e5c31af7Sopenharmony_ci state of the original slink:VkGraphicsPipelineCreateInfo each shader 2638e5c31af7Sopenharmony_ci group overrides. 2639e5c31af7Sopenharmony_ci * pname:pipelineCount is the number of elements in the pname:pPipelines 2640e5c31af7Sopenharmony_ci array. 2641e5c31af7Sopenharmony_ci * pname:pPipelines is a pointer to an array of graphics sname:VkPipeline 2642e5c31af7Sopenharmony_ci structures which are referenced within the created pipeline, including 2643e5c31af7Sopenharmony_ci all their shader groups. 2644e5c31af7Sopenharmony_ci 2645e5c31af7Sopenharmony_ciWhen referencing shader groups by index, groups defined in the referenced 2646e5c31af7Sopenharmony_cipipelines are treated as if they were defined as additional entries in 2647e5c31af7Sopenharmony_cipname:pGroups. 2648e5c31af7Sopenharmony_ciThey are appended in the order they appear in the pname:pPipelines array and 2649e5c31af7Sopenharmony_ciin the pname:pGroups array when those pipelines were defined. 2650e5c31af7Sopenharmony_ci 2651e5c31af7Sopenharmony_ciThe application must: maintain the lifetime of all such referenced pipelines 2652e5c31af7Sopenharmony_cibased on the pipelines that make use of them. 2653e5c31af7Sopenharmony_ci 2654e5c31af7Sopenharmony_ci.Valid Usage 2655e5c31af7Sopenharmony_ci**** 2656e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineShaderGroupsCreateInfoNV-groupCount-02879]] 2657e5c31af7Sopenharmony_ci pname:groupCount must: be at least `1` and as maximum 2658e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV::pname:maxGraphicsShaderGroupCount 2659e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineShaderGroupsCreateInfoNV-groupCount-02880]] 2660e5c31af7Sopenharmony_ci The sum of pname:groupCount including those groups added from referenced 2661e5c31af7Sopenharmony_ci pname:pPipelines must: also be as maximum 2662e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV::pname:maxGraphicsShaderGroupCount 2663e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineShaderGroupsCreateInfoNV-pGroups-02881]] 2664e5c31af7Sopenharmony_ci The state of the first element of pname:pGroups must: match its 2665e5c31af7Sopenharmony_ci equivalent within the parent's slink:VkGraphicsPipelineCreateInfo 2666e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineShaderGroupsCreateInfoNV-pGroups-02882]] 2667e5c31af7Sopenharmony_ci Each element of pname:pGroups must: in combination with the rest of the 2668e5c31af7Sopenharmony_ci pipeline state yield a valid state configuration 2669e5c31af7Sopenharmony_ciifndef::VK_NV_mesh_shader[] 2670e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineShaderGroupsCreateInfoNV-pGroups-02883]] 2671e5c31af7Sopenharmony_ci All elements of pname:pGroups must: use the same shader stage 2672e5c31af7Sopenharmony_ci combinations 2673e5c31af7Sopenharmony_ciendif::VK_NV_mesh_shader[] 2674e5c31af7Sopenharmony_ciifdef::VK_NV_mesh_shader[] 2675e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineShaderGroupsCreateInfoNV-pGroups-02884]] 2676e5c31af7Sopenharmony_ci All elements of pname:pGroups must: use the same shader stage 2677e5c31af7Sopenharmony_ci combinations unless any mesh shader stage is used, then either 2678e5c31af7Sopenharmony_ci combination of task and mesh or just mesh shader is valid 2679e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineShaderGroupsCreateInfoNV-pGroups-02885]] 2680e5c31af7Sopenharmony_ci Mesh and regular primitive shading stages cannot be mixed across 2681e5c31af7Sopenharmony_ci pname:pGroups 2682e5c31af7Sopenharmony_ciendif::VK_NV_mesh_shader[] 2683e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineShaderGroupsCreateInfoNV-pPipelines-02886]] 2684e5c31af7Sopenharmony_ci Each element of pname:pPipelines must: have been created with identical 2685e5c31af7Sopenharmony_ci state to the pipeline currently created except the state that can be 2686e5c31af7Sopenharmony_ci overridden by slink:VkGraphicsShaderGroupCreateInfoNV 2687e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsPipelineShaderGroupsCreateInfoNV-deviceGeneratedCommands-02887]] 2688e5c31af7Sopenharmony_ci The <<features-deviceGeneratedCommands, 2689e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV::pname:deviceGeneratedCommands>> 2690e5c31af7Sopenharmony_ci feature must: be enabled 2691e5c31af7Sopenharmony_ci**** 2692e5c31af7Sopenharmony_ci 2693e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkGraphicsPipelineShaderGroupsCreateInfoNV.txt[] 2694e5c31af7Sopenharmony_ci-- 2695e5c31af7Sopenharmony_ci 2696e5c31af7Sopenharmony_ci[open,refpage='VkGraphicsShaderGroupCreateInfoNV',desc='Structure specifying override parameters for each shader group',type='structs'] 2697e5c31af7Sopenharmony_ci-- 2698e5c31af7Sopenharmony_ciThe sname:VkGraphicsShaderGroupCreateInfoNV structure provides the state 2699e5c31af7Sopenharmony_cioverrides for each shader group. 2700e5c31af7Sopenharmony_ciEach shader group behaves like a pipeline that was created from its state as 2701e5c31af7Sopenharmony_ciwell as the remaining parent's state. 2702e5c31af7Sopenharmony_ciIt is defined as: 2703e5c31af7Sopenharmony_ci 2704e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkGraphicsShaderGroupCreateInfoNV.txt[] 2705e5c31af7Sopenharmony_ci 2706e5c31af7Sopenharmony_ci * pname:sType is the type of this structure. 2707e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 2708e5c31af7Sopenharmony_ci structure. 2709e5c31af7Sopenharmony_ci * pname:stageCount is the number of entries in the pname:pStages array. 2710e5c31af7Sopenharmony_ci * pname:pStages is a pointer to an array 2711e5c31af7Sopenharmony_ci slink:VkPipelineShaderStageCreateInfo structures specifying the set of 2712e5c31af7Sopenharmony_ci the shader stages to be included in this shader group. 2713e5c31af7Sopenharmony_ci * pname:pVertexInputState is a pointer to a 2714e5c31af7Sopenharmony_ci slink:VkPipelineVertexInputStateCreateInfo structure. 2715e5c31af7Sopenharmony_ci * pname:pTessellationState is a pointer to a 2716e5c31af7Sopenharmony_ci slink:VkPipelineTessellationStateCreateInfo structure, and is ignored if 2717e5c31af7Sopenharmony_ci the shader group does not include a tessellation control shader stage 2718e5c31af7Sopenharmony_ci and tessellation evaluation shader stage. 2719e5c31af7Sopenharmony_ci 2720e5c31af7Sopenharmony_ci.Valid Usage 2721e5c31af7Sopenharmony_ci**** 2722e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsShaderGroupCreateInfoNV-stageCount-02888]] 2723e5c31af7Sopenharmony_ci For pname:stageCount, the same restrictions as in 2724e5c31af7Sopenharmony_ci slink:VkGraphicsPipelineCreateInfo::pname:stageCount apply 2725e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsShaderGroupCreateInfoNV-pStages-02889]] 2726e5c31af7Sopenharmony_ci For pname:pStages, the same restrictions as in 2727e5c31af7Sopenharmony_ci slink:VkGraphicsPipelineCreateInfo::pname:pStages apply 2728e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsShaderGroupCreateInfoNV-pVertexInputState-02890]] 2729e5c31af7Sopenharmony_ci For pname:pVertexInputState, the same restrictions as in 2730e5c31af7Sopenharmony_ci slink:VkGraphicsPipelineCreateInfo::pname:pVertexInputState apply 2731e5c31af7Sopenharmony_ci * [[VUID-VkGraphicsShaderGroupCreateInfoNV-pTessellationState-02891]] 2732e5c31af7Sopenharmony_ci For pname:pTessellationState, the same restrictions as in 2733e5c31af7Sopenharmony_ci slink:VkGraphicsPipelineCreateInfo::pname:pTessellationState apply 2734e5c31af7Sopenharmony_ci**** 2735e5c31af7Sopenharmony_ci 2736e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkGraphicsShaderGroupCreateInfoNV.txt[] 2737e5c31af7Sopenharmony_ci-- 2738e5c31af7Sopenharmony_ciendif::VK_NV_device_generated_commands[] 2739e5c31af7Sopenharmony_ci 2740e5c31af7Sopenharmony_ci 2741e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing,VK_KHR_ray_tracing_pipeline[] 2742e5c31af7Sopenharmony_ci[[pipelines-ray-tracing]] 2743e5c31af7Sopenharmony_ci== Ray Tracing Pipelines 2744e5c31af7Sopenharmony_ci 2745e5c31af7Sopenharmony_ciRay tracing pipelines consist of multiple shader stages, fixed-function 2746e5c31af7Sopenharmony_citraversal stages, and a pipeline layout. 2747e5c31af7Sopenharmony_ci 2748e5c31af7Sopenharmony_ci[open,refpage='VK_SHADER_UNUSED_KHR',desc='Sentinel for an unused shader index',type='consts',alias='VK_SHADER_UNUSED_NV'] 2749e5c31af7Sopenharmony_ci-- 2750e5c31af7Sopenharmony_ciename:VK_SHADER_UNUSED_KHR is a special shader index used to indicate that a 2751e5c31af7Sopenharmony_ciray generation, miss, or callable shader member is not used. 2752e5c31af7Sopenharmony_ci 2753e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VK_SHADER_UNUSED_KHR.txt[] 2754e5c31af7Sopenharmony_ci 2755e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing[] 2756e5c31af7Sopenharmony_cior the equivalent 2757e5c31af7Sopenharmony_ci 2758e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VK_SHADER_UNUSED_NV.txt[] 2759e5c31af7Sopenharmony_ciendif::VK_NV_ray_tracing[] 2760e5c31af7Sopenharmony_ci-- 2761e5c31af7Sopenharmony_ci 2762e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing[] 2763e5c31af7Sopenharmony_ci[open,refpage='vkCreateRayTracingPipelinesNV',desc='Creates a new ray tracing pipeline object',type='protos'] 2764e5c31af7Sopenharmony_ci-- 2765e5c31af7Sopenharmony_ci:refpage: vkCreateRayTracingPipelinesNV 2766e5c31af7Sopenharmony_ci 2767e5c31af7Sopenharmony_ciTo create ray tracing pipelines, call: 2768e5c31af7Sopenharmony_ci 2769e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCreateRayTracingPipelinesNV.txt[] 2770e5c31af7Sopenharmony_ci 2771e5c31af7Sopenharmony_ci * pname:device is the logical device that creates the ray tracing 2772e5c31af7Sopenharmony_ci pipelines. 2773e5c31af7Sopenharmony_ci * pname:pipelineCache is either dlink:VK_NULL_HANDLE, indicating that 2774e5c31af7Sopenharmony_ci pipeline caching is disabled, or the handle of a valid 2775e5c31af7Sopenharmony_ci <<pipelines-cache,pipeline cache>> object, in which case use of that 2776e5c31af7Sopenharmony_ci cache is enabled for the duration of the command. 2777e5c31af7Sopenharmony_ci * pname:createInfoCount is the length of the pname:pCreateInfos and 2778e5c31af7Sopenharmony_ci pname:pPipelines arrays. 2779e5c31af7Sopenharmony_ci * pname:pCreateInfos is a pointer to an array of 2780e5c31af7Sopenharmony_ci slink:VkRayTracingPipelineCreateInfoNV structures. 2781e5c31af7Sopenharmony_ci * pname:pAllocator controls host memory allocation as described in the 2782e5c31af7Sopenharmony_ci <<memory-allocation, Memory Allocation>> chapter. 2783e5c31af7Sopenharmony_ci * pname:pPipelines is a pointer to an array in which the resulting ray 2784e5c31af7Sopenharmony_ci tracing pipeline objects are returned. 2785e5c31af7Sopenharmony_ci 2786e5c31af7Sopenharmony_ci.Valid Usage 2787e5c31af7Sopenharmony_ci**** 2788e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/create_ray_tracing_pipelines_common.txt[] 2789e5c31af7Sopenharmony_ci**** 2790e5c31af7Sopenharmony_ci 2791e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCreateRayTracingPipelinesNV.txt[] 2792e5c31af7Sopenharmony_ci-- 2793e5c31af7Sopenharmony_ciendif::VK_NV_ray_tracing[] 2794e5c31af7Sopenharmony_ci 2795e5c31af7Sopenharmony_ciifdef::VK_KHR_ray_tracing_pipeline[] 2796e5c31af7Sopenharmony_ci[open,refpage='vkCreateRayTracingPipelinesKHR',desc='Creates a new ray tracing pipeline object',type='protos'] 2797e5c31af7Sopenharmony_ci-- 2798e5c31af7Sopenharmony_ci:refpage: vkCreateRayTracingPipelinesKHR 2799e5c31af7Sopenharmony_ci 2800e5c31af7Sopenharmony_ciTo create ray tracing pipelines, call: 2801e5c31af7Sopenharmony_ci 2802e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCreateRayTracingPipelinesKHR.txt[] 2803e5c31af7Sopenharmony_ci 2804e5c31af7Sopenharmony_ci * pname:device is the logical device that creates the ray tracing 2805e5c31af7Sopenharmony_ci pipelines. 2806e5c31af7Sopenharmony_ci * pname:deferredOperation is dlink:VK_NULL_HANDLE or the handle of a valid 2807e5c31af7Sopenharmony_ci slink:VkDeferredOperationKHR <<deferred-host-operations-requesting, 2808e5c31af7Sopenharmony_ci request deferral>> object for this command. 2809e5c31af7Sopenharmony_ci * pname:pipelineCache is either dlink:VK_NULL_HANDLE, indicating that 2810e5c31af7Sopenharmony_ci pipeline caching is disabled, or the handle of a valid 2811e5c31af7Sopenharmony_ci <<pipelines-cache,pipeline cache>> object, in which case use of that 2812e5c31af7Sopenharmony_ci cache is enabled for the duration of the command. 2813e5c31af7Sopenharmony_ci * pname:createInfoCount is the length of the pname:pCreateInfos and 2814e5c31af7Sopenharmony_ci pname:pPipelines arrays. 2815e5c31af7Sopenharmony_ci * pname:pCreateInfos is a pointer to an array of 2816e5c31af7Sopenharmony_ci slink:VkRayTracingPipelineCreateInfoKHR structures. 2817e5c31af7Sopenharmony_ci * pname:pAllocator controls host memory allocation as described in the 2818e5c31af7Sopenharmony_ci <<memory-allocation, Memory Allocation>> chapter. 2819e5c31af7Sopenharmony_ci * pname:pPipelines is a pointer to an array in which the resulting ray 2820e5c31af7Sopenharmony_ci tracing pipeline objects are returned. 2821e5c31af7Sopenharmony_ci 2822e5c31af7Sopenharmony_ciThe ename:VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS error is returned if the 2823e5c31af7Sopenharmony_ciimplementation is unable to re-use the shader group handles provided in 2824e5c31af7Sopenharmony_cislink:VkRayTracingShaderGroupCreateInfoKHR::pname:pShaderGroupCaptureReplayHandle 2825e5c31af7Sopenharmony_ciwhen 2826e5c31af7Sopenharmony_cislink:VkPhysicalDeviceRayTracingPipelineFeaturesKHR::pname:rayTracingPipelineShaderGroupHandleCaptureReplay 2827e5c31af7Sopenharmony_ciis enabled. 2828e5c31af7Sopenharmony_ci 2829e5c31af7Sopenharmony_ci.Valid Usage 2830e5c31af7Sopenharmony_ci**** 2831e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/create_ray_tracing_pipelines_common.txt[] 2832e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/deferred_operations_common.txt[] 2833e5c31af7Sopenharmony_ci * [[VUID-vkCreateRayTracingPipelinesKHR-rayTracingPipeline-03586]] 2834e5c31af7Sopenharmony_ci The <<features-rayTracingPipeline, pname:rayTracingPipeline>> feature 2835e5c31af7Sopenharmony_ci must: be enabled 2836e5c31af7Sopenharmony_ciifdef::VK_EXT_pipeline_creation_cache_control+VK_KHR_deferred_host_operations[] 2837e5c31af7Sopenharmony_ci * [[VUID-vkCreateRayTracingPipelinesKHR-deferredOperation-03587]] 2838e5c31af7Sopenharmony_ci If pname:deferredOperation is not dlink:VK_NULL_HANDLE, the pname:flags 2839e5c31af7Sopenharmony_ci member of elements of pname:pCreateInfos must: not include 2840e5c31af7Sopenharmony_ci ename:VK_PIPELINE_CREATE_EARLY_RETURN_ON_FAILURE_BIT_EXT 2841e5c31af7Sopenharmony_ciendif::VK_EXT_pipeline_creation_cache_control+VK_KHR_deferred_host_operations[] 2842e5c31af7Sopenharmony_ci**** 2843e5c31af7Sopenharmony_ci 2844e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCreateRayTracingPipelinesKHR.txt[] 2845e5c31af7Sopenharmony_ci-- 2846e5c31af7Sopenharmony_ciendif::VK_KHR_ray_tracing_pipeline[] 2847e5c31af7Sopenharmony_ci 2848e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing[] 2849e5c31af7Sopenharmony_ci[open,refpage='VkRayTracingPipelineCreateInfoNV',desc='Structure specifying parameters of a newly created ray tracing pipeline',type='structs'] 2850e5c31af7Sopenharmony_ci-- 2851e5c31af7Sopenharmony_ci:refpage: VkRayTracingPipelineCreateInfoNV 2852e5c31af7Sopenharmony_ci 2853e5c31af7Sopenharmony_ciThe sname:VkRayTracingPipelineCreateInfoNV structure is defined as: 2854e5c31af7Sopenharmony_ci 2855e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkRayTracingPipelineCreateInfoNV.txt[] 2856e5c31af7Sopenharmony_ci 2857e5c31af7Sopenharmony_ci * pname:sType is the type of this structure. 2858e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 2859e5c31af7Sopenharmony_ci structure. 2860e5c31af7Sopenharmony_ci * pname:flags is a bitmask of elink:VkPipelineCreateFlagBits specifying 2861e5c31af7Sopenharmony_ci how the pipeline will be generated. 2862e5c31af7Sopenharmony_ci * pname:stageCount is the number of entries in the pname:pStages array. 2863e5c31af7Sopenharmony_ci * pname:pStages is a pointer to an array of 2864e5c31af7Sopenharmony_ci slink:VkPipelineShaderStageCreateInfo structures specifying the set of 2865e5c31af7Sopenharmony_ci the shader stages to be included in the ray tracing pipeline. 2866e5c31af7Sopenharmony_ci * pname:groupCount is the number of entries in the pname:pGroups array. 2867e5c31af7Sopenharmony_ci * pname:pGroups is a pointer to an array of 2868e5c31af7Sopenharmony_ci slink:VkRayTracingShaderGroupCreateInfoNV structures describing the set 2869e5c31af7Sopenharmony_ci of the shader stages to be included in each shader group in the ray 2870e5c31af7Sopenharmony_ci tracing pipeline. 2871e5c31af7Sopenharmony_ci * pname:maxRecursionDepth is the <<ray-tracing-recursion-depth, maximum 2872e5c31af7Sopenharmony_ci recursion depth>> of shaders executed by this pipeline. 2873e5c31af7Sopenharmony_ci * pname:layout is the description of binding locations used by both the 2874e5c31af7Sopenharmony_ci pipeline and descriptor sets used with the pipeline. 2875e5c31af7Sopenharmony_ci * pname:basePipelineHandle is a pipeline to derive from. 2876e5c31af7Sopenharmony_ci * pname:basePipelineIndex is an index into the pname:pCreateInfos 2877e5c31af7Sopenharmony_ci parameter to use as a pipeline to derive from. 2878e5c31af7Sopenharmony_ci 2879e5c31af7Sopenharmony_ciThe parameters pname:basePipelineHandle and pname:basePipelineIndex are 2880e5c31af7Sopenharmony_cidescribed in more detail in <<pipelines-pipeline-derivatives,Pipeline 2881e5c31af7Sopenharmony_ciDerivatives>>. 2882e5c31af7Sopenharmony_ci 2883e5c31af7Sopenharmony_ci.Valid Usage 2884e5c31af7Sopenharmony_ci**** 2885e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/ray_tracing_pipeline_create_info_common.txt[] 2886e5c31af7Sopenharmony_ci * [[VUID-VkRayTracingPipelineCreateInfoNV-stage-06232]] 2887e5c31af7Sopenharmony_ci The pname:stage member of at least one element of pname:pStages must: be 2888e5c31af7Sopenharmony_ci ename:VK_SHADER_STAGE_RAYGEN_BIT_KHR 2889e5c31af7Sopenharmony_ciifdef::VK_KHR_pipeline_library[] 2890e5c31af7Sopenharmony_ci * [[VUID-VkRayTracingPipelineCreateInfoNV-flags-03456]] 2891e5c31af7Sopenharmony_ci pname:flags must: not include ename:VK_PIPELINE_CREATE_LIBRARY_BIT_KHR 2892e5c31af7Sopenharmony_ciendif::VK_KHR_pipeline_library[] 2893e5c31af7Sopenharmony_ci * [[VUID-VkRayTracingPipelineCreateInfoNV-maxRecursionDepth-03457]] 2894e5c31af7Sopenharmony_ci pname:maxRecursionDepth must: be less than or equal to 2895e5c31af7Sopenharmony_ci slink:VkPhysicalDeviceRayTracingPropertiesNV::pname:maxRecursionDepth 2896e5c31af7Sopenharmony_ciifdef::VK_KHR_ray_tracing_pipeline[] 2897e5c31af7Sopenharmony_ci * [[VUID-VkRayTracingPipelineCreateInfoNV-flags-03458]] 2898e5c31af7Sopenharmony_ci pname:flags must: not include 2899e5c31af7Sopenharmony_ci ename:VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_ANY_HIT_SHADERS_BIT_KHR 2900e5c31af7Sopenharmony_ci * [[VUID-VkRayTracingPipelineCreateInfoNV-flags-03459]] 2901e5c31af7Sopenharmony_ci pname:flags must: not include 2902e5c31af7Sopenharmony_ci ename:VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_CLOSEST_HIT_SHADERS_BIT_KHR 2903e5c31af7Sopenharmony_ci * [[VUID-VkRayTracingPipelineCreateInfoNV-flags-03460]] 2904e5c31af7Sopenharmony_ci pname:flags must: not include 2905e5c31af7Sopenharmony_ci ename:VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_MISS_SHADERS_BIT_KHR 2906e5c31af7Sopenharmony_ci * [[VUID-VkRayTracingPipelineCreateInfoNV-flags-03461]] 2907e5c31af7Sopenharmony_ci pname:flags must: not include 2908e5c31af7Sopenharmony_ci ename:VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_INTERSECTION_SHADERS_BIT_KHR 2909e5c31af7Sopenharmony_ci * [[VUID-VkRayTracingPipelineCreateInfoNV-flags-03462]] 2910e5c31af7Sopenharmony_ci pname:flags must: not include 2911e5c31af7Sopenharmony_ci ename:VK_PIPELINE_CREATE_RAY_TRACING_SKIP_AABBS_BIT_KHR 2912e5c31af7Sopenharmony_ci * [[VUID-VkRayTracingPipelineCreateInfoNV-flags-03463]] 2913e5c31af7Sopenharmony_ci pname:flags must: not include 2914e5c31af7Sopenharmony_ci ename:VK_PIPELINE_CREATE_RAY_TRACING_SKIP_TRIANGLES_BIT_KHR 2915e5c31af7Sopenharmony_ci * [[VUID-VkRayTracingPipelineCreateInfoNV-flags-03588]] 2916e5c31af7Sopenharmony_ci pname:flags must: not include 2917e5c31af7Sopenharmony_ci ename:VK_PIPELINE_CREATE_RAY_TRACING_SHADER_GROUP_HANDLE_CAPTURE_REPLAY_BIT_KHR 2918e5c31af7Sopenharmony_ciendif::VK_KHR_ray_tracing_pipeline[] 2919e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing_motion_blur[] 2920e5c31af7Sopenharmony_ci * [[VUID-VkRayTracingPipelineCreateInfoNV-flags-04948]] 2921e5c31af7Sopenharmony_ci pname:flags must: not include 2922e5c31af7Sopenharmony_ci ename:VK_PIPELINE_CREATE_RAY_TRACING_ALLOW_MOTION_BIT_NV 2923e5c31af7Sopenharmony_ciendif::VK_NV_ray_tracing_motion_blur[] 2924e5c31af7Sopenharmony_ciifdef::VK_EXT_pipeline_creation_cache_control[] 2925e5c31af7Sopenharmony_ci * [[VUID-VkRayTracingPipelineCreateInfoNV-flags-02957]] 2926e5c31af7Sopenharmony_ci pname:flags must: not include both 2927e5c31af7Sopenharmony_ci ename:VK_PIPELINE_CREATE_DEFER_COMPILE_BIT_NV and 2928e5c31af7Sopenharmony_ci ename:VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT_EXT at 2929e5c31af7Sopenharmony_ci the same time 2930e5c31af7Sopenharmony_ciendif::VK_EXT_pipeline_creation_cache_control[] 2931e5c31af7Sopenharmony_ci**** 2932e5c31af7Sopenharmony_ci 2933e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkRayTracingPipelineCreateInfoNV.txt[] 2934e5c31af7Sopenharmony_ci-- 2935e5c31af7Sopenharmony_ciendif::VK_NV_ray_tracing[] 2936e5c31af7Sopenharmony_ci 2937e5c31af7Sopenharmony_ciifdef::VK_KHR_ray_tracing_pipeline[] 2938e5c31af7Sopenharmony_ci[open,refpage='VkRayTracingPipelineCreateInfoKHR',desc='Structure specifying parameters of a newly created ray tracing pipeline',type='structs'] 2939e5c31af7Sopenharmony_ci-- 2940e5c31af7Sopenharmony_ci:refpage: VkRayTracingPipelineCreateInfoKHR 2941e5c31af7Sopenharmony_ci 2942e5c31af7Sopenharmony_ciThe sname:VkRayTracingPipelineCreateInfoKHR structure is defined as: 2943e5c31af7Sopenharmony_ci 2944e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkRayTracingPipelineCreateInfoKHR.txt[] 2945e5c31af7Sopenharmony_ci 2946e5c31af7Sopenharmony_ci * pname:sType is the type of this structure. 2947e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 2948e5c31af7Sopenharmony_ci structure. 2949e5c31af7Sopenharmony_ci * pname:flags is a bitmask of elink:VkPipelineCreateFlagBits specifying 2950e5c31af7Sopenharmony_ci how the pipeline will be generated. 2951e5c31af7Sopenharmony_ci * pname:stageCount is the number of entries in the pname:pStages array. 2952e5c31af7Sopenharmony_ci * pname:pStages is a pointer to an array of pname:stageCount 2953e5c31af7Sopenharmony_ci slink:VkPipelineShaderStageCreateInfo structures describing the set of 2954e5c31af7Sopenharmony_ci the shader stages to be included in the ray tracing pipeline. 2955e5c31af7Sopenharmony_ci * pname:groupCount is the number of entries in the pname:pGroups array. 2956e5c31af7Sopenharmony_ci * pname:pGroups is a pointer to an array of pname:groupCount 2957e5c31af7Sopenharmony_ci slink:VkRayTracingShaderGroupCreateInfoKHR structures describing the set 2958e5c31af7Sopenharmony_ci of the shader stages to be included in each shader group in the ray 2959e5c31af7Sopenharmony_ci tracing pipeline. 2960e5c31af7Sopenharmony_ci * pname:maxPipelineRayRecursionDepth is the <<ray-tracing-recursion-depth, 2961e5c31af7Sopenharmony_ci maximum recursion depth>> of shaders executed by this pipeline. 2962e5c31af7Sopenharmony_ci * pname:pLibraryInfo is a pointer to a 2963e5c31af7Sopenharmony_ci slink:VkPipelineLibraryCreateInfoKHR structure defining pipeline 2964e5c31af7Sopenharmony_ci libraries to include. 2965e5c31af7Sopenharmony_ci * pname:pLibraryInterface is a pointer to a 2966e5c31af7Sopenharmony_ci slink:VkRayTracingPipelineInterfaceCreateInfoKHR structure defining 2967e5c31af7Sopenharmony_ci additional information when using pipeline libraries. 2968e5c31af7Sopenharmony_ci * pname:pDynamicState is a pointer to a 2969e5c31af7Sopenharmony_ci slink:VkPipelineDynamicStateCreateInfo structure, and is used to 2970e5c31af7Sopenharmony_ci indicate which properties of the pipeline state object are dynamic and 2971e5c31af7Sopenharmony_ci can: be changed independently of the pipeline state. 2972e5c31af7Sopenharmony_ci This can: be `NULL`, which means no state in the pipeline is considered 2973e5c31af7Sopenharmony_ci dynamic. 2974e5c31af7Sopenharmony_ci * pname:layout is the description of binding locations used by both the 2975e5c31af7Sopenharmony_ci pipeline and descriptor sets used with the pipeline. 2976e5c31af7Sopenharmony_ci * pname:basePipelineHandle is a pipeline to derive from. 2977e5c31af7Sopenharmony_ci * pname:basePipelineIndex is an index into the pname:pCreateInfos 2978e5c31af7Sopenharmony_ci parameter to use as a pipeline to derive from. 2979e5c31af7Sopenharmony_ci 2980e5c31af7Sopenharmony_ciThe parameters pname:basePipelineHandle and pname:basePipelineIndex are 2981e5c31af7Sopenharmony_cidescribed in more detail in <<pipelines-pipeline-derivatives,Pipeline 2982e5c31af7Sopenharmony_ciDerivatives>>. 2983e5c31af7Sopenharmony_ci 2984e5c31af7Sopenharmony_ciifdef::VK_KHR_pipeline_library[] 2985e5c31af7Sopenharmony_ciWhen ename:VK_PIPELINE_CREATE_LIBRARY_BIT_KHR is specified, this pipeline 2986e5c31af7Sopenharmony_cidefines a _pipeline library_ which cannot: be bound as a ray tracing 2987e5c31af7Sopenharmony_cipipeline directly. 2988e5c31af7Sopenharmony_ciInstead, pipeline libraries define common shaders and shader groups which 2989e5c31af7Sopenharmony_cican: be included in future pipeline creation. 2990e5c31af7Sopenharmony_ci 2991e5c31af7Sopenharmony_ciIf pipeline libraries are included in pname:pLibraryInfo, shaders defined in 2992e5c31af7Sopenharmony_cithose libraries are treated as if they were defined as additional entries in 2993e5c31af7Sopenharmony_cipname:pStages, appended in the order they appear in the pname:pLibraries 2994e5c31af7Sopenharmony_ciarray and in the pname:pStages array when those libraries were defined. 2995e5c31af7Sopenharmony_ci 2996e5c31af7Sopenharmony_ciWhen referencing shader groups in order to obtain a shader group handle, 2997e5c31af7Sopenharmony_cigroups defined in those libraries are treated as if they were defined as 2998e5c31af7Sopenharmony_ciadditional entries in pname:pGroups, appended in the order they appear in 2999e5c31af7Sopenharmony_cithe pname:pLibraries array and in the pname:pGroups array when those 3000e5c31af7Sopenharmony_cilibraries were defined. 3001e5c31af7Sopenharmony_ciThe shaders these groups reference are set when the pipeline library is 3002e5c31af7Sopenharmony_cicreated, referencing those specified in the pipeline library, not in the 3003e5c31af7Sopenharmony_cipipeline that includes it. 3004e5c31af7Sopenharmony_ciendif::VK_KHR_pipeline_library[] 3005e5c31af7Sopenharmony_ci 3006e5c31af7Sopenharmony_ciThe default stack size for a pipeline if 3007e5c31af7Sopenharmony_ciename:VK_DYNAMIC_STATE_RAY_TRACING_PIPELINE_STACK_SIZE_KHR is not provided 3008e5c31af7Sopenharmony_ciis computed as described in <<ray-tracing-pipeline-stack, Ray Tracing 3009e5c31af7Sopenharmony_ciPipeline Stack>>. 3010e5c31af7Sopenharmony_ci 3011e5c31af7Sopenharmony_ci.Valid Usage 3012e5c31af7Sopenharmony_ci**** 3013e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/ray_tracing_pipeline_create_info_common.txt[] 3014e5c31af7Sopenharmony_ci * [[VUID-VkRayTracingPipelineCreateInfoKHR-stage-03425]] 3015e5c31af7Sopenharmony_ci If pname:flags does not include 3016e5c31af7Sopenharmony_ci ename:VK_PIPELINE_CREATE_LIBRARY_BIT_KHR, the pname:stage member of at 3017e5c31af7Sopenharmony_ci least one element of pname:pStages, including those implicitly added by 3018e5c31af7Sopenharmony_ci pname:pLibraryInfo, must: be ename:VK_SHADER_STAGE_RAYGEN_BIT_KHR 3019e5c31af7Sopenharmony_ci * [[VUID-VkRayTracingPipelineCreateInfoKHR-maxPipelineRayRecursionDepth-03589]] 3020e5c31af7Sopenharmony_ci pname:maxPipelineRayRecursionDepth must: be less than or equal to 3021e5c31af7Sopenharmony_ci slink:VkPhysicalDeviceRayTracingPipelinePropertiesKHR::pname:maxRayRecursionDepth 3022e5c31af7Sopenharmony_ciifdef::VK_KHR_pipeline_library[] 3023e5c31af7Sopenharmony_ci * [[VUID-VkRayTracingPipelineCreateInfoKHR-flags-03465]] 3024e5c31af7Sopenharmony_ci If pname:flags includes ename:VK_PIPELINE_CREATE_LIBRARY_BIT_KHR, 3025e5c31af7Sopenharmony_ci pname:pLibraryInterface must: not be `NULL` 3026e5c31af7Sopenharmony_ci * [[VUID-VkRayTracingPipelineCreateInfoKHR-pLibraryInfo-03590]] 3027e5c31af7Sopenharmony_ci If pname:pLibraryInfo is not `NULL` and its pname:libraryCount member is 3028e5c31af7Sopenharmony_ci greater than `0`, its pname:pLibraryInterface member must: not be `NULL` 3029e5c31af7Sopenharmony_ci * [[VUID-VkRayTracingPipelineCreateInfoKHR-pLibraries-03591]] 3030e5c31af7Sopenharmony_ci Each element of pname:pLibraryInfo->pLibraries must: have been created 3031e5c31af7Sopenharmony_ci with the value of pname:maxPipelineRayRecursionDepth equal to that in 3032e5c31af7Sopenharmony_ci this pipeline 3033e5c31af7Sopenharmony_ci * [[VUID-VkRayTracingPipelineCreateInfoKHR-pLibraryInfo-03592]] 3034e5c31af7Sopenharmony_ci If pname:pLibraryInfo is not `NULL`, each element of its 3035e5c31af7Sopenharmony_ci pname:pLibraries member must: have been created with a pname:layout that 3036e5c31af7Sopenharmony_ci is compatible with the pname:layout in this pipeline 3037e5c31af7Sopenharmony_ci * [[VUID-VkRayTracingPipelineCreateInfoKHR-pLibraryInfo-03593]] 3038e5c31af7Sopenharmony_ci If pname:pLibraryInfo is not `NULL`, each element of its 3039e5c31af7Sopenharmony_ci pname:pLibraries member must: have been created with values of the 3040e5c31af7Sopenharmony_ci pname:maxPipelineRayPayloadSize and pname:maxPipelineRayHitAttributeSize 3041e5c31af7Sopenharmony_ci members of pname:pLibraryInterface equal to those in this pipeline 3042e5c31af7Sopenharmony_ci * [[VUID-VkRayTracingPipelineCreateInfoKHR-flags-03594]] 3043e5c31af7Sopenharmony_ci If pname:flags includes 3044e5c31af7Sopenharmony_ci ename:VK_PIPELINE_CREATE_RAY_TRACING_SHADER_GROUP_HANDLE_CAPTURE_REPLAY_BIT_KHR, 3045e5c31af7Sopenharmony_ci each element of pname:pLibraryInfo->pLibraries must: have been created 3046e5c31af7Sopenharmony_ci with the 3047e5c31af7Sopenharmony_ci ename:VK_PIPELINE_CREATE_RAY_TRACING_SHADER_GROUP_HANDLE_CAPTURE_REPLAY_BIT_KHR 3048e5c31af7Sopenharmony_ci bit set 3049e5c31af7Sopenharmony_ci * [[VUID-VkRayTracingPipelineCreateInfoKHR-flags-04718]] 3050e5c31af7Sopenharmony_ci If pname:flags includes 3051e5c31af7Sopenharmony_ci ename:VK_PIPELINE_CREATE_RAY_TRACING_SKIP_AABBS_BIT_KHR, each element of 3052e5c31af7Sopenharmony_ci pname:pLibraryInfo->pLibraries must: have been created with the 3053e5c31af7Sopenharmony_ci ename:VK_PIPELINE_CREATE_RAY_TRACING_SKIP_AABBS_BIT_KHR bit set 3054e5c31af7Sopenharmony_ci * [[VUID-VkRayTracingPipelineCreateInfoKHR-flags-04719]] 3055e5c31af7Sopenharmony_ci If pname:flags includes 3056e5c31af7Sopenharmony_ci ename:VK_PIPELINE_CREATE_RAY_TRACING_SKIP_TRIANGLES_BIT_KHR, each 3057e5c31af7Sopenharmony_ci element of pname:pLibraryInfo->pLibraries must: have been created with 3058e5c31af7Sopenharmony_ci the ename:VK_PIPELINE_CREATE_RAY_TRACING_SKIP_TRIANGLES_BIT_KHR bit set 3059e5c31af7Sopenharmony_ci * [[VUID-VkRayTracingPipelineCreateInfoKHR-flags-04720]] 3060e5c31af7Sopenharmony_ci If pname:flags includes 3061e5c31af7Sopenharmony_ci ename:VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_ANY_HIT_SHADERS_BIT_KHR, 3062e5c31af7Sopenharmony_ci each element of pname:pLibraryInfo->pLibraries must: have been created 3063e5c31af7Sopenharmony_ci with the 3064e5c31af7Sopenharmony_ci ename:VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_ANY_HIT_SHADERS_BIT_KHR bit 3065e5c31af7Sopenharmony_ci set 3066e5c31af7Sopenharmony_ci * [[VUID-VkRayTracingPipelineCreateInfoKHR-flags-04721]] 3067e5c31af7Sopenharmony_ci If pname:flags includes 3068e5c31af7Sopenharmony_ci ename:VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_CLOSEST_HIT_SHADERS_BIT_KHR, 3069e5c31af7Sopenharmony_ci each element of pname:pLibraryInfo->pLibraries must: have been created 3070e5c31af7Sopenharmony_ci with the 3071e5c31af7Sopenharmony_ci ename:VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_CLOSEST_HIT_SHADERS_BIT_KHR 3072e5c31af7Sopenharmony_ci bit set 3073e5c31af7Sopenharmony_ci * [[VUID-VkRayTracingPipelineCreateInfoKHR-flags-04722]] 3074e5c31af7Sopenharmony_ci If pname:flags includes 3075e5c31af7Sopenharmony_ci ename:VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_INTERSECTION_SHADERS_BIT_KHR, 3076e5c31af7Sopenharmony_ci each element of pname:pLibraryInfo->pLibraries must: have been created 3077e5c31af7Sopenharmony_ci with the 3078e5c31af7Sopenharmony_ci ename:VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_INTERSECTION_SHADERS_BIT_KHR 3079e5c31af7Sopenharmony_ci bit set 3080e5c31af7Sopenharmony_ci * [[VUID-VkRayTracingPipelineCreateInfoKHR-flags-04723]] 3081e5c31af7Sopenharmony_ci If pname:flags includes 3082e5c31af7Sopenharmony_ci ename:VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_MISS_SHADERS_BIT_KHR, each 3083e5c31af7Sopenharmony_ci element of pname:pLibraryInfo->pLibraries must: have been created with 3084e5c31af7Sopenharmony_ci the ename:VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_MISS_SHADERS_BIT_KHR 3085e5c31af7Sopenharmony_ci bit set 3086e5c31af7Sopenharmony_ciendif::VK_KHR_pipeline_library[] 3087e5c31af7Sopenharmony_ci * [[VUID-VkRayTracingPipelineCreateInfoKHR-pLibraryInfo-03595]] 3088e5c31af7Sopenharmony_ci If the `apiext:VK_KHR_pipeline_library` extension is not enabled, 3089e5c31af7Sopenharmony_ci pname:pLibraryInfo and pname:pLibraryInterface must: be `NULL` 3090e5c31af7Sopenharmony_ci * [[VUID-VkRayTracingPipelineCreateInfoKHR-flags-03470]] 3091e5c31af7Sopenharmony_ci If pname:flags includes 3092e5c31af7Sopenharmony_ci ename:VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_ANY_HIT_SHADERS_BIT_KHR, 3093e5c31af7Sopenharmony_ci for any element of pname:pGroups with a pname:type of 3094e5c31af7Sopenharmony_ci ename:VK_RAY_TRACING_SHADER_GROUP_TYPE_TRIANGLES_HIT_GROUP_KHR or 3095e5c31af7Sopenharmony_ci ename:VK_RAY_TRACING_SHADER_GROUP_TYPE_PROCEDURAL_HIT_GROUP_KHR, the 3096e5c31af7Sopenharmony_ci pname:anyHitShader of that element must: not be 3097e5c31af7Sopenharmony_ci ename:VK_SHADER_UNUSED_KHR 3098e5c31af7Sopenharmony_ci * [[VUID-VkRayTracingPipelineCreateInfoKHR-flags-03471]] 3099e5c31af7Sopenharmony_ci If pname:flags includes 3100e5c31af7Sopenharmony_ci ename:VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_CLOSEST_HIT_SHADERS_BIT_KHR, 3101e5c31af7Sopenharmony_ci for any element of pname:pGroups with a pname:type of 3102e5c31af7Sopenharmony_ci ename:VK_RAY_TRACING_SHADER_GROUP_TYPE_TRIANGLES_HIT_GROUP_KHR or 3103e5c31af7Sopenharmony_ci ename:VK_RAY_TRACING_SHADER_GROUP_TYPE_PROCEDURAL_HIT_GROUP_KHR, the 3104e5c31af7Sopenharmony_ci pname:closestHitShader of that element must: not be 3105e5c31af7Sopenharmony_ci ename:VK_SHADER_UNUSED_KHR 3106e5c31af7Sopenharmony_ci * [[VUID-VkRayTracingPipelineCreateInfoKHR-rayTraversalPrimitiveCulling-03596]] 3107e5c31af7Sopenharmony_ci If the <<features-rayTraversalPrimitiveCulling, 3108e5c31af7Sopenharmony_ci pname:rayTraversalPrimitiveCulling>> feature is not enabled, pname:flags 3109e5c31af7Sopenharmony_ci must: not include 3110e5c31af7Sopenharmony_ci ename:VK_PIPELINE_CREATE_RAY_TRACING_SKIP_AABBS_BIT_KHR 3111e5c31af7Sopenharmony_ci * [[VUID-VkRayTracingPipelineCreateInfoKHR-rayTraversalPrimitiveCulling-03597]] 3112e5c31af7Sopenharmony_ci If the <<features-rayTraversalPrimitiveCulling, 3113e5c31af7Sopenharmony_ci pname:rayTraversalPrimitiveCulling>> feature is not enabled, pname:flags 3114e5c31af7Sopenharmony_ci must: not include 3115e5c31af7Sopenharmony_ci ename:VK_PIPELINE_CREATE_RAY_TRACING_SKIP_TRIANGLES_BIT_KHR 3116e5c31af7Sopenharmony_ci * [[VUID-VkRayTracingPipelineCreateInfoKHR-flags-03598]] 3117e5c31af7Sopenharmony_ci If pname:flags includes 3118e5c31af7Sopenharmony_ci ename:VK_PIPELINE_CREATE_RAY_TRACING_SHADER_GROUP_HANDLE_CAPTURE_REPLAY_BIT_KHR, 3119e5c31af7Sopenharmony_ci <<features-rayTracingPipelineShaderGroupHandleCaptureReplay, 3120e5c31af7Sopenharmony_ci pname:rayTracingPipelineShaderGroupHandleCaptureReplay>> must: be 3121e5c31af7Sopenharmony_ci enabled 3122e5c31af7Sopenharmony_ci * [[VUID-VkRayTracingPipelineCreateInfoKHR-rayTracingPipelineShaderGroupHandleCaptureReplay-03599]] 3123e5c31af7Sopenharmony_ci If 3124e5c31af7Sopenharmony_ci slink:VkPhysicalDeviceRayTracingPipelineFeaturesKHR::pname:rayTracingPipelineShaderGroupHandleCaptureReplay 3125e5c31af7Sopenharmony_ci is ename:VK_TRUE and the pname:pShaderGroupCaptureReplayHandle member of 3126e5c31af7Sopenharmony_ci any element of pname:pGroups is not `NULL`, pname:flags must: include 3127e5c31af7Sopenharmony_ci ename:VK_PIPELINE_CREATE_RAY_TRACING_SHADER_GROUP_HANDLE_CAPTURE_REPLAY_BIT_KHR 3128e5c31af7Sopenharmony_ci * [[VUID-VkRayTracingPipelineCreateInfoKHR-pLibraryInfo-03600]] 3129e5c31af7Sopenharmony_ci If pname:pLibraryInfo is not `NULL` and its pname:libraryCount is `0`, 3130e5c31af7Sopenharmony_ci pname:stageCount must: not be `0` 3131e5c31af7Sopenharmony_ci * [[VUID-VkRayTracingPipelineCreateInfoKHR-pLibraryInfo-03601]] 3132e5c31af7Sopenharmony_ci If pname:pLibraryInfo is not `NULL` and its pname:libraryCount is `0`, 3133e5c31af7Sopenharmony_ci pname:groupCount must: not be `0` 3134e5c31af7Sopenharmony_ci * [[VUID-VkRayTracingPipelineCreateInfoKHR-pDynamicStates-03602]] 3135e5c31af7Sopenharmony_ci Any element of the pname:pDynamicStates member of pname:pDynamicState 3136e5c31af7Sopenharmony_ci must: be ename:VK_DYNAMIC_STATE_RAY_TRACING_PIPELINE_STACK_SIZE_KHR 3137e5c31af7Sopenharmony_ci**** 3138e5c31af7Sopenharmony_ci 3139e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkRayTracingPipelineCreateInfoKHR.txt[] 3140e5c31af7Sopenharmony_ci-- 3141e5c31af7Sopenharmony_ciendif::VK_KHR_ray_tracing_pipeline[] 3142e5c31af7Sopenharmony_ci 3143e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing[] 3144e5c31af7Sopenharmony_ci[open,refpage='VkRayTracingShaderGroupCreateInfoNV',desc='Structure specifying shaders in a shader group',type='structs'] 3145e5c31af7Sopenharmony_ci-- 3146e5c31af7Sopenharmony_ci:refpage: VkRayTracingShaderGroupCreateInfoNV 3147e5c31af7Sopenharmony_ci 3148e5c31af7Sopenharmony_ciThe sname:VkRayTracingShaderGroupCreateInfoNV structure is defined as: 3149e5c31af7Sopenharmony_ci 3150e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkRayTracingShaderGroupCreateInfoNV.txt[] 3151e5c31af7Sopenharmony_ci 3152e5c31af7Sopenharmony_ci * pname:sType is the type of this structure. 3153e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 3154e5c31af7Sopenharmony_ci structure. 3155e5c31af7Sopenharmony_ci * pname:type is the type of hit group specified in this structure. 3156e5c31af7Sopenharmony_ci * pname:generalShader is the index of the ray generation, miss, or 3157e5c31af7Sopenharmony_ci callable shader from 3158e5c31af7Sopenharmony_ci slink:VkRayTracingPipelineCreateInfoNV::pname:pStages in the group if 3159e5c31af7Sopenharmony_ci the shader group has pname:type of 3160e5c31af7Sopenharmony_ci ename:VK_RAY_TRACING_SHADER_GROUP_TYPE_GENERAL_NV, and 3161e5c31af7Sopenharmony_ci ename:VK_SHADER_UNUSED_NV otherwise. 3162e5c31af7Sopenharmony_ci * pname:closestHitShader is the optional index of the closest hit shader 3163e5c31af7Sopenharmony_ci from slink:VkRayTracingPipelineCreateInfoNV::pname:pStages in the group 3164e5c31af7Sopenharmony_ci if the shader group has pname:type of 3165e5c31af7Sopenharmony_ci ename:VK_RAY_TRACING_SHADER_GROUP_TYPE_TRIANGLES_HIT_GROUP_NV or 3166e5c31af7Sopenharmony_ci ename:VK_RAY_TRACING_SHADER_GROUP_TYPE_PROCEDURAL_HIT_GROUP_NV, and 3167e5c31af7Sopenharmony_ci ename:VK_SHADER_UNUSED_NV otherwise. 3168e5c31af7Sopenharmony_ci * pname:anyHitShader is the optional index of the any-hit shader from 3169e5c31af7Sopenharmony_ci slink:VkRayTracingPipelineCreateInfoNV::pname:pStages in the group if 3170e5c31af7Sopenharmony_ci the shader group has pname:type of 3171e5c31af7Sopenharmony_ci ename:VK_RAY_TRACING_SHADER_GROUP_TYPE_TRIANGLES_HIT_GROUP_NV or 3172e5c31af7Sopenharmony_ci ename:VK_RAY_TRACING_SHADER_GROUP_TYPE_PROCEDURAL_HIT_GROUP_NV, and 3173e5c31af7Sopenharmony_ci ename:VK_SHADER_UNUSED_NV otherwise. 3174e5c31af7Sopenharmony_ci * pname:intersectionShader is the index of the intersection shader from 3175e5c31af7Sopenharmony_ci slink:VkRayTracingPipelineCreateInfoNV::pname:pStages in the group if 3176e5c31af7Sopenharmony_ci the shader group has pname:type of 3177e5c31af7Sopenharmony_ci ename:VK_RAY_TRACING_SHADER_GROUP_TYPE_PROCEDURAL_HIT_GROUP_NV, and 3178e5c31af7Sopenharmony_ci ename:VK_SHADER_UNUSED_NV otherwise. 3179e5c31af7Sopenharmony_ci 3180e5c31af7Sopenharmony_ci.Valid Usage 3181e5c31af7Sopenharmony_ci**** 3182e5c31af7Sopenharmony_ci * [[VUID-VkRayTracingShaderGroupCreateInfoNV-type-02413]] 3183e5c31af7Sopenharmony_ci If pname:type is ename:VK_RAY_TRACING_SHADER_GROUP_TYPE_GENERAL_NV then 3184e5c31af7Sopenharmony_ci pname:generalShader must: be a valid index into 3185e5c31af7Sopenharmony_ci slink:VkRayTracingPipelineCreateInfoNV::pname:pStages referring to a 3186e5c31af7Sopenharmony_ci shader of ename:VK_SHADER_STAGE_RAYGEN_BIT_NV, 3187e5c31af7Sopenharmony_ci ename:VK_SHADER_STAGE_MISS_BIT_NV, or 3188e5c31af7Sopenharmony_ci ename:VK_SHADER_STAGE_CALLABLE_BIT_NV 3189e5c31af7Sopenharmony_ci * [[VUID-VkRayTracingShaderGroupCreateInfoNV-type-02414]] 3190e5c31af7Sopenharmony_ci If pname:type is ename:VK_RAY_TRACING_SHADER_GROUP_TYPE_GENERAL_NV then 3191e5c31af7Sopenharmony_ci pname:closestHitShader, pname:anyHitShader, and pname:intersectionShader 3192e5c31af7Sopenharmony_ci must: be ename:VK_SHADER_UNUSED_NV 3193e5c31af7Sopenharmony_ci * [[VUID-VkRayTracingShaderGroupCreateInfoNV-type-02415]] 3194e5c31af7Sopenharmony_ci If pname:type is 3195e5c31af7Sopenharmony_ci ename:VK_RAY_TRACING_SHADER_GROUP_TYPE_PROCEDURAL_HIT_GROUP_NV then 3196e5c31af7Sopenharmony_ci pname:intersectionShader must: be a valid index into 3197e5c31af7Sopenharmony_ci slink:VkRayTracingPipelineCreateInfoNV::pname:pStages referring to a 3198e5c31af7Sopenharmony_ci shader of ename:VK_SHADER_STAGE_INTERSECTION_BIT_NV 3199e5c31af7Sopenharmony_ci * [[VUID-VkRayTracingShaderGroupCreateInfoNV-type-02416]] 3200e5c31af7Sopenharmony_ci If pname:type is 3201e5c31af7Sopenharmony_ci ename:VK_RAY_TRACING_SHADER_GROUP_TYPE_TRIANGLES_HIT_GROUP_NV then 3202e5c31af7Sopenharmony_ci pname:intersectionShader must: be ename:VK_SHADER_UNUSED_NV 3203e5c31af7Sopenharmony_ci * [[VUID-VkRayTracingShaderGroupCreateInfoNV-closestHitShader-02417]] 3204e5c31af7Sopenharmony_ci pname:closestHitShader must: be either ename:VK_SHADER_UNUSED_NV or a 3205e5c31af7Sopenharmony_ci valid index into slink:VkRayTracingPipelineCreateInfoNV::pname:pStages 3206e5c31af7Sopenharmony_ci referring to a shader of ename:VK_SHADER_STAGE_CLOSEST_HIT_BIT_NV 3207e5c31af7Sopenharmony_ci * [[VUID-VkRayTracingShaderGroupCreateInfoNV-anyHitShader-02418]] 3208e5c31af7Sopenharmony_ci pname:anyHitShader must: be either ename:VK_SHADER_UNUSED_NV or a valid 3209e5c31af7Sopenharmony_ci index into slink:VkRayTracingPipelineCreateInfoNV::pname:pStages 3210e5c31af7Sopenharmony_ci referring to a shader of ename:VK_SHADER_STAGE_ANY_HIT_BIT_NV 3211e5c31af7Sopenharmony_ci**** 3212e5c31af7Sopenharmony_ci 3213e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkRayTracingShaderGroupCreateInfoNV.txt[] 3214e5c31af7Sopenharmony_ci-- 3215e5c31af7Sopenharmony_ci 3216e5c31af7Sopenharmony_ciendif::VK_NV_ray_tracing[] 3217e5c31af7Sopenharmony_ci 3218e5c31af7Sopenharmony_ciifdef::VK_KHR_ray_tracing_pipeline[] 3219e5c31af7Sopenharmony_ci[open,refpage='VkRayTracingShaderGroupCreateInfoKHR',desc='Structure specifying shaders in a shader group',type='structs'] 3220e5c31af7Sopenharmony_ci-- 3221e5c31af7Sopenharmony_ci:refpage: VkRayTracingShaderGroupCreateInfoKHR 3222e5c31af7Sopenharmony_ci 3223e5c31af7Sopenharmony_ciThe sname:VkRayTracingShaderGroupCreateInfoKHR structure is defined as: 3224e5c31af7Sopenharmony_ci 3225e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkRayTracingShaderGroupCreateInfoKHR.txt[] 3226e5c31af7Sopenharmony_ci 3227e5c31af7Sopenharmony_ci * pname:sType is the type of this structure. 3228e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 3229e5c31af7Sopenharmony_ci structure. 3230e5c31af7Sopenharmony_ci * pname:type is the type of hit group specified in this structure. 3231e5c31af7Sopenharmony_ci * pname:generalShader is the index of the ray generation, miss, or 3232e5c31af7Sopenharmony_ci callable shader from 3233e5c31af7Sopenharmony_ci slink:VkRayTracingPipelineCreateInfoKHR::pname:pStages in the group if 3234e5c31af7Sopenharmony_ci the shader group has pname:type of 3235e5c31af7Sopenharmony_ci ename:VK_RAY_TRACING_SHADER_GROUP_TYPE_GENERAL_KHR, and 3236e5c31af7Sopenharmony_ci ename:VK_SHADER_UNUSED_KHR otherwise. 3237e5c31af7Sopenharmony_ci * pname:closestHitShader is the optional index of the closest hit shader 3238e5c31af7Sopenharmony_ci from slink:VkRayTracingPipelineCreateInfoKHR::pname:pStages in the group 3239e5c31af7Sopenharmony_ci if the shader group has pname:type of 3240e5c31af7Sopenharmony_ci ename:VK_RAY_TRACING_SHADER_GROUP_TYPE_TRIANGLES_HIT_GROUP_KHR or 3241e5c31af7Sopenharmony_ci ename:VK_RAY_TRACING_SHADER_GROUP_TYPE_PROCEDURAL_HIT_GROUP_KHR, and 3242e5c31af7Sopenharmony_ci ename:VK_SHADER_UNUSED_KHR otherwise. 3243e5c31af7Sopenharmony_ci * pname:anyHitShader is the optional index of the any-hit shader from 3244e5c31af7Sopenharmony_ci slink:VkRayTracingPipelineCreateInfoKHR::pname:pStages in the group if 3245e5c31af7Sopenharmony_ci the shader group has pname:type of 3246e5c31af7Sopenharmony_ci ename:VK_RAY_TRACING_SHADER_GROUP_TYPE_TRIANGLES_HIT_GROUP_KHR or 3247e5c31af7Sopenharmony_ci ename:VK_RAY_TRACING_SHADER_GROUP_TYPE_PROCEDURAL_HIT_GROUP_KHR, and 3248e5c31af7Sopenharmony_ci ename:VK_SHADER_UNUSED_KHR otherwise. 3249e5c31af7Sopenharmony_ci * pname:intersectionShader is the index of the intersection shader from 3250e5c31af7Sopenharmony_ci slink:VkRayTracingPipelineCreateInfoKHR::pname:pStages in the group if 3251e5c31af7Sopenharmony_ci the shader group has pname:type of 3252e5c31af7Sopenharmony_ci ename:VK_RAY_TRACING_SHADER_GROUP_TYPE_PROCEDURAL_HIT_GROUP_KHR, and 3253e5c31af7Sopenharmony_ci ename:VK_SHADER_UNUSED_KHR otherwise. 3254e5c31af7Sopenharmony_ci * pname:pShaderGroupCaptureReplayHandle is `NULL` or a pointer to replay 3255e5c31af7Sopenharmony_ci information for this shader group. 3256e5c31af7Sopenharmony_ci Ignored if 3257e5c31af7Sopenharmony_ci slink:VkPhysicalDeviceRayTracingPipelineFeaturesKHR::pname:rayTracingPipelineShaderGroupHandleCaptureReplay 3258e5c31af7Sopenharmony_ci is ename:VK_FALSE. 3259e5c31af7Sopenharmony_ci 3260e5c31af7Sopenharmony_ci.Valid Usage 3261e5c31af7Sopenharmony_ci**** 3262e5c31af7Sopenharmony_ci * [[VUID-VkRayTracingShaderGroupCreateInfoKHR-type-03474]] 3263e5c31af7Sopenharmony_ci If pname:type is ename:VK_RAY_TRACING_SHADER_GROUP_TYPE_GENERAL_KHR then 3264e5c31af7Sopenharmony_ci pname:generalShader must: be a valid index into 3265e5c31af7Sopenharmony_ci slink:VkRayTracingPipelineCreateInfoKHR::pname:pStages referring to a 3266e5c31af7Sopenharmony_ci shader of ename:VK_SHADER_STAGE_RAYGEN_BIT_KHR, 3267e5c31af7Sopenharmony_ci ename:VK_SHADER_STAGE_MISS_BIT_KHR, or 3268e5c31af7Sopenharmony_ci ename:VK_SHADER_STAGE_CALLABLE_BIT_KHR 3269e5c31af7Sopenharmony_ci * [[VUID-VkRayTracingShaderGroupCreateInfoKHR-type-03475]] 3270e5c31af7Sopenharmony_ci If pname:type is ename:VK_RAY_TRACING_SHADER_GROUP_TYPE_GENERAL_KHR then 3271e5c31af7Sopenharmony_ci pname:closestHitShader, pname:anyHitShader, and pname:intersectionShader 3272e5c31af7Sopenharmony_ci must: be ename:VK_SHADER_UNUSED_KHR 3273e5c31af7Sopenharmony_ci * [[VUID-VkRayTracingShaderGroupCreateInfoKHR-type-03476]] 3274e5c31af7Sopenharmony_ci If pname:type is 3275e5c31af7Sopenharmony_ci ename:VK_RAY_TRACING_SHADER_GROUP_TYPE_PROCEDURAL_HIT_GROUP_KHR then 3276e5c31af7Sopenharmony_ci pname:intersectionShader must: be a valid index into 3277e5c31af7Sopenharmony_ci slink:VkRayTracingPipelineCreateInfoKHR::pname:pStages referring to a 3278e5c31af7Sopenharmony_ci shader of ename:VK_SHADER_STAGE_INTERSECTION_BIT_KHR 3279e5c31af7Sopenharmony_ci * [[VUID-VkRayTracingShaderGroupCreateInfoKHR-type-03477]] 3280e5c31af7Sopenharmony_ci If pname:type is 3281e5c31af7Sopenharmony_ci ename:VK_RAY_TRACING_SHADER_GROUP_TYPE_TRIANGLES_HIT_GROUP_KHR then 3282e5c31af7Sopenharmony_ci pname:intersectionShader must: be ename:VK_SHADER_UNUSED_KHR 3283e5c31af7Sopenharmony_ci * [[VUID-VkRayTracingShaderGroupCreateInfoKHR-closestHitShader-03478]] 3284e5c31af7Sopenharmony_ci pname:closestHitShader must: be either ename:VK_SHADER_UNUSED_KHR or a 3285e5c31af7Sopenharmony_ci valid index into slink:VkRayTracingPipelineCreateInfoKHR::pname:pStages 3286e5c31af7Sopenharmony_ci referring to a shader of ename:VK_SHADER_STAGE_CLOSEST_HIT_BIT_KHR 3287e5c31af7Sopenharmony_ci * [[VUID-VkRayTracingShaderGroupCreateInfoKHR-anyHitShader-03479]] 3288e5c31af7Sopenharmony_ci pname:anyHitShader must: be either ename:VK_SHADER_UNUSED_KHR or a valid 3289e5c31af7Sopenharmony_ci index into slink:VkRayTracingPipelineCreateInfoKHR::pname:pStages 3290e5c31af7Sopenharmony_ci referring to a shader of ename:VK_SHADER_STAGE_ANY_HIT_BIT_KHR 3291e5c31af7Sopenharmony_ci * [[VUID-VkRayTracingShaderGroupCreateInfoKHR-rayTracingPipelineShaderGroupHandleCaptureReplayMixed-03603]] 3292e5c31af7Sopenharmony_ci If 3293e5c31af7Sopenharmony_ci slink:VkPhysicalDeviceRayTracingPipelineFeaturesKHR::pname:rayTracingPipelineShaderGroupHandleCaptureReplayMixed 3294e5c31af7Sopenharmony_ci is ename:VK_FALSE then pname:pShaderGroupCaptureReplayHandle must: not 3295e5c31af7Sopenharmony_ci be provided if it has not been provided on a previous call to ray 3296e5c31af7Sopenharmony_ci tracing pipeline creation 3297e5c31af7Sopenharmony_ci * [[VUID-VkRayTracingShaderGroupCreateInfoKHR-rayTracingPipelineShaderGroupHandleCaptureReplayMixed-03604]] 3298e5c31af7Sopenharmony_ci If 3299e5c31af7Sopenharmony_ci slink:VkPhysicalDeviceRayTracingPipelineFeaturesKHR::pname:rayTracingPipelineShaderGroupHandleCaptureReplayMixed 3300e5c31af7Sopenharmony_ci is ename:VK_FALSE then the caller must: guarantee that no ray tracing 3301e5c31af7Sopenharmony_ci pipeline creation commands with pname:pShaderGroupCaptureReplayHandle 3302e5c31af7Sopenharmony_ci provided execute simultaneously with ray tracing pipeline creation 3303e5c31af7Sopenharmony_ci commands without pname:pShaderGroupCaptureReplayHandle provided 3304e5c31af7Sopenharmony_ci**** 3305e5c31af7Sopenharmony_ci 3306e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkRayTracingShaderGroupCreateInfoKHR.txt[] 3307e5c31af7Sopenharmony_ci-- 3308e5c31af7Sopenharmony_ciendif::VK_KHR_ray_tracing_pipeline[] 3309e5c31af7Sopenharmony_ci 3310e5c31af7Sopenharmony_ci[open,refpage='VkRayTracingShaderGroupTypeKHR',desc='Shader group types',type='enums',alias='VkRayTracingShaderGroupTypeNV'] 3311e5c31af7Sopenharmony_ci-- 3312e5c31af7Sopenharmony_ci:refpage: VkRayTracingShaderGroupTypeKHR 3313e5c31af7Sopenharmony_ci 3314e5c31af7Sopenharmony_ciPossible values of pname:type in sname:VkRayTracingShaderGroupCreateInfoKHR 3315e5c31af7Sopenharmony_ciare: 3316e5c31af7Sopenharmony_ci 3317e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkRayTracingShaderGroupTypeKHR.txt[] 3318e5c31af7Sopenharmony_ci 3319e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing[] 3320e5c31af7Sopenharmony_cior the equivalent 3321e5c31af7Sopenharmony_ci 3322e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkRayTracingShaderGroupTypeNV.txt[] 3323e5c31af7Sopenharmony_ciendif::VK_NV_ray_tracing[] 3324e5c31af7Sopenharmony_ci 3325e5c31af7Sopenharmony_ci * ename:VK_RAY_TRACING_SHADER_GROUP_TYPE_GENERAL_KHR indicates a shader 3326e5c31af7Sopenharmony_ci group with a single ename:VK_SHADER_STAGE_RAYGEN_BIT_KHR, 3327e5c31af7Sopenharmony_ci ename:VK_SHADER_STAGE_MISS_BIT_KHR, or 3328e5c31af7Sopenharmony_ci ename:VK_SHADER_STAGE_CALLABLE_BIT_KHR shader in it. 3329e5c31af7Sopenharmony_ci * ename:VK_RAY_TRACING_SHADER_GROUP_TYPE_TRIANGLES_HIT_GROUP_KHR specifies 3330e5c31af7Sopenharmony_ci a shader group that only hits triangles and must: not contain an 3331e5c31af7Sopenharmony_ci intersection shader, only closest hit and any-hit shaders. 3332e5c31af7Sopenharmony_ci * ename:VK_RAY_TRACING_SHADER_GROUP_TYPE_PROCEDURAL_HIT_GROUP_KHR 3333e5c31af7Sopenharmony_ci specifies a shader group that only intersects with custom geometry and 3334e5c31af7Sopenharmony_ci must: contain an intersection shader and may: contain closest hit and 3335e5c31af7Sopenharmony_ci any-hit shaders. 3336e5c31af7Sopenharmony_ci 3337e5c31af7Sopenharmony_ci[NOTE] 3338e5c31af7Sopenharmony_ci.Note 3339e5c31af7Sopenharmony_ci==== 3340e5c31af7Sopenharmony_ciFor current group types, the hit group type could be inferred from the 3341e5c31af7Sopenharmony_cipresence or absence of the intersection shader, but we provide the type 3342e5c31af7Sopenharmony_ciexplicitly for future hit groups that do not have that property. 3343e5c31af7Sopenharmony_ci==== 3344e5c31af7Sopenharmony_ci-- 3345e5c31af7Sopenharmony_ci 3346e5c31af7Sopenharmony_ciifdef::VK_KHR_ray_tracing_pipeline[] 3347e5c31af7Sopenharmony_ci[open,refpage='VkRayTracingPipelineInterfaceCreateInfoKHR',desc='Structure specifying additional interface information when using libraries',type='structs'] 3348e5c31af7Sopenharmony_ci-- 3349e5c31af7Sopenharmony_ci:refpage: VkRayTracingPipelineInterfaceCreateInfoKHR 3350e5c31af7Sopenharmony_ci 3351e5c31af7Sopenharmony_ciThe sname:VkRayTracingPipelineInterfaceCreateInfoKHR structure is defined 3352e5c31af7Sopenharmony_cias: 3353e5c31af7Sopenharmony_ci 3354e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkRayTracingPipelineInterfaceCreateInfoKHR.txt[] 3355e5c31af7Sopenharmony_ci 3356e5c31af7Sopenharmony_ci * pname:sType is the type of this structure. 3357e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 3358e5c31af7Sopenharmony_ci structure. 3359e5c31af7Sopenharmony_ci * pname:maxPipelineRayPayloadSize is the maximum payload size in bytes 3360e5c31af7Sopenharmony_ci used by any shader in the pipeline. 3361e5c31af7Sopenharmony_ci * pname:maxPipelineRayHitAttributeSize is the maximum attribute structure 3362e5c31af7Sopenharmony_ci size in bytes used by any shader in the pipeline. 3363e5c31af7Sopenharmony_ci 3364e5c31af7Sopenharmony_cipname:maxPipelineRayPayloadSize is calculated as the maximum number of bytes 3365e5c31af7Sopenharmony_ciused by any block declared in the code:RayPayloadKHR or 3366e5c31af7Sopenharmony_cicode:IncomingRayPayloadKHR storage classes. 3367e5c31af7Sopenharmony_cipname:maxPipelineRayHitAttributeSize is calculated as the maximum number of 3368e5c31af7Sopenharmony_cibytes used by any block declared in the code:HitAttributeKHR storage class. 3369e5c31af7Sopenharmony_ciAs variables in these storage classes do not have explicit offsets, the size 3370e5c31af7Sopenharmony_cishould be calculated as if each variable has a 3371e5c31af7Sopenharmony_ci<<interfaces-alignment-requirements, scalar alignment>> equal to the largest 3372e5c31af7Sopenharmony_ciscalar alignment of any of the block's members. 3373e5c31af7Sopenharmony_ci 3374e5c31af7Sopenharmony_ci[NOTE] 3375e5c31af7Sopenharmony_ci.Note 3376e5c31af7Sopenharmony_ci==== 3377e5c31af7Sopenharmony_ciThere is no explicit upper limit for pname:maxPipelineRayPayloadSize, but in 3378e5c31af7Sopenharmony_cipractice it should be kept as small as possible. 3379e5c31af7Sopenharmony_ciSimilar to invocation local memory, it must be allocated for each shader 3380e5c31af7Sopenharmony_ciinvocation and for devices which support many simultaneous invocations, this 3381e5c31af7Sopenharmony_cistorage can rapidly be exhausted, resulting in failure. 3382e5c31af7Sopenharmony_ci==== 3383e5c31af7Sopenharmony_ci 3384e5c31af7Sopenharmony_ci.Valid Usage 3385e5c31af7Sopenharmony_ci**** 3386e5c31af7Sopenharmony_ci * [[VUID-VkRayTracingPipelineInterfaceCreateInfoKHR-maxPipelineRayHitAttributeSize-03605]] 3387e5c31af7Sopenharmony_ci pname:maxPipelineRayHitAttributeSize must: be less than or equal to 3388e5c31af7Sopenharmony_ci slink:VkPhysicalDeviceRayTracingPipelinePropertiesKHR::pname:maxRayHitAttributeSize 3389e5c31af7Sopenharmony_ci**** 3390e5c31af7Sopenharmony_ci 3391e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkRayTracingPipelineInterfaceCreateInfoKHR.txt[] 3392e5c31af7Sopenharmony_ci-- 3393e5c31af7Sopenharmony_ciendif::VK_KHR_ray_tracing_pipeline[] 3394e5c31af7Sopenharmony_ci 3395e5c31af7Sopenharmony_ci[open,refpage='vkGetRayTracingShaderGroupHandlesKHR',desc='Query ray tracing pipeline shader group handles',type='protos',alias='vkGetRayTracingShaderGroupHandlesNV'] 3396e5c31af7Sopenharmony_ci-- 3397e5c31af7Sopenharmony_ci:refpage: vkGetRayTracingShaderGroupHandlesKHR 3398e5c31af7Sopenharmony_ci 3399e5c31af7Sopenharmony_ciTo query the opaque handles of shaders in the ray tracing pipeline, call: 3400e5c31af7Sopenharmony_ci 3401e5c31af7Sopenharmony_ciifdef::VK_KHR_ray_tracing_pipeline[] 3402e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkGetRayTracingShaderGroupHandlesKHR.txt[] 3403e5c31af7Sopenharmony_ciendif::VK_KHR_ray_tracing_pipeline[] 3404e5c31af7Sopenharmony_ci 3405e5c31af7Sopenharmony_ciifdef::VK_KHR_ray_tracing_pipeline+VK_NV_ray_tracing[or the equivalent command] 3406e5c31af7Sopenharmony_ci 3407e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing[] 3408e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkGetRayTracingShaderGroupHandlesNV.txt[] 3409e5c31af7Sopenharmony_ciendif::VK_NV_ray_tracing[] 3410e5c31af7Sopenharmony_ci 3411e5c31af7Sopenharmony_ci * pname:device is the logical device containing the ray tracing pipeline. 3412e5c31af7Sopenharmony_ci * pname:pipeline is the ray tracing pipeline object containing the 3413e5c31af7Sopenharmony_ci shaders. 3414e5c31af7Sopenharmony_ci * pname:firstGroup is the index of the first group to retrieve a handle 3415e5c31af7Sopenharmony_ci for from the 3416e5c31af7Sopenharmony_ciifdef::VK_KHR_ray_tracing_pipeline[] 3417e5c31af7Sopenharmony_cislink:VkRayTracingPipelineCreateInfoKHR::pname:pGroups 3418e5c31af7Sopenharmony_ciendif::VK_KHR_ray_tracing_pipeline[] 3419e5c31af7Sopenharmony_ciifdef::VK_KHR_ray_tracing_pipeline+VK_NV_ray_tracing[or] 3420e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing[] 3421e5c31af7Sopenharmony_cislink:VkRayTracingPipelineCreateInfoNV::pname:pGroups 3422e5c31af7Sopenharmony_ciendif::VK_NV_ray_tracing[] 3423e5c31af7Sopenharmony_ci array. 3424e5c31af7Sopenharmony_ci * pname:groupCount is the number of shader handles to retrieve. 3425e5c31af7Sopenharmony_ci * pname:dataSize is the size in bytes of the buffer pointed to by 3426e5c31af7Sopenharmony_ci pname:pData. 3427e5c31af7Sopenharmony_ci * pname:pData is a pointer to a user-allocated buffer where the results 3428e5c31af7Sopenharmony_ci will be written. 3429e5c31af7Sopenharmony_ci 3430e5c31af7Sopenharmony_ci.Valid Usage 3431e5c31af7Sopenharmony_ci**** 3432e5c31af7Sopenharmony_ci * [[VUID-vkGetRayTracingShaderGroupHandlesKHR-pipeline-04619]] 3433e5c31af7Sopenharmony_ci pname:pipeline must: be a ray tracing pipeline 3434e5c31af7Sopenharmony_ci * [[VUID-vkGetRayTracingShaderGroupHandlesKHR-firstGroup-04050]] 3435e5c31af7Sopenharmony_ci pname:firstGroup must: be less than the number of shader groups in 3436e5c31af7Sopenharmony_ci pname:pipeline 3437e5c31af7Sopenharmony_ci * [[VUID-vkGetRayTracingShaderGroupHandlesKHR-firstGroup-02419]] 3438e5c31af7Sopenharmony_ci The sum of pname:firstGroup and pname:groupCount must: be less than or 3439e5c31af7Sopenharmony_ci equal to the number of shader groups in pname:pipeline 3440e5c31af7Sopenharmony_ci * [[VUID-vkGetRayTracingShaderGroupHandlesKHR-dataSize-02420]] 3441e5c31af7Sopenharmony_ci pname:dataSize must: be at least 3442e5c31af7Sopenharmony_ci [eq]#slink:VkPhysicalDeviceRayTracingPipelinePropertiesKHR::pname:shaderGroupHandleSize 3443e5c31af7Sopenharmony_ci {times} pname:groupCount# 3444e5c31af7Sopenharmony_ciifdef::VK_KHR_pipeline_library[] 3445e5c31af7Sopenharmony_ci * [[VUID-vkGetRayTracingShaderGroupHandlesKHR-pipeline-03482]] 3446e5c31af7Sopenharmony_ci pname:pipeline must: have not been created with 3447e5c31af7Sopenharmony_ci ename:VK_PIPELINE_CREATE_LIBRARY_BIT_KHR 3448e5c31af7Sopenharmony_ciendif::VK_KHR_pipeline_library[] 3449e5c31af7Sopenharmony_ci**** 3450e5c31af7Sopenharmony_ci 3451e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkGetRayTracingShaderGroupHandlesKHR.txt[] 3452e5c31af7Sopenharmony_ci-- 3453e5c31af7Sopenharmony_ci 3454e5c31af7Sopenharmony_ciifdef::VK_KHR_ray_tracing_pipeline[] 3455e5c31af7Sopenharmony_ci[open,refpage='vkGetRayTracingCaptureReplayShaderGroupHandlesKHR',desc='Query ray tracing capture replay pipeline shader group handles',type='protos'] 3456e5c31af7Sopenharmony_ci-- 3457e5c31af7Sopenharmony_ci:refpage: vkGetRayTracingCaptureReplayShaderGroupHandlesKHR 3458e5c31af7Sopenharmony_ci 3459e5c31af7Sopenharmony_ciTo query the optional capture handle information of shaders in the ray 3460e5c31af7Sopenharmony_citracing pipeline, call: 3461e5c31af7Sopenharmony_ci 3462e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkGetRayTracingCaptureReplayShaderGroupHandlesKHR.txt[] 3463e5c31af7Sopenharmony_ci 3464e5c31af7Sopenharmony_ci * pname:device is the logical device containing the ray tracing pipeline. 3465e5c31af7Sopenharmony_ci * pname:pipeline is the ray tracing pipeline object containing the 3466e5c31af7Sopenharmony_ci shaders. 3467e5c31af7Sopenharmony_ci * pname:firstGroup is the index of the first group to retrieve a handle 3468e5c31af7Sopenharmony_ci for from the slink:VkRayTracingPipelineCreateInfoKHR::pname:pGroups 3469e5c31af7Sopenharmony_ci array. 3470e5c31af7Sopenharmony_ci * pname:groupCount is the number of shader handles to retrieve. 3471e5c31af7Sopenharmony_ci * pname:dataSize is the size in bytes of the buffer pointed to by 3472e5c31af7Sopenharmony_ci pname:pData. 3473e5c31af7Sopenharmony_ci * pname:pData is a pointer to a user-allocated buffer where the results 3474e5c31af7Sopenharmony_ci will be written. 3475e5c31af7Sopenharmony_ci 3476e5c31af7Sopenharmony_ci.Valid Usage 3477e5c31af7Sopenharmony_ci**** 3478e5c31af7Sopenharmony_ci * [[VUID-vkGetRayTracingCaptureReplayShaderGroupHandlesKHR-pipeline-04620]] 3479e5c31af7Sopenharmony_ci pname:pipeline must: be a ray tracing pipeline 3480e5c31af7Sopenharmony_ci * [[VUID-vkGetRayTracingCaptureReplayShaderGroupHandlesKHR-firstGroup-04051]] 3481e5c31af7Sopenharmony_ci pname:firstGroup must: be less than the number of shader groups in 3482e5c31af7Sopenharmony_ci pname:pipeline 3483e5c31af7Sopenharmony_ci * [[VUID-vkGetRayTracingCaptureReplayShaderGroupHandlesKHR-firstGroup-03483]] 3484e5c31af7Sopenharmony_ci The sum of pname:firstGroup and pname:groupCount must: be less than or 3485e5c31af7Sopenharmony_ci equal to the number of shader groups in pname:pipeline 3486e5c31af7Sopenharmony_ci * [[VUID-vkGetRayTracingCaptureReplayShaderGroupHandlesKHR-dataSize-03484]] 3487e5c31af7Sopenharmony_ci pname:dataSize must: be at least 3488e5c31af7Sopenharmony_ci [eq]#slink:VkPhysicalDeviceRayTracingPipelinePropertiesKHR::pname:shaderGroupHandleCaptureReplaySize 3489e5c31af7Sopenharmony_ci {times} pname:groupCount# 3490e5c31af7Sopenharmony_ci * [[VUID-vkGetRayTracingCaptureReplayShaderGroupHandlesKHR-rayTracingPipelineShaderGroupHandleCaptureReplay-03606]] 3491e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceRayTracingPipelineFeaturesKHR::pname:rayTracingPipelineShaderGroupHandleCaptureReplay 3492e5c31af7Sopenharmony_ci must: be enabled to call this function 3493e5c31af7Sopenharmony_ci * [[VUID-vkGetRayTracingCaptureReplayShaderGroupHandlesKHR-pipeline-03607]] 3494e5c31af7Sopenharmony_ci pname:pipeline must: have been created with a pname:flags that included 3495e5c31af7Sopenharmony_ci ename:VK_PIPELINE_CREATE_RAY_TRACING_SHADER_GROUP_HANDLE_CAPTURE_REPLAY_BIT_KHR 3496e5c31af7Sopenharmony_ci**** 3497e5c31af7Sopenharmony_ci 3498e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkGetRayTracingCaptureReplayShaderGroupHandlesKHR.txt[] 3499e5c31af7Sopenharmony_ci-- 3500e5c31af7Sopenharmony_ciendif::VK_KHR_ray_tracing_pipeline[] 3501e5c31af7Sopenharmony_ci 3502e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing[] 3503e5c31af7Sopenharmony_ciRay tracing pipelines can: contain more shaders than a graphics or compute 3504e5c31af7Sopenharmony_cipipeline, so to allow parallel compilation of shaders within a pipeline, an 3505e5c31af7Sopenharmony_ciapplication can: choose to defer compilation until a later point in time. 3506e5c31af7Sopenharmony_ci 3507e5c31af7Sopenharmony_ci[open,refpage='vkCompileDeferredNV',desc='Deferred compilation of shaders',type='protos'] 3508e5c31af7Sopenharmony_ci-- 3509e5c31af7Sopenharmony_ci:refpage: vkCompileDeferredNV 3510e5c31af7Sopenharmony_ci 3511e5c31af7Sopenharmony_ciTo compile a deferred shader in a pipeline call: 3512e5c31af7Sopenharmony_ci 3513e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCompileDeferredNV.txt[] 3514e5c31af7Sopenharmony_ci 3515e5c31af7Sopenharmony_ci * pname:device is the logical device containing the ray tracing pipeline. 3516e5c31af7Sopenharmony_ci * pname:pipeline is the ray tracing pipeline object containing the 3517e5c31af7Sopenharmony_ci shaders. 3518e5c31af7Sopenharmony_ci * pname:shader is the index of the shader to compile. 3519e5c31af7Sopenharmony_ci 3520e5c31af7Sopenharmony_ci.Valid Usage 3521e5c31af7Sopenharmony_ci**** 3522e5c31af7Sopenharmony_ci * [[VUID-vkCompileDeferredNV-pipeline-04621]] 3523e5c31af7Sopenharmony_ci pname:pipeline must: be a ray tracing pipeline 3524e5c31af7Sopenharmony_ci * [[VUID-vkCompileDeferredNV-pipeline-02237]] 3525e5c31af7Sopenharmony_ci pname:pipeline must: have been created with 3526e5c31af7Sopenharmony_ci ename:VK_PIPELINE_CREATE_DEFER_COMPILE_BIT_NV 3527e5c31af7Sopenharmony_ci * [[VUID-vkCompileDeferredNV-shader-02238]] 3528e5c31af7Sopenharmony_ci pname:shader must: not have been called as a deferred compile before 3529e5c31af7Sopenharmony_ci**** 3530e5c31af7Sopenharmony_ci 3531e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCompileDeferredNV.txt[] 3532e5c31af7Sopenharmony_ci-- 3533e5c31af7Sopenharmony_ciendif::VK_NV_ray_tracing[] 3534e5c31af7Sopenharmony_ci 3535e5c31af7Sopenharmony_ciifdef::VK_KHR_ray_tracing_pipeline[] 3536e5c31af7Sopenharmony_ci[open,refpage='vkGetRayTracingShaderGroupStackSizeKHR',desc='Query ray tracing pipeline shader group shader stack size',type='protos'] 3537e5c31af7Sopenharmony_ci-- 3538e5c31af7Sopenharmony_ciTo query the pipeline stack size of shaders in a shader group in the ray 3539e5c31af7Sopenharmony_citracing pipeline, call: 3540e5c31af7Sopenharmony_ci 3541e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkGetRayTracingShaderGroupStackSizeKHR.txt[] 3542e5c31af7Sopenharmony_ci 3543e5c31af7Sopenharmony_ci * pname:device is the logical device containing the ray tracing pipeline. 3544e5c31af7Sopenharmony_ci * pname:pipeline is the ray tracing pipeline object containing the shaders 3545e5c31af7Sopenharmony_ci groups. 3546e5c31af7Sopenharmony_ci * pname:group is the index of the shader group to query. 3547e5c31af7Sopenharmony_ci * pname:groupShader is the type of shader from the group to query. 3548e5c31af7Sopenharmony_ci 3549e5c31af7Sopenharmony_ciThe return value is the ray tracing pipeline stack size in bytes for the 3550e5c31af7Sopenharmony_cispecified shader as called from the specified shader group. 3551e5c31af7Sopenharmony_ci 3552e5c31af7Sopenharmony_ci.Valid Usage 3553e5c31af7Sopenharmony_ci**** 3554e5c31af7Sopenharmony_ci * [[VUID-vkGetRayTracingShaderGroupStackSizeKHR-pipeline-04622]] 3555e5c31af7Sopenharmony_ci pname:pipeline must: be a ray tracing pipeline 3556e5c31af7Sopenharmony_ci * [[VUID-vkGetRayTracingShaderGroupStackSizeKHR-group-03608]] 3557e5c31af7Sopenharmony_ci The value of pname:group must be less than the number of shader groups 3558e5c31af7Sopenharmony_ci in pname:pipeline 3559e5c31af7Sopenharmony_ci * [[VUID-vkGetRayTracingShaderGroupStackSizeKHR-groupShader-03609]] 3560e5c31af7Sopenharmony_ci The shader identified by pname:groupShader in pname:group must: not be 3561e5c31af7Sopenharmony_ci ename:VK_SHADER_UNUSED_KHR 3562e5c31af7Sopenharmony_ci**** 3563e5c31af7Sopenharmony_ci 3564e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkGetRayTracingShaderGroupStackSizeKHR.txt[] 3565e5c31af7Sopenharmony_ci-- 3566e5c31af7Sopenharmony_ci 3567e5c31af7Sopenharmony_ci[open,refpage='VkShaderGroupShaderKHR',desc='Shader group shaders',type='enums'] 3568e5c31af7Sopenharmony_ci-- 3569e5c31af7Sopenharmony_ciPossible values of pname:groupShader in 3570e5c31af7Sopenharmony_ciflink:vkGetRayTracingShaderGroupStackSizeKHR are: 3571e5c31af7Sopenharmony_ci 3572e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkShaderGroupShaderKHR.txt[] 3573e5c31af7Sopenharmony_ci 3574e5c31af7Sopenharmony_ci * ename:VK_SHADER_GROUP_SHADER_GENERAL_KHR uses the shader specified in 3575e5c31af7Sopenharmony_ci the group with 3576e5c31af7Sopenharmony_ci slink:VkRayTracingShaderGroupCreateInfoKHR::pname:generalShader 3577e5c31af7Sopenharmony_ci * ename:VK_SHADER_GROUP_SHADER_CLOSEST_HIT_KHR uses the shader specified 3578e5c31af7Sopenharmony_ci in the group with 3579e5c31af7Sopenharmony_ci slink:VkRayTracingShaderGroupCreateInfoKHR::pname:closestHitShader 3580e5c31af7Sopenharmony_ci * ename:VK_SHADER_GROUP_SHADER_ANY_HIT_KHR uses the shader specified in 3581e5c31af7Sopenharmony_ci the group with 3582e5c31af7Sopenharmony_ci slink:VkRayTracingShaderGroupCreateInfoKHR::pname:anyHitShader 3583e5c31af7Sopenharmony_ci * ename:VK_SHADER_GROUP_SHADER_INTERSECTION_KHR uses the shader specified 3584e5c31af7Sopenharmony_ci in the group with 3585e5c31af7Sopenharmony_ci slink:VkRayTracingShaderGroupCreateInfoKHR::pname:intersectionShader 3586e5c31af7Sopenharmony_ci-- 3587e5c31af7Sopenharmony_ci 3588e5c31af7Sopenharmony_ci 3589e5c31af7Sopenharmony_ci[open,refpage='vkCmdSetRayTracingPipelineStackSizeKHR',desc='Set the stack size dynamically for a ray tracing pipeline',type='protos'] 3590e5c31af7Sopenharmony_ci-- 3591e5c31af7Sopenharmony_ci:refpage: vkCmdSetRayTracingPipelineStackSizeKHR 3592e5c31af7Sopenharmony_ci 3593e5c31af7Sopenharmony_ciTo <<pipelines-dynamic-state, dynamically set>> the stack size for a ray 3594e5c31af7Sopenharmony_citracing pipeline, call: 3595e5c31af7Sopenharmony_ci 3596e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCmdSetRayTracingPipelineStackSizeKHR.txt[] 3597e5c31af7Sopenharmony_ci 3598e5c31af7Sopenharmony_ci * pname:commandBuffer is the command buffer into which the command will be 3599e5c31af7Sopenharmony_ci recorded. 3600e5c31af7Sopenharmony_ci * pname:pipelineStackSize is the stack size to use for subsequent ray 3601e5c31af7Sopenharmony_ci tracing trace commands. 3602e5c31af7Sopenharmony_ci 3603e5c31af7Sopenharmony_ciThis command sets the stack size for subsequent ray tracing commands when 3604e5c31af7Sopenharmony_cithe ray tracing pipeline is created with 3605e5c31af7Sopenharmony_ciename:VK_DYNAMIC_STATE_RAY_TRACING_PIPELINE_STACK_SIZE_KHR set in 3606e5c31af7Sopenharmony_cislink:VkPipelineDynamicStateCreateInfo::pname:pDynamicStates. 3607e5c31af7Sopenharmony_ciOtherwise, the stack size is computed as described in 3608e5c31af7Sopenharmony_ci<<ray-tracing-pipeline-stack, Ray Tracing Pipeline Stack>>. 3609e5c31af7Sopenharmony_ci 3610e5c31af7Sopenharmony_ci.Valid Usage 3611e5c31af7Sopenharmony_ci**** 3612e5c31af7Sopenharmony_ci * [[VUID-vkCmdSetRayTracingPipelineStackSizeKHR-pipelineStackSize-03610]] 3613e5c31af7Sopenharmony_ci pname:pipelineStackSize must: be large enough for any dynamic execution 3614e5c31af7Sopenharmony_ci through the shaders in the ray tracing pipeline used by a subsequent 3615e5c31af7Sopenharmony_ci trace call 3616e5c31af7Sopenharmony_ci**** 3617e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCmdSetRayTracingPipelineStackSizeKHR.txt[] 3618e5c31af7Sopenharmony_ci-- 3619e5c31af7Sopenharmony_ciendif::VK_KHR_ray_tracing_pipeline[] 3620e5c31af7Sopenharmony_ciendif::VK_NV_ray_tracing,VK_KHR_ray_tracing_pipeline[] 3621e5c31af7Sopenharmony_ci 3622e5c31af7Sopenharmony_ci 3623e5c31af7Sopenharmony_ci[[pipelines-destruction]] 3624e5c31af7Sopenharmony_ci== Pipeline Destruction 3625e5c31af7Sopenharmony_ci 3626e5c31af7Sopenharmony_ci[open,refpage='vkDestroyPipeline',desc='Destroy a pipeline object',type='protos'] 3627e5c31af7Sopenharmony_ci-- 3628e5c31af7Sopenharmony_ciTo destroy a pipeline, call: 3629e5c31af7Sopenharmony_ci 3630e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkDestroyPipeline.txt[] 3631e5c31af7Sopenharmony_ci 3632e5c31af7Sopenharmony_ci * pname:device is the logical device that destroys the pipeline. 3633e5c31af7Sopenharmony_ci * pname:pipeline is the handle of the pipeline to destroy. 3634e5c31af7Sopenharmony_ci * pname:pAllocator controls host memory allocation as described in the 3635e5c31af7Sopenharmony_ci <<memory-allocation, Memory Allocation>> chapter. 3636e5c31af7Sopenharmony_ci 3637e5c31af7Sopenharmony_ci.Valid Usage 3638e5c31af7Sopenharmony_ci**** 3639e5c31af7Sopenharmony_ci * [[VUID-vkDestroyPipeline-pipeline-00765]] 3640e5c31af7Sopenharmony_ci All submitted commands that refer to pname:pipeline must: have completed 3641e5c31af7Sopenharmony_ci execution 3642e5c31af7Sopenharmony_ci * [[VUID-vkDestroyPipeline-pipeline-00766]] 3643e5c31af7Sopenharmony_ci If sname:VkAllocationCallbacks were provided when pname:pipeline was 3644e5c31af7Sopenharmony_ci created, a compatible set of callbacks must: be provided here 3645e5c31af7Sopenharmony_ci * [[VUID-vkDestroyPipeline-pipeline-00767]] 3646e5c31af7Sopenharmony_ci If no sname:VkAllocationCallbacks were provided when pname:pipeline was 3647e5c31af7Sopenharmony_ci created, pname:pAllocator must: be `NULL` 3648e5c31af7Sopenharmony_ci**** 3649e5c31af7Sopenharmony_ci 3650e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkDestroyPipeline.txt[] 3651e5c31af7Sopenharmony_ci-- 3652e5c31af7Sopenharmony_ci 3653e5c31af7Sopenharmony_ci 3654e5c31af7Sopenharmony_ci[[pipelines-multiple]] 3655e5c31af7Sopenharmony_ci== Multiple Pipeline Creation 3656e5c31af7Sopenharmony_ci 3657e5c31af7Sopenharmony_ciMultiple pipelines can: be created simultaneously by passing an array of 3658e5c31af7Sopenharmony_cislink:VkGraphicsPipelineCreateInfo, 3659e5c31af7Sopenharmony_ciifdef::VK_KHR_ray_tracing_pipeline[slink:VkRayTracingPipelineCreateInfoKHR,] 3660e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing[slink:VkRayTracingPipelineCreateInfoNV,] 3661e5c31af7Sopenharmony_cior slink:VkComputePipelineCreateInfo structures into the 3662e5c31af7Sopenharmony_ciflink:vkCreateGraphicsPipelines, 3663e5c31af7Sopenharmony_ciifdef::VK_KHR_ray_tracing_pipeline[flink:vkCreateRayTracingPipelinesKHR,] 3664e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing[flink:vkCreateRayTracingPipelinesNV,] 3665e5c31af7Sopenharmony_ciand flink:vkCreateComputePipelines commands, respectively. 3666e5c31af7Sopenharmony_ciApplications can: group together similar pipelines to be created in a single 3667e5c31af7Sopenharmony_cicall, and implementations are encouraged to look for reuse opportunities 3668e5c31af7Sopenharmony_ciwithin a group-create. 3669e5c31af7Sopenharmony_ci 3670e5c31af7Sopenharmony_ciWhen an application attempts to create many pipelines in a single command, 3671e5c31af7Sopenharmony_ciit is possible that some subset may: fail creation. 3672e5c31af7Sopenharmony_ciIn that case, the corresponding entries in the pname:pPipelines output array 3673e5c31af7Sopenharmony_ciwill be filled with dlink:VK_NULL_HANDLE values. 3674e5c31af7Sopenharmony_ciIf any pipeline fails creation despite valid arguments (for example, due to 3675e5c31af7Sopenharmony_ciout of memory errors), the elink:VkResult code returned by 3676e5c31af7Sopenharmony_ciftext:vkCreate*Pipelines will indicate why. 3677e5c31af7Sopenharmony_ciThe implementation will attempt to create all pipelines, and only return 3678e5c31af7Sopenharmony_cidlink:VK_NULL_HANDLE values for those that actually failed. 3679e5c31af7Sopenharmony_ci 3680e5c31af7Sopenharmony_ciifdef::VK_EXT_pipeline_creation_cache_control[] 3681e5c31af7Sopenharmony_ciIf creation fails for a pipeline that had 3682e5c31af7Sopenharmony_ciename:VK_PIPELINE_CREATE_EARLY_RETURN_ON_FAILURE_BIT_EXT set, pipelines at 3683e5c31af7Sopenharmony_cian index in the pname:pPipelines array greater than or equal to that of the 3684e5c31af7Sopenharmony_cifailing pipeline must: be set to dlink:VK_NULL_HANDLE. 3685e5c31af7Sopenharmony_ciendif::VK_EXT_pipeline_creation_cache_control[] 3686e5c31af7Sopenharmony_ci 3687e5c31af7Sopenharmony_ci[[pipelines-pipeline-derivatives]] 3688e5c31af7Sopenharmony_ci== Pipeline Derivatives 3689e5c31af7Sopenharmony_ci 3690e5c31af7Sopenharmony_ciA pipeline derivative is a child pipeline created from a parent pipeline, 3691e5c31af7Sopenharmony_ciwhere the child and parent are expected to have much commonality. 3692e5c31af7Sopenharmony_ciThe goal of derivative pipelines is that they be cheaper to create using the 3693e5c31af7Sopenharmony_ciparent as a starting point, and that it be more efficient (on either host or 3694e5c31af7Sopenharmony_cidevice) to switch/bind between children of the same parent. 3695e5c31af7Sopenharmony_ci 3696e5c31af7Sopenharmony_ciA derivative pipeline is created by setting the 3697e5c31af7Sopenharmony_ciename:VK_PIPELINE_CREATE_DERIVATIVE_BIT flag in the 3698e5c31af7Sopenharmony_cistext:Vk*PipelineCreateInfo structure. 3699e5c31af7Sopenharmony_ciIf this is set, then exactly one of pname:basePipelineHandle or 3700e5c31af7Sopenharmony_cipname:basePipelineIndex members of the structure must: have a valid 3701e5c31af7Sopenharmony_cihandle/index, and specifies the parent pipeline. 3702e5c31af7Sopenharmony_ciIf pname:basePipelineHandle is used, the parent pipeline must: have already 3703e5c31af7Sopenharmony_cibeen created. 3704e5c31af7Sopenharmony_ciIf pname:basePipelineIndex is used, then the parent is being created in the 3705e5c31af7Sopenharmony_cisame command. 3706e5c31af7Sopenharmony_cidlink:VK_NULL_HANDLE acts as the invalid handle for 3707e5c31af7Sopenharmony_cipname:basePipelineHandle, and -1 is the invalid index for 3708e5c31af7Sopenharmony_cipname:basePipelineIndex. 3709e5c31af7Sopenharmony_ciIf pname:basePipelineIndex is used, the base pipeline must: appear earlier 3710e5c31af7Sopenharmony_ciin the array. 3711e5c31af7Sopenharmony_ciThe base pipeline must: have been created with the 3712e5c31af7Sopenharmony_ciename:VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT flag set. 3713e5c31af7Sopenharmony_ci 3714e5c31af7Sopenharmony_ci 3715e5c31af7Sopenharmony_ci[[pipelines-cache]] 3716e5c31af7Sopenharmony_ci== Pipeline Cache 3717e5c31af7Sopenharmony_ci 3718e5c31af7Sopenharmony_ci[open,refpage='VkPipelineCache',desc='Opaque handle to a pipeline cache object',type='handles'] 3719e5c31af7Sopenharmony_ci-- 3720e5c31af7Sopenharmony_ciPipeline cache objects allow the result of pipeline construction to be 3721e5c31af7Sopenharmony_cireused between pipelines and between runs of an application. 3722e5c31af7Sopenharmony_ciReuse between pipelines is achieved by passing the same pipeline cache 3723e5c31af7Sopenharmony_ciobject when creating multiple related pipelines. 3724e5c31af7Sopenharmony_ciReuse across runs of an application is achieved by retrieving pipeline cache 3725e5c31af7Sopenharmony_cicontents in one run of an application, saving the contents, and using them 3726e5c31af7Sopenharmony_cito preinitialize a pipeline cache on a subsequent run. 3727e5c31af7Sopenharmony_ciThe contents of the pipeline cache objects are managed by the 3728e5c31af7Sopenharmony_ciimplementation. 3729e5c31af7Sopenharmony_ciApplications can: manage the host memory consumed by a pipeline cache object 3730e5c31af7Sopenharmony_ciand control the amount of data retrieved from a pipeline cache object. 3731e5c31af7Sopenharmony_ci 3732e5c31af7Sopenharmony_ciPipeline cache objects are represented by sname:VkPipelineCache handles: 3733e5c31af7Sopenharmony_ci 3734e5c31af7Sopenharmony_ciinclude::{generated}/api/handles/VkPipelineCache.txt[] 3735e5c31af7Sopenharmony_ci-- 3736e5c31af7Sopenharmony_ci 3737e5c31af7Sopenharmony_ci[[pipelines-cache-create]] 3738e5c31af7Sopenharmony_ci=== Creating a Pipeline Cache 3739e5c31af7Sopenharmony_ci 3740e5c31af7Sopenharmony_ci[open,refpage='vkCreatePipelineCache',desc='Creates a new pipeline cache',type='protos'] 3741e5c31af7Sopenharmony_ci-- 3742e5c31af7Sopenharmony_ciTo create pipeline cache objects, call: 3743e5c31af7Sopenharmony_ci 3744e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCreatePipelineCache.txt[] 3745e5c31af7Sopenharmony_ci 3746e5c31af7Sopenharmony_ci * pname:device is the logical device that creates the pipeline cache 3747e5c31af7Sopenharmony_ci object. 3748e5c31af7Sopenharmony_ci * pname:pCreateInfo is a pointer to a slink:VkPipelineCacheCreateInfo 3749e5c31af7Sopenharmony_ci structure containing initial parameters for the pipeline cache object. 3750e5c31af7Sopenharmony_ci * pname:pAllocator controls host memory allocation as described in the 3751e5c31af7Sopenharmony_ci <<memory-allocation, Memory Allocation>> chapter. 3752e5c31af7Sopenharmony_ci * pname:pPipelineCache is a pointer to a slink:VkPipelineCache handle in 3753e5c31af7Sopenharmony_ci which the resulting pipeline cache object is returned. 3754e5c31af7Sopenharmony_ci 3755e5c31af7Sopenharmony_ci[NOTE] 3756e5c31af7Sopenharmony_ci.Note 3757e5c31af7Sopenharmony_ci==== 3758e5c31af7Sopenharmony_ciApplications can: track and manage the total host memory size of a pipeline 3759e5c31af7Sopenharmony_cicache object using the pname:pAllocator. 3760e5c31af7Sopenharmony_ciApplications can: limit the amount of data retrieved from a pipeline cache 3761e5c31af7Sopenharmony_ciobject in fname:vkGetPipelineCacheData. 3762e5c31af7Sopenharmony_ciImplementations should: not internally limit the total number of entries 3763e5c31af7Sopenharmony_ciadded to a pipeline cache object or the total host memory consumed. 3764e5c31af7Sopenharmony_ci==== 3765e5c31af7Sopenharmony_ci 3766e5c31af7Sopenharmony_ciOnce created, a pipeline cache can: be passed to the 3767e5c31af7Sopenharmony_ciflink:vkCreateGraphicsPipelines 3768e5c31af7Sopenharmony_ciifdef::VK_KHR_ray_tracing_pipeline[flink:vkCreateRayTracingPipelinesKHR,] 3769e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing[flink:vkCreateRayTracingPipelinesNV,] 3770e5c31af7Sopenharmony_ciand flink:vkCreateComputePipelines commands. 3771e5c31af7Sopenharmony_ciIf the pipeline cache passed into these commands is not 3772e5c31af7Sopenharmony_cidlink:VK_NULL_HANDLE, the implementation will query it for possible reuse 3773e5c31af7Sopenharmony_ciopportunities and update it with new content. 3774e5c31af7Sopenharmony_ciThe use of the pipeline cache object in these commands is internally 3775e5c31af7Sopenharmony_cisynchronized, and the same pipeline cache object can: be used in multiple 3776e5c31af7Sopenharmony_cithreads simultaneously. 3777e5c31af7Sopenharmony_ci 3778e5c31af7Sopenharmony_ciifdef::VK_EXT_pipeline_creation_cache_control[] 3779e5c31af7Sopenharmony_ciIf pname:flags of pname:pCreateInfo includes 3780e5c31af7Sopenharmony_ciename:VK_PIPELINE_CACHE_CREATE_EXTERNALLY_SYNCHRONIZED_BIT_EXT, all commands 3781e5c31af7Sopenharmony_cithat modify the returned pipeline cache object must: be 3782e5c31af7Sopenharmony_ci<<fundamentals-threadingbehavior,externally synchronized>>. 3783e5c31af7Sopenharmony_ciendif::VK_EXT_pipeline_creation_cache_control[] 3784e5c31af7Sopenharmony_ci 3785e5c31af7Sopenharmony_ci[NOTE] 3786e5c31af7Sopenharmony_ci.Note 3787e5c31af7Sopenharmony_ci==== 3788e5c31af7Sopenharmony_ciImplementations should: make every effort to limit any critical sections to 3789e5c31af7Sopenharmony_cithe actual accesses to the cache, which is expected to be significantly 3790e5c31af7Sopenharmony_cishorter than the duration of the ftext:vkCreate*Pipelines commands. 3791e5c31af7Sopenharmony_ci==== 3792e5c31af7Sopenharmony_ci 3793e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCreatePipelineCache.txt[] 3794e5c31af7Sopenharmony_ci-- 3795e5c31af7Sopenharmony_ci 3796e5c31af7Sopenharmony_ci[open,refpage='VkPipelineCacheCreateInfo',desc='Structure specifying parameters of a newly created pipeline cache',type='structs'] 3797e5c31af7Sopenharmony_ci-- 3798e5c31af7Sopenharmony_ciThe sname:VkPipelineCacheCreateInfo structure is defined as: 3799e5c31af7Sopenharmony_ci 3800e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkPipelineCacheCreateInfo.txt[] 3801e5c31af7Sopenharmony_ci 3802e5c31af7Sopenharmony_ci * pname:sType is the type of this structure. 3803e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 3804e5c31af7Sopenharmony_ci structure. 3805e5c31af7Sopenharmony_ciifdef::VK_EXT_pipeline_creation_cache_control[] 3806e5c31af7Sopenharmony_ci * pname:flags is a bitmask of elink:VkPipelineCacheCreateFlagBits 3807e5c31af7Sopenharmony_ci specifying the behavior of the pipeline cache. 3808e5c31af7Sopenharmony_ciendif::VK_EXT_pipeline_creation_cache_control[] 3809e5c31af7Sopenharmony_ciifndef::VK_EXT_pipeline_creation_cache_control[] 3810e5c31af7Sopenharmony_ci * pname:flags is reserved for future use. 3811e5c31af7Sopenharmony_ciendif::VK_EXT_pipeline_creation_cache_control[] 3812e5c31af7Sopenharmony_ci * pname:initialDataSize is the number of bytes in pname:pInitialData. 3813e5c31af7Sopenharmony_ci If pname:initialDataSize is zero, the pipeline cache will initially be 3814e5c31af7Sopenharmony_ci empty. 3815e5c31af7Sopenharmony_ci * pname:pInitialData is a pointer to previously retrieved pipeline cache 3816e5c31af7Sopenharmony_ci data. 3817e5c31af7Sopenharmony_ci If the pipeline cache data is incompatible (as defined below) with the 3818e5c31af7Sopenharmony_ci device, the pipeline cache will be initially empty. 3819e5c31af7Sopenharmony_ci If pname:initialDataSize is zero, pname:pInitialData is ignored. 3820e5c31af7Sopenharmony_ci 3821e5c31af7Sopenharmony_ci.Valid Usage 3822e5c31af7Sopenharmony_ci**** 3823e5c31af7Sopenharmony_ci * [[VUID-VkPipelineCacheCreateInfo-initialDataSize-00768]] 3824e5c31af7Sopenharmony_ci If pname:initialDataSize is not `0`, it must: be equal to the size of 3825e5c31af7Sopenharmony_ci pname:pInitialData, as returned by fname:vkGetPipelineCacheData when 3826e5c31af7Sopenharmony_ci pname:pInitialData was originally retrieved 3827e5c31af7Sopenharmony_ci * [[VUID-VkPipelineCacheCreateInfo-initialDataSize-00769]] 3828e5c31af7Sopenharmony_ci If pname:initialDataSize is not `0`, pname:pInitialData must: have been 3829e5c31af7Sopenharmony_ci retrieved from a previous call to fname:vkGetPipelineCacheData 3830e5c31af7Sopenharmony_ciifdef::VK_EXT_pipeline_creation_cache_control[] 3831e5c31af7Sopenharmony_ci * [[VUID-VkPipelineCacheCreateInfo-pipelineCreationCacheControl-02892]] 3832e5c31af7Sopenharmony_ci If the <<features-pipelineCreationCacheControl, 3833e5c31af7Sopenharmony_ci pname:pipelineCreationCacheControl>> feature is not enabled, pname:flags 3834e5c31af7Sopenharmony_ci must: not include 3835e5c31af7Sopenharmony_ci ename:VK_PIPELINE_CACHE_CREATE_EXTERNALLY_SYNCHRONIZED_BIT_EXT 3836e5c31af7Sopenharmony_ciendif::VK_EXT_pipeline_creation_cache_control[] 3837e5c31af7Sopenharmony_ci**** 3838e5c31af7Sopenharmony_ci 3839e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkPipelineCacheCreateInfo.txt[] 3840e5c31af7Sopenharmony_ci-- 3841e5c31af7Sopenharmony_ci 3842e5c31af7Sopenharmony_ci[open,refpage='VkPipelineCacheCreateFlags', desc='Bitmask of VkPipelineCreateFlagBits', type='flags'] 3843e5c31af7Sopenharmony_ci-- 3844e5c31af7Sopenharmony_ciinclude::{generated}/api/flags/VkPipelineCacheCreateFlags.txt[] 3845e5c31af7Sopenharmony_ci 3846e5c31af7Sopenharmony_ciifdef::VK_EXT_pipeline_creation_cache_control[] 3847e5c31af7Sopenharmony_citname:VkPipelineCacheCreateFlags is a bitmask type for setting a mask of 3848e5c31af7Sopenharmony_cizero or more elink:VkPipelineCacheCreateFlagBits. 3849e5c31af7Sopenharmony_ciendif::VK_EXT_pipeline_creation_cache_control[] 3850e5c31af7Sopenharmony_ciifndef::VK_EXT_pipeline_creation_cache_control[] 3851e5c31af7Sopenharmony_citname:VkPipelineCacheCreateFlags is a bitmask type for setting a mask, but 3852e5c31af7Sopenharmony_ciis currently reserved for future use. 3853e5c31af7Sopenharmony_ciendif::VK_EXT_pipeline_creation_cache_control[] 3854e5c31af7Sopenharmony_ci-- 3855e5c31af7Sopenharmony_ci 3856e5c31af7Sopenharmony_ciifdef::VK_EXT_pipeline_creation_cache_control[] 3857e5c31af7Sopenharmony_ci[open,refpage='VkPipelineCacheCreateFlagBits',desc='Bitmask specifying the behavior of the pipeline cache',type='enums'] 3858e5c31af7Sopenharmony_ci-- 3859e5c31af7Sopenharmony_ciPossible values of the pname:flags member of 3860e5c31af7Sopenharmony_cislink:VkPipelineCacheCreateInfo, specifying the behavior of the pipeline 3861e5c31af7Sopenharmony_cicache, are: 3862e5c31af7Sopenharmony_ci 3863e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkPipelineCacheCreateFlagBits.txt[] 3864e5c31af7Sopenharmony_ci 3865e5c31af7Sopenharmony_ci * ename:VK_PIPELINE_CACHE_CREATE_EXTERNALLY_SYNCHRONIZED_BIT_EXT specifies 3866e5c31af7Sopenharmony_ci that all commands that modify the created slink:VkPipelineCache will be 3867e5c31af7Sopenharmony_ci <<fundamentals-threadingbehavior,externally synchronized>>. 3868e5c31af7Sopenharmony_ci When set, the implementation may: skip any unnecessary processing needed 3869e5c31af7Sopenharmony_ci to support simultaneous modification from multiple threads where 3870e5c31af7Sopenharmony_ci allowed. 3871e5c31af7Sopenharmony_ci-- 3872e5c31af7Sopenharmony_ciendif::VK_EXT_pipeline_creation_cache_control[] 3873e5c31af7Sopenharmony_ci 3874e5c31af7Sopenharmony_ci 3875e5c31af7Sopenharmony_ci[[pipelines-cache-merge]] 3876e5c31af7Sopenharmony_ci=== Merging Pipeline Caches 3877e5c31af7Sopenharmony_ci 3878e5c31af7Sopenharmony_ci[open,refpage='vkMergePipelineCaches',desc='Combine the data stores of pipeline caches',type='protos'] 3879e5c31af7Sopenharmony_ci-- 3880e5c31af7Sopenharmony_ciPipeline cache objects can: be merged using the command: 3881e5c31af7Sopenharmony_ci 3882e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkMergePipelineCaches.txt[] 3883e5c31af7Sopenharmony_ci 3884e5c31af7Sopenharmony_ci * pname:device is the logical device that owns the pipeline cache objects. 3885e5c31af7Sopenharmony_ci * pname:dstCache is the handle of the pipeline cache to merge results 3886e5c31af7Sopenharmony_ci into. 3887e5c31af7Sopenharmony_ci * pname:srcCacheCount is the length of the pname:pSrcCaches array. 3888e5c31af7Sopenharmony_ci * pname:pSrcCaches is a pointer to an array of pipeline cache handles, 3889e5c31af7Sopenharmony_ci which will be merged into pname:dstCache. 3890e5c31af7Sopenharmony_ci The previous contents of pname:dstCache are included after the merge. 3891e5c31af7Sopenharmony_ci 3892e5c31af7Sopenharmony_ci[NOTE] 3893e5c31af7Sopenharmony_ci.Note 3894e5c31af7Sopenharmony_ci==== 3895e5c31af7Sopenharmony_ciThe details of the merge operation are implementation-dependent, but 3896e5c31af7Sopenharmony_ciimplementations should: merge the contents of the specified pipelines and 3897e5c31af7Sopenharmony_ciprune duplicate entries. 3898e5c31af7Sopenharmony_ci==== 3899e5c31af7Sopenharmony_ci 3900e5c31af7Sopenharmony_ci.Valid Usage 3901e5c31af7Sopenharmony_ci**** 3902e5c31af7Sopenharmony_ci * [[VUID-vkMergePipelineCaches-dstCache-00770]] 3903e5c31af7Sopenharmony_ci pname:dstCache must: not appear in the list of source caches 3904e5c31af7Sopenharmony_ci**** 3905e5c31af7Sopenharmony_ci 3906e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkMergePipelineCaches.txt[] 3907e5c31af7Sopenharmony_ci-- 3908e5c31af7Sopenharmony_ci 3909e5c31af7Sopenharmony_ci[[pipelines-cache-retrieval]] 3910e5c31af7Sopenharmony_ci=== Retrieving Pipeline Cache Data 3911e5c31af7Sopenharmony_ci 3912e5c31af7Sopenharmony_ci[open,refpage='vkGetPipelineCacheData',desc='Get the data store from a pipeline cache',type='protos'] 3913e5c31af7Sopenharmony_ci-- 3914e5c31af7Sopenharmony_ciData can: be retrieved from a pipeline cache object using the command: 3915e5c31af7Sopenharmony_ci 3916e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkGetPipelineCacheData.txt[] 3917e5c31af7Sopenharmony_ci 3918e5c31af7Sopenharmony_ci * pname:device is the logical device that owns the pipeline cache. 3919e5c31af7Sopenharmony_ci * pname:pipelineCache is the pipeline cache to retrieve data from. 3920e5c31af7Sopenharmony_ci * pname:pDataSize is a pointer to a code:size_t value related to the 3921e5c31af7Sopenharmony_ci amount of data in the pipeline cache, as described below. 3922e5c31af7Sopenharmony_ci * pname:pData is either `NULL` or a pointer to a buffer. 3923e5c31af7Sopenharmony_ci 3924e5c31af7Sopenharmony_ciIf pname:pData is `NULL`, then the maximum size of the data that can: be 3925e5c31af7Sopenharmony_ciretrieved from the pipeline cache, in bytes, is returned in pname:pDataSize. 3926e5c31af7Sopenharmony_ciOtherwise, pname:pDataSize must: point to a variable set by the user to the 3927e5c31af7Sopenharmony_cisize of the buffer, in bytes, pointed to by pname:pData, and on return the 3928e5c31af7Sopenharmony_civariable is overwritten with the amount of data actually written to 3929e5c31af7Sopenharmony_cipname:pData. 3930e5c31af7Sopenharmony_ciIf pname:pDataSize is less than the maximum size that can: be retrieved by 3931e5c31af7Sopenharmony_cithe pipeline cache, at most pname:pDataSize bytes will be written to 3932e5c31af7Sopenharmony_cipname:pData, and ename:VK_INCOMPLETE will be returned instead of 3933e5c31af7Sopenharmony_ciename:VK_SUCCESS, to indicate that not all of the pipeline cache was 3934e5c31af7Sopenharmony_cireturned. 3935e5c31af7Sopenharmony_ci 3936e5c31af7Sopenharmony_ciAny data written to pname:pData is valid and can: be provided as the 3937e5c31af7Sopenharmony_cipname:pInitialData member of the slink:VkPipelineCacheCreateInfo structure 3938e5c31af7Sopenharmony_cipassed to fname:vkCreatePipelineCache. 3939e5c31af7Sopenharmony_ci 3940e5c31af7Sopenharmony_ciTwo calls to fname:vkGetPipelineCacheData with the same parameters must: 3941e5c31af7Sopenharmony_ciretrieve the same data unless a command that modifies the contents of the 3942e5c31af7Sopenharmony_cicache is called between them. 3943e5c31af7Sopenharmony_ci 3944e5c31af7Sopenharmony_ciThe initial bytes written to pname:pData must: be a header as described in 3945e5c31af7Sopenharmony_cithe <<pipelines-cache-header, Pipeline Cache Header>> section. 3946e5c31af7Sopenharmony_ci 3947e5c31af7Sopenharmony_ciIf pname:pDataSize is less than what is necessary to store this header, 3948e5c31af7Sopenharmony_cinothing will be written to pname:pData and zero will be written to 3949e5c31af7Sopenharmony_cipname:pDataSize. 3950e5c31af7Sopenharmony_ci 3951e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkGetPipelineCacheData.txt[] 3952e5c31af7Sopenharmony_ci-- 3953e5c31af7Sopenharmony_ci 3954e5c31af7Sopenharmony_ci[[pipelines-cache-header]] 3955e5c31af7Sopenharmony_ci=== Pipeline Cache Header 3956e5c31af7Sopenharmony_ci 3957e5c31af7Sopenharmony_ciApplications can: store the data retrieved from the pipeline cache, and use 3958e5c31af7Sopenharmony_cithese data, possibly in a future run of the application, to populate new 3959e5c31af7Sopenharmony_cipipeline cache objects. 3960e5c31af7Sopenharmony_ciThe results of pipeline compiles, however, may: depend on the vendor ID, 3961e5c31af7Sopenharmony_cidevice ID, driver version, and other details of the device. 3962e5c31af7Sopenharmony_ciTo enable applications to detect when previously retrieved data is 3963e5c31af7Sopenharmony_ciincompatible with the device, the pipeline cache data must: begin with a 3964e5c31af7Sopenharmony_civalid pipeline cache header. 3965e5c31af7Sopenharmony_ci 3966e5c31af7Sopenharmony_ci[open,refpage='VkPipelineCacheHeaderVersionOne',desc='Structure describing the layout of the pipeline cache header',type='structs'] 3967e5c31af7Sopenharmony_ci-- 3968e5c31af7Sopenharmony_ciVersion one of the pipeline cache header is defined as: 3969e5c31af7Sopenharmony_ci 3970e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkPipelineCacheHeaderVersionOne.txt[] 3971e5c31af7Sopenharmony_ci 3972e5c31af7Sopenharmony_ci * pname:headerSize is the length in bytes of the pipeline cache header. 3973e5c31af7Sopenharmony_ci * pname:headerVersion is a elink:VkPipelineCacheHeaderVersion enum value 3974e5c31af7Sopenharmony_ci specifying the version of the header. 3975e5c31af7Sopenharmony_ci A consumer of the pipeline cache should: use the cache version to 3976e5c31af7Sopenharmony_ci interpret the remainder of the cache header. 3977e5c31af7Sopenharmony_ci * pname:vendorID is the sname:VkPhysicalDeviceProperties::pname:vendorID 3978e5c31af7Sopenharmony_ci of the implementation. 3979e5c31af7Sopenharmony_ci * pname:deviceID is the sname:VkPhysicalDeviceProperties::pname:deviceID 3980e5c31af7Sopenharmony_ci of the implementation. 3981e5c31af7Sopenharmony_ci * pname:pipelineCacheUUID is the 3982e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceProperties::pname:pipelineCacheUUID of the 3983e5c31af7Sopenharmony_ci implementation. 3984e5c31af7Sopenharmony_ci 3985e5c31af7Sopenharmony_ciUnlike most structures declared by the Vulkan API, all fields of this 3986e5c31af7Sopenharmony_cistructure are written with the least significant byte first, regardless of 3987e5c31af7Sopenharmony_cihost byte-order. 3988e5c31af7Sopenharmony_ci 3989e5c31af7Sopenharmony_ciThe C language specification does not define the packing of structure 3990e5c31af7Sopenharmony_cimembers. 3991e5c31af7Sopenharmony_ciThis layout assumes tight structure member packing, with members laid out in 3992e5c31af7Sopenharmony_cithe order listed in the structure, and the intended size of the structure is 3993e5c31af7Sopenharmony_ci32 bytes. 3994e5c31af7Sopenharmony_ciIf a compiler produces code that diverges from that pattern, applications 3995e5c31af7Sopenharmony_cimust: employ another method to set values at the correct offsets. 3996e5c31af7Sopenharmony_ci 3997e5c31af7Sopenharmony_ci.Valid Usage 3998e5c31af7Sopenharmony_ci**** 3999e5c31af7Sopenharmony_ci * [[VUID-VkPipelineCacheHeaderVersionOne-headerSize-04967]] 4000e5c31af7Sopenharmony_ci pname:headerSize must: be 32 4001e5c31af7Sopenharmony_ci * [[VUID-VkPipelineCacheHeaderVersionOne-headerVersion-04968]] 4002e5c31af7Sopenharmony_ci pname:headerVersion must: be ename:VK_PIPELINE_CACHE_HEADER_VERSION_ONE 4003e5c31af7Sopenharmony_ci**** 4004e5c31af7Sopenharmony_ci 4005e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkPipelineCacheHeaderVersionOne.txt[] 4006e5c31af7Sopenharmony_ci-- 4007e5c31af7Sopenharmony_ci 4008e5c31af7Sopenharmony_ci 4009e5c31af7Sopenharmony_ci[open,refpage='VkPipelineCacheHeaderVersion',desc='Encode pipeline cache version',type='enums',xrefs='vkCreatePipelineCache vkGetPipelineCacheData'] 4010e5c31af7Sopenharmony_ci-- 4011e5c31af7Sopenharmony_ciPossible values of the pname:headerVersion value of the pipeline cache 4012e5c31af7Sopenharmony_ciheader are: 4013e5c31af7Sopenharmony_ci 4014e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkPipelineCacheHeaderVersion.txt[] 4015e5c31af7Sopenharmony_ci 4016e5c31af7Sopenharmony_ci * ename:VK_PIPELINE_CACHE_HEADER_VERSION_ONE specifies version one of the 4017e5c31af7Sopenharmony_ci pipeline cache. 4018e5c31af7Sopenharmony_ci-- 4019e5c31af7Sopenharmony_ci 4020e5c31af7Sopenharmony_ci[[pipelines-cache-destroy]] 4021e5c31af7Sopenharmony_ci=== Destroying a Pipeline Cache 4022e5c31af7Sopenharmony_ci 4023e5c31af7Sopenharmony_ci[open,refpage='vkDestroyPipelineCache',desc='Destroy a pipeline cache object',type='protos'] 4024e5c31af7Sopenharmony_ci-- 4025e5c31af7Sopenharmony_ciTo destroy a pipeline cache, call: 4026e5c31af7Sopenharmony_ci 4027e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkDestroyPipelineCache.txt[] 4028e5c31af7Sopenharmony_ci 4029e5c31af7Sopenharmony_ci * pname:device is the logical device that destroys the pipeline cache 4030e5c31af7Sopenharmony_ci object. 4031e5c31af7Sopenharmony_ci * pname:pipelineCache is the handle of the pipeline cache to destroy. 4032e5c31af7Sopenharmony_ci * pname:pAllocator controls host memory allocation as described in the 4033e5c31af7Sopenharmony_ci <<memory-allocation, Memory Allocation>> chapter. 4034e5c31af7Sopenharmony_ci 4035e5c31af7Sopenharmony_ci.Valid Usage 4036e5c31af7Sopenharmony_ci**** 4037e5c31af7Sopenharmony_ci * [[VUID-vkDestroyPipelineCache-pipelineCache-00771]] 4038e5c31af7Sopenharmony_ci If sname:VkAllocationCallbacks were provided when pname:pipelineCache 4039e5c31af7Sopenharmony_ci was created, a compatible set of callbacks must: be provided here 4040e5c31af7Sopenharmony_ci * [[VUID-vkDestroyPipelineCache-pipelineCache-00772]] 4041e5c31af7Sopenharmony_ci If no sname:VkAllocationCallbacks were provided when pname:pipelineCache 4042e5c31af7Sopenharmony_ci was created, pname:pAllocator must: be `NULL` 4043e5c31af7Sopenharmony_ci**** 4044e5c31af7Sopenharmony_ci 4045e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkDestroyPipelineCache.txt[] 4046e5c31af7Sopenharmony_ci-- 4047e5c31af7Sopenharmony_ci 4048e5c31af7Sopenharmony_ci 4049e5c31af7Sopenharmony_ci[[pipelines-specialization-constants]] 4050e5c31af7Sopenharmony_ci== Specialization Constants 4051e5c31af7Sopenharmony_ci 4052e5c31af7Sopenharmony_ciSpecialization constants are a mechanism whereby constants in a SPIR-V 4053e5c31af7Sopenharmony_cimodule can: have their constant value specified at the time the 4054e5c31af7Sopenharmony_cisname:VkPipeline is created. 4055e5c31af7Sopenharmony_ciThis allows a SPIR-V module to have constants that can: be modified while 4056e5c31af7Sopenharmony_ciexecuting an application that uses the Vulkan API. 4057e5c31af7Sopenharmony_ci 4058e5c31af7Sopenharmony_ci[NOTE] 4059e5c31af7Sopenharmony_ci.Note 4060e5c31af7Sopenharmony_ci==== 4061e5c31af7Sopenharmony_ciSpecialization constants are useful to allow a compute shader to have its 4062e5c31af7Sopenharmony_cilocal workgroup size changed at runtime by the user, for example. 4063e5c31af7Sopenharmony_ci==== 4064e5c31af7Sopenharmony_ci 4065e5c31af7Sopenharmony_ciEach slink:VkPipelineShaderStageCreateInfo structure contains a 4066e5c31af7Sopenharmony_cipname:pSpecializationInfo member, which can: be `NULL` to indicate no 4067e5c31af7Sopenharmony_cispecialization constants, or point to a sname:VkSpecializationInfo 4068e5c31af7Sopenharmony_cistructure. 4069e5c31af7Sopenharmony_ci 4070e5c31af7Sopenharmony_ci[open,refpage='VkSpecializationInfo',desc='Structure specifying specialization information',type='structs'] 4071e5c31af7Sopenharmony_ci-- 4072e5c31af7Sopenharmony_ciThe sname:VkSpecializationInfo structure is defined as: 4073e5c31af7Sopenharmony_ci 4074e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkSpecializationInfo.txt[] 4075e5c31af7Sopenharmony_ci 4076e5c31af7Sopenharmony_ci * pname:mapEntryCount is the number of entries in the pname:pMapEntries 4077e5c31af7Sopenharmony_ci array. 4078e5c31af7Sopenharmony_ci * pname:pMapEntries is a pointer to an array of 4079e5c31af7Sopenharmony_ci sname:VkSpecializationMapEntry structures which map constant IDs to 4080e5c31af7Sopenharmony_ci offsets in pname:pData. 4081e5c31af7Sopenharmony_ci * pname:dataSize is the byte size of the pname:pData buffer. 4082e5c31af7Sopenharmony_ci * pname:pData contains the actual constant values to specialize with. 4083e5c31af7Sopenharmony_ci 4084e5c31af7Sopenharmony_ci.Valid Usage 4085e5c31af7Sopenharmony_ci**** 4086e5c31af7Sopenharmony_ci * [[VUID-VkSpecializationInfo-offset-00773]] 4087e5c31af7Sopenharmony_ci The pname:offset member of each element of pname:pMapEntries must: be 4088e5c31af7Sopenharmony_ci less than pname:dataSize 4089e5c31af7Sopenharmony_ci * [[VUID-VkSpecializationInfo-pMapEntries-00774]] 4090e5c31af7Sopenharmony_ci The pname:size member of each element of pname:pMapEntries must: be less 4091e5c31af7Sopenharmony_ci than or equal to pname:dataSize minus pname:offset 4092e5c31af7Sopenharmony_ci * [[VUID-VkSpecializationInfo-constantID-04911]] 4093e5c31af7Sopenharmony_ci The pname:constantID value of each element of pname:pMapEntries must: be 4094e5c31af7Sopenharmony_ci unique within pname:pMapEntries 4095e5c31af7Sopenharmony_ci**** 4096e5c31af7Sopenharmony_ci 4097e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkSpecializationInfo.txt[] 4098e5c31af7Sopenharmony_ci-- 4099e5c31af7Sopenharmony_ci 4100e5c31af7Sopenharmony_ci[open,refpage='VkSpecializationMapEntry',desc='Structure specifying a specialization map entry',type='structs'] 4101e5c31af7Sopenharmony_ci-- 4102e5c31af7Sopenharmony_ciThe sname:VkSpecializationMapEntry structure is defined as: 4103e5c31af7Sopenharmony_ci 4104e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkSpecializationMapEntry.txt[] 4105e5c31af7Sopenharmony_ci 4106e5c31af7Sopenharmony_ci * pname:constantID is the ID of the specialization constant in SPIR-V. 4107e5c31af7Sopenharmony_ci * pname:offset is the byte offset of the specialization constant value 4108e5c31af7Sopenharmony_ci within the supplied data buffer. 4109e5c31af7Sopenharmony_ci * pname:size is the byte size of the specialization constant value within 4110e5c31af7Sopenharmony_ci the supplied data buffer. 4111e5c31af7Sopenharmony_ci 4112e5c31af7Sopenharmony_ciIf a pname:constantID value is not a specialization constant ID used in the 4113e5c31af7Sopenharmony_cishader, that map entry does not affect the behavior of the pipeline. 4114e5c31af7Sopenharmony_ci 4115e5c31af7Sopenharmony_ci.Valid Usage 4116e5c31af7Sopenharmony_ci**** 4117e5c31af7Sopenharmony_ci * [[VUID-VkSpecializationMapEntry-constantID-00776]] 4118e5c31af7Sopenharmony_ci For a pname:constantID specialization constant declared in a shader, 4119e5c31af7Sopenharmony_ci pname:size must: match the byte size of the pname:constantID. 4120e5c31af7Sopenharmony_ci If the specialization constant is of type code:boolean, pname:size must: 4121e5c31af7Sopenharmony_ci be the byte size of basetype:VkBool32 4122e5c31af7Sopenharmony_ci**** 4123e5c31af7Sopenharmony_ci 4124e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkSpecializationMapEntry.txt[] 4125e5c31af7Sopenharmony_ci-- 4126e5c31af7Sopenharmony_ci 4127e5c31af7Sopenharmony_ciIn human readable SPIR-V: 4128e5c31af7Sopenharmony_ci 4129e5c31af7Sopenharmony_ci[source,glsl] 4130e5c31af7Sopenharmony_ci--------------------------------------------------- 4131e5c31af7Sopenharmony_ciOpDecorate %x SpecId 13 ; decorate .x component of WorkgroupSize with ID 13 4132e5c31af7Sopenharmony_ciOpDecorate %y SpecId 42 ; decorate .y component of WorkgroupSize with ID 42 4133e5c31af7Sopenharmony_ciOpDecorate %z SpecId 3 ; decorate .z component of WorkgroupSize with ID 3 4134e5c31af7Sopenharmony_ciOpDecorate %wgsize BuiltIn WorkgroupSize ; decorate WorkgroupSize onto constant 4135e5c31af7Sopenharmony_ci%i32 = OpTypeInt 32 0 ; declare an unsigned 32-bit type 4136e5c31af7Sopenharmony_ci%uvec3 = OpTypeVector %i32 3 ; declare a 3 element vector type of unsigned 32-bit 4137e5c31af7Sopenharmony_ci%x = OpSpecConstant %i32 1 ; declare the .x component of WorkgroupSize 4138e5c31af7Sopenharmony_ci%y = OpSpecConstant %i32 1 ; declare the .y component of WorkgroupSize 4139e5c31af7Sopenharmony_ci%z = OpSpecConstant %i32 1 ; declare the .z component of WorkgroupSize 4140e5c31af7Sopenharmony_ci%wgsize = OpSpecConstantComposite %uvec3 %x %y %z ; declare WorkgroupSize 4141e5c31af7Sopenharmony_ci--------------------------------------------------- 4142e5c31af7Sopenharmony_ci 4143e5c31af7Sopenharmony_ciFrom the above we have three specialization constants, one for each of the 4144e5c31af7Sopenharmony_cix, y & z elements of the WorkgroupSize vector. 4145e5c31af7Sopenharmony_ci 4146e5c31af7Sopenharmony_ciNow to specialize the above via the specialization constants mechanism: 4147e5c31af7Sopenharmony_ci 4148e5c31af7Sopenharmony_ci[source,c++] 4149e5c31af7Sopenharmony_ci--------------------------------------------------- 4150e5c31af7Sopenharmony_ciconst VkSpecializationMapEntry entries[] = 4151e5c31af7Sopenharmony_ci{ 4152e5c31af7Sopenharmony_ci { 4153e5c31af7Sopenharmony_ci 13, // constantID 4154e5c31af7Sopenharmony_ci 0 * sizeof(uint32_t), // offset 4155e5c31af7Sopenharmony_ci sizeof(uint32_t) // size 4156e5c31af7Sopenharmony_ci }, 4157e5c31af7Sopenharmony_ci { 4158e5c31af7Sopenharmony_ci 42, // constantID 4159e5c31af7Sopenharmony_ci 1 * sizeof(uint32_t), // offset 4160e5c31af7Sopenharmony_ci sizeof(uint32_t) // size 4161e5c31af7Sopenharmony_ci }, 4162e5c31af7Sopenharmony_ci { 4163e5c31af7Sopenharmony_ci 3, // constantID 4164e5c31af7Sopenharmony_ci 2 * sizeof(uint32_t), // offset 4165e5c31af7Sopenharmony_ci sizeof(uint32_t) // size 4166e5c31af7Sopenharmony_ci } 4167e5c31af7Sopenharmony_ci}; 4168e5c31af7Sopenharmony_ci 4169e5c31af7Sopenharmony_ciconst uint32_t data[] = { 16, 8, 4 }; // our workgroup size is 16x8x4 4170e5c31af7Sopenharmony_ci 4171e5c31af7Sopenharmony_ciconst VkSpecializationInfo info = 4172e5c31af7Sopenharmony_ci{ 4173e5c31af7Sopenharmony_ci 3, // mapEntryCount 4174e5c31af7Sopenharmony_ci entries, // pMapEntries 4175e5c31af7Sopenharmony_ci 3 * sizeof(uint32_t), // dataSize 4176e5c31af7Sopenharmony_ci data, // pData 4177e5c31af7Sopenharmony_ci}; 4178e5c31af7Sopenharmony_ci--------------------------------------------------- 4179e5c31af7Sopenharmony_ci 4180e5c31af7Sopenharmony_ciThen when calling flink:vkCreateComputePipelines, and passing the 4181e5c31af7Sopenharmony_cisname:VkSpecializationInfo we defined as the pname:pSpecializationInfo 4182e5c31af7Sopenharmony_ciparameter of slink:VkPipelineShaderStageCreateInfo, we will create a compute 4183e5c31af7Sopenharmony_cipipeline with the runtime specified local workgroup size. 4184e5c31af7Sopenharmony_ci 4185e5c31af7Sopenharmony_ciAnother example would be that an application has a SPIR-V module that has 4186e5c31af7Sopenharmony_cisome platform-dependent constants they wish to use. 4187e5c31af7Sopenharmony_ci 4188e5c31af7Sopenharmony_ciIn human readable SPIR-V: 4189e5c31af7Sopenharmony_ci 4190e5c31af7Sopenharmony_ci// [source,glsl] 4191e5c31af7Sopenharmony_ci[source,glsl] 4192e5c31af7Sopenharmony_ci--------------------------------------------------- 4193e5c31af7Sopenharmony_ciOpDecorate %1 SpecId 0 ; decorate our signed 32-bit integer constant 4194e5c31af7Sopenharmony_ciOpDecorate %2 SpecId 12 ; decorate our 32-bit floating-point constant 4195e5c31af7Sopenharmony_ci%i32 = OpTypeInt 32 1 ; declare a signed 32-bit type 4196e5c31af7Sopenharmony_ci%float = OpTypeFloat 32 ; declare a 32-bit floating-point type 4197e5c31af7Sopenharmony_ci%1 = OpSpecConstant %i32 -1 ; some signed 32-bit integer constant 4198e5c31af7Sopenharmony_ci%2 = OpSpecConstant %float 0.5 ; some 32-bit floating-point constant 4199e5c31af7Sopenharmony_ci--------------------------------------------------- 4200e5c31af7Sopenharmony_ci 4201e5c31af7Sopenharmony_ciFrom the above we have two specialization constants, one is a signed 32-bit 4202e5c31af7Sopenharmony_ciinteger and the second is a 32-bit floating-point value. 4203e5c31af7Sopenharmony_ci 4204e5c31af7Sopenharmony_ciNow to specialize the above via the specialization constants mechanism: 4205e5c31af7Sopenharmony_ci 4206e5c31af7Sopenharmony_ci[source,c++] 4207e5c31af7Sopenharmony_ci--------------------------------------------------- 4208e5c31af7Sopenharmony_cistruct SpecializationData { 4209e5c31af7Sopenharmony_ci int32_t data0; 4210e5c31af7Sopenharmony_ci float data1; 4211e5c31af7Sopenharmony_ci}; 4212e5c31af7Sopenharmony_ci 4213e5c31af7Sopenharmony_ciconst VkSpecializationMapEntry entries[] = 4214e5c31af7Sopenharmony_ci{ 4215e5c31af7Sopenharmony_ci { 4216e5c31af7Sopenharmony_ci 0, // constantID 4217e5c31af7Sopenharmony_ci offsetof(SpecializationData, data0), // offset 4218e5c31af7Sopenharmony_ci sizeof(SpecializationData::data0) // size 4219e5c31af7Sopenharmony_ci }, 4220e5c31af7Sopenharmony_ci { 4221e5c31af7Sopenharmony_ci 12, // constantID 4222e5c31af7Sopenharmony_ci offsetof(SpecializationData, data1), // offset 4223e5c31af7Sopenharmony_ci sizeof(SpecializationData::data1) // size 4224e5c31af7Sopenharmony_ci } 4225e5c31af7Sopenharmony_ci}; 4226e5c31af7Sopenharmony_ci 4227e5c31af7Sopenharmony_ciSpecializationData data; 4228e5c31af7Sopenharmony_cidata.data0 = -42; // set the data for the 32-bit integer 4229e5c31af7Sopenharmony_cidata.data1 = 42.0f; // set the data for the 32-bit floating-point 4230e5c31af7Sopenharmony_ci 4231e5c31af7Sopenharmony_ciconst VkSpecializationInfo info = 4232e5c31af7Sopenharmony_ci{ 4233e5c31af7Sopenharmony_ci 2, // mapEntryCount 4234e5c31af7Sopenharmony_ci entries, // pMapEntries 4235e5c31af7Sopenharmony_ci sizeof(data), // dataSize 4236e5c31af7Sopenharmony_ci &data, // pData 4237e5c31af7Sopenharmony_ci}; 4238e5c31af7Sopenharmony_ci--------------------------------------------------- 4239e5c31af7Sopenharmony_ci 4240e5c31af7Sopenharmony_ciIt is legal for a SPIR-V module with specializations to be compiled into a 4241e5c31af7Sopenharmony_cipipeline where no specialization information was provided. 4242e5c31af7Sopenharmony_ciSPIR-V specialization constants contain default values such that if a 4243e5c31af7Sopenharmony_cispecialization is not provided, the default value will be used. 4244e5c31af7Sopenharmony_ciIn the examples above, it would be valid for an application to only 4245e5c31af7Sopenharmony_cispecialize some of the specialization constants within the SPIR-V module, 4246e5c31af7Sopenharmony_ciand let the other constants use their default values encoded within the 4247e5c31af7Sopenharmony_ciOpSpecConstant declarations. 4248e5c31af7Sopenharmony_ci 4249e5c31af7Sopenharmony_ci 4250e5c31af7Sopenharmony_ciifdef::VK_KHR_pipeline_library[] 4251e5c31af7Sopenharmony_ci[[pipeline-library]] 4252e5c31af7Sopenharmony_ci== Pipeline Libraries 4253e5c31af7Sopenharmony_ci 4254e5c31af7Sopenharmony_ciA pipeline library is a special pipeline that was created using the 4255e5c31af7Sopenharmony_ciename:VK_PIPELINE_CREATE_LIBRARY_BIT_KHR and cannot be bound, instead it 4256e5c31af7Sopenharmony_cidefines a set of pipeline state which can be linked into other pipelines. 4257e5c31af7Sopenharmony_ciifdef::VK_KHR_ray_tracing_pipeline[] 4258e5c31af7Sopenharmony_ciFor ray tracing pipelines this includes shaders and shader groups. 4259e5c31af7Sopenharmony_ciendif::VK_KHR_ray_tracing_pipeline[] 4260e5c31af7Sopenharmony_ciThe application must: maintain the lifetime of a pipeline library based on 4261e5c31af7Sopenharmony_cithe pipelines that link with it. 4262e5c31af7Sopenharmony_ciA pipeline library is considered in-use, as long as one of the linking 4263e5c31af7Sopenharmony_cipipelines is in-use. 4264e5c31af7Sopenharmony_ci 4265e5c31af7Sopenharmony_ciThis linkage is achieved by using the following structure within the 4266e5c31af7Sopenharmony_ciappropriate creation mechanisms: 4267e5c31af7Sopenharmony_ci 4268e5c31af7Sopenharmony_ci[open,refpage='VkPipelineLibraryCreateInfoKHR',desc='Structure specifying pipeline libraries to use when creating a pipeline',type='structs'] 4269e5c31af7Sopenharmony_ci-- 4270e5c31af7Sopenharmony_ciThe sname:VkPipelineLibraryCreateInfoKHR structure is defined as: 4271e5c31af7Sopenharmony_ci 4272e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkPipelineLibraryCreateInfoKHR.txt[] 4273e5c31af7Sopenharmony_ci 4274e5c31af7Sopenharmony_ci * pname:sType is the type of this structure. 4275e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 4276e5c31af7Sopenharmony_ci structure. 4277e5c31af7Sopenharmony_ci * pname:libraryCount is the number of pipeline libraries in 4278e5c31af7Sopenharmony_ci pname:pLibraries. 4279e5c31af7Sopenharmony_ci * pname:pLibraries is a pointer to an array of slink:VkPipeline structures 4280e5c31af7Sopenharmony_ci specifying pipeline libraries to use when creating a pipeline. 4281e5c31af7Sopenharmony_ci 4282e5c31af7Sopenharmony_ci.Valid Usage 4283e5c31af7Sopenharmony_ci**** 4284e5c31af7Sopenharmony_ci * [[VUID-VkPipelineLibraryCreateInfoKHR-pLibraries-03381]] 4285e5c31af7Sopenharmony_ci Each element of pname:pLibraries must: have been created with 4286e5c31af7Sopenharmony_ci ename:VK_PIPELINE_CREATE_LIBRARY_BIT_KHR 4287e5c31af7Sopenharmony_ci**** 4288e5c31af7Sopenharmony_ci 4289e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkPipelineLibraryCreateInfoKHR.txt[] 4290e5c31af7Sopenharmony_ci-- 4291e5c31af7Sopenharmony_ciendif::VK_KHR_pipeline_library[] 4292e5c31af7Sopenharmony_ci 4293e5c31af7Sopenharmony_ci 4294e5c31af7Sopenharmony_ci[[pipelines-binding]] 4295e5c31af7Sopenharmony_ci== Pipeline Binding 4296e5c31af7Sopenharmony_ci 4297e5c31af7Sopenharmony_ci[open,refpage='vkCmdBindPipeline',desc='Bind a pipeline object to a command buffer',type='protos'] 4298e5c31af7Sopenharmony_ci-- 4299e5c31af7Sopenharmony_ciOnce a pipeline has been created, it can: be bound to the command buffer 4300e5c31af7Sopenharmony_ciusing the command: 4301e5c31af7Sopenharmony_ci 4302e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCmdBindPipeline.txt[] 4303e5c31af7Sopenharmony_ci 4304e5c31af7Sopenharmony_ci * pname:commandBuffer is the command buffer that the pipeline will be 4305e5c31af7Sopenharmony_ci bound to. 4306e5c31af7Sopenharmony_ci * pname:pipelineBindPoint is a elink:VkPipelineBindPoint value specifying 4307e5c31af7Sopenharmony_ci to which bind point the pipeline is bound. 4308e5c31af7Sopenharmony_ci Binding one does not disturb the others. 4309e5c31af7Sopenharmony_ci * pname:pipeline is the pipeline to be bound. 4310e5c31af7Sopenharmony_ci 4311e5c31af7Sopenharmony_ci[[pipeline-bindpoint-commands]] 4312e5c31af7Sopenharmony_ciOnce bound, a pipeline binding affects subsequent commands that interact 4313e5c31af7Sopenharmony_ciwith the given pipeline type in the command buffer until a different 4314e5c31af7Sopenharmony_cipipeline of the same type is bound to the bind point. 4315e5c31af7Sopenharmony_ciCommands that do not interact with the given pipeline type must: not be 4316e5c31af7Sopenharmony_ciaffected by the pipeline state. 4317e5c31af7Sopenharmony_ci 4318e5c31af7Sopenharmony_ci * The pipeline bound to ename:VK_PIPELINE_BIND_POINT_COMPUTE controls the 4319e5c31af7Sopenharmony_ci behavior of all <<dispatch, dispatching commands>>. 4320e5c31af7Sopenharmony_ci * The pipeline bound to ename:VK_PIPELINE_BIND_POINT_GRAPHICS controls the 4321e5c31af7Sopenharmony_ci behavior of all <<drawing, drawing commands>>. 4322e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing,VK_KHR_ray_tracing_pipeline[] 4323e5c31af7Sopenharmony_ci * The pipeline bound to ename:VK_PIPELINE_BIND_POINT_RAY_TRACING_KHR 4324e5c31af7Sopenharmony_ci controls the behavior of flink:vkCmdTraceRaysKHR and 4325e5c31af7Sopenharmony_ci flink:vkCmdTraceRaysIndirectKHR. 4326e5c31af7Sopenharmony_ciendif::VK_NV_ray_tracing,VK_KHR_ray_tracing_pipeline[] 4327e5c31af7Sopenharmony_ciifdef::VK_HUAWEI_subpass_shading[] 4328e5c31af7Sopenharmony_ci * The pipeline bound to 4329e5c31af7Sopenharmony_ci ename:VK_PIPELINE_BIND_POINT_SUBPASS_SHADING_HUAWEI controls the 4330e5c31af7Sopenharmony_ci behavior of flink:vkCmdSubpassShadingHUAWEI. 4331e5c31af7Sopenharmony_ciendif::VK_HUAWEI_subpass_shading[] 4332e5c31af7Sopenharmony_ci 4333e5c31af7Sopenharmony_ci.Valid Usage 4334e5c31af7Sopenharmony_ci**** 4335e5c31af7Sopenharmony_ci * [[VUID-vkCmdBindPipeline-pipelineBindPoint-00777]] 4336e5c31af7Sopenharmony_ci If pname:pipelineBindPoint is ename:VK_PIPELINE_BIND_POINT_COMPUTE, the 4337e5c31af7Sopenharmony_ci sname:VkCommandPool that pname:commandBuffer was allocated from must: 4338e5c31af7Sopenharmony_ci support compute operations 4339e5c31af7Sopenharmony_ci * [[VUID-vkCmdBindPipeline-pipelineBindPoint-00778]] 4340e5c31af7Sopenharmony_ci If pname:pipelineBindPoint is ename:VK_PIPELINE_BIND_POINT_GRAPHICS, the 4341e5c31af7Sopenharmony_ci sname:VkCommandPool that pname:commandBuffer was allocated from must: 4342e5c31af7Sopenharmony_ci support graphics operations 4343e5c31af7Sopenharmony_ci * [[VUID-vkCmdBindPipeline-pipelineBindPoint-00779]] 4344e5c31af7Sopenharmony_ci If pname:pipelineBindPoint is ename:VK_PIPELINE_BIND_POINT_COMPUTE, 4345e5c31af7Sopenharmony_ci pname:pipeline must: be a compute pipeline 4346e5c31af7Sopenharmony_ci * [[VUID-vkCmdBindPipeline-pipelineBindPoint-00780]] 4347e5c31af7Sopenharmony_ci If pname:pipelineBindPoint is ename:VK_PIPELINE_BIND_POINT_GRAPHICS, 4348e5c31af7Sopenharmony_ci pname:pipeline must: be a graphics pipeline 4349e5c31af7Sopenharmony_ci * [[VUID-vkCmdBindPipeline-pipeline-00781]] 4350e5c31af7Sopenharmony_ci If the <<features-variableMultisampleRate,variable multisample rate>> 4351e5c31af7Sopenharmony_ci feature is not supported, pname:pipeline is a graphics pipeline, the 4352e5c31af7Sopenharmony_ci current subpass <<renderpass-noattachments, uses no attachments>>, and 4353e5c31af7Sopenharmony_ci this is not the first call to this function with a graphics pipeline 4354e5c31af7Sopenharmony_ci after transitioning to the current subpass, then the sample count 4355e5c31af7Sopenharmony_ci specified by this pipeline must: match that set in the previous pipeline 4356e5c31af7Sopenharmony_ciifdef::VK_EXT_sample_locations[] 4357e5c31af7Sopenharmony_ci * [[VUID-vkCmdBindPipeline-variableSampleLocations-01525]] 4358e5c31af7Sopenharmony_ci If 4359e5c31af7Sopenharmony_ci slink:VkPhysicalDeviceSampleLocationsPropertiesEXT::pname:variableSampleLocations 4360e5c31af7Sopenharmony_ci is ename:VK_FALSE, and pname:pipeline is a graphics pipeline created 4361e5c31af7Sopenharmony_ci with a slink:VkPipelineSampleLocationsStateCreateInfoEXT structure 4362e5c31af7Sopenharmony_ci having its pname:sampleLocationsEnable member set to ename:VK_TRUE but 4363e5c31af7Sopenharmony_ci without ename:VK_DYNAMIC_STATE_SAMPLE_LOCATIONS_EXT enabled then the 4364e5c31af7Sopenharmony_ci current render pass instance must: have been begun by specifying a 4365e5c31af7Sopenharmony_ci slink:VkRenderPassSampleLocationsBeginInfoEXT structure whose 4366e5c31af7Sopenharmony_ci pname:pPostSubpassSampleLocations member contains an element with a 4367e5c31af7Sopenharmony_ci pname:subpassIndex matching the current subpass index and the 4368e5c31af7Sopenharmony_ci pname:sampleLocationsInfo member of that element must: match the 4369e5c31af7Sopenharmony_ci pname:sampleLocationsInfo specified in 4370e5c31af7Sopenharmony_ci slink:VkPipelineSampleLocationsStateCreateInfoEXT when the pipeline was 4371e5c31af7Sopenharmony_ci created 4372e5c31af7Sopenharmony_ciendif::VK_EXT_sample_locations[] 4373e5c31af7Sopenharmony_ciifdef::VK_EXT_transform_feedback[] 4374e5c31af7Sopenharmony_ci * [[VUID-vkCmdBindPipeline-None-02323]] 4375e5c31af7Sopenharmony_ci This command must: not be recorded when transform feedback is active 4376e5c31af7Sopenharmony_ciendif::VK_EXT_transform_feedback[] 4377e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing,VK_KHR_ray_tracing_pipeline[] 4378e5c31af7Sopenharmony_ci * [[VUID-vkCmdBindPipeline-pipelineBindPoint-02391]] 4379e5c31af7Sopenharmony_ci If pname:pipelineBindPoint is 4380e5c31af7Sopenharmony_ci ename:VK_PIPELINE_BIND_POINT_RAY_TRACING_KHR, the sname:VkCommandPool 4381e5c31af7Sopenharmony_ci that pname:commandBuffer was allocated from must: support compute 4382e5c31af7Sopenharmony_ci operations 4383e5c31af7Sopenharmony_ci * [[VUID-vkCmdBindPipeline-pipelineBindPoint-02392]] 4384e5c31af7Sopenharmony_ci If pname:pipelineBindPoint is 4385e5c31af7Sopenharmony_ci ename:VK_PIPELINE_BIND_POINT_RAY_TRACING_KHR, pname:pipeline must: be a 4386e5c31af7Sopenharmony_ci ray tracing pipeline 4387e5c31af7Sopenharmony_ciendif::VK_NV_ray_tracing,VK_KHR_ray_tracing_pipeline[] 4388e5c31af7Sopenharmony_ciifdef::VK_KHR_pipeline_library[] 4389e5c31af7Sopenharmony_ci * [[VUID-vkCmdBindPipeline-pipeline-03382]] 4390e5c31af7Sopenharmony_ci pname:pipeline must: not have been created with 4391e5c31af7Sopenharmony_ci ename:VK_PIPELINE_CREATE_LIBRARY_BIT_KHR set 4392e5c31af7Sopenharmony_ciendif::VK_KHR_pipeline_library[] 4393e5c31af7Sopenharmony_ciifdef::VK_NV_inherited_viewport_scissor[] 4394e5c31af7Sopenharmony_ci * [[VUID-vkCmdBindPipeline-commandBuffer-04808]] 4395e5c31af7Sopenharmony_ci If pname:commandBuffer is a secondary command buffer with 4396e5c31af7Sopenharmony_ci slink:VkCommandBufferInheritanceViewportScissorInfoNV::pname:viewportScissor2D 4397e5c31af7Sopenharmony_ci enabled and pname:pipelineBindPoint is 4398e5c31af7Sopenharmony_ci ename:VK_PIPELINE_BIND_POINT_GRAPHICS, then the pname:pipeline must: 4399e5c31af7Sopenharmony_ci have been created with ename:VK_DYNAMIC_STATE_VIEWPORT_WITH_COUNT_EXT or 4400e5c31af7Sopenharmony_ci ename:VK_DYNAMIC_STATE_VIEWPORT, and 4401e5c31af7Sopenharmony_ci ename:VK_DYNAMIC_STATE_SCISSOR_WITH_COUNT_EXT or 4402e5c31af7Sopenharmony_ci ename:VK_DYNAMIC_STATE_SCISSOR enabled 4403e5c31af7Sopenharmony_ciendif::VK_NV_inherited_viewport_scissor[] 4404e5c31af7Sopenharmony_ciifdef::VK_NV_inherited_viewport_scissor,VK_EXT_discard_rectangles[] 4405e5c31af7Sopenharmony_ci * [[VUID-vkCmdBindPipeline-commandBuffer-04809]] 4406e5c31af7Sopenharmony_ci If pname:commandBuffer is a secondary command buffer with 4407e5c31af7Sopenharmony_ci slink:VkCommandBufferInheritanceViewportScissorInfoNV::pname:viewportScissor2D 4408e5c31af7Sopenharmony_ci enabled and pname:pipelineBindPoint is 4409e5c31af7Sopenharmony_ci ename:VK_PIPELINE_BIND_POINT_GRAPHICS and pname:pipeline was created 4410e5c31af7Sopenharmony_ci with slink:VkPipelineDiscardRectangleStateCreateInfoEXT structure and 4411e5c31af7Sopenharmony_ci its pname:discardRectangleCount member is not `0`, then the pipeline 4412e5c31af7Sopenharmony_ci must: have been created with 4413e5c31af7Sopenharmony_ci ename:VK_DYNAMIC_STATE_DISCARD_RECTANGLE_EXT enabled 4414e5c31af7Sopenharmony_ciendif::VK_NV_inherited_viewport_scissor,VK_EXT_discard_rectangles[] 4415e5c31af7Sopenharmony_ciifdef::VK_EXT_provoking_vertex[] 4416e5c31af7Sopenharmony_ci * [[VUID-vkCmdBindPipeline-pipelineBindPoint-04881]] 4417e5c31af7Sopenharmony_ci If pname:pipelineBindPoint is ename:VK_PIPELINE_BIND_POINT_GRAPHICS and 4418e5c31af7Sopenharmony_ci the 4419e5c31af7Sopenharmony_ci <<limits-provokingVertexModePerPipeline,provokingVertexModePerPipeline>> 4420e5c31af7Sopenharmony_ci limit is ename:VK_FALSE, then pipeline's 4421e5c31af7Sopenharmony_ci slink:VkPipelineRasterizationProvokingVertexStateCreateInfoEXT::pname:provokingVertexMode 4422e5c31af7Sopenharmony_ci must: be the same as that of any other pipelines previously bound to 4423e5c31af7Sopenharmony_ci this bind point within the current render pass instance, including any 4424e5c31af7Sopenharmony_ci pipeline already bound when beginning the render pass instance 4425e5c31af7Sopenharmony_ciendif::VK_EXT_provoking_vertex[] 4426e5c31af7Sopenharmony_ciifdef::VK_HUAWEI_subpass_shading[] 4427e5c31af7Sopenharmony_ci * [[VUID-vkCmdBindPipeline-pipelineBindPoint-04949]] 4428e5c31af7Sopenharmony_ci If pname:pipelineBindPoint is 4429e5c31af7Sopenharmony_ci ename:VK_PIPELINE_BIND_POINT_SUBPASS_SHADING_HUAWEI, the 4430e5c31af7Sopenharmony_ci sname:VkCommandPool that pname:commandBuffer was allocated from must: 4431e5c31af7Sopenharmony_ci support compute operations 4432e5c31af7Sopenharmony_ci * [[VUID-vkCmdBindPipeline-pipelineBindPoint-04950]] 4433e5c31af7Sopenharmony_ci If pname:pipelineBindPoint is 4434e5c31af7Sopenharmony_ci ename:VK_PIPELINE_BIND_POINT_SUBPASS_SHADING_HUAWEI, pname:pipeline 4435e5c31af7Sopenharmony_ci must: be a subpass shading pipeline 4436e5c31af7Sopenharmony_ciendif::VK_HUAWEI_subpass_shading[] 4437e5c31af7Sopenharmony_ciifdef::VK_KHR_dynamic_rendering[] 4438e5c31af7Sopenharmony_ci * [[VUID-vkCmdBindPipeline-pipeline-06195]] 4439e5c31af7Sopenharmony_ci If pname:pipeline is a graphics pipeline, this command has been called 4440e5c31af7Sopenharmony_ci inside a render pass instance started with flink:vkCmdBeginRenderingKHR, 4441e5c31af7Sopenharmony_ci and commands using the previously bound graphics pipeline have been 4442e5c31af7Sopenharmony_ci recorded within the render pass instance, then the value of 4443e5c31af7Sopenharmony_ci slink:VkPipelineRenderingCreateInfoKHR::pname:colorAttachmentCount 4444e5c31af7Sopenharmony_ci specified by this pipeline must: match that set in the previous pipeline 4445e5c31af7Sopenharmony_ci * [[VUID-vkCmdBindPipeline-pipeline-06196]] 4446e5c31af7Sopenharmony_ci If pname:pipeline is a graphics pipeline, this command has been called 4447e5c31af7Sopenharmony_ci inside a render pass instance started with flink:vkCmdBeginRenderingKHR, 4448e5c31af7Sopenharmony_ci and commands using the previously bound graphics pipeline have been 4449e5c31af7Sopenharmony_ci recorded within the render pass instance, then the elements of 4450e5c31af7Sopenharmony_ci slink:VkPipelineRenderingCreateInfoKHR::pname:pColorAttachmentFormats 4451e5c31af7Sopenharmony_ci specified by this pipeline must: match that set in the previous pipeline 4452e5c31af7Sopenharmony_ci * [[VUID-vkCmdBindPipeline-pipeline-06197]] 4453e5c31af7Sopenharmony_ci If pname:pipeline is a graphics pipeline, this command has been called 4454e5c31af7Sopenharmony_ci inside a render pass instance started with flink:vkCmdBeginRenderingKHR, 4455e5c31af7Sopenharmony_ci and commands using the previously bound graphics pipeline have been 4456e5c31af7Sopenharmony_ci recorded within the render pass instance, then the value of 4457e5c31af7Sopenharmony_ci slink:VkPipelineRenderingCreateInfoKHR::pname:depthAttachmentFormat 4458e5c31af7Sopenharmony_ci specified by this pipeline must: match that set in the previous pipeline 4459e5c31af7Sopenharmony_ci * [[VUID-vkCmdBindPipeline-pipeline-06194]] 4460e5c31af7Sopenharmony_ci If pname:pipeline is a graphics pipeline, this command has been called 4461e5c31af7Sopenharmony_ci inside a render pass instance started with flink:vkCmdBeginRenderingKHR, 4462e5c31af7Sopenharmony_ci and commands using the previously bound graphics pipeline have been 4463e5c31af7Sopenharmony_ci recorded within the render pass instance, then the value of 4464e5c31af7Sopenharmony_ci slink:VkPipelineRenderingCreateInfoKHR::pname:stencilAttachmentFormat 4465e5c31af7Sopenharmony_ci specified by this pipeline must: match that set in the previous pipeline 4466e5c31af7Sopenharmony_ciendif::VK_KHR_dynamic_rendering[] 4467e5c31af7Sopenharmony_ci**** 4468e5c31af7Sopenharmony_ci 4469e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCmdBindPipeline.txt[] 4470e5c31af7Sopenharmony_ci-- 4471e5c31af7Sopenharmony_ci 4472e5c31af7Sopenharmony_ci[open,refpage='VkPipelineBindPoint',desc='Specify the bind point of a pipeline object to a command buffer',type='enums'] 4473e5c31af7Sopenharmony_ci-- 4474e5c31af7Sopenharmony_ciPossible values of flink:vkCmdBindPipeline::pname:pipelineBindPoint, 4475e5c31af7Sopenharmony_cispecifying the bind point of a pipeline object, are: 4476e5c31af7Sopenharmony_ci 4477e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkPipelineBindPoint.txt[] 4478e5c31af7Sopenharmony_ci 4479e5c31af7Sopenharmony_ci * ename:VK_PIPELINE_BIND_POINT_COMPUTE specifies binding as a compute 4480e5c31af7Sopenharmony_ci pipeline. 4481e5c31af7Sopenharmony_ci * ename:VK_PIPELINE_BIND_POINT_GRAPHICS specifies binding as a graphics 4482e5c31af7Sopenharmony_ci pipeline. 4483e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing,VK_KHR_ray_tracing_pipeline[] 4484e5c31af7Sopenharmony_ci * ename:VK_PIPELINE_BIND_POINT_RAY_TRACING_KHR specifies binding as a ray 4485e5c31af7Sopenharmony_ci tracing pipeline. 4486e5c31af7Sopenharmony_ciendif::VK_NV_ray_tracing,VK_KHR_ray_tracing_pipeline[] 4487e5c31af7Sopenharmony_ciifdef::VK_HUAWEI_subpass_shading[] 4488e5c31af7Sopenharmony_ci * ename:VK_PIPELINE_BIND_POINT_SUBPASS_SHADING_HUAWEI specifies binding as 4489e5c31af7Sopenharmony_ci a subpass shading pipeline. 4490e5c31af7Sopenharmony_ciendif::VK_HUAWEI_subpass_shading[] 4491e5c31af7Sopenharmony_ci-- 4492e5c31af7Sopenharmony_ci 4493e5c31af7Sopenharmony_ciifdef::VK_NV_device_generated_commands[] 4494e5c31af7Sopenharmony_ci[open,refpage='vkCmdBindPipelineShaderGroupNV',desc='Bind a pipeline object's shader group to a command buffer',type='protos'] 4495e5c31af7Sopenharmony_ci-- 4496e5c31af7Sopenharmony_ciFor pipelines that were created with the support of multiple shader groups 4497e5c31af7Sopenharmony_ci(see <<graphics-shadergroups,Graphics Pipeline Shader Groups>>), the regular 4498e5c31af7Sopenharmony_cifname:vkCmdBindPipeline command will bind Shader Group `0`. 4499e5c31af7Sopenharmony_ciTo explicitly bind a shader group use: 4500e5c31af7Sopenharmony_ci 4501e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCmdBindPipelineShaderGroupNV.txt[] 4502e5c31af7Sopenharmony_ci 4503e5c31af7Sopenharmony_ci * pname:commandBuffer is the command buffer that the pipeline will be 4504e5c31af7Sopenharmony_ci bound to. 4505e5c31af7Sopenharmony_ci * pname:pipelineBindPoint is a elink:VkPipelineBindPoint value specifying 4506e5c31af7Sopenharmony_ci the bind point to which the pipeline will be bound. 4507e5c31af7Sopenharmony_ci * pname:pipeline is the pipeline to be bound. 4508e5c31af7Sopenharmony_ci * pname:groupIndex is the shader group to be bound. 4509e5c31af7Sopenharmony_ci 4510e5c31af7Sopenharmony_ci 4511e5c31af7Sopenharmony_ci.Valid Usage 4512e5c31af7Sopenharmony_ci**** 4513e5c31af7Sopenharmony_ci * [[VUID-vkCmdBindPipelineShaderGroupNV-groupIndex-02893]] 4514e5c31af7Sopenharmony_ci pname:groupIndex must: be `0` or less than the effective 4515e5c31af7Sopenharmony_ci slink:VkGraphicsPipelineShaderGroupsCreateInfoNV::pname:groupCount 4516e5c31af7Sopenharmony_ci including the referenced pipelines 4517e5c31af7Sopenharmony_ci * [[VUID-vkCmdBindPipelineShaderGroupNV-pipelineBindPoint-02894]] 4518e5c31af7Sopenharmony_ci The pname:pipelineBindPoint must: be 4519e5c31af7Sopenharmony_ci ename:VK_PIPELINE_BIND_POINT_GRAPHICS 4520e5c31af7Sopenharmony_ci * [[VUID-vkCmdBindPipelineShaderGroupNV-groupIndex-02895]] 4521e5c31af7Sopenharmony_ci The same restrictions as flink:vkCmdBindPipeline apply as if the bound 4522e5c31af7Sopenharmony_ci pipeline was created only with the Shader Group from the 4523e5c31af7Sopenharmony_ci pname:groupIndex information 4524e5c31af7Sopenharmony_ci * [[VUID-vkCmdBindPipelineShaderGroupNV-deviceGeneratedCommands-02896]] 4525e5c31af7Sopenharmony_ci The <<features-deviceGeneratedCommands, 4526e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV::pname:deviceGeneratedCommands>> 4527e5c31af7Sopenharmony_ci feature must: be enabled 4528e5c31af7Sopenharmony_ci**** 4529e5c31af7Sopenharmony_ci 4530e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCmdBindPipelineShaderGroupNV.txt[] 4531e5c31af7Sopenharmony_ci-- 4532e5c31af7Sopenharmony_ciendif::VK_NV_device_generated_commands[] 4533e5c31af7Sopenharmony_ci 4534e5c31af7Sopenharmony_ci 4535e5c31af7Sopenharmony_ci[[pipelines-dynamic-state]] 4536e5c31af7Sopenharmony_ci== Dynamic State 4537e5c31af7Sopenharmony_ci 4538e5c31af7Sopenharmony_ciWhen a pipeline object is bound, any pipeline object state that is not 4539e5c31af7Sopenharmony_cispecified as dynamic is applied to the command buffer state. 4540e5c31af7Sopenharmony_ciPipeline object state that is specified as dynamic is not applied to the 4541e5c31af7Sopenharmony_cicommand buffer state at this time. 4542e5c31af7Sopenharmony_ciInstead, dynamic state can: be modified at any time and persists for the 4543e5c31af7Sopenharmony_cilifetime of the command buffer, or until modified by another dynamic state 4544e5c31af7Sopenharmony_cisetting command or another pipeline bind. 4545e5c31af7Sopenharmony_ci 4546e5c31af7Sopenharmony_ciWhen a pipeline object is bound, the following applies to each state 4547e5c31af7Sopenharmony_ciparameter: 4548e5c31af7Sopenharmony_ci 4549e5c31af7Sopenharmony_ci * If the state is not specified as dynamic in the new pipeline object, 4550e5c31af7Sopenharmony_ci then that command buffer state is overwritten by the state in the new 4551e5c31af7Sopenharmony_ci pipeline object. 4552e5c31af7Sopenharmony_ci Before any draw or dispatch call with this pipeline there must: not have 4553e5c31af7Sopenharmony_ci been any calls to any of the corresponding dynamic state setting 4554e5c31af7Sopenharmony_ci commands after this pipeline was bound 4555e5c31af7Sopenharmony_ci * If the state is specified as dynamic in the new pipeline object, then 4556e5c31af7Sopenharmony_ci that command buffer state is not disturbed. 4557e5c31af7Sopenharmony_ci Before any draw or dispatch call with this pipeline there must: have 4558e5c31af7Sopenharmony_ci been at least one call to each of the corresponding dynamic state 4559e5c31af7Sopenharmony_ci setting commands since the command buffer recording was begun, or the 4560e5c31af7Sopenharmony_ci last bound pipeline object with that state specified as static, 4561e5c31af7Sopenharmony_ci whichever was the latter 4562e5c31af7Sopenharmony_ci 4563e5c31af7Sopenharmony_ciDynamic state that does not affect the result of operations can: be left 4564e5c31af7Sopenharmony_ciundefined:. 4565e5c31af7Sopenharmony_ci 4566e5c31af7Sopenharmony_ci[NOTE] 4567e5c31af7Sopenharmony_ci.Note 4568e5c31af7Sopenharmony_ci==== 4569e5c31af7Sopenharmony_ciFor example, if blending is disabled by the pipeline object state then the 4570e5c31af7Sopenharmony_cidynamic color blend constants do not need to be specified in the command 4571e5c31af7Sopenharmony_cibuffer, even if this state is specified as dynamic in the pipeline object. 4572e5c31af7Sopenharmony_ci==== 4573e5c31af7Sopenharmony_ci 4574e5c31af7Sopenharmony_ciifdef::VK_AMD_shader_info,VK_KHR_pipeline_executable_properties[] 4575e5c31af7Sopenharmony_ci[[pipelines-shader-information]] 4576e5c31af7Sopenharmony_ci== Pipeline Shader Information 4577e5c31af7Sopenharmony_ciendif::VK_AMD_shader_info,VK_KHR_pipeline_executable_properties[] 4578e5c31af7Sopenharmony_ci 4579e5c31af7Sopenharmony_ciifdef::VK_KHR_pipeline_executable_properties[] 4580e5c31af7Sopenharmony_ciinclude::{chapters}/VK_KHR_pipeline_executable_properties/pipelines.txt[] 4581e5c31af7Sopenharmony_ciendif::VK_KHR_pipeline_executable_properties[] 4582e5c31af7Sopenharmony_ci 4583e5c31af7Sopenharmony_ciifdef::VK_AMD_shader_info[] 4584e5c31af7Sopenharmony_ciinclude::{chapters}/VK_AMD_shader_info.txt[] 4585e5c31af7Sopenharmony_ciendif::VK_AMD_shader_info[] 4586e5c31af7Sopenharmony_ci 4587e5c31af7Sopenharmony_ci// These includes have their own section headers 4588e5c31af7Sopenharmony_ci 4589e5c31af7Sopenharmony_ciifdef::VK_AMD_pipeline_compiler_control[] 4590e5c31af7Sopenharmony_ciinclude::{chapters}/VK_AMD_pipeline_compiler_control.txt[] 4591e5c31af7Sopenharmony_ciendif::VK_AMD_pipeline_compiler_control[] 4592e5c31af7Sopenharmony_ci 4593e5c31af7Sopenharmony_ciifdef::VK_EXT_pipeline_creation_feedback[] 4594e5c31af7Sopenharmony_ciinclude::{chapters}/VK_EXT_pipeline_creation_feedback/pipelines.txt[] 4595e5c31af7Sopenharmony_ciendif::VK_EXT_pipeline_creation_feedback[] 4596