• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright 2015-2024 The Khronos Group Inc.
2//
3// SPDX-License-Identifier: CC-BY-4.0
4
5[[pipelines]]
6= Pipelines
7
8The following <<pipelines-block-diagram,figure>> shows a block diagram of
9the Vulkan pipelines.
10Some Vulkan commands specify geometric objects to be drawn or computational
11work to be performed, while others specify state controlling how objects are
12handled by the various pipeline stages, or control data transfer between
13memory organized as images and buffers.
14Commands are effectively sent through a processing pipeline, either a
15_graphics pipeline_,
16ifdef::VK_NV_ray_tracing,VK_KHR_ray_tracing_pipeline[]
17a _ray tracing pipeline_,
18endif::VK_NV_ray_tracing,VK_KHR_ray_tracing_pipeline[]
19or a _compute pipeline_.
20
21ifdef::VK_NV_mesh_shader,VK_EXT_mesh_shader[]
22The graphics pipeline can be operated in two modes, as either _primitive
23shading_ or _mesh shading_ pipeline.
24
25*Primitive Shading*
26
27endif::VK_NV_mesh_shader,VK_EXT_mesh_shader[]
28
29The first stage of the <<pipelines-graphics,graphics pipeline>>
30(<<drawing,Input Assembler>>) assembles vertices to form geometric
31primitives such as points, lines, and triangles, based on a requested
32primitive topology.
33In the next stage (<<shaders-vertex,Vertex Shader>>) vertices can: be
34transformed, computing positions and attributes for each vertex.
35If <<tessellation,tessellation>> and/or <<geometry,geometry>> shaders are
36supported, they can: then generate multiple primitives from a single input
37primitive, possibly changing the primitive topology or generating additional
38attribute data in the process.
39
40ifdef::VK_HUAWEI_cluster_culling_shader[]
41*Cluster Culling Shading*
42
43When using the Cluster Culling Shader, a compute-like shader will perform
44cluster-based culling, a set of new built-in output variables are used to
45express visible cluster, in addition, a new built-in function is used to
46emit these variables from the cluster culling shader to the Input
47Assembler(IA) stage, then IA can use these variables to fetches vertices of
48visible cluster and drive vertex shader to work.
49
50endif::VK_HUAWEI_cluster_culling_shader[]
51
52ifdef::VK_NV_mesh_shader,VK_EXT_mesh_shader[]
53*Mesh Shading*
54
55When using the <<mesh,_mesh shading_>> pipeline input primitives are not
56assembled implicitly, but explicitly through the (<<shaders-mesh,Mesh
57Shader>>).
58The work on the mesh pipeline is initiated by the application
59<<drawing-mesh-shading,drawing>> a set of mesh tasks.
60
61If an optional (<<shaders-task,Task Shader>>) is active, each task triggers
62the execution of a task shader workgroup that will generate a new set of
63tasks upon completion.
64Each of these spawned tasks, or each of the original dispatched tasks if no
65task shader is present, triggers the execution of a mesh shader workgroup
66that produces an output mesh with a variable-sized number of primitives
67assembled from vertices stored in the output mesh.
68
69*Common*
70endif::VK_NV_mesh_shader,VK_EXT_mesh_shader[]
71
72The final resulting primitives are <<vertexpostproc-clipping,clipped>> to a
73clip volume in preparation for the next stage, <<primsrast,Rasterization>>.
74The rasterizer produces a series of _fragments_ associated with a region of
75the framebuffer, from a two-dimensional description of a point, line
76segment, or triangle.
77These fragments are processed by <<fragops,fragment operations>> to
78determine whether generated values will be written to the framebuffer.
79<<fragops-shader, Fragment shading>> determines the values to be written to
80the framebuffer attachments.
81Framebuffer operations then read and write the color and depth/stencil
82attachments of the framebuffer for a given subpass of a <<renderpass,render
83pass instance>>.
84The attachments can: be used as input attachments in the fragment shader in
85a later subpass of the same render pass.
86
87The <<pipelines-compute,compute pipeline>> is a separate pipeline from the
88graphics pipeline, which operates on one-, two-, or three-dimensional
89workgroups which can: read from and write to buffer and image memory.
90
91This ordering is meant only as a tool for describing Vulkan, not as a strict
92rule of how Vulkan is implemented, and we present it only as a means to
93organize the various operations of the pipelines.
94Actual ordering guarantees between pipeline stages are explained in detail
95in the <<synchronization-pipeline-stages-order, synchronization chapter>>.
96
97[[pipelines-block-diagram]]
98ifndef::VK_NV_mesh_shader,VK_EXT_mesh_shader[]
99image::{images}/pipeline.svg[title="Block diagram of the Vulkan pipeline",align="center",opts="{imageopts}"]
100endif::VK_NV_mesh_shader,VK_EXT_mesh_shader[]
101ifdef::VK_NV_mesh_shader,VK_EXT_mesh_shader[]
102image::{images}/pipelinemesh.svg[title="Block diagram of the Vulkan pipeline",align="center",opts="{imageopts}"]
103endif::VK_NV_mesh_shader,VK_EXT_mesh_shader[]
104
105Each pipeline is controlled by a monolithic object created from a
106description of all of the shader stages and any relevant fixed-function
107stages.
108<<interfaces,Linking>> the whole pipeline together allows the optimization
109of shaders based on their input/outputs and eliminates expensive draw time
110state validation.
111
112A pipeline object is bound to the current state using
113flink:vkCmdBindPipeline.
114Any pipeline object state that is specified as <<pipelines-dynamic-state,
115dynamic>> is not applied to the current state when the pipeline object is
116bound, but is instead set by dynamic state setting commands.
117
118No state, including dynamic state, is inherited from one command buffer to
119another.
120
121
122[open,refpage='VkPipeline',desc='Opaque handle to a pipeline object',type='handles']
123--
124Compute,
125ifdef::VK_NV_ray_tracing,VK_KHR_ray_tracing_pipeline[]
126ray tracing,
127endif::VK_NV_ray_tracing,VK_KHR_ray_tracing_pipeline[]
128and graphics pipelines are each represented by sname:VkPipeline handles:
129
130include::{generated}/api/handles/VkPipeline.adoc[]
131--
132
133
134[[pipelines-multiple]]
135== Multiple Pipeline Creation
136
137Multiple pipelines can: be created in a single call by commands such as
138ifdef::VK_AMDX_shader_enqueue[flink:vkCreateExecutionGraphPipelinesAMDX,]
139ifdef::VK_KHR_ray_tracing_pipeline[flink:vkCreateRayTracingPipelinesKHR,]
140ifdef::VK_NV_ray_tracing[flink:vkCreateRayTracingPipelinesNV,]
141flink:vkCreateComputePipelines, and flink:vkCreateGraphicsPipelines.
142
143The creation commands are passed an array pname:pCreateInfos of
144stext:Vk*PipelineCreateInfo structures specifying parameters of each
145pipeline to be created, and return a corresponding array of handles in
146pname:pPipelines.
147Each element index _i_ of pname:pPipelines is created based on the
148corresponding element _i_ of pname:pCreateInfos.
149
150Applications can: group together similar pipelines to be created in a single
151call, and implementations are encouraged to look for reuse opportunities
152when creating a group.
153
154When attempting to create many pipelines in a single command, it is possible
155that creation may: fail for a subset of them.
156In this case, the corresponding elements of pname:pPipelines will be set to
157dlink:VK_NULL_HANDLE.
158If creation fails for a pipeline despite valid arguments (for example, due
159to out of memory errors), the elink:VkResult code returned by the pipeline
160creation command will indicate why.
161The implementation will attempt to create all pipelines, and only return
162dlink:VK_NULL_HANDLE values for those that actually failed.
163
164ifdef::VK_VERSION_1_3,VK_EXT_pipeline_creation_cache_control[]
165If creation fails for a pipeline that has the
166ename:VK_PIPELINE_CREATE_EARLY_RETURN_ON_FAILURE_BIT set in its
167stext:Vk*PipelineCreateInfo, pipelines at an index in the pname:pPipelines
168array greater than or equal to that of the failing pipeline will be set to
169dlink:VK_NULL_HANDLE.
170endif::VK_VERSION_1_3,VK_EXT_pipeline_creation_cache_control[]
171
172If creation fails for multiple pipelines, the returned elink:VkResult must:
173be the return value of any one of the pipelines which did not succeed.
174An application can: reliably clean up from a failed call by iterating over
175the pname:pPipelines array and destroying every element that is not
176dlink:VK_NULL_HANDLE.
177
178If the entire command fails and no pipelines are created, all elements of
179pname:pPipelines will be set to dlink:VK_NULL_HANDLE.
180
181
182[[pipelines-compute]]
183== Compute Pipelines
184
185Compute pipelines consist of a single static compute shader stage and the
186pipeline layout.
187
188The compute pipeline represents a compute shader and is created by calling
189fname:vkCreateComputePipelines
190ifndef::VKSC_VERSION_1_0[]
191with pname:module and pname:pName selecting an entry point from a shader
192module, where that entry point defines a valid compute shader, in the
193slink:VkPipelineShaderStageCreateInfo structure contained within the
194slink:VkComputePipelineCreateInfo structure.
195endif::VKSC_VERSION_1_0[]
196ifdef::VKSC_VERSION_1_0[]
197with an offline compiled pipeline provided in pname:pipelineCache and the
198pipeline identified by slink:VkPipelineOfflineCreateInfo structure in the
199pname:pNext chain of slink:VkComputePipelineCreateInfo structure.
200endif::VKSC_VERSION_1_0[]
201
202
203[open,refpage='vkCreateComputePipelines',desc='Creates a new compute pipeline object',type='protos']
204--
205:refpage: vkCreateComputePipelines
206:objectnameplural: compute pipelines
207:objectnamecamelcase: computePipeline
208:objectcount: pname:createInfoCount
209
210To create compute pipelines, call:
211
212include::{generated}/api/protos/vkCreateComputePipelines.adoc[]
213
214  * pname:device is the logical device that creates the compute pipelines.
215ifndef::VKSC_VERSION_1_0[]
216  * pname:pipelineCache is either dlink:VK_NULL_HANDLE, indicating that
217    pipeline caching is disabled; or the handle of a valid
218    <<pipelines-cache,pipeline cache>> object, in which case use of that
219    cache is enabled for the duration of the command.
220endif::VKSC_VERSION_1_0[]
221ifdef::VKSC_VERSION_1_0[]
222  * pname:pipelineCache is the handle of a valid <<pipelines-cache,pipeline
223    cache>> object.
224endif::VKSC_VERSION_1_0[]
225  * pname:createInfoCount is the length of the pname:pCreateInfos and
226    pname:pPipelines arrays.
227  * pname:pCreateInfos is a pointer to an array of
228    slink:VkComputePipelineCreateInfo structures.
229  * pname:pAllocator controls host memory allocation as described in the
230    <<memory-allocation, Memory Allocation>> chapter.
231  * pname:pPipelines is a pointer to an array of slink:VkPipeline handles in
232    which the resulting compute pipeline objects are returned.
233
234Pipelines are created and returned as described for <<pipelines-multiple,
235Multiple Pipeline Creation>>.
236
237ifdef::VKSC_VERSION_1_0[]
238If a pipeline creation fails due to:
239
240  * The identified pipeline not being present in pname:pipelineCache
241  * The pname:pNext chain not including a slink:VkPipelineOfflineCreateInfo
242    structure
243
244the operation will continue as specified in <<pipelines-multiple, Multiple
245Pipeline Creation>> and the command will return
246ename:VK_ERROR_NO_PIPELINE_MATCH.
247ifdef::hidden[]
248// tag::scdeviation[]
249  * flink:vkCreateComputePipelines returns ename:VK_ERROR_NO_PIPELINE_MATCH
250    if the slink:VkComputePipelineCreateInfo::pname:pNext chain does not
251    include a valid slink:VkPipelineOfflineCreateInfo structure <<SCID-1>>.
252// end::scdeviation[]
253endif::hidden[]
254endif::VKSC_VERSION_1_0[]
255
256include::{chapters}/commonvalidity/no_dynamic_allocations_common.adoc[]
257
258.Valid Usage
259****
260ifndef::VKSC_VERSION_1_0[]
261  * [[VUID-vkCreateComputePipelines-flags-00695]]
262    If the pname:flags member of any element of pname:pCreateInfos contains
263    the ename:VK_PIPELINE_CREATE_DERIVATIVE_BIT flag, and the
264    pname:basePipelineIndex member of that same element is not `-1`,
265    pname:basePipelineIndex must: be less than the index into
266    pname:pCreateInfos that corresponds to that element
267  * [[VUID-vkCreateComputePipelines-flags-00696]]
268    If the pname:flags member of any element of pname:pCreateInfos contains
269    the ename:VK_PIPELINE_CREATE_DERIVATIVE_BIT flag, the base pipeline
270    must: have been created with the
271    ename:VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT flag set
272endif::VKSC_VERSION_1_0[]
273ifdef::VK_VERSION_1_3,VK_EXT_pipeline_creation_cache_control[]
274  * [[VUID-vkCreateComputePipelines-pipelineCache-02873]]
275    If pname:pipelineCache was created with
276    ename:VK_PIPELINE_CACHE_CREATE_EXTERNALLY_SYNCHRONIZED_BIT, host access
277    to pname:pipelineCache must: be
278    <<fundamentals-threadingbehavior,externally synchronized>>
279endif::VK_VERSION_1_3,VK_EXT_pipeline_creation_cache_control[]
280include::{chapters}/commonvalidity/memory_reservation_request_count_common.adoc[]
281****
282ifdef::VKSC_VERSION_1_0[]
283ifdef::hidden[]
284// tag::scdeviation[]
285  * flink:vkCreateComputePipelines::pname:pipelineCache must: not be
286    dlink:VK_NULL_HANDLE <<SCID-1>>, <<SCID-8>>.
287// end::scdeviation[]
288endif::hidden[]
289endif::VKSC_VERSION_1_0[]
290
291include::{generated}/validity/protos/vkCreateComputePipelines.adoc[]
292--
293
294[open,refpage='VkComputePipelineCreateInfo',desc='Structure specifying parameters of a newly created compute pipeline',type='structs']
295--
296:refpage: VkComputePipelineCreateInfo
297
298The sname:VkComputePipelineCreateInfo structure is defined as:
299
300include::{generated}/api/structs/VkComputePipelineCreateInfo.adoc[]
301
302  * pname:sType is a elink:VkStructureType value identifying this structure.
303  * pname:pNext is `NULL` or a pointer to a structure extending this
304    structure.
305  * pname:flags is a bitmask of elink:VkPipelineCreateFlagBits specifying
306    how the pipeline will be generated.
307  * pname:stage is a slink:VkPipelineShaderStageCreateInfo structure
308    describing the compute shader.
309  * pname:layout is the description of binding locations used by both the
310    pipeline and descriptor sets used with the pipeline.
311  * pname:basePipelineHandle is a pipeline to derive from.
312ifdef::VKSC_VERSION_1_0[]
313    This is not used in Vulkan SC <<SCID-8>>.
314endif::VKSC_VERSION_1_0[]
315  * pname:basePipelineIndex is an index into the pname:pCreateInfos
316    parameter to use as a pipeline to derive from.
317ifdef::VKSC_VERSION_1_0[]
318    This is not used in Vulkan SC <<SCID-8>>.
319endif::VKSC_VERSION_1_0[]
320
321The parameters pname:basePipelineHandle and pname:basePipelineIndex are
322described in more detail in <<pipelines-pipeline-derivatives,Pipeline
323Derivatives>>.
324
325ifdef::VK_KHR_maintenance5[]
326If a slink:VkPipelineCreateFlags2CreateInfoKHR structure is present in the
327pname:pNext chain, slink:VkPipelineCreateFlags2CreateInfoKHR::pname:flags
328from that structure is used instead of pname:flags from this structure.
329endif::VK_KHR_maintenance5[]
330
331.Valid Usage
332****
333:pipelineType: compute
334include::{chapters}/commonvalidity/pipeline_create_info_common.adoc[]
335include::{chapters}/commonvalidity/compute_graph_pipeline_create_info_common.adoc[]
336  * [[VUID-VkComputePipelineCreateInfo-stage-00701]]
337    The pname:stage member of pname:stage must: be
338    ename:VK_SHADER_STAGE_COMPUTE_BIT
339  * [[VUID-VkComputePipelineCreateInfo-stage-00702]]
340    The shader code for the entry point identified by pname:stage and the
341    rest of the state identified by this structure must: adhere to the
342    pipeline linking rules described in the <<interfaces,Shader Interfaces>>
343    chapter
344  * [[VUID-VkComputePipelineCreateInfo-layout-01687]]
345    The number of resources in pname:layout accessible to the compute shader
346    stage must: be less than or equal to
347    sname:VkPhysicalDeviceLimits::pname:maxPerStageResources
348ifdef::VK_KHR_pipeline_library[]
349  * [[VUID-VkComputePipelineCreateInfo-shaderEnqueue-09177]]
350ifdef::VK_AMDX_shader_enqueue[]
351    If <<features-shaderEnqueue,pname:shaderEnqueue>> is not enabled,
352endif::VK_AMDX_shader_enqueue[]
353    pname:flags must: not include ename:VK_PIPELINE_CREATE_LIBRARY_BIT_KHR
354ifdef::VK_AMDX_shader_enqueue[]
355  * [[VUID-VkComputePipelineCreateInfo-flags-09178]]
356    If pname:flags does not include
357    ename:VK_PIPELINE_CREATE_LIBRARY_BIT_KHR, the shader specified by
358    pname:stage must: not declare the code:ShaderEnqueueAMDX capability
359endif::VK_AMDX_shader_enqueue[]
360endif::VK_KHR_pipeline_library[]
361ifdef::VK_EXT_pipeline_creation_feedback,VK_VERSION_1_3[]
362  * [[VUID-VkComputePipelineCreateInfo-pipelineStageCreationFeedbackCount-06566]]
363    If
364    slink:VkPipelineCreationFeedbackCreateInfo::pname:pipelineStageCreationFeedbackCount
365    is not `0`, it must: be `1`
366endif::VK_EXT_pipeline_creation_feedback,VK_VERSION_1_3[]
367ifdef::VK_EXT_opacity_micromap[]
368  * [[VUID-VkComputePipelineCreateInfo-flags-07367]]
369    pname:flags must: not include
370    ename:VK_PIPELINE_CREATE_RAY_TRACING_OPACITY_MICROMAP_BIT_EXT
371endif::VK_EXT_opacity_micromap[]
372ifdef::VK_NV_displacement_micromap[]
373  * [[VUID-VkComputePipelineCreateInfo-flags-07996]]
374    pname:flags must: not include
375    ename:VK_PIPELINE_CREATE_RAY_TRACING_DISPLACEMENT_MICROMAP_BIT_NV
376endif::VK_NV_displacement_micromap[]
377****
378ifdef::VKSC_VERSION_1_0[]
379ifdef::hidden[]
380// tag::scdeviation[]
381  * slink:VkComputePipelineCreateInfo::pname:basePipelineHandle must: be
382    dlink:VK_NULL_HANDLE <<SCID-8>>.
383  * slink:VkComputePipelineCreateInfo::pname:basePipelineIndex must: be zero
384    <<SCID-8>>.
385// end::scdeviation[]
386endif::hidden[]
387endif::VKSC_VERSION_1_0[]
388
389include::{generated}/validity/structs/VkComputePipelineCreateInfo.adoc[]
390--
391
392[open,refpage='VkPipelineShaderStageCreateInfo',desc='Structure specifying parameters of a newly created pipeline shader stage',type='structs']
393--
394The sname:VkPipelineShaderStageCreateInfo structure is defined as:
395
396include::{generated}/api/structs/VkPipelineShaderStageCreateInfo.adoc[]
397
398  * pname:sType is a elink:VkStructureType value identifying this structure.
399  * pname:pNext is `NULL` or a pointer to a structure extending this
400    structure.
401  * pname:flags is a bitmask of elink:VkPipelineShaderStageCreateFlagBits
402    specifying how the pipeline shader stage will be generated.
403  * pname:stage is a elink:VkShaderStageFlagBits value specifying a single
404    pipeline stage.
405ifdef::VK_EXT_graphics_pipeline_library,VK_EXT_shader_module_identifier,VK_KHR_maintenance5[]
406  * pname:module is optionally a slink:VkShaderModule object containing the
407    shader code for this stage.
408endif::VK_EXT_graphics_pipeline_library,VK_EXT_shader_module_identifier,VK_KHR_maintenance5[]
409ifndef::VK_EXT_graphics_pipeline_library,VK_EXT_shader_module_identifier,VK_KHR_maintenance5[]
410  * pname:module is a slink:VkShaderModule object containing the shader code
411    for this stage.
412endif::VK_EXT_graphics_pipeline_library,VK_EXT_shader_module_identifier,VK_KHR_maintenance5[]
413ifdef::VKSC_VERSION_1_0[]
414    This is not used in Vulkan SC <<SCID-8>>.
415endif::VKSC_VERSION_1_0[]
416  * pname:pName is a pointer to a null-terminated UTF-8 string specifying
417    the entry point name of the shader for this stage.
418  * pname:pSpecializationInfo is a pointer to a slink:VkSpecializationInfo
419    structure, as described in
420    <<pipelines-specialization-constants,Specialization Constants>>, or
421    `NULL`.
422
423ifdef::VKSC_VERSION_1_0[]
424In Vulkan SC, the pipeline compilation process occurs
425<<pipelines-offline-compilation,offline>>.
426Accordingly, pname:module must: be dlink:VK_NULL_HANDLE, and the pname:pName
427and pname:pSpecializationInfo parameters are not used at runtime and should:
428be ignored by the implementation.
429If provided, the application must: set the pname:pName and
430pname:pSpecializationInfo parameters to the values that were specified for
431the offline compilation of this pipeline.
432endif::VKSC_VERSION_1_0[]
433
434ifndef::VKSC_VERSION_1_0[]
435ifdef::VK_EXT_graphics_pipeline_library,VK_KHR_maintenance5[]
436If pname:module is not dlink:VK_NULL_HANDLE, the shader code used by the
437pipeline is defined by pname:module.
438If pname:module is dlink:VK_NULL_HANDLE, the shader code is defined by the
439chained slink:VkShaderModuleCreateInfo if present.
440endif::VK_EXT_graphics_pipeline_library,VK_KHR_maintenance5[]
441ifndef::VK_EXT_graphics_pipeline_library,VK_KHR_maintenance5[]
442The shader code used by the pipeline is defined by pname:module.
443endif::VK_EXT_graphics_pipeline_library,VK_KHR_maintenance5[]
444endif::VKSC_VERSION_1_0[]
445
446ifdef::VK_EXT_shader_module_identifier[]
447If the <<features-shaderModuleIdentifier, pname:shaderModuleIdentifier>>
448feature is enabled, applications can: omit shader code for pname:stage and
449instead provide a module identifier.
450This is done by including a
451slink:VkPipelineShaderStageModuleIdentifierCreateInfoEXT struct with
452pname:identifierSize not equal to 0 in the pname:pNext chain.
453A shader stage created in this way is equivalent to one created using a
454shader module with the same identifier.
455The identifier allows an implementation to look up a pipeline without
456consuming a valid SPIR-V module.
457If a pipeline is not found, pipeline compilation is not possible and the
458implementation must: fail as specified by
459ename:VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT.
460
461When an identifier is used in lieu of a shader module, implementations may:
462fail pipeline compilation with ename:VK_PIPELINE_COMPILE_REQUIRED for any
463reason.
464
465[NOTE]
466.Note
467====
468The rationale for the relaxed requirement on implementations to return a
469pipeline with slink:VkPipelineShaderStageModuleIdentifierCreateInfoEXT is
470that layers or tools may intercept pipeline creation calls and require the
471full SPIR-V context to operate correctly.
472ICDs are not expected to fail pipeline compilation if the pipeline exists in
473a cache somewhere.
474====
475
476ifdef::VK_KHR_pipeline_library[]
477Applications can: use identifiers when creating pipelines with
478ename:VK_PIPELINE_CREATE_LIBRARY_BIT_KHR.
479When creating such pipelines, ename:VK_SUCCESS may: be returned, but
480subsequently fail when referencing the pipeline in a
481slink:VkPipelineLibraryCreateInfoKHR struct.
482Applications must: allow pipeline compilation to fail during link steps with
483ename:VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT as it may:
484not be possible to determine if a pipeline can: be created from identifiers
485until the link step.
486endif::VK_KHR_pipeline_library[]
487endif::VK_EXT_shader_module_identifier[]
488
489.Valid Usage
490****
491  * [[VUID-VkPipelineShaderStageCreateInfo-stage-00704]]
492    If the <<features-geometryShader, pname:geometryShader>> feature is not
493    enabled, pname:stage must: not be ename:VK_SHADER_STAGE_GEOMETRY_BIT
494  * [[VUID-VkPipelineShaderStageCreateInfo-stage-00705]]
495    If the <<features-tessellationShader, pname:tessellationShader>> feature
496    is not enabled, pname:stage must: not be
497    ename:VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT or
498    ename:VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT
499ifdef::VK_NV_mesh_shader,VK_EXT_mesh_shader[]
500  * [[VUID-VkPipelineShaderStageCreateInfo-stage-02091]]
501    If the <<features-meshShader, pname:meshShaders>> feature is not
502    enabled, pname:stage must: not be ename:VK_SHADER_STAGE_MESH_BIT_EXT
503  * [[VUID-VkPipelineShaderStageCreateInfo-stage-02092]]
504    If the <<features-taskShader, pname:taskShaders>> feature is not
505    enabled, pname:stage must: not be ename:VK_SHADER_STAGE_TASK_BIT_EXT
506endif::VK_NV_mesh_shader,VK_EXT_mesh_shader[]
507
508ifdef::VK_HUAWEI_cluster_culling_shader[]
509  * [[VUID-VkPipelineShaderStageCreateInfo-clustercullingShader-07813]]
510    If the <<features-clustercullingShader, pname:clustercullingShader>>
511    feature is not enabled, pname:stage must: not be
512    ename:VK_SHADER_STAGE_CLUSTER_CULLING_BIT_HUAWEI
513endif::VK_HUAWEI_cluster_culling_shader[]
514  * [[VUID-VkPipelineShaderStageCreateInfo-stage-00706]]
515    pname:stage must: not be ename:VK_SHADER_STAGE_ALL_GRAPHICS, or
516    ename:VK_SHADER_STAGE_ALL
517ifdef::VKSC_VERSION_1_0[]
518  * [[VUID-VkPipelineShaderStageCreateInfo-module-05026]]
519    pname:module must: be dlink:VK_NULL_HANDLE.
520  * [[VUID-VkPipelineShaderStageCreateInfo-pName-05027]]
521    If pname:pName is not `NULL`, it must: be the name of an
522    code:OpEntryPoint in the SPIR-V shader module used for offline
523    compilation of this pipeline with an execution model that matches
524    pname:stage
525endif::VKSC_VERSION_1_0[]
526ifndef::VKSC_VERSION_1_0[]
527  * [[VUID-VkPipelineShaderStageCreateInfo-pName-00707]]
528    pname:pName must: be the name of an code:OpEntryPoint in pname:module
529    with an execution model that matches pname:stage
530endif::VKSC_VERSION_1_0[]
531  * [[VUID-VkPipelineShaderStageCreateInfo-maxClipDistances-00708]]
532    If the identified entry point includes any variable in its interface
533    that is declared with the code:ClipDistance code:BuiltIn decoration,
534    that variable must: not have an array size greater than
535    sname:VkPhysicalDeviceLimits::pname:maxClipDistances
536  * [[VUID-VkPipelineShaderStageCreateInfo-maxCullDistances-00709]]
537    If the identified entry point includes any variable in its interface
538    that is declared with the code:CullDistance code:BuiltIn decoration,
539    that variable must: not have an array size greater than
540    sname:VkPhysicalDeviceLimits::pname:maxCullDistances
541  * [[VUID-VkPipelineShaderStageCreateInfo-maxCombinedClipAndCullDistances-00710]]
542    If the identified entry point includes any variables in its interface
543    that are declared with the code:ClipDistance or code:CullDistance
544    code:BuiltIn decoration, those variables must: not have array sizes
545    which sum to more than
546    sname:VkPhysicalDeviceLimits::pname:maxCombinedClipAndCullDistances
547  * [[VUID-VkPipelineShaderStageCreateInfo-maxSampleMaskWords-00711]]
548    If the identified entry point includes any variable in its interface
549    that is declared with the code:SampleMask code:BuiltIn decoration, that
550    variable must: not have an array size greater than
551    sname:VkPhysicalDeviceLimits::pname:maxSampleMaskWords
552  * [[VUID-VkPipelineShaderStageCreateInfo-stage-00713]]
553    If pname:stage is ename:VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT or
554    ename:VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT, and the identified
555    entry point has an code:OpExecutionMode instruction specifying a patch
556    size with code:OutputVertices, the patch size must: be greater than `0`
557    and less than or equal to
558    sname:VkPhysicalDeviceLimits::pname:maxTessellationPatchSize
559  * [[VUID-VkPipelineShaderStageCreateInfo-stage-00714]]
560    If pname:stage is ename:VK_SHADER_STAGE_GEOMETRY_BIT, the identified
561    entry point must: have an code:OpExecutionMode instruction specifying a
562    maximum output vertex count that is greater than `0` and less than or
563    equal to sname:VkPhysicalDeviceLimits::pname:maxGeometryOutputVertices
564  * [[VUID-VkPipelineShaderStageCreateInfo-stage-00715]]
565    If pname:stage is ename:VK_SHADER_STAGE_GEOMETRY_BIT, the identified
566    entry point must: have an code:OpExecutionMode instruction specifying an
567    invocation count that is greater than `0` and less than or equal to
568    sname:VkPhysicalDeviceLimits::pname:maxGeometryShaderInvocations
569  * [[VUID-VkPipelineShaderStageCreateInfo-stage-02596]]
570    If pname:stage is either ename:VK_SHADER_STAGE_VERTEX_BIT,
571    ename:VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT,
572    ename:VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT, or
573    ename:VK_SHADER_STAGE_GEOMETRY_BIT, and the identified entry point
574    writes to code:Layer for any primitive, it must: write the same value to
575    code:Layer for all vertices of a given primitive
576  * [[VUID-VkPipelineShaderStageCreateInfo-stage-02597]]
577    If pname:stage is either ename:VK_SHADER_STAGE_VERTEX_BIT,
578    ename:VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT,
579    ename:VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT, or
580    ename:VK_SHADER_STAGE_GEOMETRY_BIT, and the identified entry point
581    writes to code:ViewportIndex for any primitive, it must: write the same
582    value to code:ViewportIndex for all vertices of a given primitive
583  * [[VUID-VkPipelineShaderStageCreateInfo-stage-06685]]
584    If pname:stage is ename:VK_SHADER_STAGE_FRAGMENT_BIT, and the identified
585    entry point writes to code:FragDepth in any execution path, all
586    execution paths that are not exclusive to helper invocations must:
587    either discard the fragment, or write or initialize the value of
588    code:FragDepth
589ifdef::VK_EXT_shader_stencil_export[]
590  * [[VUID-VkPipelineShaderStageCreateInfo-stage-06686]]
591    If pname:stage is ename:VK_SHADER_STAGE_FRAGMENT_BIT, and the identified
592    entry point writes to code:FragStencilRefEXT in any execution path, all
593    execution paths that are not exclusive to helper invocations must:
594    either discard the fragment, or write or initialize the value of
595    code:FragStencilRefEXT
596endif::VK_EXT_shader_stencil_export[]
597ifdef::VK_VERSION_1_3,VK_EXT_subgroup_size_control[]
598  * [[VUID-VkPipelineShaderStageCreateInfo-flags-02784]]
599    If pname:flags has the
600    ename:VK_PIPELINE_SHADER_STAGE_CREATE_ALLOW_VARYING_SUBGROUP_SIZE_BIT
601    flag set, the <<features-subgroupSizeControl,
602    pname:subgroupSizeControl>> feature must: be enabled
603  * [[VUID-VkPipelineShaderStageCreateInfo-flags-02785]]
604    If pname:flags has the
605    ename:VK_PIPELINE_SHADER_STAGE_CREATE_REQUIRE_FULL_SUBGROUPS_BIT flag
606    set, the <<features-computeFullSubgroups, pname:computeFullSubgroups>>
607    feature must: be enabled
608  * [[VUID-VkPipelineShaderStageCreateInfo-flags-08988]]
609    If pname:flags includes
610    ename:VK_PIPELINE_SHADER_STAGE_CREATE_REQUIRE_FULL_SUBGROUPS_BIT,
611    pname:stage must: be
612ifdef::VK_NV_mesh_shader,VK_EXT_mesh_shader[]
613    one of ename:VK_SHADER_STAGE_MESH_BIT_EXT,
614    ename:VK_SHADER_STAGE_TASK_BIT_EXT, or
615endif::VK_NV_mesh_shader,VK_EXT_mesh_shader[]
616    ename:VK_SHADER_STAGE_COMPUTE_BIT
617  * [[VUID-VkPipelineShaderStageCreateInfo-pNext-02754]]
618    If a slink:VkPipelineShaderStageRequiredSubgroupSizeCreateInfo structure
619    is included in the pname:pNext chain, pname:flags must: not have the
620    ename:VK_PIPELINE_SHADER_STAGE_CREATE_ALLOW_VARYING_SUBGROUP_SIZE_BIT
621    flag set
622  * [[VUID-VkPipelineShaderStageCreateInfo-pNext-02755]]
623    If a slink:VkPipelineShaderStageRequiredSubgroupSizeCreateInfo structure
624    is included in the pname:pNext chain, the
625    <<features-subgroupSizeControl, pname:subgroupSizeControl>> feature
626    must: be enabled, and pname:stage must: be a valid bit specified in
627    <<limits-requiredSubgroupSizeStages, pname:requiredSubgroupSizeStages>>
628  * [[VUID-VkPipelineShaderStageCreateInfo-pNext-02756]]
629    If a slink:VkPipelineShaderStageRequiredSubgroupSizeCreateInfo structure
630    is included in the pname:pNext chain and pname:stage is
631    ename:VK_SHADER_STAGE_COMPUTE_BIT,
632ifdef::VK_NV_mesh_shader,VK_EXT_mesh_shader[ename:VK_SHADER_STAGE_MESH_BIT_EXT, or ename:VK_SHADER_STAGE_TASK_BIT_EXT,]
633    the local workgroup size of the shader must: be less than or equal to
634    the product of
635    slink:VkPipelineShaderStageRequiredSubgroupSizeCreateInfo::pname:requiredSubgroupSize
636    and <<limits-maxComputeWorkgroupSubgroups,
637    pname:maxComputeWorkgroupSubgroups>>
638  * [[VUID-VkPipelineShaderStageCreateInfo-pNext-02757]]
639    If a slink:VkPipelineShaderStageRequiredSubgroupSizeCreateInfo structure
640    is included in the pname:pNext chain, and pname:flags has the
641    ename:VK_PIPELINE_SHADER_STAGE_CREATE_REQUIRE_FULL_SUBGROUPS_BIT flag
642    set, the local workgroup size in the X dimension of the pipeline must:
643    be a multiple of
644    slink:VkPipelineShaderStageRequiredSubgroupSizeCreateInfo::pname:requiredSubgroupSize
645  * [[VUID-VkPipelineShaderStageCreateInfo-flags-02758]]
646    If pname:flags has both the
647    ename:VK_PIPELINE_SHADER_STAGE_CREATE_REQUIRE_FULL_SUBGROUPS_BIT and
648    ename:VK_PIPELINE_SHADER_STAGE_CREATE_ALLOW_VARYING_SUBGROUP_SIZE_BIT
649    flags set, the local workgroup size in the X dimension of the pipeline
650    must: be a multiple of <<limits-maxSubgroupSize, pname:maxSubgroupSize>>
651  * [[VUID-VkPipelineShaderStageCreateInfo-flags-02759]]
652    If pname:flags has the
653    ename:VK_PIPELINE_SHADER_STAGE_CREATE_REQUIRE_FULL_SUBGROUPS_BIT flag
654    set and pname:flags does not have the
655    ename:VK_PIPELINE_SHADER_STAGE_CREATE_ALLOW_VARYING_SUBGROUP_SIZE_BIT
656    flag set and no
657    slink:VkPipelineShaderStageRequiredSubgroupSizeCreateInfo structure is
658    included in the pname:pNext chain, the local workgroup size in the X
659    dimension of the pipeline must: be a multiple of <<limits-subgroup-size,
660    pname:subgroupSize>>
661ifdef::VK_KHR_cooperative_matrix[]
662  * [[VUID-VkPipelineShaderStageCreateInfo-module-08987]]
663    If pname:module uses the code:OpTypeCooperativeMatrixKHR instruction
664    with a code:Scope equal to code:Subgroup, then the local workgroup size
665    in the X dimension of the pipeline must: be a multiple of
666    <<limits-subgroup-size,pname:subgroupSize>>.
667endif::VK_KHR_cooperative_matrix[]
668endif::VK_VERSION_1_3,VK_EXT_subgroup_size_control[]
669
670ifndef::VKSC_VERSION_1_0[]
671  * [[VUID-VkPipelineShaderStageCreateInfo-stage-08771]]
672ifdef::VK_EXT_shader_module_identifier[]
673    If a shader module identifier is not specified for this pname:stage,
674endif::VK_EXT_shader_module_identifier[]
675    pname:module must: be a valid slink:VkShaderModule
676ifdef::VK_EXT_graphics_pipeline_library,VK_KHR_maintenance5[]
677    if none of the following features are enabled:
678ifdef::VK_EXT_graphics_pipeline_library[]
679  ** <<features-graphicsPipelineLibrary, pname:graphicsPipelineLibrary>>
680endif::VK_EXT_graphics_pipeline_library[]
681ifdef::VK_KHR_maintenance5[]
682  ** <<features-maintenance5, pname:maintenance5>>
683endif::VK_KHR_maintenance5[]
684endif::VK_EXT_graphics_pipeline_library,VK_KHR_maintenance5[]
685
686ifdef::VK_EXT_graphics_pipeline_library,VK_KHR_maintenance5[]
687  * [[VUID-VkPipelineShaderStageCreateInfo-stage-06845]]
688ifdef::VK_EXT_shader_module_identifier[]
689    If a shader module identifier is not specified for this pname:stage,
690    pname:module must: be a valid slink:VkShaderModule, or
691endif::VK_EXT_shader_module_identifier[]
692ifndef::VK_EXT_shader_module_identifier[]
693    If pname:module is dlink:VK_NULL_HANDLE]
694endif::VK_EXT_shader_module_identifier[]
695    there must: be a valid slink:VkShaderModuleCreateInfo structure in the
696    pname:pNext chain
697endif::VK_EXT_graphics_pipeline_library,VK_KHR_maintenance5[]
698
699ifdef::VK_EXT_shader_module_identifier[]
700ifdef::VK_EXT_graphics_pipeline_library,VK_KHR_maintenance5[]
701  * [[VUID-VkPipelineShaderStageCreateInfo-stage-06844]]
702    If a shader module identifier is specified for this pname:stage, a
703    slink:VkShaderModuleCreateInfo structure must: not be present in the
704    pname:pNext chain
705endif::VK_EXT_graphics_pipeline_library,VK_KHR_maintenance5[]
706  * [[VUID-VkPipelineShaderStageCreateInfo-stage-06848]]
707    If a shader module identifier is specified for this pname:stage,
708    pname:module must: be dlink:VK_NULL_HANDLE
709endif::VK_EXT_shader_module_identifier[]
710  * [[VUID-VkPipelineShaderStageCreateInfo-pSpecializationInfo-06849]]
711ifdef::VK_EXT_shader_module_identifier[]
712    If a shader module identifier is not specified, the
713endif::VK_EXT_shader_module_identifier[]
714ifndef::VK_EXT_shader_module_identifier[The]
715    shader code used by the pipeline must: be valid as described by the
716    <<spirv-spec,Khronos SPIR-V Specification>> after applying the
717    specializations provided in pname:pSpecializationInfo, if any, and then
718    converting all specialization constants into fixed constants
719endif::VKSC_VERSION_1_0[]
720****
721
722include::{generated}/validity/structs/VkPipelineShaderStageCreateInfo.adoc[]
723--
724
725[open,refpage='VkPipelineShaderStageCreateFlags',desc='Bitmask of VkPipelineShaderStageCreateFlagBits',type='flags']
726--
727include::{generated}/api/flags/VkPipelineShaderStageCreateFlags.adoc[]
728
729tname:VkPipelineShaderStageCreateFlags is a bitmask type for setting a mask
730of zero or more elink:VkPipelineShaderStageCreateFlagBits.
731--
732
733[open,refpage='VkPipelineShaderStageCreateFlagBits',desc='Bitmask controlling how a pipeline shader stage is created',type='enums']
734--
735Possible values of the pname:flags member of
736slink:VkPipelineShaderStageCreateInfo specifying how a pipeline shader stage
737is created, are:
738
739include::{generated}/api/enums/VkPipelineShaderStageCreateFlagBits.adoc[]
740
741ifdef::VK_VERSION_1_3,VK_EXT_subgroup_size_control[]
742  * ename:VK_PIPELINE_SHADER_STAGE_CREATE_ALLOW_VARYING_SUBGROUP_SIZE_BIT
743    specifies that the
744    <<interfaces-builtin-variables-sgs,code:SubgroupSize>> may: vary in the
745    shader stage.
746  * ename:VK_PIPELINE_SHADER_STAGE_CREATE_REQUIRE_FULL_SUBGROUPS_BIT
747    specifies that the subgroup sizes must: be launched with all invocations
748    active in the
749ifdef::VK_NV_mesh_shader,VK_EXT_mesh_shader[task, mesh, or]
750    compute stage.
751
752[NOTE]
753.Note
754====
755If ename:VK_PIPELINE_SHADER_STAGE_CREATE_ALLOW_VARYING_SUBGROUP_SIZE_BIT_EXT
756and ename:VK_PIPELINE_SHADER_STAGE_CREATE_REQUIRE_FULL_SUBGROUPS_BIT_EXT are
757specified and <<limits-minSubgroupSize, pname:minSubgroupSize>> does not
758equal <<limits-maxSubgroupSize, pname:maxSubgroupSize>> and no
759<<pipelines-required-subgroup-size, required subgroup size>> is specified,
760then the only way to guarantee that the 'X' dimension of the local workgroup
761size is a multiple of <<interfaces-builtin-variables-sgs,
762code:SubgroupSize>> is to make it a multiple of pname:maxSubgroupSize.
763Under these conditions, you are guaranteed full subgroups but not any
764particular subgroup size.
765====
766
767endif::VK_VERSION_1_3,VK_EXT_subgroup_size_control[]
768--
769
770[open,refpage='VkShaderStageFlagBits',desc='Bitmask specifying a pipeline stage',type='enums']
771--
772Bits which can: be set by commands and structures, specifying one or more
773shader stages, are:
774
775include::{generated}/api/enums/VkShaderStageFlagBits.adoc[]
776
777  * ename:VK_SHADER_STAGE_VERTEX_BIT specifies the vertex stage.
778  * ename:VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT specifies the
779    tessellation control stage.
780  * ename:VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT specifies the
781    tessellation evaluation stage.
782  * ename:VK_SHADER_STAGE_GEOMETRY_BIT specifies the geometry stage.
783  * ename:VK_SHADER_STAGE_FRAGMENT_BIT specifies the fragment stage.
784  * ename:VK_SHADER_STAGE_COMPUTE_BIT specifies the compute stage.
785  * ename:VK_SHADER_STAGE_ALL_GRAPHICS is a combination of bits used as
786    shorthand to specify all graphics stages defined above (excluding the
787    compute stage).
788  * ename:VK_SHADER_STAGE_ALL is a combination of bits used as shorthand to
789    specify all shader stages supported by the device, including all
790    additional stages which are introduced by extensions.
791ifdef::VK_NV_mesh_shader,VK_EXT_mesh_shader[]
792  * ename:VK_SHADER_STAGE_TASK_BIT_EXT specifies the task stage.
793  * ename:VK_SHADER_STAGE_MESH_BIT_EXT specifies the mesh stage.
794endif::VK_NV_mesh_shader,VK_EXT_mesh_shader[]
795ifdef::VK_HUAWEI_cluster_culling_shader[]
796  * ename:VK_SHADER_STAGE_CLUSTER_CULLING_BIT_HUAWEI specifies the cluster
797    culling stage.
798endif::VK_HUAWEI_cluster_culling_shader[]
799ifdef::VK_NV_ray_tracing,VK_KHR_ray_tracing_pipeline[]
800  * ename:VK_SHADER_STAGE_RAYGEN_BIT_KHR specifies the ray generation stage.
801  * ename:VK_SHADER_STAGE_ANY_HIT_BIT_KHR specifies the any-hit stage.
802  * ename:VK_SHADER_STAGE_CLOSEST_HIT_BIT_KHR specifies the closest hit
803    stage.
804  * ename:VK_SHADER_STAGE_MISS_BIT_KHR specifies the miss stage.
805  * ename:VK_SHADER_STAGE_INTERSECTION_BIT_KHR specifies the intersection
806    stage.
807  * ename:VK_SHADER_STAGE_CALLABLE_BIT_KHR specifies the callable stage.
808endif::VK_NV_ray_tracing,VK_KHR_ray_tracing_pipeline[]
809
810[NOTE]
811.Note
812====
813ename:VK_SHADER_STAGE_ALL_GRAPHICS only includes the original five graphics
814stages included in Vulkan 1.0, and not any stages added by extensions.
815Thus, it may not have the desired effect in all cases.
816====
817--
818
819[open,refpage='VkShaderStageFlags',desc='Bitmask of VkShaderStageFlagBits',type='flags']
820--
821include::{generated}/api/flags/VkShaderStageFlags.adoc[]
822
823tname:VkShaderStageFlags is a bitmask type for setting a mask of zero or
824more elink:VkShaderStageFlagBits.
825--
826
827ifdef::VK_VERSION_1_3,VK_EXT_subgroup_size_control[]
828[open,refpage='VkPipelineShaderStageRequiredSubgroupSizeCreateInfo',desc='Structure specifying the required subgroup size of a newly created pipeline shader stage',type='structs',alias='VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT']
829--
830The sname:VkPipelineShaderStageRequiredSubgroupSizeCreateInfo structure is
831defined as:
832
833include::{generated}/api/structs/VkPipelineShaderStageRequiredSubgroupSizeCreateInfo.adoc[]
834
835ifdef::VK_EXT_subgroup_size_control[]
836or the equivalent
837
838include::{generated}/api/structs/VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT.adoc[]
839endif::VK_EXT_subgroup_size_control[]
840
841ifdef::VK_EXT_shader_object[]
842or the equiavlent
843
844include::{generated}/api/structs/VkShaderRequiredSubgroupSizeCreateInfoEXT.adoc[]
845endif::VK_EXT_shader_object[]
846
847  * pname:sType is a elink:VkStructureType value identifying this structure.
848  * pname:pNext is `NULL` or a pointer to a structure extending this
849    structure.
850  * [[pipelines-required-subgroup-size]] pname:requiredSubgroupSize is an
851    unsigned integer value specifying the required subgroup size for the
852    newly created pipeline shader stage.
853
854If a sname:VkPipelineShaderStageRequiredSubgroupSizeCreateInfo structure is
855included in the pname:pNext chain of slink:VkPipelineShaderStageCreateInfo,
856it specifies that the pipeline shader stage being compiled has a required
857subgroup size.
858
859ifdef::VK_EXT_shader_object[]
860If a sname:VkShaderRequiredSubgroupSizeCreateInfoEXT structure is included
861in the pname:pNext chain of slink:VkShaderCreateInfoEXT, it specifies that
862the shader being compiled has a required subgroup size.
863endif::VK_EXT_shader_object[]
864
865.Valid Usage
866****
867  * [[VUID-VkPipelineShaderStageRequiredSubgroupSizeCreateInfo-requiredSubgroupSize-02760]]
868    pname:requiredSubgroupSize must: be a power-of-two integer
869  * [[VUID-VkPipelineShaderStageRequiredSubgroupSizeCreateInfo-requiredSubgroupSize-02761]]
870    pname:requiredSubgroupSize must: be greater or equal to
871    <<limits-minSubgroupSize, pname:minSubgroupSize>>
872  * [[VUID-VkPipelineShaderStageRequiredSubgroupSizeCreateInfo-requiredSubgroupSize-02762]]
873    pname:requiredSubgroupSize must: be less than or equal to
874    <<limits-maxSubgroupSize, pname:maxSubgroupSize>>
875****
876
877include::{generated}/validity/structs/VkPipelineShaderStageRequiredSubgroupSizeCreateInfo.adoc[]
878--
879endif::VK_VERSION_1_3,VK_EXT_subgroup_size_control[]
880
881ifdef::VK_HUAWEI_subpass_shading[]
882[open,refpage='VkSubpassShadingPipelineCreateInfoHUAWEI',desc='Structure specifying parameters of a newly created subpass shading pipeline',type='structs']
883--
884A subpass shading pipeline is a compute pipeline which must: be called only
885in a subpass of a render pass with work dimensions specified by render area
886size.
887The subpass shading pipeline shader is a compute shader allowed to access
888input attachments specified in the calling subpass.
889To create a subpass shading pipeline, call flink:vkCreateComputePipelines
890with slink:VkSubpassShadingPipelineCreateInfoHUAWEI in the pname:pNext chain
891of slink:VkComputePipelineCreateInfo.
892
893The sname:VkSubpassShadingPipelineCreateInfoHUAWEI structure is defined as:
894
895include::{generated}/api/structs/VkSubpassShadingPipelineCreateInfoHUAWEI.adoc[]
896
897  * pname:sType is a elink:VkStructureType value identifying this structure.
898  * pname:pNext is `NULL` or a pointer to a structure extending this
899    structure.
900  * pname:renderPass is a handle to a render pass object describing the
901    environment in which the pipeline will be used.
902    The pipeline must: only be used with a render pass instance compatible
903    with the one provided.
904    See <<renderpass-compatibility,Render Pass Compatibility>> for more
905    information.
906  * pname:subpass is the index of the subpass in the render pass where this
907    pipeline will be used.
908
909.Valid Usage
910****
911  * [[VUID-VkSubpassShadingPipelineCreateInfoHUAWEI-subpass-04946]]
912    pname:subpass must: be created with
913    ename:VK_PIPELINE_BIND_POINT_SUBPASS_SHADING_HUAWEI bind point
914****
915
916include::{generated}/validity/structs/VkSubpassShadingPipelineCreateInfoHUAWEI.adoc[]
917--
918
919[open,refpage='vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI',desc='Query maximum supported subpass shading workgroup size for a give render pass',type='protos']
920--
921A subpass shading pipeline's workgroup size is a 2D vector with number of
922power-of-two in width and height.
923The maximum number of width and height is implementation-dependent, and may:
924vary for different formats and sample counts of attachments in a render
925pass.
926
927To query the maximum workgroup size, call:
928
929include::{generated}/api/protos/vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI.adoc[]
930
931  * pname:device is a handle to a local device object that was used to
932    create the given render pass.
933  * pname:renderPass is a handle to a render pass object describing the
934    environment in which the pipeline will be used.
935    The pipeline must: only be used with a render pass instance compatible
936    with the one provided.
937    See <<renderpass-compatibility,Render Pass Compatibility>> for more
938    information.
939  * pname:pMaxWorkgroupSize is a pointer to a slink:VkExtent2D structure.
940
941include::{generated}/validity/protos/vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI.adoc[]
942--
943endif::VK_HUAWEI_subpass_shading[]
944
945ifdef::VK_EXT_pipeline_robustness[]
946[open,refpage='VkPipelineRobustnessCreateInfoEXT',desc='Structure controlling the robustness of a newly created pipeline shader stage',type='structs']
947--
948The sname:VkPipelineRobustnessCreateInfoEXT structure is defined as:
949
950include::{generated}/api/structs/VkPipelineRobustnessCreateInfoEXT.adoc[]
951
952  * pname:sType is a elink:VkStructureType value identifying this structure.
953  * pname:pNext is `NULL` or a pointer to a structure extending this
954    structure.
955  * pname:storageBuffers sets the behaviour of out of bounds accesses made
956    to resources bound as:
957  ** ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER
958  ** ename:VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER
959  ** ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC
960  * pname:uniformBuffers describes the behaviour of out of bounds accesses
961    made to resources bound as:
962  ** ename:VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER
963  ** ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER
964  ** ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC
965ifdef::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
966  ** ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK
967endif::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
968  * pname:vertexInputs describes the behaviour of out of bounds accesses
969    made to vertex input attributes
970  * pname:images describes the behaviour of out of bounds accesses made to
971    resources bound as:
972  ** ename:VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE
973  ** ename:VK_DESCRIPTOR_TYPE_STORAGE_IMAGE
974
975ifdef::VK_EXT_mutable_descriptor_type,VK_VALVE_mutable_descriptor_type[]
976Resources bound as ename:VK_DESCRIPTOR_TYPE_MUTABLE_EXT will have the
977robustness behavior that covers its active descriptor type.
978endif::VK_EXT_mutable_descriptor_type,VK_VALVE_mutable_descriptor_type[]
979
980The scope of the effect of sname:VkPipelineRobustnessCreateInfoEXT depends
981on which structure's pname:pNext chain it is included in.
982
983  * sname:VkGraphicsPipelineCreateInfo,
984ifdef::VK_KHR_ray_tracing_pipeline[sname:VkRayTracingPipelineCreateInfoKHR,]
985    sname:VkComputePipelineCreateInfo: +
986    The robustness behavior described by
987    sname:VkPipelineRobustnessCreateInfoEXT applies to all accesses through
988    this pipeline
989  * sname:VkPipelineShaderStageCreateInfo: +
990    The robustness behavior described by
991    sname:VkPipelineRobustnessCreateInfoEXT applies to all accesses
992    emanating from the shader code of this shader stage
993
994If sname:VkPipelineRobustnessCreateInfoEXT is specified for both a pipeline
995and a pipeline stage, the sname:VkPipelineRobustnessCreateInfoEXT specified
996for the pipeline stage will take precedence.
997
998ifdef::VK_KHR_pipeline_library[]
999When sname:VkPipelineRobustnessCreateInfoEXT is specified for a pipeline, it
1000only affects the subset of the pipeline that is specified by the create
1001info, as opposed to subsets linked from pipeline libraries.
1002ifdef::VK_EXT_graphics_pipeline_library[]
1003For slink:VkGraphicsPipelineCreateInfo, that subset is specified by
1004slink:VkGraphicsPipelineLibraryCreateInfoEXT::pname:flags.
1005endif::VK_EXT_graphics_pipeline_library[]
1006ifdef::VK_KHR_ray_tracing_pipeline[]
1007For slink:VkRayTracingPipelineCreateInfoKHR, that subset is specified by the
1008specific stages in slink:VkRayTracingPipelineCreateInfoKHR::pname:pStages.
1009endif::VK_KHR_ray_tracing_pipeline[]
1010endif::VK_KHR_pipeline_library[]
1011
1012.Valid Usage
1013****
1014  * [[VUID-VkPipelineRobustnessCreateInfoEXT-pipelineRobustness-06926]]
1015    If the <<features-pipelineRobustness, pname:pipelineRobustness>> feature
1016    is not enabled, pname:storageBuffers must: be
1017    ename:VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_DEVICE_DEFAULT_EXT
1018  * [[VUID-VkPipelineRobustnessCreateInfoEXT-pipelineRobustness-06927]]
1019    If the <<features-pipelineRobustness, pname:pipelineRobustness>> feature
1020    is not enabled, pname:uniformBuffers must: be
1021    ename:VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_DEVICE_DEFAULT_EXT
1022  * [[VUID-VkPipelineRobustnessCreateInfoEXT-pipelineRobustness-06928]]
1023    If the <<features-pipelineRobustness, pname:pipelineRobustness>> feature
1024    is not enabled, pname:vertexInputs must: be
1025    ename:VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_DEVICE_DEFAULT_EXT
1026  * [[VUID-VkPipelineRobustnessCreateInfoEXT-pipelineRobustness-06929]]
1027    If the <<features-pipelineRobustness, pname:pipelineRobustness>> feature
1028    is not enabled, pname:images must: be
1029    ename:VK_PIPELINE_ROBUSTNESS_IMAGE_BEHAVIOR_DEVICE_DEFAULT_EXT
1030  * [[VUID-VkPipelineRobustnessCreateInfoEXT-robustImageAccess-06930]]
1031    If the <<features-robustImageAccess, pname:robustImageAccess>> feature
1032    is not supported, pname:images must: not be
1033    ename:VK_PIPELINE_ROBUSTNESS_IMAGE_BEHAVIOR_ROBUST_IMAGE_ACCESS_EXT
1034  * [[VUID-VkPipelineRobustnessCreateInfoEXT-robustBufferAccess2-06931]]
1035    If the <<features-robustBufferAccess2, pname:robustBufferAccess2>>
1036    feature is not supported, pname:storageBuffers must: not be
1037    ename:VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_ROBUST_BUFFER_ACCESS_2_EXT
1038  * [[VUID-VkPipelineRobustnessCreateInfoEXT-robustBufferAccess2-06932]]
1039    If the <<features-robustBufferAccess2, pname:robustBufferAccess2>>
1040    feature is not supported, pname:uniformBuffers must: not be
1041    ename:VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_ROBUST_BUFFER_ACCESS_2_EXT
1042  * [[VUID-VkPipelineRobustnessCreateInfoEXT-robustBufferAccess2-06933]]
1043    If the <<features-robustBufferAccess2, pname:robustBufferAccess2>>
1044    feature is not supported, pname:vertexInputs must: not be
1045    ename:VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_ROBUST_BUFFER_ACCESS_2_EXT
1046  * [[VUID-VkPipelineRobustnessCreateInfoEXT-robustImageAccess2-06934]]
1047    If the <<features-robustImageAccess2, pname:robustImageAccess2>> feature
1048    is not supported, pname:images must: not be
1049    ename:VK_PIPELINE_ROBUSTNESS_IMAGE_BEHAVIOR_ROBUST_IMAGE_ACCESS_2_EXT
1050****
1051
1052include::{generated}/validity/structs/VkPipelineRobustnessCreateInfoEXT.adoc[]
1053--
1054
1055[open,refpage='VkPipelineRobustnessBufferBehaviorEXT',desc='Enum controlling the robustness of buffer accesses in a pipeline stage',type='enums']
1056--
1057Possible values of the pname:storageBuffers, pname:uniformBuffers, and
1058pname:vertexInputs members of slink:VkPipelineRobustnessCreateInfoEXT are:
1059
1060include::{generated}/api/enums/VkPipelineRobustnessBufferBehaviorEXT.adoc[]
1061
1062  * ename:VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_DEVICE_DEFAULT_EXT
1063    specifies that this pipeline stage follows the behavior of robustness
1064    features that are enabled on the device that created this pipeline
1065  * ename:VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_DISABLED_EXT specifies that
1066    buffer accesses by this pipeline stage to the relevant resource types
1067    must: not be out of bounds
1068  * ename:VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_ROBUST_BUFFER_ACCESS_EXT
1069    specifies that out of bounds accesses by this pipeline stage to the
1070    relevant resource types behave as if the <<features-robustBufferAccess,
1071    pname:robustBufferAccess>> feature is enabled
1072  * ename:VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_ROBUST_BUFFER_ACCESS_2_EXT
1073    specifies that out of bounds accesses by this pipeline stage to the
1074    relevant resource types behave as if the <<features-robustBufferAccess2,
1075    pname:robustBufferAccess2>> feature is enabled
1076--
1077
1078[open,refpage='VkPipelineRobustnessImageBehaviorEXT',desc='Enum controlling the robustness of image accesses in a pipeline stage',type='enums']
1079--
1080Possible values of the pname:images member of
1081slink:VkPipelineRobustnessCreateInfoEXT are:
1082
1083include::{generated}/api/enums/VkPipelineRobustnessImageBehaviorEXT.adoc[]
1084
1085  * ename:VK_PIPELINE_ROBUSTNESS_IMAGE_BEHAVIOR_DEVICE_DEFAULT_EXT specifies
1086    that this pipeline stage follows the behavior of robustness features
1087    that are enabled on the device that created this pipeline
1088  * ename:VK_PIPELINE_ROBUSTNESS_IMAGE_BEHAVIOR_DISABLED_EXT specifies that
1089    image accesses by this pipeline stage to the relevant resource types
1090    must: not be out of bounds
1091  * ename:VK_PIPELINE_ROBUSTNESS_IMAGE_BEHAVIOR_ROBUST_IMAGE_ACCESS_EXT
1092    specifies that out of bounds accesses by this pipeline stage to images
1093    behave as if the <<features-robustImageAccess, pname:robustImageAccess>>
1094    feature is enabled
1095  * ename:VK_PIPELINE_ROBUSTNESS_IMAGE_BEHAVIOR_ROBUST_IMAGE_ACCESS_2_EXT
1096    specifies that out of bounds accesses by this pipeline stage to images
1097    behave as if the <<features-robustImageAccess2,
1098    pname:robustImageAccess2>> feature is enabled
1099--
1100endif::VK_EXT_pipeline_robustness[]
1101
1102ifdef::VK_EXT_shader_module_identifier[]
1103[open,refpage='VkPipelineShaderStageModuleIdentifierCreateInfoEXT',desc='Structure specifying an identifier for a shader module',type='structs']
1104--
1105An identifier can: be provided instead of shader code in an attempt to
1106compile pipelines without providing complete SPIR-V to the implementation.
1107
1108The sname:VkPipelineShaderStageModuleIdentifierCreateInfoEXT structure is
1109defined as:
1110
1111include::{generated}/api/structs/VkPipelineShaderStageModuleIdentifierCreateInfoEXT.adoc[]
1112
1113  * pname:sType is a elink:VkStructureType value identifying this structure.
1114  * pname:pNext is `NULL` or a pointer to a structure extending this
1115    structure.
1116  * pname:identifierSize is the size, in bytes, of the buffer pointed to by
1117    pname:pIdentifier.
1118  * pname:pIdentifier is a pointer to a buffer of opaque data specifying an
1119    identifier.
1120
1121Any identifier can: be used.
1122If the pipeline being created with identifier requires compilation to
1123complete the pipeline creation call, pipeline compilation must: fail as
1124defined by ename:VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT.
1125
1126pname:pIdentifier and pname:identifierSize can: be obtained from an
1127slink:VkShaderModuleIdentifierEXT queried earlier.
1128
1129.Valid Usage
1130****
1131  * [[VUID-VkPipelineShaderStageModuleIdentifierCreateInfoEXT-pNext-06850]]
1132    If this structure is included in a pname:pNext chain and
1133    pname:identifierSize is not equal to 0, the
1134    <<features-shaderModuleIdentifier, pname:shaderModuleIdentifier>>
1135    feature must: be enabled
1136  * [[VUID-VkPipelineShaderStageModuleIdentifierCreateInfoEXT-pNext-06851]]
1137    If this struct is included in a pname:pNext chain of
1138    slink:VkPipelineShaderStageCreateInfo and pname:identifierSize is not
1139    equal to 0, the pipeline must: be created with the
1140    ename:VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT flag set
1141  * [[VUID-VkPipelineShaderStageModuleIdentifierCreateInfoEXT-identifierSize-06852]]
1142    pname:identifierSize must: be less-or-equal to
1143    ename:VK_MAX_SHADER_MODULE_IDENTIFIER_SIZE_EXT
1144****
1145
1146include::{generated}/validity/structs/VkPipelineShaderStageModuleIdentifierCreateInfoEXT.adoc[]
1147--
1148endif::VK_EXT_shader_module_identifier[]
1149
1150ifdef::VK_NV_device_generated_commands_compute[]
1151If a compute pipeline is going to be used in <<device-generated-commands,
1152Device-Generated Commands>> by specifying its pipeline token with
1153slink:VkBindPipelineIndirectCommandNV, then that pipeline's associated
1154metadata must: be saved at a specified buffer device address for later use
1155in indirect command generation.
1156The buffer device address must: be specified at the time of compute pipeline
1157creation with slink:VkComputePipelineIndirectBufferInfoNV structure in the
1158pname:pNext chain of slink:VkComputePipelineCreateInfo.
1159
1160[open,refpage='VkComputePipelineIndirectBufferInfoNV',desc='Structure describing the device address where pipeline\'s metadata will be saved',type='structs']
1161--
1162The sname:VkComputePipelineIndirectBufferInfoNV structure is defined as:
1163
1164include::{generated}/api/structs/VkComputePipelineIndirectBufferInfoNV.adoc[]
1165
1166  * pname:sType is a elink:VkStructureType value identifying this structure.
1167  * pname:pNext is `NULL` or a pointer to a structure extending this
1168    structure.
1169  * pname:deviceAddress is the address where the pipeline's metadata will be
1170    stored.
1171  * pname:size is the size of pipeline's metadata that was queried using
1172    flink:vkGetPipelineIndirectMemoryRequirementsNV.
1173  * pname:pipelineDeviceAddressCaptureReplay is the device address where
1174    pipeline's metadata was originally saved and can now be used to
1175    re-populate pname:deviceAddress for replay.
1176
1177If pname:pipelineDeviceAddressCaptureReplay is zero, no specific address is
1178requested.
1179If pname:pipelineDeviceAddressCaptureReplay is not zero, then it must: be an
1180address retrieved from an identically created pipeline on the same
1181implementation.
1182The pipeline metadata must: also be placed on an identically created buffer
1183and at the same offset using the flink:vkCmdUpdatePipelineIndirectBufferNV
1184command.
1185
1186.Valid Usage
1187****
1188  * [[VUID-VkComputePipelineIndirectBufferInfoNV-deviceGeneratedComputePipelines-09009]]
1189    The <<features-deviceGeneratedComputePipelines,
1190    sname:VkPhysicalDeviceDeviceGeneratedCommandsComputeFeaturesNV::pname:deviceGeneratedComputePipelines>>
1191    feature must: be enabled
1192  * [[VUID-VkComputePipelineIndirectBufferInfoNV-flags-09010]]
1193    The pipeline creation flags in
1194    slink:VkComputePipelineCreateInfo::pname:flags must: include
1195    ename:VK_PIPELINE_CREATE_INDIRECT_BINDABLE_BIT_NV
1196  * [[VUID-VkComputePipelineIndirectBufferInfoNV-deviceAddress-09011]]
1197    pname:deviceAddress must: be aligned to the
1198    slink:VkMemoryRequirements2::pname:alignment, as returned by
1199    flink:vkGetPipelineIndirectMemoryRequirementsNV
1200  * [[VUID-VkComputePipelineIndirectBufferInfoNV-deviceAddress-09012]]
1201    pname:deviceAddress must: have been allocated from a buffer that was
1202    created with usage ename:VK_BUFFER_USAGE_TRANSFER_DST_BIT and
1203    ename:VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT
1204  * [[VUID-VkComputePipelineIndirectBufferInfoNV-size-09013]]
1205    pname:size must: be greater than or equal to the
1206    slink:VkMemoryRequirements2::pname:size, as returned by
1207    flink:vkGetPipelineIndirectMemoryRequirementsNV
1208  * [[VUID-VkComputePipelineIndirectBufferInfoNV-pipelineDeviceAddressCaptureReplay-09014]]
1209    If pname:pipelineDeviceAddressCaptureReplay is non-zero then the
1210    <<features-deviceGeneratedComputePipelines,
1211    sname:VkPhysicalDeviceDeviceGeneratedCommandsComputeFeaturesNV::pname:deviceGeneratedComputeCaptureReplay>>
1212    feature must: be enabled
1213  * [[VUID-VkComputePipelineIndirectBufferInfoNV-pipelineDeviceAddressCaptureReplay-09015]]
1214    If pname:pipelineDeviceAddressCaptureReplay is non-zero then that
1215    address must: have been allocated with flag
1216    ename:VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT set
1217  * [[VUID-VkComputePipelineIndirectBufferInfoNV-pipelineDeviceAddressCaptureReplay-09016]]
1218    If pname:pipelineDeviceAddressCaptureReplay is non-zero, the
1219    pname:pipeline must: have been recreated for replay
1220  * [[VUID-VkComputePipelineIndirectBufferInfoNV-pipelineDeviceAddressCaptureReplay-09017]]
1221    pname:pipelineDeviceAddressCaptureReplay must: satisfy the
1222    pname:alignment and pname:size requirements similar to
1223    pname:deviceAddress
1224****
1225
1226include::{generated}/validity/structs/VkComputePipelineIndirectBufferInfoNV.adoc[]
1227--
1228
1229[open,refpage='vkCmdUpdatePipelineIndirectBufferNV',desc='Update the indirect compute pipeline\'s metadata',type='protos']
1230--
1231To save a compute pipeline's metadata at a device address call:
1232
1233include::{generated}/api/protos/vkCmdUpdatePipelineIndirectBufferNV.adoc[]
1234
1235  * pname:commandBuffer is the command buffer into which the command will be
1236    recorded.
1237  * pname:pipelineBindPoint is a elink:VkPipelineBindPoint value specifying
1238    the type of pipeline whose metadata will be saved.
1239  * pname:pipeline is the pipeline whose metadata will be saved.
1240
1241fname:vkCmdUpdatePipelineIndirectBufferNV is only allowed outside of a
1242render pass.
1243This command is treated as a "`transfer`" operation for the purposes of
1244synchronization barriers.
1245The writes to the address must: be synchronized using stages
1246ename:VK_PIPELINE_STAGE_2_COPY_BIT and
1247ename:VK_PIPELINE_STAGE_COMMAND_PREPROCESS_BIT_NV and with access masks
1248ename:VK_ACCESS_MEMORY_WRITE_BIT and
1249ename:VK_ACCESS_COMMAND_PREPROCESS_READ_BIT_NV respectively before using the
1250results in preprocessing.
1251
1252.Valid Usage
1253****
1254  * [[VUID-vkCmdUpdatePipelineIndirectBufferNV-pipelineBindPoint-09018]]
1255    pname:pipelineBindPoint must: be ename:VK_PIPELINE_BIND_POINT_COMPUTE
1256  * [[VUID-vkCmdUpdatePipelineIndirectBufferNV-pipeline-09019]]
1257    pname:pipeline must: have been created with
1258    ename:VK_PIPELINE_CREATE_INDIRECT_BINDABLE_BIT_NV flag set
1259  * [[VUID-vkCmdUpdatePipelineIndirectBufferNV-pipeline-09020]]
1260    pname:pipeline must: have been created with
1261    slink:VkComputePipelineIndirectBufferInfoNV structure specifying a valid
1262    address where its metadata will be saved
1263  * [[VUID-vkCmdUpdatePipelineIndirectBufferNV-deviceGeneratedComputePipelines-09021]]
1264    The <<features-deviceGeneratedComputePipelines,
1265    sname:VkPhysicalDeviceDeviceGeneratedCommandsComputeFeaturesNV::pname:deviceGeneratedComputePipelines>>
1266    feature must: be enabled
1267****
1268
1269include::{generated}/validity/protos/vkCmdUpdatePipelineIndirectBufferNV.adoc[]
1270--
1271
1272endif::VK_NV_device_generated_commands_compute[]
1273
1274[[pipelines-graphics]]
1275== Graphics Pipelines
1276
1277Graphics pipelines consist of multiple shader stages, multiple
1278fixed-function pipeline stages, and a pipeline layout.
1279
1280[open,refpage='vkCreateGraphicsPipelines',desc='Create graphics pipelines',type='protos']
1281--
1282:refpage: vkCreateGraphicsPipelines
1283:objectnameplural: graphics pipelines
1284:objectnamecamelcase: graphicsPipeline
1285:objectcount: pname:createInfoCount
1286
1287To create graphics pipelines, call:
1288
1289include::{generated}/api/protos/vkCreateGraphicsPipelines.adoc[]
1290
1291  * pname:device is the logical device that creates the graphics pipelines.
1292ifndef::VKSC_VERSION_1_0[]
1293  * pname:pipelineCache is either dlink:VK_NULL_HANDLE, indicating that
1294    pipeline caching is disabled; or the handle of a valid
1295    <<pipelines-cache,pipeline cache>> object, in which case use of that
1296    cache is enabled for the duration of the command.
1297endif::VKSC_VERSION_1_0[]
1298ifdef::VKSC_VERSION_1_0[]
1299  * pname:pipelineCache is the handle of a valid <<pipelines-cache,pipeline
1300    cache>> object.
1301endif::VKSC_VERSION_1_0[]
1302  * pname:createInfoCount is the length of the pname:pCreateInfos and
1303    pname:pPipelines arrays.
1304  * pname:pCreateInfos is a pointer to an array of
1305    slink:VkGraphicsPipelineCreateInfo structures.
1306  * pname:pAllocator controls host memory allocation as described in the
1307    <<memory-allocation, Memory Allocation>> chapter.
1308  * pname:pPipelines is a pointer to an array of slink:VkPipeline handles in
1309    which the resulting graphics pipeline objects are returned.
1310
1311The slink:VkGraphicsPipelineCreateInfo structure includes an array of
1312slink:VkPipelineShaderStageCreateInfo structures for each of the desired
1313active shader stages, as well as creation information for all relevant
1314fixed-function stages, and a pipeline layout.
1315
1316Pipelines are created and returned as described for <<pipelines-multiple,
1317Multiple Pipeline Creation>>.
1318
1319ifdef::VKSC_VERSION_1_0[]
1320If a pipeline creation fails due to:
1321
1322  * The identified pipeline not being present in pname:pipelineCache
1323  * The pname:pNext chain not including a slink:VkPipelineOfflineCreateInfo
1324    structure
1325
1326the operation will continue as specified in <<pipelines-multiple, Multiple
1327Pipeline Creation>> and the command will return
1328ename:VK_ERROR_NO_PIPELINE_MATCH.
1329ifdef::hidden[]
1330// tag::scdeviation[]
1331  * flink:vkCreateGraphicsPipelines returns ename:VK_ERROR_NO_PIPELINE_MATCH
1332    if the slink:VkGraphicsPipelineCreateInfo::pname:pNext chain does not
1333    include a valid slink:VkPipelineOfflineCreateInfo structure <<SCID-1>>.
1334// end::scdeviation[]
1335endif::hidden[]
1336endif::VKSC_VERSION_1_0[]
1337
1338include::{chapters}/commonvalidity/no_dynamic_allocations_common.adoc[]
1339
1340.Valid Usage
1341****
1342ifndef::VKSC_VERSION_1_0[]
1343  * [[VUID-vkCreateGraphicsPipelines-flags-00720]]
1344    If the pname:flags member of any element of pname:pCreateInfos contains
1345    the ename:VK_PIPELINE_CREATE_DERIVATIVE_BIT flag, and the
1346    pname:basePipelineIndex member of that same element is not `-1`,
1347    pname:basePipelineIndex must: be less than the index into
1348    pname:pCreateInfos that corresponds to that element
1349  * [[VUID-vkCreateGraphicsPipelines-flags-00721]]
1350    If the pname:flags member of any element of pname:pCreateInfos contains
1351    the ename:VK_PIPELINE_CREATE_DERIVATIVE_BIT flag, the base pipeline
1352    must: have been created with the
1353    ename:VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT flag set
1354endif::VKSC_VERSION_1_0[]
1355ifdef::VK_VERSION_1_3,VK_EXT_pipeline_creation_cache_control[]
1356  * [[VUID-vkCreateGraphicsPipelines-pipelineCache-02876]]
1357    If pname:pipelineCache was created with
1358    ename:VK_PIPELINE_CACHE_CREATE_EXTERNALLY_SYNCHRONIZED_BIT, host access
1359    to pname:pipelineCache must: be
1360    <<fundamentals-threadingbehavior,externally synchronized>>
1361endif::VK_VERSION_1_3,VK_EXT_pipeline_creation_cache_control[]
1362include::{chapters}/commonvalidity/memory_reservation_request_count_common.adoc[]
1363****
1364ifdef::VKSC_VERSION_1_0[]
1365ifdef::hidden[]
1366// tag::scdeviation[]
1367  * flink:vkCreateGraphicsPipelines::pname:pipelineCache must: not be
1368    dlink:VK_NULL_HANDLE <<SCID-1>>, <<SCID-8>>.
1369// end::scdeviation[]
1370endif::hidden[]
1371endif::VKSC_VERSION_1_0[]
1372
1373ifdef::VK_VERSION_1_3,VK_EXT_pipeline_creation_cache_control[]
1374[NOTE]
1375.Note
1376====
1377An implicit cache may be provided by the implementation or a layer.
1378For this reason, it is still valid to set
1379ename:VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT on
1380pname:flags for any element of pname:pCreateInfos while passing
1381dlink:VK_NULL_HANDLE for pname:pipelineCache.
1382====
1383endif::VK_VERSION_1_3,VK_EXT_pipeline_creation_cache_control[]
1384
1385include::{generated}/validity/protos/vkCreateGraphicsPipelines.adoc[]
1386--
1387
1388[open,refpage='VkGraphicsPipelineCreateInfo',desc='Structure specifying parameters of a newly created graphics pipeline',type='structs']
1389--
1390:refpage: VkGraphicsPipelineCreateInfo
1391
1392The sname:VkGraphicsPipelineCreateInfo structure is defined as:
1393
1394include::{generated}/api/structs/VkGraphicsPipelineCreateInfo.adoc[]
1395
1396  * pname:sType is a elink:VkStructureType value identifying this structure.
1397  * pname:pNext is `NULL` or a pointer to a structure extending this
1398    structure.
1399  * pname:flags is a bitmask of elink:VkPipelineCreateFlagBits specifying
1400    how the pipeline will be generated.
1401  * pname:stageCount is the number of entries in the pname:pStages array.
1402  * pname:pStages is a pointer to an array of pname:stageCount
1403    slink:VkPipelineShaderStageCreateInfo structures describing the set of
1404    the shader stages to be included in the graphics pipeline.
1405  * pname:pVertexInputState is a pointer to a
1406    slink:VkPipelineVertexInputStateCreateInfo structure.
1407ifdef::VK_NV_mesh_shader,VK_EXT_mesh_shader[]
1408    It is ignored if the pipeline includes a mesh shader stage.
1409endif::VK_NV_mesh_shader,VK_EXT_mesh_shader[]
1410ifdef::VK_EXT_vertex_input_dynamic_state[]
1411    It can: be `NULL` if the pipeline is created with the
1412    ename:VK_DYNAMIC_STATE_VERTEX_INPUT_EXT dynamic state set.
1413endif::VK_EXT_vertex_input_dynamic_state[]
1414  * pname:pInputAssemblyState is a pointer to a
1415    slink:VkPipelineInputAssemblyStateCreateInfo structure which determines
1416    input assembly behavior for vertex shading, as described in <<drawing,
1417    Drawing Commands>>.
1418ifdef::VK_EXT_extended_dynamic_state3[]
1419    If the `apiext:VK_EXT_extended_dynamic_state3` extension is enabled, it
1420    can: be `NULL` if the pipeline is created with both
1421    ename:VK_DYNAMIC_STATE_PRIMITIVE_RESTART_ENABLE, and
1422    ename:VK_DYNAMIC_STATE_PRIMITIVE_TOPOLOGY dynamic states set and
1423    <<limits-dynamicPrimitiveTopologyUnrestricted,
1424    pname:dynamicPrimitiveTopologyUnrestricted>> is ename:VK_TRUE.
1425endif::VK_EXT_extended_dynamic_state3[]
1426ifdef::VK_NV_mesh_shader,VK_EXT_mesh_shader[]
1427    It is ignored if the pipeline includes a mesh shader stage.
1428endif::VK_NV_mesh_shader,VK_EXT_mesh_shader[]
1429  * pname:pTessellationState is a pointer to a
1430    slink:VkPipelineTessellationStateCreateInfo structure defining
1431    tessellation state used by tessellation shaders.
1432ifdef::VK_EXT_extended_dynamic_state2[]
1433    It can: be `NULL` if the pipeline is created with the
1434    ename:VK_DYNAMIC_STATE_PATCH_CONTROL_POINTS_EXT dynamic state set.
1435endif::VK_EXT_extended_dynamic_state2[]
1436  * pname:pViewportState is a pointer to a
1437    slink:VkPipelineViewportStateCreateInfo structure defining viewport
1438    state used when rasterization is enabled.
1439ifdef::VK_EXT_extended_dynamic_state3[]
1440    If the `apiext:VK_EXT_extended_dynamic_state3` extension is enabled, it
1441    can: be `NULL` if the pipeline is created with both
1442    ename:VK_DYNAMIC_STATE_VIEWPORT_WITH_COUNT, and
1443    ename:VK_DYNAMIC_STATE_SCISSOR_WITH_COUNT dynamic states set.
1444endif::VK_EXT_extended_dynamic_state3[]
1445  * pname:pRasterizationState is a pointer to a
1446    slink:VkPipelineRasterizationStateCreateInfo structure defining
1447    rasterization state.
1448ifdef::VK_EXT_extended_dynamic_state3[]
1449    If the `apiext:VK_EXT_extended_dynamic_state3` extension is enabled, it
1450    can: be `NULL` if the pipeline is created with all of
1451    ename:VK_DYNAMIC_STATE_DEPTH_CLAMP_ENABLE_EXT,
1452    ename:VK_DYNAMIC_STATE_RASTERIZER_DISCARD_ENABLE,
1453    ename:VK_DYNAMIC_STATE_POLYGON_MODE_EXT,
1454    ename:VK_DYNAMIC_STATE_CULL_MODE, ename:VK_DYNAMIC_STATE_FRONT_FACE,
1455    ename:VK_DYNAMIC_STATE_DEPTH_BIAS_ENABLE,
1456    ename:VK_DYNAMIC_STATE_DEPTH_BIAS, and ename:VK_DYNAMIC_STATE_LINE_WIDTH
1457    dynamic states set.
1458endif::VK_EXT_extended_dynamic_state3[]
1459  * pname:pMultisampleState is a pointer to a
1460    slink:VkPipelineMultisampleStateCreateInfo structure defining
1461    multisample state used when rasterization is enabled.
1462ifdef::VK_EXT_extended_dynamic_state3[]
1463    If the `apiext:VK_EXT_extended_dynamic_state3` extension is enabled, it
1464    can: be `NULL` if the pipeline is created with all of
1465    ename:VK_DYNAMIC_STATE_RASTERIZATION_SAMPLES_EXT,
1466    ename:VK_DYNAMIC_STATE_SAMPLE_MASK_EXT, and
1467    ename:VK_DYNAMIC_STATE_ALPHA_TO_COVERAGE_ENABLE_EXT dynamic states set,
1468    and either <<features-alphaToOne,alphaToOne>> is disabled on the device
1469    or ename:VK_DYNAMIC_STATE_ALPHA_TO_ONE_ENABLE_EXT is set, in which case
1470    slink:VkPipelineMultisampleStateCreateInfo::pname:sampleShadingEnable is
1471    assumed to be ename:VK_FALSE.
1472endif::VK_EXT_extended_dynamic_state3[]
1473  * pname:pDepthStencilState is a pointer to a
1474    slink:VkPipelineDepthStencilStateCreateInfo structure defining
1475    depth/stencil state used when rasterization is enabled for depth or
1476    stencil attachments accessed during rendering.
1477ifdef::VK_EXT_extended_dynamic_state3[]
1478    If the `apiext:VK_EXT_extended_dynamic_state3` extension is enabled, it
1479    can: be `NULL` if the pipeline is created with all of
1480    ename:VK_DYNAMIC_STATE_DEPTH_TEST_ENABLE,
1481    ename:VK_DYNAMIC_STATE_DEPTH_WRITE_ENABLE,
1482    ename:VK_DYNAMIC_STATE_DEPTH_COMPARE_OP,
1483    ename:VK_DYNAMIC_STATE_DEPTH_BOUNDS_TEST_ENABLE,
1484    ename:VK_DYNAMIC_STATE_STENCIL_TEST_ENABLE,
1485    ename:VK_DYNAMIC_STATE_STENCIL_OP, and
1486    ename:VK_DYNAMIC_STATE_DEPTH_BOUNDS dynamic states set.
1487endif::VK_EXT_extended_dynamic_state3[]
1488  * pname:pColorBlendState is a pointer to a
1489    slink:VkPipelineColorBlendStateCreateInfo structure defining color blend
1490    state used when rasterization is enabled for any color attachments
1491    accessed during rendering.
1492ifdef::VK_EXT_extended_dynamic_state3[]
1493    If the `apiext:VK_EXT_extended_dynamic_state3` extension is enabled, it
1494    can: be `NULL` if the pipeline is created with all of
1495    ename:VK_DYNAMIC_STATE_LOGIC_OP_ENABLE_EXT,
1496    ename:VK_DYNAMIC_STATE_LOGIC_OP_EXT,
1497    ename:VK_DYNAMIC_STATE_COLOR_BLEND_ENABLE_EXT,
1498    ename:VK_DYNAMIC_STATE_COLOR_BLEND_EQUATION_EXT,
1499    ename:VK_DYNAMIC_STATE_COLOR_WRITE_MASK_EXT, and
1500    ename:VK_DYNAMIC_STATE_BLEND_CONSTANTS dynamic states set.
1501endif::VK_EXT_extended_dynamic_state3[]
1502  * pname:pDynamicState is a pointer to a
1503    slink:VkPipelineDynamicStateCreateInfo structure defining which
1504    properties of the pipeline state object are dynamic and can: be changed
1505    independently of the pipeline state.
1506    This can: be `NULL`, which means no state in the pipeline is considered
1507    dynamic.
1508  * pname:layout is the description of binding locations used by both the
1509    pipeline and descriptor sets used with the pipeline.
1510  * pname:renderPass is a handle to a render pass object describing the
1511    environment in which the pipeline will be used.
1512    The pipeline must: only be used with a render pass instance compatible
1513    with the one provided.
1514    See <<renderpass-compatibility,Render Pass Compatibility>> for more
1515    information.
1516  * pname:subpass is the index of the subpass in the render pass where this
1517    pipeline will be used.
1518  * pname:basePipelineHandle is a pipeline to derive from.
1519ifdef::VKSC_VERSION_1_0[]
1520    This is not used in Vulkan SC <<SCID-8>>.
1521endif::VKSC_VERSION_1_0[]
1522  * pname:basePipelineIndex is an index into the pname:pCreateInfos
1523    parameter to use as a pipeline to derive from.
1524ifdef::VKSC_VERSION_1_0[]
1525    This is not used in Vulkan SC <<SCID-8>>.
1526endif::VKSC_VERSION_1_0[]
1527
1528The parameters pname:basePipelineHandle and pname:basePipelineIndex are
1529described in more detail in <<pipelines-pipeline-derivatives,Pipeline
1530Derivatives>>.
1531
1532ifdef::VK_NV_glsl_shader[]
1533If any shader stage fails to compile,
1534ifdef::VK_EXT_debug_report[]
1535the compile log will be reported back to the application, and
1536endif::VK_EXT_debug_report[]
1537ename:VK_ERROR_INVALID_SHADER_NV will be generated.
1538endif::VK_NV_glsl_shader[]
1539
1540ifdef::VK_EXT_extended_dynamic_state3[]
1541[NOTE]
1542.Note
1543====
1544With `apiext:VK_EXT_extended_dynamic_state3`, it is possible that many of
1545the sname:VkGraphicsPipelineCreateInfo members above can: be `NULL` because
1546all their state is dynamic and therefore ignored.
1547This is optional so the application can: still use a valid pointer if it
1548needs to set the pname:pNext or pname:flags fields to specify state for
1549other extensions.
1550====
1551endif::VK_EXT_extended_dynamic_state3[]
1552
1553[[pipelines-graphics-subsets]]
1554The state required for a graphics pipeline is divided into
1555<<pipelines-graphics-subsets-vertex-input, vertex input state>>,
1556<<pipelines-graphics-subsets-pre-rasterization,pre-rasterization shader
1557state>>, <<pipelines-graphics-subsets-fragment-shader,fragment shader
1558state>>, and <<pipelines-graphics-subsets-fragment-output,fragment output
1559state>>.
1560
1561[[pipelines-graphics-subsets-vertex-input]]
1562.Vertex Input State
1563Vertex input state is defined by:
1564
1565  * slink:VkPipelineVertexInputStateCreateInfo
1566  * slink:VkPipelineInputAssemblyStateCreateInfo
1567
1568ifndef::VK_EXT_mesh_shader[]
1569This state must: be specified to create a
1570<<pipelines-graphics-subsets-complete,complete graphics pipeline>>.
1571endif::VK_EXT_mesh_shader[]
1572
1573ifdef::VK_EXT_mesh_shader[]
1574If
1575ifdef::VK_EXT_graphics_pipeline_library[]
1576this pipeline specifies
1577<<pipelines-graphics-subsets-pre-rasterization,pre-rasterization state>>
1578either directly or by including it as a pipeline library and its
1579endif::VK_EXT_graphics_pipeline_library[]
1580pname:pStages includes a vertex shader, this state must: be specified to
1581create a <<pipelines-graphics-subsets-complete,complete graphics pipeline>>.
1582endif::VK_EXT_mesh_shader[]
1583
1584ifdef::VK_EXT_graphics_pipeline_library[]
1585If a pipeline includes
1586ename:VK_GRAPHICS_PIPELINE_LIBRARY_VERTEX_INPUT_INTERFACE_BIT_EXT in
1587slink:VkGraphicsPipelineLibraryCreateInfoEXT::pname:flags either explicitly
1588or as a default, and either the conditions requiring this state for a
1589<<pipelines-graphics-subsets-complete,complete graphics pipeline>> are met
1590or this pipeline does not specify
1591<<pipelines-graphics-subsets-pre-rasterization,pre-rasterization state>> in
1592any way, that pipeline must: specify this state directly.
1593endif::VK_EXT_graphics_pipeline_library[]
1594
1595
1596[[pipelines-graphics-subsets-pre-rasterization]]
1597.Pre-Rasterization Shader State
1598Pre-rasterization shader state is defined by:
1599
1600  * slink:VkPipelineShaderStageCreateInfo entries for:
1601  ** Vertex shaders
1602  ** Tessellation control shaders
1603  ** Tessellation evaluation shaders
1604  ** Geometry shaders
1605ifdef::VK_NV_mesh_shader,VK_EXT_mesh_shader[]
1606  ** Task shaders
1607  ** Mesh shaders
1608endif::VK_NV_mesh_shader,VK_EXT_mesh_shader[]
1609ifdef::VK_EXT_graphics_pipeline_library[]
1610  * Within the slink:VkPipelineLayout, all descriptor sets with
1611    pre-rasterization shader bindings if
1612    ename:VK_PIPELINE_LAYOUT_CREATE_INDEPENDENT_SETS_BIT_EXT was specified.
1613  ** If ename:VK_PIPELINE_LAYOUT_CREATE_INDEPENDENT_SETS_BIT_EXT was not
1614     specified, the full pipeline layout must be specified.
1615endif::VK_EXT_graphics_pipeline_library[]
1616ifndef::VK_EXT_graphics_pipeline_library[]
1617  * Within the slink:VkPipelineLayout, the full pipeline layout must be
1618    specified.
1619endif::VK_EXT_graphics_pipeline_library[]
1620  * slink:VkPipelineViewportStateCreateInfo
1621  * slink:VkPipelineRasterizationStateCreateInfo
1622  * slink:VkPipelineTessellationStateCreateInfo
1623  * slink:VkRenderPass and pname:subpass parameter
1624ifdef::VK_VERSION_1_3,VK_KHR_dynamic_rendering[]
1625  * The pname:viewMask parameter of slink:VkPipelineRenderingCreateInfo
1626    (formats are ignored)
1627endif::VK_VERSION_1_3,VK_KHR_dynamic_rendering[]
1628ifdef::VK_EXT_discard_rectangles[]
1629  * slink:VkPipelineDiscardRectangleStateCreateInfoEXT
1630endif::VK_EXT_discard_rectangles[]
1631ifdef::VK_KHR_fragment_shading_rate[]
1632  * slink:VkPipelineFragmentShadingRateStateCreateInfoKHR
1633endif::VK_KHR_fragment_shading_rate[]
1634
1635This state must: be specified to create a
1636<<pipelines-graphics-subsets-complete,complete graphics pipeline>>.
1637
1638ifdef::VK_EXT_graphics_pipeline_library[]
1639If either the pname:pNext chain includes a
1640slink:VkGraphicsPipelineLibraryCreateInfoEXT structure with
1641ename:VK_GRAPHICS_PIPELINE_LIBRARY_PRE_RASTERIZATION_SHADERS_BIT_EXT
1642included in pname:flags, or it is not specified and would default to include
1643that value, this state must: be specified in the pipeline.
1644endif::VK_EXT_graphics_pipeline_library[]
1645
1646
1647[[pipelines-graphics-subsets-fragment-shader]]
1648.Fragment Shader State
1649Fragment shader state is defined by:
1650
1651  * A slink:VkPipelineShaderStageCreateInfo entry for the fragment shader
1652ifdef::VK_EXT_graphics_pipeline_library[]
1653  * Within the slink:VkPipelineLayout, all descriptor sets with fragment
1654    shader bindings if
1655    ename:VK_PIPELINE_LAYOUT_CREATE_INDEPENDENT_SETS_BIT_EXT was specified.
1656  ** If ename:VK_PIPELINE_LAYOUT_CREATE_INDEPENDENT_SETS_BIT_EXT was not
1657     specified, the full pipeline layout must be specified.
1658endif::VK_EXT_graphics_pipeline_library[]
1659ifndef::VK_EXT_graphics_pipeline_library[]
1660  * Within the slink:VkPipelineLayout, the full pipeline layout must be
1661    specified.
1662endif::VK_EXT_graphics_pipeline_library[]
1663  * slink:VkPipelineMultisampleStateCreateInfo
1664ifdef::VK_VERSION_1_3,VK_KHR_dynamic_rendering[]
1665    if <<primsrast-sampleshading, sample shading>> is enabled or
1666    pname:renderpass is not dlink:VK_NULL_HANDLE
1667endif::VK_VERSION_1_3,VK_KHR_dynamic_rendering[]
1668  * slink:VkPipelineDepthStencilStateCreateInfo
1669  * slink:VkRenderPass and pname:subpass parameter
1670ifdef::VK_VERSION_1_3,VK_KHR_dynamic_rendering[]
1671  * The pname:viewMask parameter of slink:VkPipelineRenderingCreateInfo
1672    (formats are ignored)
1673endif::VK_VERSION_1_3,VK_KHR_dynamic_rendering[]
1674ifdef::VK_KHR_fragment_shading_rate[]
1675  * slink:VkPipelineFragmentShadingRateStateCreateInfoKHR
1676ifdef::VK_NV_fragment_shading_rate_enums[]
1677  * slink:VkPipelineFragmentShadingRateEnumStateCreateInfoNV
1678endif::VK_NV_fragment_shading_rate_enums[]
1679endif::VK_KHR_fragment_shading_rate[]
1680ifdef::VK_NV_representative_fragment_test[]
1681  * slink:VkPipelineRepresentativeFragmentTestStateCreateInfoNV
1682endif::VK_NV_representative_fragment_test[]
1683ifdef::VK_KHR_fragment_shading_rate[]
1684  * Inclusion/omission of the
1685    ename:VK_PIPELINE_RASTERIZATION_STATE_CREATE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR
1686    flag
1687endif::VK_KHR_fragment_shading_rate[]
1688ifdef::VK_EXT_fragment_density_map[]
1689  * Inclusion/omission of the
1690    ename:VK_PIPELINE_RASTERIZATION_STATE_CREATE_FRAGMENT_DENSITY_MAP_ATTACHMENT_BIT_EXT
1691    flag
1692endif::VK_EXT_fragment_density_map[]
1693
1694If
1695ifdef::VK_EXT_graphics_pipeline_library[]
1696a pipeline specifies
1697<<pipelines-graphics-subsets-pre-rasterization,pre-rasterization state>>
1698either directly or by including it as a pipeline library and
1699endif::VK_EXT_graphics_pipeline_library[]
1700pname:rasterizerDiscardEnable is set to ename:VK_FALSE
1701ifdef::VK_VERSION_1_3,VK_EXT_extended_dynamic_state2[]
1702or ename:VK_DYNAMIC_STATE_RASTERIZER_DISCARD_ENABLE is used,
1703endif::VK_VERSION_1_3,VK_EXT_extended_dynamic_state2[]
1704ifdef::VK_EXT_graphics_pipeline_library[]
1705endif::VK_EXT_graphics_pipeline_library[]
1706this state must: be specified to create a
1707<<pipelines-graphics-subsets-complete,complete graphics pipeline>>.
1708
1709ifdef::VK_EXT_graphics_pipeline_library[]
1710If a pipeline includes
1711ename:VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT in
1712slink:VkGraphicsPipelineLibraryCreateInfoEXT::pname:flags either explicitly
1713or as a default, and either the conditions requiring this state for a
1714<<pipelines-graphics-subsets-complete,complete graphics pipeline>> are met
1715or this pipeline does not specify
1716<<pipelines-graphics-subsets-pre-rasterization,pre-rasterization state>> in
1717any way, that pipeline must: specify this state directly.
1718endif::VK_EXT_graphics_pipeline_library[]
1719
1720
1721[[pipelines-graphics-subsets-fragment-output]]
1722.Fragment Output State
1723Fragment output state is defined by:
1724
1725  * slink:VkPipelineColorBlendStateCreateInfo
1726  * slink:VkRenderPass and pname:subpass parameter
1727  * slink:VkPipelineMultisampleStateCreateInfo
1728ifdef::VK_VERSION_1_3,VK_KHR_dynamic_rendering[]
1729  * slink:VkPipelineRenderingCreateInfo
1730ifdef::VK_AMD_mixed_attachment_samples[]
1731  * slink:VkAttachmentSampleCountInfoAMD
1732endif::VK_AMD_mixed_attachment_samples[]
1733ifdef::VK_NV_framebuffer_mixed_samples[]
1734  * slink:VkAttachmentSampleCountInfoNV
1735endif::VK_NV_framebuffer_mixed_samples[]
1736ifdef::VK_ANDROID_external_format_resolve[]
1737  * slink:VkExternalFormatANDROID
1738endif::VK_ANDROID_external_format_resolve[]
1739endif::VK_VERSION_1_3,VK_KHR_dynamic_rendering[]
1740ifdef::VK_EXT_attachment_feedback_loop_layout[]
1741  * Inclusion/omission of the
1742    ename:VK_PIPELINE_CREATE_COLOR_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT and
1743    ename:VK_PIPELINE_CREATE_DEPTH_STENCIL_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT
1744    flags
1745endif::VK_EXT_attachment_feedback_loop_layout[]
1746
1747If
1748ifdef::VK_EXT_graphics_pipeline_library[]
1749a pipeline specifies
1750<<pipelines-graphics-subsets-pre-rasterization,pre-rasterization state>>
1751either directly or by including it as a pipeline library and
1752endif::VK_EXT_graphics_pipeline_library[]
1753pname:rasterizerDiscardEnable is set to ename:VK_FALSE
1754ifdef::VK_VERSION_1_3,VK_EXT_extended_dynamic_state2[]
1755or ename:VK_DYNAMIC_STATE_RASTERIZER_DISCARD_ENABLE is used,
1756endif::VK_VERSION_1_3,VK_EXT_extended_dynamic_state2[]
1757ifdef::VK_EXT_graphics_pipeline_library[]
1758endif::VK_EXT_graphics_pipeline_library[]
1759this state must: be specified to create a
1760<<pipelines-graphics-subsets-complete,complete graphics pipeline>>.
1761
1762ifdef::VK_EXT_graphics_pipeline_library[]
1763If a pipeline includes
1764ename:VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_OUTPUT_INTERFACE_BIT_EXT in
1765slink:VkGraphicsPipelineLibraryCreateInfoEXT::pname:flags either explicitly
1766or as a default, and either the conditions requiring this state for a
1767<<pipelines-graphics-subsets-complete,complete graphics pipeline>> are met
1768or this pipeline does not specify
1769<<pipelines-graphics-subsets-pre-rasterization,pre-rasterization state>> in
1770any way, that pipeline must: specify this state directly.
1771endif::VK_EXT_graphics_pipeline_library[]
1772
1773
1774[[pipelines-graphics-subsets-dynamic-state]]
1775.Dynamic State
1776Dynamic state values set via pname:pDynamicState must: be ignored if the
1777state they correspond to is not otherwise statically set by one of the state
1778subsets used to create the pipeline.
1779ifdef::VK_EXT_graphics_pipeline_library[]
1780Additionally, setting dynamic state values must: not modify whether state in
1781a linked library is static or dynamic; this is set and unchangeable when the
1782library is created.
1783endif::VK_EXT_graphics_pipeline_library[]
1784For example, if a pipeline only included
1785<<pipelines-graphics-subsets-pre-rasterization, pre-rasterization shader
1786state>>, then any dynamic state value corresponding to depth or stencil
1787testing has no effect.
1788ifdef::VK_EXT_graphics_pipeline_library[]
1789Any linked library that has dynamic state enabled that same dynamic state
1790must: also be enabled in all the other linked libraries to which that
1791dynamic state applies.
1792endif::VK_EXT_graphics_pipeline_library[]
1793
1794[[pipelines-graphics-subsets-complete]]
1795.Complete Graphics Pipelines
1796
1797A complete graphics pipeline always includes
1798<<pipelines-graphics-subsets-pre-rasterization, pre-rasterization shader
1799state>>, with other subsets included depending on that state as specified in
1800the above sections.
1801
1802ifdef::VK_EXT_graphics_pipeline_library[]
1803.Graphics Pipeline Library Layouts
1804
1805If different subsets are linked together with pipeline layouts created with
1806ename:VK_PIPELINE_LAYOUT_CREATE_INDEPENDENT_SETS_BIT_EXT, the final
1807effective pipeline layout is effectively the union of the linked pipeline
1808layouts.
1809When binding descriptor sets for this pipeline, the pipeline layout used
1810must: be compatible with this union.
1811This pipeline layout can: be overridden when linking with
1812ename:VK_PIPELINE_CREATE_LINK_TIME_OPTIMIZATION_BIT_EXT by providing a
1813slink:VkPipelineLayout that is <<descriptorsets-compatibility,compatible>>
1814with this union other than
1815ename:VK_PIPELINE_LAYOUT_CREATE_INDEPENDENT_SETS_BIT_EXT, or when linking
1816without ename:VK_PIPELINE_CREATE_LINK_TIME_OPTIMIZATION_BIT_EXT by providing
1817a slink:VkPipelineLayout that is fully
1818<<descriptorsets-compatibility,compatible>> with this union.
1819endif::VK_EXT_graphics_pipeline_library[]
1820
1821ifdef::VK_KHR_maintenance5[]
1822If a slink:VkPipelineCreateFlags2CreateInfoKHR structure is present in the
1823pname:pNext chain, slink:VkPipelineCreateFlags2CreateInfoKHR::pname:flags
1824from that structure is used instead of pname:flags from this structure.
1825endif::VK_KHR_maintenance5[]
1826
1827ifdef::VKSC_VERSION_1_0[]
1828In Vulkan SC, the pipeline compilation process occurs
1829<<pipelines-offline-compilation,offline>> and the pname:pStages are not
1830needed at runtime and may: be omitted.
1831If omitted, pname:stageCount must: be set to `0` and pname:pStages must: be
1832`NULL`.
1833If provided, the values must: match the values specified to the offline
1834compiler.
1835endif::VKSC_VERSION_1_0[]
1836
1837.Valid Usage
1838****
1839:pipelineType: graphics
1840include::{chapters}/commonvalidity/pipeline_create_info_common.adoc[]
1841  * [[VUID-VkGraphicsPipelineCreateInfo-stage-02096]]
1842    If the pipeline requires <<pipelines-graphics-subsets-pre-rasterization,
1843    pre-rasterization shader state>> the pname:stage member of one element
1844    of pname:pStages must: be ename:VK_SHADER_STAGE_VERTEX_BIT
1845ifdef::VK_NV_mesh_shader,VK_EXT_mesh_shader[]
1846    or ename:VK_SHADER_STAGE_MESH_BIT_EXT
1847endif::VK_NV_mesh_shader,VK_EXT_mesh_shader[]
1848ifdef::VK_NV_mesh_shader,VK_EXT_mesh_shader[]
1849  * [[VUID-VkGraphicsPipelineCreateInfo-pStages-02095]]
1850    If the pipeline requires <<pipelines-graphics-subsets-pre-rasterization,
1851    pre-rasterization shader state>> the geometric shader stages provided in
1852    pname:pStages must: be either from the mesh shading pipeline
1853    (pname:stage is ename:VK_SHADER_STAGE_TASK_BIT_EXT or
1854    ename:VK_SHADER_STAGE_MESH_BIT_EXT) or from the primitive shading
1855    pipeline (pname:stage is ename:VK_SHADER_STAGE_VERTEX_BIT,
1856    ename:VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT,
1857    ename:VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT, or
1858    ename:VK_SHADER_STAGE_GEOMETRY_BIT)
1859endif::VK_NV_mesh_shader,VK_EXT_mesh_shader[]
1860ifdef::VK_NV_mesh_shader+VK_EXT_mesh_shader[]
1861  * [[VUID-VkGraphicsPipelineCreateInfo-TaskNV-07063]]
1862    The shader stages for ename:VK_SHADER_STAGE_TASK_BIT_EXT or
1863    ename:VK_SHADER_STAGE_MESH_BIT_EXT must: use either the code:TaskNV and
1864    code:MeshNV {ExecutionModel} or the code:TaskEXT and code:MeshEXT
1865    {ExecutionModel}, but must: not use both
1866endif::VK_NV_mesh_shader+VK_EXT_mesh_shader[]
1867  * [[VUID-VkGraphicsPipelineCreateInfo-pStages-00729]]
1868    If the pipeline requires <<pipelines-graphics-subsets-pre-rasterization,
1869    pre-rasterization shader state>> and pname:pStages includes a
1870    tessellation control shader stage, it must: include a tessellation
1871    evaluation shader stage
1872  * [[VUID-VkGraphicsPipelineCreateInfo-pStages-00730]]
1873    If the pipeline requires <<pipelines-graphics-subsets-pre-rasterization,
1874    pre-rasterization shader state>> and pname:pStages includes a
1875    tessellation evaluation shader stage, it must: include a tessellation
1876    control shader stage
1877  * [[VUID-VkGraphicsPipelineCreateInfo-pStages-09022]]
1878    If the pipeline requires <<pipelines-graphics-subsets-pre-rasterization,
1879    pre-rasterization shader state>> and pname:pStages includes a
1880    tessellation control shader stage,
1881ifdef::VK_EXT_extended_dynamic_state3[]
1882    and the `apiext:VK_EXT_extended_dynamic_state3` extension is not enabled
1883    or the ename:VK_DYNAMIC_STATE_PATCH_CONTROL_POINTS_EXT dynamic state is
1884    not set,
1885endif::VK_EXT_extended_dynamic_state3[]
1886    pname:pTessellationState must: be a valid pointer to a valid
1887    slink:VkPipelineTessellationStateCreateInfo structure
1888ifdef::VK_EXT_extended_dynamic_state3[]
1889  * [[VUID-VkGraphicsPipelineCreateInfo-pTessellationState-09023]]
1890    If pname:pTessellationState is not `NULL` it must: be a pointer to a
1891    valid slink:VkPipelineTessellationStateCreateInfo structure
1892endif::VK_EXT_extended_dynamic_state3[]
1893  * [[VUID-VkGraphicsPipelineCreateInfo-pStages-00732]]
1894    If the pipeline requires <<pipelines-graphics-subsets-pre-rasterization,
1895    pre-rasterization shader state>> and pname:pStages includes tessellation
1896    shader stages, the shader code of at least one stage must: contain an
1897    code:OpExecutionMode instruction specifying the type of subdivision in
1898    the pipeline
1899  * [[VUID-VkGraphicsPipelineCreateInfo-pStages-00733]]
1900    If the pipeline requires <<pipelines-graphics-subsets-pre-rasterization,
1901    pre-rasterization shader state>> and pname:pStages includes tessellation
1902    shader stages, and the shader code of both stages contain an
1903    code:OpExecutionMode instruction specifying the type of subdivision in
1904    the pipeline, they must: both specify the same subdivision mode
1905  * [[VUID-VkGraphicsPipelineCreateInfo-pStages-00734]]
1906    If the pipeline requires <<pipelines-graphics-subsets-pre-rasterization,
1907    pre-rasterization shader state>> and pname:pStages includes tessellation
1908    shader stages, the shader code of at least one stage must: contain an
1909    code:OpExecutionMode instruction specifying the output patch size in the
1910    pipeline
1911  * [[VUID-VkGraphicsPipelineCreateInfo-pStages-00735]]
1912    If the pipeline requires <<pipelines-graphics-subsets-pre-rasterization,
1913    pre-rasterization shader state>> and pname:pStages includes tessellation
1914    shader stages, and the shader code of both contain an
1915    code:OpExecutionMode instruction specifying the out patch size in the
1916    pipeline, they must: both specify the same patch size
1917  * [[VUID-VkGraphicsPipelineCreateInfo-pStages-08888]]
1918    If the pipeline is being created with
1919    <<pipelines-graphics-subsets-pre-rasterization, pre-rasterization shader
1920    state>> and <<pipelines-graphics-subsets-vertex-input, vertex input
1921    state>> and pname:pStages includes tessellation shader stages,
1922ifdef::VK_EXT_extended_dynamic_state3[]
1923    and either ename:VK_DYNAMIC_STATE_PRIMITIVE_TOPOLOGY dynamic state is
1924    not enabled or
1925    <<limits-dynamicPrimitiveTopologyUnrestricted,pname:dynamicPrimitiveTopologyUnrestricted>>
1926    is ename:VK_FALSE,
1927endif::VK_EXT_extended_dynamic_state3[]
1928    the pname:topology member of pname:pInputAssembly must: be
1929    ename:VK_PRIMITIVE_TOPOLOGY_PATCH_LIST
1930  * [[VUID-VkGraphicsPipelineCreateInfo-topology-08889]]
1931    If the pipeline is being created with
1932    <<pipelines-graphics-subsets-pre-rasterization, pre-rasterization shader
1933    state>> and <<pipelines-graphics-subsets-vertex-input, vertex input
1934    state>> and the pname:topology member of pname:pInputAssembly is
1935    ename:VK_PRIMITIVE_TOPOLOGY_PATCH_LIST,
1936ifdef::VK_EXT_extended_dynamic_state3[]
1937    and either ename:VK_DYNAMIC_STATE_PRIMITIVE_TOPOLOGY dynamic state is
1938    not enabled or
1939    <<limits-dynamicPrimitiveTopologyUnrestricted,pname:dynamicPrimitiveTopologyUnrestricted>>
1940    is ename:VK_FALSE,
1941endif::VK_EXT_extended_dynamic_state3[]
1942    then pname:pStages must: include tessellation shader stages
1943  * [[VUID-VkGraphicsPipelineCreateInfo-TessellationEvaluation-07723]]
1944    If the pipeline is being created with a code:TessellationEvaluation
1945    {ExecutionModel}, no code:Geometry {ExecutionModel}, uses the
1946    code:PointMode {ExecutionMode}, and
1947    <<features-shaderTessellationAndGeometryPointSize,
1948    pname:shaderTessellationAndGeometryPointSize>> is enabled, a
1949    code:PointSize decorated variable must: be written to
1950ifdef::VK_KHR_maintenance5[]
1951    if <<features-maintenance5, pname:maintenance5>> is not enabled
1952endif::VK_KHR_maintenance5[]
1953  * [[VUID-VkGraphicsPipelineCreateInfo-topology-08773]]
1954    If the pipeline is being created with a code:Vertex {ExecutionModel} and
1955    no code:TessellationEvaluation or code:Geometry {ExecutionModel}, and
1956    the pname:topology member of pname:pInputAssembly is
1957    ename:VK_PRIMITIVE_TOPOLOGY_POINT_LIST,
1958ifdef::VK_EXT_extended_dynamic_state3[]
1959    and either ename:VK_DYNAMIC_STATE_PRIMITIVE_TOPOLOGY dynamic state is
1960    not enabled or
1961    <<limits-dynamicPrimitiveTopologyUnrestricted,pname:dynamicPrimitiveTopologyUnrestricted>>
1962    is ename:VK_FALSE,
1963endif::VK_EXT_extended_dynamic_state3[]
1964    a code:PointSize decorated variable must: be written to
1965ifdef::VK_KHR_maintenance5[]
1966    if <<features-maintenance5, pname:maintenance5>> is not enabled
1967endif::VK_KHR_maintenance5[]
1968ifdef::VK_KHR_maintenance5[]
1969  * [[VUID-VkGraphicsPipelineCreateInfo-maintenance5-08775]]
1970    If <<features-maintenance5, pname:maintenance5>> is enabled and a
1971    code:PointSize decorated variable is written to, all execution paths
1972    must: write to a code:PointSize decorated variable
1973endif::VK_KHR_maintenance5[]
1974  * [[VUID-VkGraphicsPipelineCreateInfo-TessellationEvaluation-07724]]
1975    If the pipeline is being created with a code:TessellationEvaluation
1976    {ExecutionModel}, no code:Geometry {ExecutionModel}, uses the
1977    code:PointMode {ExecutionMode}, and
1978    <<features-shaderTessellationAndGeometryPointSize,
1979    pname:shaderTessellationAndGeometryPointSize>> is not enabled, a
1980    code:PointSize decorated variable must: not be written to
1981  * [[VUID-VkGraphicsPipelineCreateInfo-shaderTessellationAndGeometryPointSize-08776]]
1982    If the pipeline is being created with a code:Geometry {ExecutionModel},
1983    uses the code:OutputPoints {ExecutionMode}, and
1984    <<features-shaderTessellationAndGeometryPointSize,
1985    pname:shaderTessellationAndGeometryPointSize>> is enabled, a
1986    code:PointSize decorated variable must: be written to for every vertex
1987    emitted
1988ifdef::VK_KHR_maintenance5[]
1989    if <<features-maintenance5, pname:maintenance5>> is not enabled
1990endif::VK_KHR_maintenance5[]
1991  * [[VUID-VkGraphicsPipelineCreateInfo-Geometry-07726]]
1992    If the pipeline is being created with a code:Geometry {ExecutionModel},
1993    uses the code:OutputPoints {ExecutionMode}, and
1994    <<features-shaderTessellationAndGeometryPointSize,
1995    pname:shaderTessellationAndGeometryPointSize>> is not enabled, a
1996    code:PointSize decorated variable must: not be written to
1997  * [[VUID-VkGraphicsPipelineCreateInfo-pStages-00738]]
1998    If the pipeline requires <<pipelines-graphics-subsets-pre-rasterization,
1999    pre-rasterization shader state>> and pname:pStages includes a geometry
2000    shader stage, and does not include any tessellation shader stages, its
2001    shader code must: contain an code:OpExecutionMode instruction specifying
2002    an input primitive type that is <<shaders-geometry-execution,
2003    compatible>> with the primitive topology specified in
2004    pname:pInputAssembly
2005  * [[VUID-VkGraphicsPipelineCreateInfo-pStages-00739]]
2006    If the pipeline requires <<pipelines-graphics-subsets-pre-rasterization,
2007    pre-rasterization shader state>> and pname:pStages includes a geometry
2008    shader stage, and also includes tessellation shader stages, its shader
2009    code must: contain an code:OpExecutionMode instruction specifying an
2010    input primitive type that is <<shaders-geometry-execution, compatible>>
2011    with the primitive topology that is output by the tessellation stages
2012  * [[VUID-VkGraphicsPipelineCreateInfo-pStages-00740]]
2013    If the pipeline requires <<pipelines-graphics-subsets-pre-rasterization,
2014    pre-rasterization shader state>> and
2015    <<pipelines-graphics-subsets-fragment-shader, fragment shader state>>,
2016    it includes both a fragment shader and a geometry shader, and the
2017    fragment shader code reads from an input variable that is decorated with
2018    code:PrimitiveId, then the geometry shader code must: write to a
2019    matching output variable, decorated with code:PrimitiveId, in all
2020    execution paths
2021ifdef::VK_NV_mesh_shader,VK_EXT_mesh_shader[]
2022  * [[VUID-VkGraphicsPipelineCreateInfo-PrimitiveId-06264]]
2023    If the pipeline requires <<pipelines-graphics-subsets-pre-rasterization,
2024    pre-rasterization shader state>>, it includes a mesh shader and the
2025    fragment shader code reads from an input variable that is decorated with
2026    code:PrimitiveId, then the mesh shader code must: write to a matching
2027    output variable, decorated with code:PrimitiveId, in all execution paths
2028endif::VK_NV_mesh_shader,VK_EXT_mesh_shader[]
2029  * [[VUID-VkGraphicsPipelineCreateInfo-renderPass-06038]]
2030    If pname:renderPass is not dlink:VK_NULL_HANDLE and the pipeline is
2031    being created with <<pipelines-graphics-subsets-fragment-shader,
2032    fragment shader state>> the fragment shader must: not read from any
2033    input attachment that is defined as ename:VK_ATTACHMENT_UNUSED in
2034    pname:subpass
2035  * [[VUID-VkGraphicsPipelineCreateInfo-pStages-00742]]
2036    If the pipeline requires <<pipelines-graphics-subsets-pre-rasterization,
2037    pre-rasterization shader state>> and multiple pre-rasterization shader
2038    stages are included in pname:pStages, the shader code for the entry
2039    points identified by those pname:pStages and the rest of the state
2040    identified by this structure must: adhere to the pipeline linking rules
2041    described in the <<interfaces,Shader Interfaces>> chapter
2042  * [[VUID-VkGraphicsPipelineCreateInfo-None-04889]]
2043    If the pipeline requires <<pipelines-graphics-subsets-pre-rasterization,
2044    pre-rasterization shader state>> and
2045    <<pipelines-graphics-subsets-fragment-shader, fragment shader state>>,
2046    the fragment shader and last
2047    <<pipelines-graphics-subsets-pre-rasterization,pre-rasterization shader
2048    stage>> and any relevant state must: adhere to the pipeline linking
2049    rules described in the <<interfaces,Shader Interfaces>> chapter
2050  * [[VUID-VkGraphicsPipelineCreateInfo-renderPass-06041]]
2051    If pname:renderPass is not dlink:VK_NULL_HANDLE, and the pipeline is
2052    being created with <<pipelines-graphics-subsets-fragment-output,
2053    fragment output interface state>>, then for each color attachment in the
2054    subpass, if the <<potential-format-features,potential format features>>
2055    of the format of the corresponding attachment description do not contain
2056    ename:VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT, then the
2057    pname:blendEnable member of the corresponding element of the
2058    pname:pAttachments member of pname:pColorBlendState must: be
2059    ename:VK_FALSE
2060  * [[VUID-VkGraphicsPipelineCreateInfo-renderPass-07609]]
2061    If pname:renderPass is not dlink:VK_NULL_HANDLE, and the pipeline is
2062    being created with <<pipelines-graphics-subsets-fragment-output,
2063    fragment output interface state>>, and the pname:pColorBlendState
2064    pointer is not `NULL`, and the subpass uses color attachments, the
2065    pname:attachmentCount member of pname:pColorBlendState must: be equal to
2066    the pname:colorAttachmentCount used to create pname:subpass
2067  * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-04130]]
2068    If the pipeline requires <<pipelines-graphics-subsets-pre-rasterization,
2069    pre-rasterization shader state>>, and pname:pViewportState->pViewports
2070    is not dynamic, then pname:pViewportState->pViewports must: be a valid
2071    pointer to an array of pname:pViewportState->viewportCount valid
2072    sname:VkViewport structures
2073  * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-04131]]
2074    If the pipeline requires <<pipelines-graphics-subsets-pre-rasterization,
2075    pre-rasterization shader state>>, and pname:pViewportState->pScissors is
2076    not dynamic, then pname:pViewportState->pScissors must: be a valid
2077    pointer to an array of pname:pViewportState->scissorCount sname:VkRect2D
2078    structures
2079  * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-00749]]
2080    If the pipeline requires <<pipelines-graphics-subsets-pre-rasterization,
2081    pre-rasterization shader state>>, and the <<features-wideLines,
2082    pname:wideLines>> feature is not enabled, and no element of the
2083    pname:pDynamicStates member of pname:pDynamicState is
2084    ename:VK_DYNAMIC_STATE_LINE_WIDTH, the pname:lineWidth member of
2085    pname:pRasterizationState must: be `1.0`
2086  * [[VUID-VkGraphicsPipelineCreateInfo-rasterizerDiscardEnable-09024]]
2087    If the pipeline requires <<pipelines-graphics-subsets-pre-rasterization,
2088    pre-rasterization shader state>>, and
2089ifdef::VK_VERSION_1_3,VK_EXT_extended_dynamic_state2[]
2090    the ename:VK_DYNAMIC_STATE_RASTERIZER_DISCARD_ENABLE dynamic state is
2091    enabled or
2092endif::VK_VERSION_1_3,VK_EXT_extended_dynamic_state2[]
2093    the pname:rasterizerDiscardEnable member of pname:pRasterizationState is
2094    ename:VK_FALSE,
2095ifdef::VK_EXT_extended_dynamic_state3[]
2096    and either the `apiext:VK_EXT_extended_dynamic_state3` extension is not
2097    enabled, or either the ename:VK_DYNAMIC_STATE_VIEWPORT_WITH_COUNT or
2098    ename:VK_DYNAMIC_STATE_SCISSOR_WITH_COUNT dynamic states are not set,
2099endif::VK_EXT_extended_dynamic_state3[]
2100    pname:pViewportState must: be a valid pointer to a valid
2101    slink:VkPipelineViewportStateCreateInfo structure
2102ifdef::VK_EXT_extended_dynamic_state3[]
2103  * [[VUID-VkGraphicsPipelineCreateInfo-pViewportState-09025]]
2104    If pname:pViewportState is not `NULL` it must: be a valid pointer to a
2105    valid slink:VkPipelineViewportStateCreateInfo structure
2106endif::VK_EXT_extended_dynamic_state3[]
2107  * [[VUID-VkGraphicsPipelineCreateInfo-pMultisampleState-09026]]
2108    If the pipeline requires <<pipelines-graphics-subsets-fragment-output,
2109    fragment output interface state>>,
2110ifdef::VK_EXT_extended_dynamic_state3[]
2111    and the `apiext:VK_EXT_extended_dynamic_state3` extension is not enabled
2112    or any of the ename:VK_DYNAMIC_STATE_RASTERIZATION_SAMPLES_EXT,
2113    ename:VK_DYNAMIC_STATE_SAMPLE_MASK_EXT, or
2114    ename:VK_DYNAMIC_STATE_ALPHA_TO_COVERAGE_ENABLE_EXT dynamic states is
2115    not set, or <<features-alphaToOne,alphaToOne>> is enabled on the device
2116    and ename:VK_DYNAMIC_STATE_ALPHA_TO_ONE_ENABLE_EXT is not set,
2117endif::VK_EXT_extended_dynamic_state3[]
2118    pname:pMultisampleState must: be a valid pointer to a valid
2119    slink:VkPipelineMultisampleStateCreateInfo structure
2120  * [[VUID-VkGraphicsPipelineCreateInfo-pMultisampleState-09027]]
2121    If pname:pMultisampleState is not `NULL` it must: be a valid pointer to
2122    a valid slink:VkPipelineMultisampleStateCreateInfo structure
2123  * [[VUID-VkGraphicsPipelineCreateInfo-alphaToCoverageEnable-08891]]
2124    If the pipeline is being created with
2125    <<pipelines-graphics-subsets-fragment-shader, fragment shader state>>,
2126    the
2127    slink:VkPipelineMultisampleStateCreateInfo::pname:alphaToCoverageEnable
2128    is not ignored and is ename:VK_TRUE, then the
2129    <<interfaces-fragmentoutput, Fragment Output Interface>> must: contain a
2130    variable for the alpha code:Component word in code:Location 0 at
2131    code:Index 0
2132  * [[VUID-VkGraphicsPipelineCreateInfo-renderPass-09028]]
2133    If pname:renderPass is not dlink:VK_NULL_HANDLE, the pipeline is being
2134    created with <<pipelines-graphics-subsets-fragment-shader, fragment
2135    shader state>>, and pname:subpass uses a depth/stencil attachment,
2136ifdef::VK_EXT_extended_dynamic_state3[]
2137    and the `apiext:VK_EXT_extended_dynamic_state3` extension is not enabled
2138    or, any of the ename:VK_DYNAMIC_STATE_DEPTH_TEST_ENABLE,
2139    ename:VK_DYNAMIC_STATE_DEPTH_WRITE_ENABLE,
2140    ename:VK_DYNAMIC_STATE_DEPTH_COMPARE_OP,
2141    ename:VK_DYNAMIC_STATE_DEPTH_BOUNDS_TEST_ENABLE,
2142    ename:VK_DYNAMIC_STATE_STENCIL_TEST_ENABLE,
2143    ename:VK_DYNAMIC_STATE_STENCIL_OP, or
2144    ename:VK_DYNAMIC_STATE_DEPTH_BOUNDS dynamic states are not set,
2145endif::VK_EXT_extended_dynamic_state3[]
2146    pname:pDepthStencilState must: be a valid pointer to a valid
2147    slink:VkPipelineDepthStencilStateCreateInfo structure
2148  * [[VUID-VkGraphicsPipelineCreateInfo-pDepthStencilState-09029]]
2149    If pname:pDepthStencilState is not `NULL` it must: be a valid pointer to
2150    a valid slink:VkPipelineDepthStencilStateCreateInfo structure
2151  * [[VUID-VkGraphicsPipelineCreateInfo-renderPass-09030]]
2152    If pname:renderPass is not dlink:VK_NULL_HANDLE, the pipeline is being
2153    created with <<pipelines-graphics-subsets-fragment-output, fragment
2154    output interface state>>, and pname:subpass uses color attachments,
2155ifdef::VK_EXT_extended_dynamic_state3[]
2156    and `apiext:VK_EXT_extended_dynamic_state3` extension is not enabled, or
2157    any of the ename:VK_DYNAMIC_STATE_LOGIC_OP_ENABLE_EXT,
2158    ename:VK_DYNAMIC_STATE_LOGIC_OP_EXT,
2159    ename:VK_DYNAMIC_STATE_COLOR_BLEND_ENABLE_EXT,
2160    ename:VK_DYNAMIC_STATE_COLOR_BLEND_EQUATION_EXT,
2161    ename:VK_DYNAMIC_STATE_COLOR_WRITE_MASK_EXT, or
2162    ename:VK_DYNAMIC_STATE_BLEND_CONSTANTS dynamic states are not set,
2163endif::VK_EXT_extended_dynamic_state3[]
2164    pname:pColorBlendState must: be a valid pointer to a valid
2165    slink:VkPipelineColorBlendStateCreateInfo structure
2166  * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-00754]]
2167    If the pipeline requires <<pipelines-graphics-subsets-pre-rasterization,
2168    pre-rasterization shader state>>, the <<features-depthBiasClamp,
2169    pname:depthBiasClamp>> feature is not enabled, no element of the
2170    pname:pDynamicStates member of pname:pDynamicState is
2171    ename:VK_DYNAMIC_STATE_DEPTH_BIAS, and the pname:depthBiasEnable member
2172    of pname:pRasterizationState is ename:VK_TRUE, the pname:depthBiasClamp
2173    member of pname:pRasterizationState must: be `0.0`
2174  * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-02510]]
2175    If the pipeline requires <<pipelines-graphics-subsets-fragment-shader,
2176    fragment shader state>>,
2177ifdef::VK_EXT_depth_range_unrestricted[]
2178    the `apiext:VK_EXT_depth_range_unrestricted` extension is not enabled
2179endif::VK_EXT_depth_range_unrestricted[]
2180    and no element of the pname:pDynamicStates member of pname:pDynamicState
2181    is ename:VK_DYNAMIC_STATE_DEPTH_BOUNDS, and the
2182    pname:depthBoundsTestEnable member of pname:pDepthStencilState is
2183    ename:VK_TRUE, the pname:minDepthBounds and pname:maxDepthBounds members
2184    of pname:pDepthStencilState must: be between `0.0` and `1.0`, inclusive
2185ifdef::VK_EXT_sample_locations[]
2186  * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-07610]]
2187    If the pipeline requires <<pipelines-graphics-subsets-fragment-shader,
2188    fragment shader state>> or <<pipelines-graphics-subsets-fragment-output,
2189    fragment output interface state>>, and pname:rasterizationSamples and
2190    pname:sampleLocationsInfo are not dynamic, and
2191    slink:VkPipelineSampleLocationsStateCreateInfoEXT::pname:sampleLocationsEnable
2192    included in the pname:pNext chain of pname:pMultisampleState is
2193    ename:VK_TRUE, pname:sampleLocationsInfo.sampleLocationGridSize.width
2194    must: evenly divide
2195    slink:VkMultisamplePropertiesEXT::pname:sampleLocationGridSize.width as
2196    returned by flink:vkGetPhysicalDeviceMultisamplePropertiesEXT with a
2197    pname:samples parameter equaling pname:rasterizationSamples
2198  * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-07611]]
2199    If the pipeline requires <<pipelines-graphics-subsets-fragment-shader,
2200    fragment shader state>> or <<pipelines-graphics-subsets-fragment-output,
2201    fragment output interface state>>, and pname:rasterizationSamples and
2202    pname:sampleLocationsInfo are not dynamic, and
2203    slink:VkPipelineSampleLocationsStateCreateInfoEXT::pname:sampleLocationsEnable
2204    the included in the pname:pNext chain of pname:pMultisampleState is
2205    ename:VK_TRUE or ename:VK_DYNAMIC_STATE_SAMPLE_LOCATIONS_ENABLE_EXT is
2206    used, pname:sampleLocationsInfo.sampleLocationGridSize.height must:
2207    evenly divide
2208    slink:VkMultisamplePropertiesEXT::pname:sampleLocationGridSize.height as
2209    returned by flink:vkGetPhysicalDeviceMultisamplePropertiesEXT with a
2210    pname:samples parameter equaling pname:rasterizationSamples
2211  * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-07612]]
2212    If the pipeline requires <<pipelines-graphics-subsets-fragment-shader,
2213    fragment shader state>> or <<pipelines-graphics-subsets-fragment-output,
2214    fragment output interface state>>, and pname:rasterizationSamples and
2215    pname:sampleLocationsInfo are not dynamic, and
2216    slink:VkPipelineSampleLocationsStateCreateInfoEXT::pname:sampleLocationsEnable
2217    included in the pname:pNext chain of pname:pMultisampleState is
2218    ename:VK_TRUE or ename:VK_DYNAMIC_STATE_SAMPLE_LOCATIONS_ENABLE_EXT is
2219    used, pname:sampleLocationsInfo.sampleLocationsPerPixel must: equal
2220    pname:rasterizationSamples
2221  * [[VUID-VkGraphicsPipelineCreateInfo-sampleLocationsEnable-01524]]
2222    If the pipeline requires <<pipelines-graphics-subsets-fragment-shader,
2223    fragment shader state>>, and the pname:sampleLocationsEnable member of a
2224    slink:VkPipelineSampleLocationsStateCreateInfoEXT structure included in
2225    the pname:pNext chain of pname:pMultisampleState is ename:VK_TRUE, the
2226    fragment shader code must: not statically use the extended instruction
2227    code:InterpolateAtSample
2228endif::VK_EXT_sample_locations[]
2229ifdef::VK_EXT_multisampled_render_to_single_sampled[]
2230  * [[VUID-VkGraphicsPipelineCreateInfo-multisampledRenderToSingleSampled-06853]]
2231    If the pipeline requires <<pipelines-graphics-subsets-fragment-output,
2232    fragment output interface state>>, and none of the
2233    `apiext:VK_AMD_mixed_attachment_samples` extension, the
2234    `apiext:VK_NV_framebuffer_mixed_samples` extension, or the
2235    <<features-multisampledRenderToSingleSampled,
2236    pname:multisampledRenderToSingleSampled>> feature are enabled,
2237    pname:rasterizationSamples is not dynamic, and if pname:subpass uses
2238    color and/or depth/stencil attachments, then the
2239    pname:rasterizationSamples member of pname:pMultisampleState must: be
2240    the same as the sample count for those subpass attachments
2241endif::VK_EXT_multisampled_render_to_single_sampled[]
2242ifdef::VK_AMD_mixed_attachment_samples[]
2243  * [[VUID-VkGraphicsPipelineCreateInfo-subpass-01505]]
2244    If the pipeline requires <<pipelines-graphics-subsets-fragment-output,
2245    fragment output interface state>>, and the
2246    `apiext:VK_AMD_mixed_attachment_samples` extension is enabled,
2247    pname:rasterizationSamples is not dynamic, and if pname:subpass uses
2248    color and/or depth/stencil attachments, then the
2249    pname:rasterizationSamples member of pname:pMultisampleState must: equal
2250    the maximum of the sample counts of those subpass attachments
2251endif::VK_AMD_mixed_attachment_samples[]
2252ifdef::VK_EXT_multisampled_render_to_single_sampled[]
2253  * [[VUID-VkGraphicsPipelineCreateInfo-renderPass-06854]]
2254    If pname:renderPass is not dlink:VK_NULL_HANDLE, the
2255    `apiext:VK_EXT_multisampled_render_to_single_sampled` extension is
2256    enabled, pname:rasterizationSamples is not dynamic, and pname:subpass
2257    has a slink:VkMultisampledRenderToSingleSampledInfoEXT structure
2258    included in the slink:VkSubpassDescription2::pname:pNext chain with
2259    pname:multisampledRenderToSingleSampledEnable equal to ename:VK_TRUE,
2260    then the pname:rasterizationSamples member of pname:pMultisampleState
2261    must: be equal to
2262    slink:VkMultisampledRenderToSingleSampledInfoEXT::pname:rasterizationSamples
2263endif::VK_EXT_multisampled_render_to_single_sampled[]
2264ifdef::VK_NV_framebuffer_mixed_samples[]
2265  * [[VUID-VkGraphicsPipelineCreateInfo-subpass-01411]]
2266    If the pipeline requires <<pipelines-graphics-subsets-fragment-output,
2267    fragment output interface state>>, the
2268    `apiext:VK_NV_framebuffer_mixed_samples` extension is enabled,
2269    pname:rasterizationSamples is not dynamic, and if pname:subpass has a
2270    depth/stencil attachment and depth test, stencil test, or depth bounds
2271    test are enabled, then the pname:rasterizationSamples member of
2272    pname:pMultisampleState must: be the same as the sample count of the
2273    depth/stencil attachment
2274  * [[VUID-VkGraphicsPipelineCreateInfo-subpass-01412]]
2275    If the pipeline requires <<pipelines-graphics-subsets-fragment-output,
2276    fragment output interface state>>, the
2277    `apiext:VK_NV_framebuffer_mixed_samples` extension is enabled,
2278    pname:rasterizationSamples is not dynamic, and if pname:subpass has any
2279    color attachments, then the pname:rasterizationSamples member of
2280    pname:pMultisampleState must: be greater than or equal to the sample
2281    count for those subpass attachments
2282endif::VK_NV_framebuffer_mixed_samples[]
2283ifdef::VK_NV_coverage_reduction_mode[]
2284  * [[VUID-VkGraphicsPipelineCreateInfo-coverageReductionMode-02722]]
2285    If the pipeline requires <<pipelines-graphics-subsets-fragment-output,
2286    fragment output interface state>>, the
2287    `apiext:VK_NV_coverage_reduction_mode` extension is enabled, and
2288    pname:rasterizationSamples is not dynamic, the coverage reduction mode
2289    specified by
2290    slink:VkPipelineCoverageReductionStateCreateInfoNV::pname:coverageReductionMode,
2291    the pname:rasterizationSamples member of pname:pMultisampleState and the
2292    sample counts for the color and depth/stencil attachments (if the
2293    subpass has them) must: be a valid combination returned by
2294    fname:vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV
2295endif::VK_NV_coverage_reduction_mode[]
2296  * [[VUID-VkGraphicsPipelineCreateInfo-subpass-00758]]
2297    If the pipeline requires <<pipelines-graphics-subsets-fragment-output,
2298    fragment output interface state>>, pname:rasterizationSamples is not
2299    dynamic, and pname:subpass does not use any color and/or depth/stencil
2300    attachments, then the pname:rasterizationSamples member of
2301    pname:pMultisampleState must: follow the rules for a
2302    <<renderpass-noattachments, zero-attachment subpass>>
2303  * [[VUID-VkGraphicsPipelineCreateInfo-renderPass-06046]]
2304    If pname:renderPass is not dlink:VK_NULL_HANDLE, pname:subpass must: be
2305    a valid subpass within pname:renderPass
2306ifdef::VK_VERSION_1_1,VK_KHR_multiview[]
2307  * [[VUID-VkGraphicsPipelineCreateInfo-renderPass-06047]]
2308    If pname:renderPass is not dlink:VK_NULL_HANDLE, the pipeline is being
2309    created with <<pipelines-graphics-subsets-pre-rasterization,
2310    pre-rasterization shader state>>, pname:subpass viewMask is not `0`, and
2311    pname:multiviewTessellationShader is not enabled, then pname:pStages
2312    must: not include tessellation shaders
2313  * [[VUID-VkGraphicsPipelineCreateInfo-renderPass-06048]]
2314    If pname:renderPass is not dlink:VK_NULL_HANDLE, the pipeline is being
2315    created with <<pipelines-graphics-subsets-pre-rasterization,
2316    pre-rasterization shader state>>, pname:subpass viewMask is not `0`, and
2317    pname:multiviewGeometryShader is not enabled, then pname:pStages must:
2318    not include a geometry shader
2319  * [[VUID-VkGraphicsPipelineCreateInfo-renderPass-06049]]
2320    If pname:renderPass is not dlink:VK_NULL_HANDLE, the pipeline is being
2321    created with <<pipelines-graphics-subsets-pre-rasterization,
2322    pre-rasterization shader state>>, and pname:subpass viewMask is not `0`,
2323    all of the shaders in the pipeline must: not write to the code:Layer
2324    built-in output
2325  * [[VUID-VkGraphicsPipelineCreateInfo-renderPass-06050]]
2326    If pname:renderPass is not dlink:VK_NULL_HANDLE and the pipeline is
2327    being created with <<pipelines-graphics-subsets-pre-rasterization,
2328    pre-rasterization shader state>>, and pname:subpass viewMask is not `0`,
2329    then all of the shaders in the pipeline must: not include variables
2330    decorated with the code:Layer built-in decoration in their interfaces
2331  * [[VUID-VkGraphicsPipelineCreateInfo-renderPass-07717]]
2332    If pname:renderPass is not dlink:VK_NULL_HANDLE and the pipeline is
2333    being created with <<pipelines-graphics-subsets-pre-rasterization,
2334    pre-rasterization shader state>>, and pname:subpass viewMask is not `0`,
2335    then all of the shaders in the pipeline must: not include variables
2336    decorated with the code:ViewMask built-in decoration in their interfaces
2337ifdef::VK_EXT_mesh_shader[]
2338  * [[VUID-VkGraphicsPipelineCreateInfo-renderPass-07064]]
2339    If pname:renderPass is not dlink:VK_NULL_HANDLE, the pipeline is being
2340    created with <<pipelines-graphics-subsets-pre-rasterization,
2341    pre-rasterization shader state>>, pname:subpass viewMask is not `0`, and
2342    pname:multiviewMeshShader is not enabled, then pname:pStages must: not
2343    include a mesh shader
2344endif::VK_EXT_mesh_shader[]
2345endif::VK_VERSION_1_1,VK_KHR_multiview[]
2346ifdef::VK_VERSION_1_1,VK_KHR_device_group[]
2347  * [[VUID-VkGraphicsPipelineCreateInfo-flags-00764]]
2348    pname:flags must: not contain the ename:VK_PIPELINE_CREATE_DISPATCH_BASE
2349    flag
2350endif::VK_VERSION_1_1,VK_KHR_device_group[]
2351ifdef::VK_VERSION_1_1,VK_KHR_maintenance2,VK_KHR_create_renderpass2[]
2352  * [[VUID-VkGraphicsPipelineCreateInfo-pStages-01565]]
2353    If the pipeline requires <<pipelines-graphics-subsets-fragment-shader,
2354    fragment shader state>> and an input attachment was referenced by an
2355    pname:aspectMask at pname:renderPass creation time, the fragment shader
2356    must: only read from the aspects that were specified for that input
2357    attachment
2358endif::VK_VERSION_1_1,VK_KHR_maintenance2,VK_KHR_create_renderpass2[]
2359  * [[VUID-VkGraphicsPipelineCreateInfo-layout-01688]]
2360    The number of resources in pname:layout accessible to each shader stage
2361    that is used by the pipeline must: be less than or equal to
2362    sname:VkPhysicalDeviceLimits::pname:maxPerStageResources
2363ifdef::VK_NV_clip_space_w_scaling[]
2364  * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-01715]]
2365    If the pipeline requires <<pipelines-graphics-subsets-pre-rasterization,
2366    pre-rasterization shader state>>, and no element of the
2367    pname:pDynamicStates member of pname:pDynamicState is
2368    ename:VK_DYNAMIC_STATE_VIEWPORT_W_SCALING_NV, and the
2369    pname:viewportWScalingEnable member of a
2370    slink:VkPipelineViewportWScalingStateCreateInfoNV structure, included in
2371    the pname:pNext chain of pname:pViewportState, is ename:VK_TRUE, the
2372    pname:pViewportWScalings member of the
2373    slink:VkPipelineViewportWScalingStateCreateInfoNV must: be a pointer to
2374    an array of
2375    slink:VkPipelineViewportWScalingStateCreateInfoNV::pname:viewportCount
2376    valid slink:VkViewportWScalingNV structures
2377endif::VK_NV_clip_space_w_scaling[]
2378ifdef::VK_NV_scissor_exclusive[]
2379  * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-04056]]
2380    If the pipeline requires <<pipelines-graphics-subsets-pre-rasterization,
2381    pre-rasterization shader state>>, and no element of the
2382    pname:pDynamicStates member of pname:pDynamicState is
2383    ename:VK_DYNAMIC_STATE_EXCLUSIVE_SCISSOR_NV, and if
2384    pname:pViewportState->pNext chain includes a
2385    slink:VkPipelineViewportExclusiveScissorStateCreateInfoNV structure, and
2386    if its pname:exclusiveScissorCount member is not `0`, then its
2387    pname:pExclusiveScissors member must: be a valid pointer to an array of
2388    pname:exclusiveScissorCount slink:VkRect2D structures
2389  * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-07854]]
2390    If ename:VK_DYNAMIC_STATE_EXCLUSIVE_SCISSOR_ENABLE_NV is included in the
2391    pname:pDynamicStates array then the implementation must: support at
2392    least pname:specVersion `2` of the `apiext:VK_NV_scissor_exclusive`
2393    extension
2394endif::VK_NV_scissor_exclusive[]
2395ifdef::VK_NV_shading_rate_image[]
2396  * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-04057]]
2397    If the pipeline requires <<pipelines-graphics-subsets-pre-rasterization,
2398    pre-rasterization shader state>>, and no element of the
2399    pname:pDynamicStates member of pname:pDynamicState is
2400    ename:VK_DYNAMIC_STATE_VIEWPORT_SHADING_RATE_PALETTE_NV, and if
2401    pname:pViewportState->pNext chain includes a
2402    slink:VkPipelineViewportShadingRateImageStateCreateInfoNV structure,
2403    then its pname:pShadingRatePalettes member must: be a valid pointer to
2404    an array of pname:viewportCount valid slink:VkShadingRatePaletteNV
2405    structures
2406endif::VK_NV_shading_rate_image[]
2407ifdef::VK_EXT_discard_rectangles[]
2408  * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-04058]]
2409    If the pipeline requires <<pipelines-graphics-subsets-pre-rasterization,
2410    pre-rasterization shader state>>, and no element of the
2411    pname:pDynamicStates member of pname:pDynamicState is
2412    ename:VK_DYNAMIC_STATE_DISCARD_RECTANGLE_EXT, and if pname:pNext chain
2413    includes a slink:VkPipelineDiscardRectangleStateCreateInfoEXT structure,
2414    and if its pname:discardRectangleCount member is not `0`, then its
2415    pname:pDiscardRectangles member must: be a valid pointer to an array of
2416    pname:discardRectangleCount slink:VkRect2D structures
2417  * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-07855]]
2418    If ename:VK_DYNAMIC_STATE_DISCARD_RECTANGLE_ENABLE_EXT is included in
2419    the pname:pDynamicStates array then the implementation must: support at
2420    least pname:specVersion `2` of the `apiext:VK_EXT_discard_rectangles`
2421    extension
2422  * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-07856]]
2423    If ename:VK_DYNAMIC_STATE_DISCARD_RECTANGLE_MODE_EXT is included in the
2424    pname:pDynamicStates array then the implementation must: support at
2425    least pname:specVersion `2` of the `apiext:VK_EXT_discard_rectangles`
2426    extension
2427endif::VK_EXT_discard_rectangles[]
2428  * [[VUID-VkGraphicsPipelineCreateInfo-pStages-02097]]
2429    If the pipeline requires <<pipelines-graphics-subsets-vertex-input,
2430    vertex input state>>, and pname:pVertexInputState is not dynamic, then
2431    pname:pVertexInputState must: be a valid pointer to a valid
2432    slink:VkPipelineVertexInputStateCreateInfo structure
2433  * [[VUID-VkGraphicsPipelineCreateInfo-Input-07904]]
2434    If the pipeline is being created with
2435    <<pipelines-graphics-subsets-vertex-input, vertex input state>> and
2436    pname:pVertexInputState is not dynamic, then all variables with the
2437    code:Input storage class decorated with code:Location in the code:Vertex
2438    {ExecutionModel} code:OpEntryPoint must: contain a location in
2439    slink:VkVertexInputAttributeDescription::pname:location
2440  * [[VUID-VkGraphicsPipelineCreateInfo-Input-08733]]
2441    If the pipeline requires <<pipelines-graphics-subsets-vertex-input,
2442    vertex input state>> and pname:pVertexInputState is not dynamic, then
2443    the numeric type associated with all code:Input variables of the
2444    corresponding code:Location in the code:Vertex {ExecutionModel}
2445    code:OpEntryPoint must: be the same as
2446    slink:VkVertexInputAttributeDescription::pname:format
2447  * [[VUID-VkGraphicsPipelineCreateInfo-pVertexInputState-08929]]
2448    If the pipeline is being created with
2449    <<pipelines-graphics-subsets-vertex-input, vertex input state>> and
2450    pname:pVertexInputState is not dynamic, and
2451    slink:VkVertexInputAttributeDescription::pname:format has a 64-bit
2452    component, then the scalar width associated with all code:Input
2453    variables of the corresponding code:Location in the code:Vertex
2454    {ExecutionModel} code:OpEntryPoint must: be 64-bit
2455  * [[VUID-VkGraphicsPipelineCreateInfo-pVertexInputState-08930]]
2456    If the pipeline is being created with
2457    <<pipelines-graphics-subsets-vertex-input, vertex input state>> and
2458    pname:pVertexInputState is not dynamic, and the scalar width associated
2459    with a code:Location decorated code:Input variable in the code:Vertex
2460    {ExecutionModel} code:OpEntryPoint is 64-bit, then the corresponding
2461    slink:VkVertexInputAttributeDescription::pname:format must: have a
2462    64-bit component
2463  * [[VUID-VkGraphicsPipelineCreateInfo-pVertexInputState-09198]]
2464    If the pipeline is being created with
2465    <<pipelines-graphics-subsets-vertex-input, vertex input state>> and
2466    pname:pVertexInputState is not dynamic, and
2467    slink:VkVertexInputAttributeDescription::pname:format has a 64-bit
2468    component, then all code:Input variables at the corresponding
2469    code:Location in the code:Vertex {ExecutionModel} code:OpEntryPoint
2470    must: not use components that are not present in the format
2471  * [[VUID-VkGraphicsPipelineCreateInfo-dynamicPrimitiveTopologyUnrestricted-09031]]
2472    If the pipeline requires <<pipelines-graphics-subsets-vertex-input,
2473    vertex input state>>,
2474ifdef::VK_EXT_extended_dynamic_state3[]
2475    and the `apiext:VK_EXT_extended_dynamic_state3` extension is not
2476    enabled, or either ename:VK_DYNAMIC_STATE_PRIMITIVE_RESTART_ENABLE, or
2477    ename:VK_DYNAMIC_STATE_PRIMITIVE_TOPOLOGY dynamic states are not set, or
2478    <<limits-dynamicPrimitiveTopologyUnrestricted,
2479    pname:dynamicPrimitiveTopologyUnrestricted>> is ename:VK_FALSE,
2480endif::VK_EXT_extended_dynamic_state3[]
2481    pname:pInputAssemblyState must: be a valid pointer to a valid
2482    slink:VkPipelineInputAssemblyStateCreateInfo structure
2483  * [[VUID-VkGraphicsPipelineCreateInfo-pInputAssemblyState-09032]]
2484    If pname:pInputAssemblyState is not `NULL` it must: be a valid pointer
2485    to a valid slink:VkPipelineInputAssemblyStateCreateInfo structure
2486ifdef::VK_EXT_transform_feedback[]
2487  * [[VUID-VkGraphicsPipelineCreateInfo-pStages-02317]]
2488    If the pipeline requires <<pipelines-graphics-subsets-pre-rasterization,
2489    pre-rasterization shader state>>, the code:Xfb execution mode can: be
2490    specified by no more than one shader stage in pname:pStages
2491  * [[VUID-VkGraphicsPipelineCreateInfo-pStages-02318]]
2492    If the pipeline requires <<pipelines-graphics-subsets-pre-rasterization,
2493    pre-rasterization shader state>>, and any shader stage in pname:pStages
2494    specifies code:Xfb execution mode it must: be the last
2495    <<pipelines-graphics-subsets-pre-rasterization,pre-rasterization shader
2496    stage>>
2497  * [[VUID-VkGraphicsPipelineCreateInfo-rasterizationStream-02319]]
2498    If the pipeline requires <<pipelines-graphics-subsets-pre-rasterization,
2499    pre-rasterization shader state>>, and a
2500    slink:VkPipelineRasterizationStateStreamCreateInfoEXT::pname:rasterizationStream
2501    value other than zero is specified, all variables in the output
2502    interface of the entry point being compiled decorated with
2503    code:Position, code:PointSize, code:ClipDistance, or code:CullDistance
2504    must: be decorated with identical code:Stream values that match the
2505    pname:rasterizationStream
2506  * [[VUID-VkGraphicsPipelineCreateInfo-rasterizationStream-02320]]
2507    If the pipeline requires <<pipelines-graphics-subsets-pre-rasterization,
2508    pre-rasterization shader state>>, and
2509    slink:VkPipelineRasterizationStateStreamCreateInfoEXT::pname:rasterizationStream
2510    is zero, or not specified, all variables in the output interface of the
2511    entry point being compiled decorated with code:Position, code:PointSize,
2512    code:ClipDistance, or code:CullDistance must: be decorated with a
2513    code:Stream value of zero, or must: not specify the code:Stream
2514    decoration
2515  * [[VUID-VkGraphicsPipelineCreateInfo-geometryStreams-02321]]
2516    If the pipeline requires <<pipelines-graphics-subsets-pre-rasterization,
2517    pre-rasterization shader state>>, and the last
2518    <<pipelines-graphics-subsets-pre-rasterization,pre-rasterization shader
2519    stage>> is a geometry shader, and that geometry shader uses the
2520    code:GeometryStreams capability, then
2521    sname:VkPhysicalDeviceTransformFeedbackFeaturesEXT::pname:geometryStreams
2522    feature must: be enabled
2523ifdef::VK_NV_mesh_shader,VK_EXT_mesh_shader[]
2524  * [[VUID-VkGraphicsPipelineCreateInfo-None-02322]]
2525    If the pipeline requires <<pipelines-graphics-subsets-pre-rasterization,
2526    pre-rasterization shader state>>, and there are any mesh shader stages
2527    in the pipeline there must: not be any shader stage in the pipeline with
2528    a code:Xfb execution mode
2529endif::VK_NV_mesh_shader,VK_EXT_mesh_shader[]
2530endif::VK_EXT_transform_feedback[]
2531ifdef::VK_EXT_line_rasterization[]
2532  * [[VUID-VkGraphicsPipelineCreateInfo-lineRasterizationMode-02766]]
2533    If the pipeline requires <<pipelines-graphics-subsets-pre-rasterization,
2534    pre-rasterization shader state>> and at least one of
2535    <<pipelines-graphics-subsets-fragment-output, fragment output interface
2536    state>> or <<pipelines-graphics-subsets-fragment-shader, fragment shader
2537    state>>, and pname:pMultisampleState is not `NULL`, the
2538    pname:lineRasterizationMode member of a
2539    slink:VkPipelineRasterizationLineStateCreateInfoEXT structure included
2540    in the pname:pNext chain of pname:pRasterizationState is
2541    ename:VK_LINE_RASTERIZATION_MODE_BRESENHAM_EXT or
2542    ename:VK_LINE_RASTERIZATION_MODE_RECTANGULAR_SMOOTH_EXT, then the
2543    pname:alphaToCoverageEnable, pname:alphaToOneEnable, and
2544    pname:sampleShadingEnable members of pname:pMultisampleState must: all
2545    be ename:VK_FALSE
2546  * [[VUID-VkGraphicsPipelineCreateInfo-stippledLineEnable-02767]]
2547    If the pipeline requires <<pipelines-graphics-subsets-pre-rasterization,
2548    pre-rasterization shader state>>, the pname:stippledLineEnable member of
2549    slink:VkPipelineRasterizationLineStateCreateInfoEXT is ename:VK_TRUE,
2550    and no element of the pname:pDynamicStates member of pname:pDynamicState
2551    is ename:VK_DYNAMIC_STATE_LINE_STIPPLE_EXT, then the
2552    pname:lineStippleFactor member of
2553    slink:VkPipelineRasterizationLineStateCreateInfoEXT must: be in the
2554    range [eq]#[1,256]#
2555endif::VK_EXT_line_rasterization[]
2556ifdef::VK_KHR_ray_tracing_pipeline[]
2557  * [[VUID-VkGraphicsPipelineCreateInfo-flags-03372]]
2558    pname:flags must: not include
2559    ename:VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_ANY_HIT_SHADERS_BIT_KHR
2560  * [[VUID-VkGraphicsPipelineCreateInfo-flags-03373]]
2561    pname:flags must: not include
2562    ename:VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_CLOSEST_HIT_SHADERS_BIT_KHR
2563  * [[VUID-VkGraphicsPipelineCreateInfo-flags-03374]]
2564    pname:flags must: not include
2565    ename:VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_MISS_SHADERS_BIT_KHR
2566  * [[VUID-VkGraphicsPipelineCreateInfo-flags-03375]]
2567    pname:flags must: not include
2568    ename:VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_INTERSECTION_SHADERS_BIT_KHR
2569  * [[VUID-VkGraphicsPipelineCreateInfo-flags-03376]]
2570    pname:flags must: not include
2571    ename:VK_PIPELINE_CREATE_RAY_TRACING_SKIP_TRIANGLES_BIT_KHR
2572  * [[VUID-VkGraphicsPipelineCreateInfo-flags-03377]]
2573    pname:flags must: not include
2574    ename:VK_PIPELINE_CREATE_RAY_TRACING_SKIP_AABBS_BIT_KHR
2575  * [[VUID-VkGraphicsPipelineCreateInfo-flags-03577]]
2576    pname:flags must: not include
2577    ename:VK_PIPELINE_CREATE_RAY_TRACING_SHADER_GROUP_HANDLE_CAPTURE_REPLAY_BIT_KHR
2578endif::VK_KHR_ray_tracing_pipeline[]
2579ifdef::VK_NV_ray_tracing_motion_blur[]
2580  * [[VUID-VkGraphicsPipelineCreateInfo-flags-04947]]
2581    pname:flags must: not include
2582    ename:VK_PIPELINE_CREATE_RAY_TRACING_ALLOW_MOTION_BIT_NV
2583endif::VK_NV_ray_tracing_motion_blur[]
2584ifdef::VK_VERSION_1_3,VK_EXT_extended_dynamic_state[]
2585  * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-03378]]
2586    If
2587ifdef::VK_EXT_extended_dynamic_state[]
2588    the <<features-extendedDynamicState, pname:extendedDynamicState>>
2589    feature is not enabled,
2590endif::VK_EXT_extended_dynamic_state[]
2591ifdef::VK_VERSION_1_3+VK_EXT_extended_dynamic_state[and]
2592ifdef::VK_VERSION_1_3[]
2593    the value of slink:VkApplicationInfo::pname:apiVersion used to create
2594    the slink:VkInstance is less than Version 1.3
2595endif::VK_VERSION_1_3[]
2596    there must: be no element of the pname:pDynamicStates member of
2597    pname:pDynamicState set to ename:VK_DYNAMIC_STATE_CULL_MODE,
2598    ename:VK_DYNAMIC_STATE_FRONT_FACE,
2599    ename:VK_DYNAMIC_STATE_PRIMITIVE_TOPOLOGY,
2600    ename:VK_DYNAMIC_STATE_VIEWPORT_WITH_COUNT,
2601    ename:VK_DYNAMIC_STATE_SCISSOR_WITH_COUNT,
2602    ename:VK_DYNAMIC_STATE_VERTEX_INPUT_BINDING_STRIDE,
2603    ename:VK_DYNAMIC_STATE_DEPTH_TEST_ENABLE,
2604    ename:VK_DYNAMIC_STATE_DEPTH_WRITE_ENABLE,
2605    ename:VK_DYNAMIC_STATE_DEPTH_COMPARE_OP,
2606    ename:VK_DYNAMIC_STATE_DEPTH_BOUNDS_TEST_ENABLE,
2607    ename:VK_DYNAMIC_STATE_STENCIL_TEST_ENABLE, or
2608    ename:VK_DYNAMIC_STATE_STENCIL_OP
2609  * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-03379]]
2610    If the pipeline requires <<pipelines-graphics-subsets-pre-rasterization,
2611    pre-rasterization shader state>>, and
2612    ename:VK_DYNAMIC_STATE_VIEWPORT_WITH_COUNT is included in the
2613    pname:pDynamicStates array then pname:viewportCount must: be zero
2614  * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-03380]]
2615    If the pipeline requires <<pipelines-graphics-subsets-pre-rasterization,
2616    pre-rasterization shader state>>, and
2617    ename:VK_DYNAMIC_STATE_SCISSOR_WITH_COUNT is included in the
2618    pname:pDynamicStates array then pname:scissorCount must: be zero
2619  * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-04132]]
2620    If the pipeline requires <<pipelines-graphics-subsets-pre-rasterization,
2621    pre-rasterization shader state>>, and
2622    ename:VK_DYNAMIC_STATE_VIEWPORT_WITH_COUNT is included in the
2623    pname:pDynamicStates array then ename:VK_DYNAMIC_STATE_VIEWPORT must:
2624    not be present
2625  * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-04133]]
2626    If the pipeline requires <<pipelines-graphics-subsets-pre-rasterization,
2627    pre-rasterization shader state>>, and
2628    ename:VK_DYNAMIC_STATE_SCISSOR_WITH_COUNT is included in the
2629    pname:pDynamicStates array then ename:VK_DYNAMIC_STATE_SCISSOR must: not
2630    be present
2631ifdef::VK_NV_mesh_shader,VK_EXT_mesh_shader[]
2632  * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-07065]]
2633    If the pipeline requires <<pipelines-graphics-subsets-pre-rasterization,
2634    pre-rasterization shader state>>, and includes a mesh shader, there
2635    must: be no element of the pname:pDynamicStates member of
2636    pname:pDynamicState set to ename:VK_DYNAMIC_STATE_PRIMITIVE_TOPOLOGY, or
2637    ename:VK_DYNAMIC_STATE_VERTEX_INPUT_BINDING_STRIDE
2638endif::VK_NV_mesh_shader,VK_EXT_mesh_shader[]
2639endif::VK_VERSION_1_3,VK_EXT_extended_dynamic_state[]
2640ifdef::VK_VERSION_1_3,VK_EXT_extended_dynamic_state2[]
2641  * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-04868]]
2642    If
2643ifdef::VK_EXT_extended_dynamic_state[]
2644    the <<features-extendedDynamicState2, pname:extendedDynamicState2>>
2645    feature is not enabled,
2646endif::VK_EXT_extended_dynamic_state[]
2647ifdef::VK_VERSION_1_3+VK_EXT_extended_dynamic_state[and]
2648ifdef::VK_VERSION_1_3[]
2649    the value of slink:VkApplicationInfo::pname:apiVersion used to create
2650    the slink:VkInstance is less than Version 1.3
2651endif::VK_VERSION_1_3[]
2652    there must: be no element of the pname:pDynamicStates member of
2653    pname:pDynamicState set to ename:VK_DYNAMIC_STATE_DEPTH_BIAS_ENABLE,
2654    ename:VK_DYNAMIC_STATE_PRIMITIVE_RESTART_ENABLE, or
2655    ename:VK_DYNAMIC_STATE_RASTERIZER_DISCARD_ENABLE
2656  * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-04869]]
2657    If the <<features-extendedDynamicState2LogicOp,
2658    pname:extendedDynamicState2LogicOp>> feature is not enabled, there must:
2659    be no element of the pname:pDynamicStates member of pname:pDynamicState
2660    set to ename:VK_DYNAMIC_STATE_LOGIC_OP_EXT
2661  * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-04870]]
2662    If the <<features-extendedDynamicState2PatchControlPoints,
2663    pname:extendedDynamicState2PatchControlPoints>> feature is not enabled,
2664    there must: be no element of the pname:pDynamicStates member of
2665    pname:pDynamicState set to
2666    ename:VK_DYNAMIC_STATE_PATCH_CONTROL_POINTS_EXT
2667ifdef::VK_NV_mesh_shader,VK_EXT_mesh_shader[]
2668  * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-07066]]
2669    If the pipeline requires <<pipelines-graphics-subsets-pre-rasterization,
2670    pre-rasterization shader state>>, and includes a mesh shader, there
2671    must: be no element of the pname:pDynamicStates member of
2672    pname:pDynamicState set to
2673    ename:VK_DYNAMIC_STATE_PRIMITIVE_RESTART_ENABLE, or
2674    ename:VK_DYNAMIC_STATE_PATCH_CONTROL_POINTS_EXT
2675endif::VK_NV_mesh_shader,VK_EXT_mesh_shader[]
2676endif::VK_VERSION_1_3,VK_EXT_extended_dynamic_state2[]
2677ifdef::VK_NV_device_generated_commands[]
2678  * [[VUID-VkGraphicsPipelineCreateInfo-flags-02877]]
2679    If pname:flags includes
2680    ename:VK_PIPELINE_CREATE_INDIRECT_BINDABLE_BIT_NV, then the
2681    <<features-deviceGeneratedCommands, pname:deviceGeneratedCommands>>
2682    feature must: be enabled
2683ifdef::VK_EXT_transform_feedback[]
2684  * [[VUID-VkGraphicsPipelineCreateInfo-flags-02966]]
2685    If the pipeline requires <<pipelines-graphics-subsets-pre-rasterization,
2686    pre-rasterization shader state>> and pname:flags includes
2687    ename:VK_PIPELINE_CREATE_INDIRECT_BINDABLE_BIT_NV, then all stages must:
2688    not specify code:Xfb execution mode
2689endif::VK_EXT_transform_feedback[]
2690  * [[VUID-VkGraphicsPipelineCreateInfo-libraryCount-06648]]
2691    If the pipeline is not created with a
2692    <<pipelines-graphics-subsets-complete, complete set of state>>,
2693ifdef::VK_EXT_graphics_pipeline_library[]
2694    or slink:VkPipelineLibraryCreateInfoKHR::pname:libraryCount is not `0`,
2695endif::VK_EXT_graphics_pipeline_library[]
2696    slink:VkGraphicsPipelineShaderGroupsCreateInfoNV::pname:groupCount and
2697    slink:VkGraphicsPipelineShaderGroupsCreateInfoNV::pname:pipelineCount
2698    must: be `0`
2699  * [[VUID-VkGraphicsPipelineCreateInfo-libraryCount-06649]]
2700    If the pipeline is created with a <<pipelines-graphics-subsets-complete,
2701    complete set of state>>,
2702ifdef::VK_EXT_graphics_pipeline_library[]
2703    and slink:VkPipelineLibraryCreateInfoKHR::pname:libraryCount is `0`,
2704endif::VK_EXT_graphics_pipeline_library[]
2705    and the pname:pNext chain includes an instance of
2706    slink:VkGraphicsPipelineShaderGroupsCreateInfoNV,
2707    slink:VkGraphicsPipelineShaderGroupsCreateInfoNV::pname:groupCount must:
2708    be greater than `0`
2709endif::VK_NV_device_generated_commands[]
2710ifdef::VK_VERSION_1_3,VK_EXT_pipeline_creation_cache_control[]
2711  * [[VUID-VkGraphicsPipelineCreateInfo-pipelineCreationCacheControl-02878]]
2712    If the <<features-pipelineCreationCacheControl,
2713    pname:pipelineCreationCacheControl>> feature is not enabled, pname:flags
2714    must: not include
2715    ename:VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT or
2716    ename:VK_PIPELINE_CREATE_EARLY_RETURN_ON_FAILURE_BIT
2717endif::VK_VERSION_1_3,VK_EXT_pipeline_creation_cache_control[]
2718ifdef::VK_EXT_pipeline_protected_access[]
2719  * [[VUID-VkGraphicsPipelineCreateInfo-pipelineProtectedAccess-07368]]
2720    If the <<features-pipelineProtectedAccess,
2721    pname:pipelineProtectedAccess>> feature is not enabled, pname:flags
2722    must: not include ename:VK_PIPELINE_CREATE_NO_PROTECTED_ACCESS_BIT_EXT
2723    or ename:VK_PIPELINE_CREATE_PROTECTED_ACCESS_ONLY_BIT_EXT
2724  * [[VUID-VkGraphicsPipelineCreateInfo-flags-07369]]
2725    pname:flags must: not include both
2726    ename:VK_PIPELINE_CREATE_NO_PROTECTED_ACCESS_BIT_EXT and
2727    ename:VK_PIPELINE_CREATE_PROTECTED_ACCESS_ONLY_BIT_EXT
2728endif::VK_EXT_pipeline_protected_access[]
2729ifdef::VK_KHR_fragment_shading_rate[]
2730  * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicState-04494]]
2731    If the pipeline requires <<pipelines-graphics-subsets-pre-rasterization,
2732    pre-rasterization shader state>> or
2733    <<pipelines-graphics-subsets-fragment-shader, fragment shader state>>
2734    and ename:VK_DYNAMIC_STATE_FRAGMENT_SHADING_RATE_KHR is not included in
2735    pname:pDynamicState->pDynamicStates,
2736    slink:VkPipelineFragmentShadingRateStateCreateInfoKHR::pname:fragmentSize.width
2737    must: be greater than or equal to `1`
2738  * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicState-04495]]
2739    If the pipeline requires <<pipelines-graphics-subsets-pre-rasterization,
2740    pre-rasterization shader state>> or
2741    <<pipelines-graphics-subsets-fragment-shader, fragment shader state>>
2742    and ename:VK_DYNAMIC_STATE_FRAGMENT_SHADING_RATE_KHR is not included in
2743    pname:pDynamicState->pDynamicStates,
2744    slink:VkPipelineFragmentShadingRateStateCreateInfoKHR::pname:fragmentSize.height
2745    must: be greater than or equal to `1`
2746  * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicState-04496]]
2747    If the pipeline requires <<pipelines-graphics-subsets-pre-rasterization,
2748    pre-rasterization shader state>> or
2749    <<pipelines-graphics-subsets-fragment-shader, fragment shader state>>
2750    and ename:VK_DYNAMIC_STATE_FRAGMENT_SHADING_RATE_KHR is not included in
2751    pname:pDynamicState->pDynamicStates,
2752    slink:VkPipelineFragmentShadingRateStateCreateInfoKHR::pname:fragmentSize.width
2753    must: be a power-of-two value
2754  * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicState-04497]]
2755    If the pipeline requires <<pipelines-graphics-subsets-pre-rasterization,
2756    pre-rasterization shader state>> or
2757    <<pipelines-graphics-subsets-fragment-shader, fragment shader state>>
2758    and ename:VK_DYNAMIC_STATE_FRAGMENT_SHADING_RATE_KHR is not included in
2759    pname:pDynamicState->pDynamicStates,
2760    slink:VkPipelineFragmentShadingRateStateCreateInfoKHR::pname:fragmentSize.height
2761    must: be a power-of-two value
2762  * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicState-04498]]
2763    If the pipeline requires <<pipelines-graphics-subsets-pre-rasterization,
2764    pre-rasterization shader state>> or
2765    <<pipelines-graphics-subsets-fragment-shader, fragment shader state>>
2766    and ename:VK_DYNAMIC_STATE_FRAGMENT_SHADING_RATE_KHR is not included in
2767    pname:pDynamicState->pDynamicStates,
2768    slink:VkPipelineFragmentShadingRateStateCreateInfoKHR::pname:fragmentSize.width
2769    must: be less than or equal to `4`
2770  * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicState-04499]]
2771    If the pipeline requires <<pipelines-graphics-subsets-pre-rasterization,
2772    pre-rasterization shader state>> or
2773    <<pipelines-graphics-subsets-fragment-shader, fragment shader state>>
2774    and ename:VK_DYNAMIC_STATE_FRAGMENT_SHADING_RATE_KHR is not included in
2775    pname:pDynamicState->pDynamicStates,
2776    slink:VkPipelineFragmentShadingRateStateCreateInfoKHR::pname:fragmentSize.height
2777    must: be less than or equal to `4`
2778  * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicState-04500]]
2779    If the pipeline requires <<pipelines-graphics-subsets-pre-rasterization,
2780    pre-rasterization shader state>> or
2781    <<pipelines-graphics-subsets-fragment-shader, fragment shader state>>
2782    and ename:VK_DYNAMIC_STATE_FRAGMENT_SHADING_RATE_KHR is not included in
2783    pname:pDynamicState->pDynamicStates, and the
2784    <<features-pipelineFragmentShadingRate,
2785    pname:pipelineFragmentShadingRate>> feature is not enabled,
2786    slink:VkPipelineFragmentShadingRateStateCreateInfoKHR::pname:fragmentSize.width
2787    and
2788    slink:VkPipelineFragmentShadingRateStateCreateInfoKHR::pname:fragmentSize.height
2789    must: both be equal to `1`
2790  * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicState-06567]]
2791    If the pipeline requires <<pipelines-graphics-subsets-pre-rasterization,
2792    pre-rasterization shader state>> or
2793    <<pipelines-graphics-subsets-fragment-shader, fragment shader state>>
2794    and ename:VK_DYNAMIC_STATE_FRAGMENT_SHADING_RATE_KHR is not included in
2795    pname:pDynamicState->pDynamicStates,
2796    slink:VkPipelineFragmentShadingRateStateCreateInfoKHR::pname:combinerOps[0]
2797    must: be a valid elink:VkFragmentShadingRateCombinerOpKHR value
2798  * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicState-06568]]
2799    If the pipeline requires <<pipelines-graphics-subsets-pre-rasterization,
2800    pre-rasterization shader state>> or
2801    <<pipelines-graphics-subsets-fragment-shader, fragment shader state>>
2802    and ename:VK_DYNAMIC_STATE_FRAGMENT_SHADING_RATE_KHR is not included in
2803    pname:pDynamicState->pDynamicStates,
2804    slink:VkPipelineFragmentShadingRateStateCreateInfoKHR::pname:combinerOps[1]
2805    must: be a valid elink:VkFragmentShadingRateCombinerOpKHR value
2806  * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicState-04501]]
2807    If the pipeline requires <<pipelines-graphics-subsets-pre-rasterization,
2808    pre-rasterization shader state>> or
2809    <<pipelines-graphics-subsets-fragment-shader, fragment shader state>>
2810    and ename:VK_DYNAMIC_STATE_FRAGMENT_SHADING_RATE_KHR is not included in
2811    pname:pDynamicState->pDynamicStates, and the
2812    <<features-primitiveFragmentShadingRate,
2813    pname:primitiveFragmentShadingRate>> feature is not enabled,
2814    slink:VkPipelineFragmentShadingRateStateCreateInfoKHR::pname:combinerOps[0]
2815    must: be ename:VK_FRAGMENT_SHADING_RATE_COMBINER_OP_KEEP_KHR
2816  * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicState-04502]]
2817    If the pipeline requires <<pipelines-graphics-subsets-pre-rasterization,
2818    pre-rasterization shader state>> or
2819    <<pipelines-graphics-subsets-fragment-shader, fragment shader state>>
2820    and ename:VK_DYNAMIC_STATE_FRAGMENT_SHADING_RATE_KHR is not included in
2821    pname:pDynamicState->pDynamicStates, and the
2822    <<features-attachmentFragmentShadingRate,
2823    pname:attachmentFragmentShadingRate>> feature is not enabled,
2824    slink:VkPipelineFragmentShadingRateStateCreateInfoKHR::pname:combinerOps[1]
2825    must: be ename:VK_FRAGMENT_SHADING_RATE_COMBINER_OP_KEEP_KHR
2826ifdef::VK_VERSION_1_3,VK_EXT_extended_dynamic_state[]
2827  * [[VUID-VkGraphicsPipelineCreateInfo-primitiveFragmentShadingRateWithMultipleViewports-04503]]
2828    If the pipeline requires <<pipelines-graphics-subsets-pre-rasterization,
2829    pre-rasterization shader state>> and the
2830    <<limits-primitiveFragmentShadingRateWithMultipleViewports,
2831    pname:primitiveFragmentShadingRateWithMultipleViewports>> limit is not
2832    supported, ename:VK_DYNAMIC_STATE_VIEWPORT_WITH_COUNT is not included in
2833    pname:pDynamicState->pDynamicStates, and
2834    slink:VkPipelineViewportStateCreateInfo::pname:viewportCount is greater
2835    than `1`, entry points specified in pname:pStages must: not write to the
2836    code:PrimitiveShadingRateKHR built-in
2837endif::VK_VERSION_1_3,VK_EXT_extended_dynamic_state[]
2838  * [[VUID-VkGraphicsPipelineCreateInfo-primitiveFragmentShadingRateWithMultipleViewports-04504]]
2839    If the pipeline requires <<pipelines-graphics-subsets-pre-rasterization,
2840    pre-rasterization shader state>> and the
2841    <<limits-primitiveFragmentShadingRateWithMultipleViewports,
2842    pname:primitiveFragmentShadingRateWithMultipleViewports>> limit is not
2843    supported, and entry points specified in pname:pStages write to the
2844    code:ViewportIndex built-in, they must: not also write to the
2845    code:PrimitiveShadingRateKHR built-in
2846ifdef::VK_NV_viewport_array2[]
2847  * [[VUID-VkGraphicsPipelineCreateInfo-primitiveFragmentShadingRateWithMultipleViewports-04505]]
2848    If the pipeline requires <<pipelines-graphics-subsets-pre-rasterization,
2849    pre-rasterization shader state>> and the
2850    <<limits-primitiveFragmentShadingRateWithMultipleViewports,
2851    pname:primitiveFragmentShadingRateWithMultipleViewports>> limit is not
2852    supported, and entry points specified in pname:pStages write to the
2853    code:ViewportMaskNV built-in, they must: not also write to the
2854    code:PrimitiveShadingRateKHR built-in
2855endif::VK_NV_viewport_array2[]
2856  * [[VUID-VkGraphicsPipelineCreateInfo-fragmentShadingRateNonTrivialCombinerOps-04506]]
2857    If the pipeline requires <<pipelines-graphics-subsets-pre-rasterization,
2858    pre-rasterization shader state>> or
2859    <<pipelines-graphics-subsets-fragment-shader, fragment shader state>>,
2860    the <<limits-fragmentShadingRateNonTrivialCombinerOps,
2861    pname:fragmentShadingRateNonTrivialCombinerOps>> limit is not supported,
2862    and ename:VK_DYNAMIC_STATE_FRAGMENT_SHADING_RATE_KHR is not included in
2863    pname:pDynamicState->pDynamicStates, elements of
2864    slink:VkPipelineFragmentShadingRateStateCreateInfoKHR::pname:combinerOps
2865    must: be ename:VK_FRAGMENT_SHADING_RATE_COMBINER_OP_KEEP_KHR or
2866    ename:VK_FRAGMENT_SHADING_RATE_COMBINER_OP_REPLACE_KHR
2867endif::VK_KHR_fragment_shading_rate[]
2868ifdef::VK_NV_fragment_shading_rate_enums[]
2869  * [[VUID-VkGraphicsPipelineCreateInfo-None-06569]]
2870     If the pipeline requires <<pipelines-graphics-subsets-fragment-shader,
2871     fragment shader state>>
2872    and ename:VK_DYNAMIC_STATE_FRAGMENT_SHADING_RATE_KHR is not included in
2873    pname:pDynamicState->pDynamicStates,
2874    slink:VkPipelineFragmentShadingRateEnumStateCreateInfoNV::pname:shadingRateType
2875    must: be a valid elink:VkFragmentShadingRateTypeNV value
2876  * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicState-06570]]
2877    If the pipeline requires <<pipelines-graphics-subsets-fragment-shader,
2878    fragment shader state>> and
2879    ename:VK_DYNAMIC_STATE_FRAGMENT_SHADING_RATE_KHR is not included in
2880    pname:pDynamicState->pDynamicStates,
2881    slink:VkPipelineFragmentShadingRateEnumStateCreateInfoNV::pname:shadingRate
2882    must: be a valid elink:VkFragmentShadingRateNV value
2883  * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicState-06571]]
2884    If the pipeline requires <<pipelines-graphics-subsets-fragment-shader,
2885    fragment shader state>> and
2886    ename:VK_DYNAMIC_STATE_FRAGMENT_SHADING_RATE_KHR is not included in
2887    pname:pDynamicState->pDynamicStates,
2888    slink:VkPipelineFragmentShadingRateEnumStateCreateInfoNV::pname:combinerOps[0]
2889    must: be a valid elink:VkFragmentShadingRateCombinerOpKHR value
2890  * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicState-06572]]
2891    If the pipeline requires <<pipelines-graphics-subsets-fragment-shader,
2892    fragment shader state>> and
2893    ename:VK_DYNAMIC_STATE_FRAGMENT_SHADING_RATE_KHR is not included in
2894    pname:pDynamicState->pDynamicStates,
2895    slink:VkPipelineFragmentShadingRateEnumStateCreateInfoNV::pname:combinerOps[1]
2896    must: be a valid elink:VkFragmentShadingRateCombinerOpKHR value
2897  * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicState-04569]]
2898    If the pipeline requires <<pipelines-graphics-subsets-fragment-shader,
2899    fragment shader state>> and
2900    ename:VK_DYNAMIC_STATE_FRAGMENT_SHADING_RATE_KHR is not included in
2901    pname:pDynamicState->pDynamicStates, and the
2902    <<features-fragmentShadingRateEnums, pname:fragmentShadingRateEnums>>
2903    feature is not enabled,
2904    slink:VkPipelineFragmentShadingRateEnumStateCreateInfoNV::pname:shadingRateType
2905    must: be equal to ename:VK_FRAGMENT_SHADING_RATE_TYPE_FRAGMENT_SIZE_NV
2906  * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicState-04570]]
2907    If the pipeline requires <<pipelines-graphics-subsets-fragment-shader,
2908    fragment shader state>> and
2909    ename:VK_DYNAMIC_STATE_FRAGMENT_SHADING_RATE_KHR is not included in
2910    pname:pDynamicState->pDynamicStates, and the
2911    <<features-pipelineFragmentShadingRate,
2912    pname:pipelineFragmentShadingRate>> feature is not enabled,
2913    slink:VkPipelineFragmentShadingRateEnumStateCreateInfoNV::pname:shadingRate
2914    must: be equal to
2915    ename:VK_FRAGMENT_SHADING_RATE_1_INVOCATION_PER_PIXEL_NV
2916  * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicState-04571]]
2917    If the pipeline requires <<pipelines-graphics-subsets-fragment-shader,
2918    fragment shader state>> and
2919    ename:VK_DYNAMIC_STATE_FRAGMENT_SHADING_RATE_KHR is not included in
2920    pname:pDynamicState->pDynamicStates, and the
2921    <<features-primitiveFragmentShadingRate,
2922    pname:primitiveFragmentShadingRate>> feature is not enabled,
2923    slink:VkPipelineFragmentShadingRateEnumStateCreateInfoNV::pname:combinerOps[0]
2924    must: be ename:VK_FRAGMENT_SHADING_RATE_COMBINER_OP_KEEP_KHR
2925  * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicState-04572]]
2926    If the pipeline requires <<pipelines-graphics-subsets-fragment-shader,
2927    fragment shader state>> and
2928    ename:VK_DYNAMIC_STATE_FRAGMENT_SHADING_RATE_KHR is not included in
2929    pname:pDynamicState->pDynamicStates, and the
2930    <<features-attachmentFragmentShadingRate,
2931    pname:attachmentFragmentShadingRate>> feature is not enabled,
2932    slink:VkPipelineFragmentShadingRateEnumStateCreateInfoNV::pname:combinerOps[1]
2933    must: be ename:VK_FRAGMENT_SHADING_RATE_COMBINER_OP_KEEP_KHR
2934  * [[VUID-VkGraphicsPipelineCreateInfo-fragmentShadingRateNonTrivialCombinerOps-04573]]
2935    If the pipeline requires <<pipelines-graphics-subsets-fragment-shader,
2936    fragment shader state>>, and the
2937    <<limits-fragmentShadingRateNonTrivialCombinerOps,
2938    pname:fragmentShadingRateNonTrivialCombinerOps>> limit is not supported
2939    and ename:VK_DYNAMIC_STATE_FRAGMENT_SHADING_RATE_KHR is not included in
2940    pname:pDynamicState->pDynamicStates, elements of
2941    slink:VkPipelineFragmentShadingRateEnumStateCreateInfoNV::pname:combinerOps
2942    must: be ename:VK_FRAGMENT_SHADING_RATE_COMBINER_OP_KEEP_KHR or
2943    ename:VK_FRAGMENT_SHADING_RATE_COMBINER_OP_REPLACE_KHR
2944  * [[VUID-VkGraphicsPipelineCreateInfo-None-04574]]
2945    If the pipeline requires <<pipelines-graphics-subsets-fragment-shader,
2946    fragment shader state>>, and the
2947    <<features-supersampleFragmentShadingRates,
2948    pname:supersampleFragmentShadingRates>> feature is not enabled,
2949    slink:VkPipelineFragmentShadingRateEnumStateCreateInfoNV::pname:shadingRate
2950    must: not be equal to
2951    ename:VK_FRAGMENT_SHADING_RATE_2_INVOCATIONS_PER_PIXEL_NV,
2952    ename:VK_FRAGMENT_SHADING_RATE_4_INVOCATIONS_PER_PIXEL_NV,
2953    ename:VK_FRAGMENT_SHADING_RATE_8_INVOCATIONS_PER_PIXEL_NV, or
2954    ename:VK_FRAGMENT_SHADING_RATE_16_INVOCATIONS_PER_PIXEL_NV
2955  * [[VUID-VkGraphicsPipelineCreateInfo-None-04575]]
2956    If the pipeline requires <<pipelines-graphics-subsets-fragment-shader,
2957    fragment shader state>>, and the
2958    <<features-noInvocationFragmentShadingRates,
2959    pname:noInvocationFragmentShadingRates>> feature is not enabled,
2960    slink:VkPipelineFragmentShadingRateEnumStateCreateInfoNV::pname:shadingRate
2961    must: not be equal to ename:VK_FRAGMENT_SHADING_RATE_NO_INVOCATIONS_NV
2962endif::VK_NV_fragment_shading_rate_enums[]
2963ifdef::VK_KHR_ray_tracing_pipeline[]
2964  * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-03578]]
2965    All elements of the pname:pDynamicStates member of pname:pDynamicState
2966    must: not be ename:VK_DYNAMIC_STATE_RAY_TRACING_PIPELINE_STACK_SIZE_KHR
2967endif::VK_KHR_ray_tracing_pipeline[]
2968ifdef::VK_EXT_vertex_input_dynamic_state[]
2969  * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-04807]]
2970    If the pipeline requires <<pipelines-graphics-subsets-pre-rasterization,
2971    pre-rasterization shader state>> and the
2972    <<features-vertexInputDynamicState, pname:vertexInputDynamicState>>
2973    feature is not enabled, there must: be no element of the
2974    pname:pDynamicStates member of pname:pDynamicState set to
2975    ename:VK_DYNAMIC_STATE_VERTEX_INPUT_EXT
2976ifdef::VK_NV_mesh_shader,VK_EXT_mesh_shader[]
2977  * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-07067]]
2978    If the pipeline requires <<pipelines-graphics-subsets-pre-rasterization,
2979    pre-rasterization shader state>>, and includes a mesh shader, there
2980    must: be no element of the pname:pDynamicStates member of
2981    pname:pDynamicState set to ename:VK_DYNAMIC_STATE_VERTEX_INPUT_EXT
2982endif::VK_NV_mesh_shader,VK_EXT_mesh_shader[]
2983endif::VK_EXT_vertex_input_dynamic_state[]
2984ifdef::VK_EXT_color_write_enable[]
2985  * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-04800]]
2986    If the <<features-colorWriteEnable, pname:colorWriteEnable>> feature is
2987    not enabled, there must: be no element of the pname:pDynamicStates
2988    member of pname:pDynamicState set to
2989    ename:VK_DYNAMIC_STATE_COLOR_WRITE_ENABLE_EXT
2990endif::VK_EXT_color_write_enable[]
2991ifdef::VK_QCOM_render_pass_shader_resolve[]
2992  * [[VUID-VkGraphicsPipelineCreateInfo-rasterizationSamples-04899]]
2993    If the pipeline requires <<pipelines-graphics-subsets-fragment-shader,
2994    fragment shader state>>, and the
2995    `apiext:VK_QCOM_render_pass_shader_resolve` extension is enabled,
2996    pname:rasterizationSamples is not dynamic, and if subpass has any input
2997    attachments, and if the subpass description contains
2998    ename:VK_SUBPASS_DESCRIPTION_FRAGMENT_REGION_BIT_QCOM, then the sample
2999    count of the input attachments must: equal pname:rasterizationSamples
3000  * [[VUID-VkGraphicsPipelineCreateInfo-sampleShadingEnable-04900]]
3001    If the pipeline requires <<pipelines-graphics-subsets-fragment-shader,
3002    fragment shader state>>, and the
3003    `apiext:VK_QCOM_render_pass_shader_resolve` extension is enabled, and if
3004    the subpass description contains
3005    ename:VK_SUBPASS_DESCRIPTION_FRAGMENT_REGION_BIT_QCOM, then
3006    pname:sampleShadingEnable must: be false
3007  * [[VUID-VkGraphicsPipelineCreateInfo-flags-04901]]
3008    If pname:flags includes
3009    ename:VK_SUBPASS_DESCRIPTION_SHADER_RESOLVE_BIT_QCOM, then the subpass
3010    must: be the last subpass in a subpass dependency chain
3011  * [[VUID-VkGraphicsPipelineCreateInfo-flags-04902]]
3012    If pname:flags includes
3013    ename:VK_SUBPASS_DESCRIPTION_SHADER_RESOLVE_BIT_QCOM, and if
3014    pname:pResolveAttachments is not `NULL`, then each resolve attachment
3015    must: be ename:VK_ATTACHMENT_UNUSED
3016endif::VK_QCOM_render_pass_shader_resolve[]
3017ifdef::VK_VERSION_1_3,VK_KHR_dynamic_rendering[]
3018  * [[VUID-VkGraphicsPipelineCreateInfo-dynamicRendering-06576]]
3019    If the <<features-dynamicRendering, pname:dynamicRendering>> feature is
3020    not enabled and the pipeline requires
3021    <<pipelines-graphics-subsets-pre-rasterization, pre-rasterization shader
3022    state>>, <<pipelines-graphics-subsets-fragment-shader, fragment shader
3023    state>>, or <<pipelines-graphics-subsets-fragment-output, fragment
3024    output interface state>>, pname:renderPass must: not be
3025    dlink:VK_NULL_HANDLE
3026  * [[VUID-VkGraphicsPipelineCreateInfo-multiview-06577]]
3027    If the <<features-multiview, pname:multiview>> feature is not enabled,
3028    the pipeline requires <<pipelines-graphics-subsets-pre-rasterization,
3029    pre-rasterization shader state>>,
3030    <<pipelines-graphics-subsets-fragment-shader, fragment shader state>>,
3031    or <<pipelines-graphics-subsets-fragment-output, fragment output
3032    interface state>>, and pname:renderPass is dlink:VK_NULL_HANDLE,
3033    slink:VkPipelineRenderingCreateInfo::pname:viewMask must: be `0`
3034  * [[VUID-VkGraphicsPipelineCreateInfo-renderPass-06578]]
3035    If the pipeline requires <<pipelines-graphics-subsets-pre-rasterization,
3036    pre-rasterization shader state>>,
3037    <<pipelines-graphics-subsets-fragment-shader, fragment shader state>>,
3038    or <<pipelines-graphics-subsets-fragment-output, fragment output
3039    interface state>>, and pname:renderPass is dlink:VK_NULL_HANDLE, the
3040    index of the most significant bit in
3041    slink:VkPipelineRenderingCreateInfo::pname:viewMask must: be less than
3042    <<limits-maxMultiviewViewCount, pname:maxMultiviewViewCount>>
3043  * [[VUID-VkGraphicsPipelineCreateInfo-renderPass-06579]]
3044    If the pipeline requires <<pipelines-graphics-subsets-fragment-output,
3045    fragment output interface state>>, and pname:renderPass is
3046    dlink:VK_NULL_HANDLE, and
3047    slink:VkPipelineRenderingCreateInfo::pname:colorAttachmentCount is not
3048    0, slink:VkPipelineRenderingCreateInfo::pname:pColorAttachmentFormats
3049    must: be a valid pointer to an array of pname:colorAttachmentCount valid
3050    elink:VkFormat values
3051  * [[VUID-VkGraphicsPipelineCreateInfo-renderPass-06580]]
3052    If the pipeline requires <<pipelines-graphics-subsets-fragment-output,
3053    fragment output interface state>>, and pname:renderPass is
3054    dlink:VK_NULL_HANDLE, each element of
3055    slink:VkPipelineRenderingCreateInfo::pname:pColorAttachmentFormats must:
3056    be a valid elink:VkFormat value
3057  * [[VUID-VkGraphicsPipelineCreateInfo-renderPass-06582]]
3058    If the pipeline requires <<pipelines-graphics-subsets-fragment-output,
3059    fragment output interface state>>, pname:renderPass is
3060    dlink:VK_NULL_HANDLE, and any element of
3061    slink:VkPipelineRenderingCreateInfo::pname:pColorAttachmentFormats is
3062    not ename:VK_FORMAT_UNDEFINED, that format must: be a format with
3063    <<potential-format-features, potential format features>> that include
3064    ename:VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT
3065ifdef::VK_NV_linear_color_attachment[]
3066    or ename:VK_FORMAT_FEATURE_2_LINEAR_COLOR_ATTACHMENT_BIT_NV
3067endif::VK_NV_linear_color_attachment[]
3068  * [[VUID-VkGraphicsPipelineCreateInfo-renderPass-06583]]
3069    If the pipeline requires <<pipelines-graphics-subsets-fragment-output,
3070    fragment output interface state>>, and pname:renderPass is
3071    dlink:VK_NULL_HANDLE,
3072    slink:VkPipelineRenderingCreateInfo::pname:depthAttachmentFormat must:
3073    be a valid elink:VkFormat value
3074  * [[VUID-VkGraphicsPipelineCreateInfo-renderPass-06584]]
3075    If the pipeline requires <<pipelines-graphics-subsets-fragment-output,
3076    fragment output interface state>>, and pname:renderPass is
3077    dlink:VK_NULL_HANDLE,
3078    slink:VkPipelineRenderingCreateInfo::pname:stencilAttachmentFormat must:
3079    be a valid elink:VkFormat value
3080  * [[VUID-VkGraphicsPipelineCreateInfo-renderPass-06585]]
3081    If the pipeline requires <<pipelines-graphics-subsets-fragment-output,
3082    fragment output interface state>>, pname:renderPass is
3083    dlink:VK_NULL_HANDLE, and
3084    slink:VkPipelineRenderingCreateInfo::pname:depthAttachmentFormat is not
3085    ename:VK_FORMAT_UNDEFINED, it must: be a format with
3086    <<potential-format-features, potential format features>> that include
3087    ename:VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT
3088  * [[VUID-VkGraphicsPipelineCreateInfo-renderPass-06586]]
3089    If the pipeline requires <<pipelines-graphics-subsets-fragment-output,
3090    fragment output interface state>>, pname:renderPass is
3091    dlink:VK_NULL_HANDLE, and
3092    slink:VkPipelineRenderingCreateInfo::pname:stencilAttachmentFormat is
3093    not ename:VK_FORMAT_UNDEFINED, it must: be a format with
3094    <<potential-format-features, potential format features>> that include
3095    ename:VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT
3096  * [[VUID-VkGraphicsPipelineCreateInfo-renderPass-06587]]
3097    If the pipeline requires <<pipelines-graphics-subsets-fragment-output,
3098    fragment output interface state>>, pname:renderPass is
3099    dlink:VK_NULL_HANDLE, and
3100    slink:VkPipelineRenderingCreateInfo::pname:depthAttachmentFormat is not
3101    ename:VK_FORMAT_UNDEFINED, it must: be a format that includes a depth
3102    component
3103  * [[VUID-VkGraphicsPipelineCreateInfo-renderPass-06588]]
3104    If the pipeline requires <<pipelines-graphics-subsets-fragment-output,
3105    fragment output interface state>>, pname:renderPass is
3106    dlink:VK_NULL_HANDLE, and
3107    slink:VkPipelineRenderingCreateInfo::pname:stencilAttachmentFormat is
3108    not ename:VK_FORMAT_UNDEFINED, it must: be a format that includes a
3109    stencil component
3110  * [[VUID-VkGraphicsPipelineCreateInfo-renderPass-06589]]
3111    If the pipeline requires <<pipelines-graphics-subsets-fragment-output,
3112    fragment output interface state>>, pname:renderPass is
3113    dlink:VK_NULL_HANDLE,
3114    slink:VkPipelineRenderingCreateInfo::pname:depthAttachmentFormat is not
3115    ename:VK_FORMAT_UNDEFINED, and
3116    slink:VkPipelineRenderingCreateInfo::pname:stencilAttachmentFormat is
3117    not ename:VK_FORMAT_UNDEFINED, pname:depthAttachmentFormat must: equal
3118    pname:stencilAttachmentFormat
3119  * [[VUID-VkGraphicsPipelineCreateInfo-renderPass-09033]]
3120    If pname:renderPass is dlink:VK_NULL_HANDLE, the pipeline is being
3121    created with <<pipelines-graphics-subsets-fragment-shader, fragment
3122    shader state>> and <<pipelines-graphics-subsets-fragment-output,
3123    fragment output interface state>>, and either of
3124    slink:VkPipelineRenderingCreateInfo::pname:depthAttachmentFormat or
3125    slink:VkPipelineRenderingCreateInfo::pname:stencilAttachmentFormat are
3126    not ename:VK_FORMAT_UNDEFINED,
3127ifdef::VK_EXT_extended_dynamic_state3[]
3128    and the `apiext:VK_EXT_extended_dynamic_state3` extension is not enabled
3129    or any of the ename:VK_DYNAMIC_STATE_DEPTH_TEST_ENABLE,
3130    ename:VK_DYNAMIC_STATE_DEPTH_WRITE_ENABLE,
3131    ename:VK_DYNAMIC_STATE_DEPTH_COMPARE_OP,
3132    ename:VK_DYNAMIC_STATE_DEPTH_BOUNDS_TEST_ENABLE,
3133    ename:VK_DYNAMIC_STATE_STENCIL_TEST_ENABLE,
3134    ename:VK_DYNAMIC_STATE_STENCIL_OP, or
3135    ename:VK_DYNAMIC_STATE_DEPTH_BOUNDS dynamic states are not set,
3136endif::VK_EXT_extended_dynamic_state3[]
3137    pname:pDepthStencilState must: be a valid pointer to a valid
3138    slink:VkPipelineDepthStencilStateCreateInfo structure
3139  * [[VUID-VkGraphicsPipelineCreateInfo-pDepthStencilState-09034]]
3140    If pname:pDepthStencilState is not `NULL` it must: be a valid pointer to
3141    a valid slink:VkPipelineDepthStencilStateCreateInfo structure
3142ifdef::VK_EXT_graphics_pipeline_library[]
3143  * [[VUID-VkGraphicsPipelineCreateInfo-renderPass-09035]]
3144    If pname:renderPass is dlink:VK_NULL_HANDLE and the pipeline is being
3145    created with <<pipelines-graphics-subsets-fragment-shader, fragment
3146    shader state>> but not <<pipelines-graphics-subsets-fragment-output,
3147    fragment output interface state>>,
3148ifdef::VK_EXT_extended_dynamic_state3[]
3149    and the `apiext:VK_EXT_extended_dynamic_state3` extension is not
3150    enabled, or any of the ename:VK_DYNAMIC_STATE_DEPTH_TEST_ENABLE,
3151    ename:VK_DYNAMIC_STATE_DEPTH_WRITE_ENABLE,
3152    ename:VK_DYNAMIC_STATE_DEPTH_COMPARE_OP,
3153    ename:VK_DYNAMIC_STATE_DEPTH_BOUNDS_TEST_ENABLE,
3154    ename:VK_DYNAMIC_STATE_STENCIL_TEST_ENABLE,
3155    ename:VK_DYNAMIC_STATE_STENCIL_OP, or
3156    ename:VK_DYNAMIC_STATE_DEPTH_BOUNDS dynamic states are not set,
3157endif::VK_EXT_extended_dynamic_state3[]
3158    pname:pDepthStencilState must: be a valid pointer to a valid
3159    slink:VkPipelineDepthStencilStateCreateInfo structure
3160  * [[VUID-VkGraphicsPipelineCreateInfo-pDepthStencilState-09036]]
3161    If pname:pDepthStencilState is not `NULL` it must: be a valid pointer to
3162    a valid slink:VkPipelineDepthStencilStateCreateInfo structure
3163endif::VK_EXT_graphics_pipeline_library[]
3164  * [[VUID-VkGraphicsPipelineCreateInfo-renderPass-09037]]
3165    If pname:renderPass is dlink:VK_NULL_HANDLE, the pipeline is being
3166    created with <<pipelines-graphics-subsets-fragment-output, fragment
3167    output interface state>>, and
3168    slink:VkPipelineRenderingCreateInfo::pname:colorAttachmentCount is not
3169    equal to `0`,
3170ifdef::VK_EXT_extended_dynamic_state3[]
3171    and the `apiext:VK_EXT_extended_dynamic_state3` extension is not
3172    enabled, or any of the ename:VK_DYNAMIC_STATE_LOGIC_OP_ENABLE_EXT,
3173    ename:VK_DYNAMIC_STATE_LOGIC_OP_EXT,
3174    ename:VK_DYNAMIC_STATE_COLOR_BLEND_ENABLE_EXT,
3175    ename:VK_DYNAMIC_STATE_COLOR_BLEND_EQUATION_EXT,
3176    ename:VK_DYNAMIC_STATE_COLOR_WRITE_MASK_EXT, or
3177    ename:VK_DYNAMIC_STATE_BLEND_CONSTANTS dynamic states are not set,
3178endif::VK_EXT_extended_dynamic_state3[]
3179    pname:pColorBlendState must: be a valid pointer to a valid
3180    slink:VkPipelineColorBlendStateCreateInfo structure
3181  * [[VUID-VkGraphicsPipelineCreateInfo-pColorBlendState-09038]]
3182    If pname:pColorBlendState is not `NULL` it must: be a valid pointer to a
3183    valid slink:VkPipelineColorBlendStateCreateInfo structure
3184  * [[VUID-VkGraphicsPipelineCreateInfo-renderPass-06055]]
3185    If pname:renderPass is dlink:VK_NULL_HANDLE, pname:pColorBlendState is
3186    not dynamic, and the pipeline is being created with
3187    <<pipelines-graphics-subsets-fragment-output, fragment output interface
3188    state>>, pname:pColorBlendState->attachmentCount must: be equal to
3189    slink:VkPipelineRenderingCreateInfo::pname:colorAttachmentCount
3190ifdef::VK_KHR_multiview,VK_VERSION_1_1[]
3191  * [[VUID-VkGraphicsPipelineCreateInfo-renderPass-06057]]
3192    If pname:renderPass is dlink:VK_NULL_HANDLE, the pipeline is being
3193    created with <<pipelines-graphics-subsets-pre-rasterization,
3194    pre-rasterization shader state>>,
3195    slink:VkPipelineRenderingCreateInfo::pname:viewMask is not `0`, and the
3196    <<features-multiview-tess, pname:multiviewTessellationShader>> feature
3197    is not enabled, then pname:pStages must: not include tessellation
3198    shaders
3199  * [[VUID-VkGraphicsPipelineCreateInfo-renderPass-06058]]
3200    If pname:renderPass is dlink:VK_NULL_HANDLE, the pipeline is being
3201    created with <<pipelines-graphics-subsets-pre-rasterization,
3202    pre-rasterization shader state>>,
3203    slink:VkPipelineRenderingCreateInfo::pname:viewMask is not `0`, and the
3204    <<features-multiview-gs, pname:multiviewGeometryShader>> feature is not
3205    enabled, then pname:pStages must: not include a geometry shader
3206  * [[VUID-VkGraphicsPipelineCreateInfo-renderPass-07718]]
3207    If pname:renderPass is dlink:VK_NULL_HANDLE, the pipeline is being
3208    created with <<pipelines-graphics-subsets-pre-rasterization,
3209    pre-rasterization shader state>>, and
3210    slink:VkPipelineRenderingCreateInfo::pname:viewMask is not `0`, all of
3211    the shaders in the pipeline must: not write to the code:Layer built-in
3212    output
3213  * [[VUID-VkGraphicsPipelineCreateInfo-renderPass-06059]]
3214    If pname:renderPass is dlink:VK_NULL_HANDLE, the pipeline is being
3215    created with <<pipelines-graphics-subsets-pre-rasterization,
3216    pre-rasterization shader state>>, and
3217    slink:VkPipelineRenderingCreateInfo::pname:viewMask is not `0`, all of
3218    the shaders in the pipeline must: not include variables decorated with
3219    the code:Layer built-in decoration in their interfaces
3220  * [[VUID-VkGraphicsPipelineCreateInfo-renderPass-07719]]
3221    If pname:renderPass is dlink:VK_NULL_HANDLE, the pipeline is being
3222    created with <<pipelines-graphics-subsets-pre-rasterization,
3223    pre-rasterization shader state>>, and
3224    slink:VkPipelineRenderingCreateInfo::pname:viewMask is not `0`, all of
3225    the shaders in the pipeline must: not include variables decorated with
3226    the code:ViewIndex built-in decoration in their interfaces
3227ifdef::VK_EXT_mesh_shader[]
3228  * [[VUID-VkGraphicsPipelineCreateInfo-renderPass-07720]]
3229    If pname:renderPass is dlink:VK_NULL_HANDLE, the pipeline is being
3230    created with <<pipelines-graphics-subsets-pre-rasterization,
3231    pre-rasterization shader state>>, and
3232    slink:VkPipelineRenderingCreateInfo::pname:viewMask is not `0`, and
3233    pname:multiviewMeshShader is not enabled, then pname:pStages must: not
3234    include a mesh shader
3235endif::VK_EXT_mesh_shader[]
3236  * [[VUID-VkGraphicsPipelineCreateInfo-renderPass-06061]]
3237    If the pipeline requires <<pipelines-graphics-subsets-fragment-shader,
3238    fragment shader state>> and pname:renderPass is dlink:VK_NULL_HANDLE,
3239    fragment shaders in pname:pStages must: not include the
3240    code:InputAttachment capability
3241ifdef::VK_EXT_shader_tile_image[]
3242  * [[VUID-VkGraphicsPipelineCreateInfo-renderPass-08710]]
3243    If the pipeline requires <<pipelines-graphics-subsets-fragment-shader,
3244    fragment shader state>> and pname:renderPass is not
3245    dlink:VK_NULL_HANDLE, fragment shaders in pname:pStages must: not
3246    include any of the code:TileImageColorReadAccessEXT,
3247    code:TileImageDepthReadAccessEXT, or code:TileImageStencilReadAccessEXT
3248    capabilities
3249endif::VK_EXT_shader_tile_image[]
3250  * [[VUID-VkGraphicsPipelineCreateInfo-renderPass-06062]]
3251    If the pipeline requires <<pipelines-graphics-subsets-fragment-output,
3252    fragment output interface state>> and pname:renderPass is
3253    dlink:VK_NULL_HANDLE, for each color attachment format defined by the
3254    pname:pColorAttachmentFormats member of
3255    slink:VkPipelineRenderingCreateInfo, if its
3256    <<potential-format-features,potential format features>> do not contain
3257    ename:VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT, then the
3258    pname:blendEnable member of the corresponding element of the
3259    pname:pAttachments member of pname:pColorBlendState must: be
3260    ename:VK_FALSE
3261endif::VK_KHR_multiview,VK_VERSION_1_1[]
3262ifdef::VK_AMD_mixed_attachment_samples,VK_NV_framebuffer_mixed_samples[]
3263  * [[VUID-VkGraphicsPipelineCreateInfo-renderPass-06063]]
3264    If the pipeline requires <<pipelines-graphics-subsets-fragment-output,
3265    fragment output interface state>> and pname:renderPass is
3266    dlink:VK_NULL_HANDLE, if the pname:pNext chain includes
3267    slink:VkAttachmentSampleCountInfoAMD or
3268    sname:VkAttachmentSampleCountInfoNV, the pname:colorAttachmentCount
3269    member of that structure must: be equal to the value of
3270    slink:VkPipelineRenderingCreateInfo::pname:colorAttachmentCount
3271endif::VK_AMD_mixed_attachment_samples,VK_NV_framebuffer_mixed_samples[]
3272endif::VK_VERSION_1_3,VK_KHR_dynamic_rendering[]
3273ifdef::VK_EXT_rasterization_order_attachment_access,VK_ARM_rasterization_order_attachment_access[]
3274  * [[VUID-VkGraphicsPipelineCreateInfo-flags-06591]]
3275    If pname:pStages includes a fragment shader stage, and the fragment
3276    shader declares the code:EarlyFragmentTests execution mode, the
3277    pname:flags member of slink:VkPipelineDepthStencilStateCreateInfo must:
3278    not include
3279    ename:VK_PIPELINE_DEPTH_STENCIL_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_DEPTH_ACCESS_BIT_EXT
3280    or
3281    ename:VK_PIPELINE_DEPTH_STENCIL_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_STENCIL_ACCESS_BIT_EXT
3282ifdef::VK_VERSION_1_3,VK_KHR_dynamic_rendering[]
3283  * [[VUID-VkGraphicsPipelineCreateInfo-flags-06482]]
3284    If the pipeline requires <<pipelines-graphics-subsets-fragment-output,
3285    fragment output interface state>> and the pname:flags member of
3286    slink:VkPipelineColorBlendStateCreateInfo includes
3287    ename:VK_PIPELINE_COLOR_BLEND_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_BIT_EXT,
3288    pname:renderpass must: not be dlink:VK_NULL_HANDLE
3289  * [[VUID-VkGraphicsPipelineCreateInfo-flags-06483]]
3290    If the pipeline requires <<pipelines-graphics-subsets-fragment-output,
3291    fragment output interface state>> and the pname:flags member of
3292    slink:VkPipelineDepthStencilStateCreateInfo includes
3293    ename:VK_PIPELINE_DEPTH_STENCIL_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_DEPTH_ACCESS_BIT_EXT
3294    or
3295    ename:VK_PIPELINE_DEPTH_STENCIL_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_STENCIL_ACCESS_BIT_EXT,
3296    pname:renderpass must: not be dlink:VK_NULL_HANDLE
3297ifdef::VK_AMD_mixed_attachment_samples,VK_NV_framebuffer_mixed_samples[]
3298  * [[VUID-VkGraphicsPipelineCreateInfo-pColorAttachmentSamples-06592]]
3299    If the <<pipelines-graphics-subsets-fragment-output, fragment output
3300    interface state>>, elements of the pname:pColorAttachmentSamples member
3301    of slink:VkAttachmentSampleCountInfoAMD or
3302    slink:VkAttachmentSampleCountInfoNV must: be valid
3303    elink:VkSampleCountFlagBits values
3304  * [[VUID-VkGraphicsPipelineCreateInfo-depthStencilAttachmentSamples-06593]]
3305    If the <<pipelines-graphics-subsets-fragment-output, fragment output
3306    interface state>> and the pname:depthStencilAttachmentSamples member of
3307    slink:VkAttachmentSampleCountInfoAMD or
3308    slink:VkAttachmentSampleCountInfoNV is not 0, it must: be a valid
3309    elink:VkSampleCountFlagBits value
3310endif::VK_AMD_mixed_attachment_samples,VK_NV_framebuffer_mixed_samples[]
3311endif::VK_VERSION_1_3,VK_KHR_dynamic_rendering[]
3312  * [[VUID-VkGraphicsPipelineCreateInfo-flags-06484]]
3313    If the pipeline requires <<pipelines-graphics-subsets-fragment-output,
3314    fragment output interface state>> and the pname:flags member of
3315    slink:VkPipelineColorBlendStateCreateInfo includes
3316    ename:VK_PIPELINE_COLOR_BLEND_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_BIT_EXT
3317    pname:subpass must: have been created with
3318    ename:VK_SUBPASS_DESCRIPTION_RASTERIZATION_ORDER_ATTACHMENT_COLOR_ACCESS_BIT_EXT
3319  * [[VUID-VkGraphicsPipelineCreateInfo-flags-06485]]
3320    If the pipeline requires <<pipelines-graphics-subsets-fragment-shader,
3321    fragment shader state>> and the pname:flags member of
3322    slink:VkPipelineDepthStencilStateCreateInfo includes
3323    ename:VK_PIPELINE_DEPTH_STENCIL_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_DEPTH_ACCESS_BIT_EXT,
3324    pname:subpass must: have been created with
3325    ename:VK_SUBPASS_DESCRIPTION_RASTERIZATION_ORDER_ATTACHMENT_DEPTH_ACCESS_BIT_EXT
3326  * [[VUID-VkGraphicsPipelineCreateInfo-flags-06486]]
3327    If the pipeline requires <<pipelines-graphics-subsets-fragment-shader,
3328    fragment shader state>> and the pname:flags member of
3329    slink:VkPipelineDepthStencilStateCreateInfo includes
3330    ename:VK_PIPELINE_DEPTH_STENCIL_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_STENCIL_ACCESS_BIT_EXT,
3331    pname:subpass must: have been created with
3332    ename:VK_SUBPASS_DESCRIPTION_RASTERIZATION_ORDER_ATTACHMENT_STENCIL_ACCESS_BIT_EXT
3333endif::VK_EXT_rasterization_order_attachment_access,VK_ARM_rasterization_order_attachment_access[]
3334ifdef::VK_EXT_pipeline_creation_feedback,VK_VERSION_1_3[]
3335  * [[VUID-VkGraphicsPipelineCreateInfo-pipelineStageCreationFeedbackCount-06594]]
3336    If
3337    slink:VkPipelineCreationFeedbackCreateInfo::pname:pipelineStageCreationFeedbackCount
3338    is not `0`, it must: be equal to pname:stageCount
3339endif::VK_EXT_pipeline_creation_feedback,VK_VERSION_1_3[]
3340ifdef::VK_NVX_multiview_per_view_attributes[]
3341  * [[VUID-VkGraphicsPipelineCreateInfo-renderPass-06595]]
3342    If pname:renderPass is dlink:VK_NULL_HANDLE, the pipeline is being
3343    created with <<pipelines-graphics-subsets-pre-rasterization,
3344    pre-rasterization shader state>> or
3345    <<pipelines-graphics-subsets-fragment-shader, fragment shader state>>,
3346    and
3347    slink:VkMultiviewPerViewAttributesInfoNVX::pname:perViewAttributesPositionXOnly
3348    is ename:VK_TRUE then
3349    slink:VkMultiviewPerViewAttributesInfoNVX::pname:perViewAttributes must:
3350    also be ename:VK_TRUE
3351  * [[VUID-VkGraphicsPipelineCreateInfo-flags-06596]]
3352    If slink:VkGraphicsPipelineLibraryCreateInfoEXT::pname:flags includes
3353    only one of
3354    ename:VK_GRAPHICS_PIPELINE_LIBRARY_PRE_RASTERIZATION_SHADERS_BIT_EXT or
3355    ename:VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT, and an
3356    element of slink:VkPipelineLibraryCreateInfoKHR::pname:pLibraries
3357    includes the other flag, the value of
3358    slink:VkMultiviewPerViewAttributesInfoNVX::pname:perViewAttributes
3359    specified in both this pipeline and the library must: be equal
3360  * [[VUID-VkGraphicsPipelineCreateInfo-pLibraries-06597]]
3361    If one element of slink:VkPipelineLibraryCreateInfoKHR::pname:pLibraries
3362    includes
3363    ename:VK_GRAPHICS_PIPELINE_LIBRARY_PRE_RASTERIZATION_SHADERS_BIT_EXT and
3364    another element includes
3365    ename:VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT, the value of
3366    slink:VkMultiviewPerViewAttributesInfoNVX::pname:perViewAttributes
3367    specified in both libraries must: be equal
3368  * [[VUID-VkGraphicsPipelineCreateInfo-flags-06598]]
3369    If slink:VkGraphicsPipelineLibraryCreateInfoEXT::pname:flags includes
3370    only one of
3371    ename:VK_GRAPHICS_PIPELINE_LIBRARY_PRE_RASTERIZATION_SHADERS_BIT_EXT or
3372    ename:VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT, and an
3373    element of slink:VkPipelineLibraryCreateInfoKHR::pname:pLibraries
3374    includes the other flag, the value of
3375    slink:VkMultiviewPerViewAttributesInfoNVX::pname:perViewAttributesPositionXOnly
3376    specified in both this pipeline and the library must: be equal
3377  * [[VUID-VkGraphicsPipelineCreateInfo-pLibraries-06599]]
3378    If one element of slink:VkPipelineLibraryCreateInfoKHR::pname:pLibraries
3379    includes
3380    ename:VK_GRAPHICS_PIPELINE_LIBRARY_PRE_RASTERIZATION_SHADERS_BIT_EXT and
3381    another element includes
3382    ename:VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT, the value of
3383    slink:VkMultiviewPerViewAttributesInfoNVX::pname:perViewAttributesPositionXOnly
3384    specified in both libraries must: be equal
3385endif::VK_NVX_multiview_per_view_attributes[]
3386  * [[VUID-VkGraphicsPipelineCreateInfo-pStages-06600]]
3387    If the pipeline requires <<pipelines-graphics-subsets-pre-rasterization,
3388    pre-rasterization shader state>> or
3389    <<pipelines-graphics-subsets-fragment-shader, fragment shader state>>,
3390    pname:pStages must: be a valid pointer to an array of pname:stageCount
3391    valid slink:VkPipelineShaderStageCreateInfo structures
3392ifndef::VK_EXT_extended_dynamic_state3[]
3393  * [[VUID-VkGraphicsPipelineCreateInfo-pRasterizationState-06601]]
3394    If the pipeline requires <<pipelines-graphics-subsets-pre-rasterization,
3395    pre-rasterization shader state>>, pname:pRasterizationState must: be a
3396    valid pointer to a valid slink:VkPipelineRasterizationStateCreateInfo
3397    structure
3398endif::VK_EXT_extended_dynamic_state3[]
3399ifdef::VK_EXT_extended_dynamic_state3[]
3400  * [[VUID-VkGraphicsPipelineCreateInfo-pRasterizationState-09039]]
3401    If
3402ifdef::VK_EXT_graphics_pipeline_library[]
3403    slink:VkGraphicsPipelineLibraryCreateInfoEXT::pname:flags includes
3404    ename:VK_GRAPHICS_PIPELINE_LIBRARY_PRE_RASTERIZATION_SHADERS_BIT_EXT,
3405    and
3406endif::VK_EXT_graphics_pipeline_library[]
3407    the `apiext:VK_EXT_extended_dynamic_state3` extension is not enabled, or
3408    any of the ename:VK_DYNAMIC_STATE_RASTERIZATION_SAMPLES_EXT,
3409    ename:VK_DYNAMIC_STATE_SAMPLE_MASK_EXT, or
3410    ename:VK_DYNAMIC_STATE_ALPHA_TO_COVERAGE_ENABLE_EXT dynamic states are
3411    not set, or <<features-alphaToOne,alphaToOne>> is enabled on the device
3412    and ename:VK_DYNAMIC_STATE_ALPHA_TO_ONE_ENABLE_EXT is not set, then
3413    pname:pMultisampleState must: be a valid pointer to a valid
3414    slink:VkPipelineMultisampleStateCreateInfo structure
3415  * [[VUID-VkGraphicsPipelineCreateInfo-pRasterizationState-09040]]
3416    If pname:pRasterizationState is not `NULL` it must: be a valid pointer
3417    to a valid slink:VkPipelineRasterizationStateCreateInfo structure
3418endif::VK_EXT_extended_dynamic_state3[]
3419  * [[VUID-VkGraphicsPipelineCreateInfo-layout-06602]]
3420    If the pipeline requires <<pipelines-graphics-subsets-fragment-shader,
3421    fragment shader state>> or
3422    <<pipelines-graphics-subsets-pre-rasterization, pre-rasterization shader
3423    state>>, pname:layout must: be a valid slink:VkPipelineLayout handle
3424  * [[VUID-VkGraphicsPipelineCreateInfo-renderPass-06603]]
3425    If <<pipelines-graphics-subsets-pre-rasterization, pre-rasterization
3426    shader state>>, <<pipelines-graphics-subsets-fragment-shader, fragment
3427    shader state>>, or <<pipelines-graphics-subsets-fragment-output,
3428    fragment output state>>,
3429ifdef::VK_VERSION_1_3,VK_KHR_dynamic_rendering[]
3430    and pname:renderPass is not dlink:VK_NULL_HANDLE,
3431endif::VK_VERSION_1_3,VK_KHR_dynamic_rendering[]
3432    pname:renderPass must: be a valid slink:VkRenderPass handle
3433  * [[VUID-VkGraphicsPipelineCreateInfo-stageCount-06604]]
3434    If the pipeline requires <<pipelines-graphics-subsets-pre-rasterization,
3435    pre-rasterization shader state>> or
3436    <<pipelines-graphics-subsets-fragment-shader, fragment shader state>>,
3437    pname:stageCount must: be greater than `0`
3438ifdef::VK_KHR_pipeline_library[]
3439  * [[VUID-VkGraphicsPipelineCreateInfo-graphicsPipelineLibrary-06606]]
3440ifdef::VK_EXT_graphics_pipeline_library[]
3441    If the <<features-graphicsPipelineLibrary,
3442    pname:graphicsPipelineLibrary>> feature is not enabled,
3443endif::VK_EXT_graphics_pipeline_library[]
3444    pname:flags must: not include ename:VK_PIPELINE_CREATE_LIBRARY_BIT_KHR
3445endif::VK_KHR_pipeline_library[]
3446ifdef::VK_EXT_graphics_pipeline_library[]
3447  * [[VUID-VkGraphicsPipelineCreateInfo-flags-06608]]
3448    If the pipeline defines, or includes as libraries, all the state subsets
3449    required for a <<pipelines-graphics-subsets-complete, complete graphics
3450    pipeline>>, pname:flags must: not include
3451    ename:VK_PIPELINE_CREATE_LIBRARY_BIT_KHR
3452  * [[VUID-VkGraphicsPipelineCreateInfo-flags-06609]]
3453    If pname:flags includes
3454    ename:VK_PIPELINE_CREATE_LINK_TIME_OPTIMIZATION_BIT_EXT, pipeline
3455    libraries included via slink:VkPipelineLibraryCreateInfoKHR must: have
3456    been created with
3457    ename:VK_PIPELINE_CREATE_RETAIN_LINK_TIME_OPTIMIZATION_INFO_BIT_EXT
3458  * [[VUID-VkGraphicsPipelineCreateInfo-flags-09245]]
3459    If pname:flags includes
3460    ename:VK_PIPELINE_CREATE_RETAIN_LINK_TIME_OPTIMIZATION_INFO_BIT_EXT,
3461    pname:flags must: also include ename:VK_PIPELINE_CREATE_LIBRARY_BIT_KHR
3462  * [[VUID-VkGraphicsPipelineCreateInfo-flags-06610]]
3463    If pname:flags includes
3464    ename:VK_PIPELINE_CREATE_RETAIN_LINK_TIME_OPTIMIZATION_INFO_BIT_EXT,
3465    pipeline libraries included via slink:VkPipelineLibraryCreateInfoKHR
3466    must: have been created with
3467    ename:VK_PIPELINE_CREATE_RETAIN_LINK_TIME_OPTIMIZATION_INFO_BIT_EXT
3468  * [[VUID-VkGraphicsPipelineCreateInfo-pLibraries-06611]]
3469    Any pipeline libraries included via
3470    slink:VkPipelineLibraryCreateInfoKHR::pname:pLibraries must: not include
3471    any <<pipelines-graphics-subsets, state subset>> already defined by this
3472    structure or defined by any other pipeline library in
3473    slink:VkPipelineLibraryCreateInfoKHR::pname:pLibraries
3474  * [[VUID-VkGraphicsPipelineCreateInfo-flags-06612]]
3475    If slink:VkGraphicsPipelineLibraryCreateInfoEXT::pname:flags includes
3476    only one of
3477    ename:VK_GRAPHICS_PIPELINE_LIBRARY_PRE_RASTERIZATION_SHADERS_BIT_EXT or
3478    ename:VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT, and an
3479    element of slink:VkPipelineLibraryCreateInfoKHR::pname:pLibraries
3480    includes the other flag, and pname:layout was not created with
3481    ename:VK_PIPELINE_LAYOUT_CREATE_INDEPENDENT_SETS_BIT_EXT, then the
3482    pname:layout used by this pipeline and the library must: be _identically
3483    defined_
3484  * [[VUID-VkGraphicsPipelineCreateInfo-pLibraries-06613]]
3485    If one element of slink:VkPipelineLibraryCreateInfoKHR::pname:pLibraries
3486    includes
3487    ename:VK_GRAPHICS_PIPELINE_LIBRARY_PRE_RASTERIZATION_SHADERS_BIT_EXT and
3488    another element includes
3489    ename:VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT, and the
3490    pname:layout specified by either library was not created with
3491    ename:VK_PIPELINE_LAYOUT_CREATE_INDEPENDENT_SETS_BIT_EXT, then the
3492    pname:layout used by each library must: be _identically defined_
3493  * [[VUID-VkGraphicsPipelineCreateInfo-flags-06614]]
3494    If slink:VkGraphicsPipelineLibraryCreateInfoEXT::pname:flags includes
3495    only one of
3496    ename:VK_GRAPHICS_PIPELINE_LIBRARY_PRE_RASTERIZATION_SHADERS_BIT_EXT or
3497    ename:VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT, an element
3498    of slink:VkPipelineLibraryCreateInfoKHR::pname:pLibraries includes the
3499    other subset, and pname:layout was created with
3500    ename:VK_PIPELINE_LAYOUT_CREATE_INDEPENDENT_SETS_BIT_EXT, then the
3501    pname:layout used by the library must: also have been created with
3502    ename:VK_PIPELINE_LAYOUT_CREATE_INDEPENDENT_SETS_BIT_EXT
3503  * [[VUID-VkGraphicsPipelineCreateInfo-pLibraries-06615]]
3504    If one element of slink:VkPipelineLibraryCreateInfoKHR::pname:pLibraries
3505    includes
3506    ename:VK_GRAPHICS_PIPELINE_LIBRARY_PRE_RASTERIZATION_SHADERS_BIT_EXT and
3507    another element includes
3508    ename:VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT, and the
3509    pname:layout specified by either library was created with
3510    ename:VK_PIPELINE_LAYOUT_CREATE_INDEPENDENT_SETS_BIT_EXT, then the
3511    pname:layout used by both libraries must: have been created with
3512    ename:VK_PIPELINE_LAYOUT_CREATE_INDEPENDENT_SETS_BIT_EXT
3513  * [[VUID-VkGraphicsPipelineCreateInfo-flags-06616]]
3514    If slink:VkGraphicsPipelineLibraryCreateInfoEXT::pname:flags includes
3515    only one of
3516    ename:VK_GRAPHICS_PIPELINE_LIBRARY_PRE_RASTERIZATION_SHADERS_BIT_EXT or
3517    ename:VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT, an element
3518    of slink:VkPipelineLibraryCreateInfoKHR::pname:pLibraries includes the
3519    other subset, and pname:layout was created with
3520    ename:VK_PIPELINE_LAYOUT_CREATE_INDEPENDENT_SETS_BIT_EXT, elements of
3521    the pname:pSetLayouts array which pname:layout was created with that are
3522    not dlink:VK_NULL_HANDLE must: be _identically defined_ to the element
3523    at the same index of pname:pSetLayouts used to create the library's
3524    pname:layout
3525  * [[VUID-VkGraphicsPipelineCreateInfo-pLibraries-06617]]
3526    If one element of slink:VkPipelineLibraryCreateInfoKHR::pname:pLibraries
3527    includes
3528    ename:VK_GRAPHICS_PIPELINE_LIBRARY_PRE_RASTERIZATION_SHADERS_BIT_EXT and
3529    another element includes
3530    ename:VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT, and the
3531    pname:layout specified by either library was created with
3532    ename:VK_PIPELINE_LAYOUT_CREATE_INDEPENDENT_SETS_BIT_EXT, elements of
3533    the pname:pSetLayouts array which either pname:layout was created with
3534    that are not dlink:VK_NULL_HANDLE must: be _identically defined_ to the
3535    element at the same index of pname:pSetLayouts used to create the other
3536    library's pname:layout
3537  * [[VUID-VkGraphicsPipelineCreateInfo-flags-06618]]
3538    If slink:VkGraphicsPipelineLibraryCreateInfoEXT::pname:flags includes
3539    only one of
3540    ename:VK_GRAPHICS_PIPELINE_LIBRARY_PRE_RASTERIZATION_SHADERS_BIT_EXT or
3541    ename:VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT, and an
3542    element of slink:VkPipelineLibraryCreateInfoKHR::pname:pLibraries
3543    includes the other flag, any descriptor set layout _N_ specified by
3544    pname:layout in both this pipeline and the library which include
3545    bindings accessed by shader stages in each must: be _identically
3546    defined_
3547  * [[VUID-VkGraphicsPipelineCreateInfo-pLibraries-06619]]
3548    If one element of slink:VkPipelineLibraryCreateInfoKHR::pname:pLibraries
3549    includes
3550    ename:VK_GRAPHICS_PIPELINE_LIBRARY_PRE_RASTERIZATION_SHADERS_BIT_EXT and
3551    another element includes
3552    ename:VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT, any
3553    descriptor set layout _N_ specified by pname:layout in both libraries
3554    which include bindings accessed by shader stages in each must: be
3555    _identically defined_
3556  * [[VUID-VkGraphicsPipelineCreateInfo-flags-06620]]
3557    If slink:VkGraphicsPipelineLibraryCreateInfoEXT::pname:flags includes
3558    only one of
3559    ename:VK_GRAPHICS_PIPELINE_LIBRARY_PRE_RASTERIZATION_SHADERS_BIT_EXT or
3560    ename:VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT, and an
3561    element of slink:VkPipelineLibraryCreateInfoKHR::pname:pLibraries
3562    includes the other flag, push constants specified in pname:layout in
3563    both this pipeline and the library which are available to shader stages
3564    in each must: be _identically defined_
3565  * [[VUID-VkGraphicsPipelineCreateInfo-pLibraries-06621]]
3566    If one element of slink:VkPipelineLibraryCreateInfoKHR::pname:pLibraries
3567    includes
3568    ename:VK_GRAPHICS_PIPELINE_LIBRARY_PRE_RASTERIZATION_SHADERS_BIT_EXT and
3569    another element includes
3570    ename:VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT, push
3571    constants specified in pname:layout in both this pipeline and the
3572    library which are available to shader stages in each must: be
3573    _identically defined_
3574  * [[VUID-VkGraphicsPipelineCreateInfo-flags-06679]]
3575    If slink:VkGraphicsPipelineLibraryCreateInfoEXT::pname:flags includes
3576    only one of
3577    ename:VK_GRAPHICS_PIPELINE_LIBRARY_PRE_RASTERIZATION_SHADERS_BIT_EXT or
3578    ename:VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT, an element
3579    of slink:VkPipelineLibraryCreateInfoKHR::pname:pLibraries includes the
3580    other subset, any element of the pname:pSetLayouts array when
3581    pname:layout was created and the corresponding element of the
3582    pname:pSetLayouts array used to create the library's pname:layout must:
3583    not both be dlink:VK_NULL_HANDLE
3584  * [[VUID-VkGraphicsPipelineCreateInfo-pLibraries-06681]]
3585    If one element of slink:VkPipelineLibraryCreateInfoKHR::pname:pLibraries
3586    includes
3587    ename:VK_GRAPHICS_PIPELINE_LIBRARY_PRE_RASTERIZATION_SHADERS_BIT_EXT and
3588    another element includes
3589    ename:VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT, and any
3590    element of the pname:pSetLayouts array used to create each library's
3591    pname:layout was dlink:VK_NULL_HANDLE, then the corresponding element of
3592    the pname:pSetLayouts array used to create the other library's
3593    pname:layout must: not be dlink:VK_NULL_HANDLE
3594  * [[VUID-VkGraphicsPipelineCreateInfo-flags-06756]]
3595    If slink:VkGraphicsPipelineLibraryCreateInfoEXT::pname:flags includes
3596    only one of
3597    ename:VK_GRAPHICS_PIPELINE_LIBRARY_PRE_RASTERIZATION_SHADERS_BIT_EXT or
3598    ename:VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT, an element
3599    of slink:VkPipelineLibraryCreateInfoKHR::pname:pLibraries includes the
3600    other subset, and any element of the pname:pSetLayouts array which
3601    pname:layout was created with was dlink:VK_NULL_HANDLE, then the
3602    corresponding element of the pname:pSetLayouts array used to create the
3603    library's pname:layout must: not have shader bindings for shaders in the
3604    other subset
3605  * [[VUID-VkGraphicsPipelineCreateInfo-flags-06757]]
3606    If slink:VkGraphicsPipelineLibraryCreateInfoEXT::pname:flags includes
3607    only one of
3608    ename:VK_GRAPHICS_PIPELINE_LIBRARY_PRE_RASTERIZATION_SHADERS_BIT_EXT or
3609    ename:VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT, an element
3610    of slink:VkPipelineLibraryCreateInfoKHR::pname:pLibraries includes the
3611    other subset, and any element of the pname:pSetLayouts array used to
3612    create the library's pname:layout was dlink:VK_NULL_HANDLE, then the
3613    corresponding element of the pname:pSetLayouts array used to create this
3614    pipeline's pname:layout must: not have shader bindings for shaders in
3615    the other subset
3616  * [[VUID-VkGraphicsPipelineCreateInfo-pLibraries-06758]]
3617    If one element of slink:VkPipelineLibraryCreateInfoKHR::pname:pLibraries
3618    includes
3619    ename:VK_GRAPHICS_PIPELINE_LIBRARY_PRE_RASTERIZATION_SHADERS_BIT_EXT and
3620    another element includes
3621    ename:VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT, and any
3622    element of the pname:pSetLayouts array used to create each library's
3623    pname:layout was dlink:VK_NULL_HANDLE, then the corresponding element of
3624    the pname:pSetLayouts array used to create the other library's
3625    pname:layout must: not have shader bindings for shaders in the other
3626    subset
3627  * [[VUID-VkGraphicsPipelineCreateInfo-flags-06682]]
3628    If slink:VkGraphicsPipelineLibraryCreateInfoEXT::pname:flags includes
3629    both
3630    ename:VK_GRAPHICS_PIPELINE_LIBRARY_PRE_RASTERIZATION_SHADERS_BIT_EXT and
3631    ename:VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT, pname:layout
3632    must: have been created with no elements of the pname:pSetLayouts array
3633    set to dlink:VK_NULL_HANDLE
3634  * [[VUID-VkGraphicsPipelineCreateInfo-flags-06683]]
3635    If slink:VkGraphicsPipelineLibraryCreateInfoEXT::pname:flags includes
3636    ename:VK_GRAPHICS_PIPELINE_LIBRARY_PRE_RASTERIZATION_SHADERS_BIT_EXT and
3637    pname:pRasterizationState->rasterizerDiscardEnable is ename:VK_TRUE,
3638    pname:layout must: have been created with no elements of the
3639    pname:pSetLayouts array set to dlink:VK_NULL_HANDLE
3640  * [[VUID-VkGraphicsPipelineCreateInfo-flags-06684]]
3641    If slink:VkGraphicsPipelineLibraryCreateInfoEXT::pname:flags includes at
3642    least one of and no more than two of
3643    ename:VK_GRAPHICS_PIPELINE_LIBRARY_PRE_RASTERIZATION_SHADERS_BIT_EXT,
3644    ename:VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT, or
3645    ename:VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_OUTPUT_INTERFACE_BIT_EXT,
3646    and an element of slink:VkPipelineLibraryCreateInfoKHR::pname:pLibraries
3647    includes one of the other flags, the value of pname:subpass must: be
3648    equal to that used to create the library
3649  * [[VUID-VkGraphicsPipelineCreateInfo-pLibraries-06623]]
3650    If one element of slink:VkPipelineLibraryCreateInfoKHR::pname:pLibraries
3651    includes at least one of and no more than two of
3652    ename:VK_GRAPHICS_PIPELINE_LIBRARY_PRE_RASTERIZATION_SHADERS_BIT_EXT,
3653    ename:VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT, or
3654    ename:VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_OUTPUT_INTERFACE_BIT_EXT,
3655    and another element of
3656    slink:VkPipelineLibraryCreateInfoKHR::pname:pLibraries includes one of
3657    the other flags, the value of pname:subpass used to create each library
3658    must: be identical
3659  * [[VUID-VkGraphicsPipelineCreateInfo-renderpass-06624]]
3660    If pname:renderpass is not dlink:VK_NULL_HANDLE,
3661    slink:VkGraphicsPipelineLibraryCreateInfoEXT::pname:flags includes at
3662    least one of and no more than two of
3663    ename:VK_GRAPHICS_PIPELINE_LIBRARY_PRE_RASTERIZATION_SHADERS_BIT_EXT,
3664    ename:VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT, or
3665    ename:VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_OUTPUT_INTERFACE_BIT_EXT,
3666    and an element of slink:VkPipelineLibraryCreateInfoKHR::pname:pLibraries
3667    includes one of the other flags, pname:renderPass must: be compatible
3668    with that used to create the library
3669ifdef::VK_VERSION_1_3,VK_KHR_dynamic_rendering[]
3670  * [[VUID-VkGraphicsPipelineCreateInfo-renderpass-06625]]
3671    If pname:renderpass is dlink:VK_NULL_HANDLE,
3672    slink:VkGraphicsPipelineLibraryCreateInfoEXT::pname:flags includes at
3673    least one of and no more than two of
3674    ename:VK_GRAPHICS_PIPELINE_LIBRARY_PRE_RASTERIZATION_SHADERS_BIT_EXT,
3675    ename:VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT, or
3676    ename:VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_OUTPUT_INTERFACE_BIT_EXT,
3677    and an element of slink:VkPipelineLibraryCreateInfoKHR::pname:pLibraries
3678    includes one of the other flags, the value of pname:renderPass used to
3679    create that library must: also be dlink:VK_NULL_HANDLE
3680  * [[VUID-VkGraphicsPipelineCreateInfo-flags-06626]]
3681    If slink:VkGraphicsPipelineLibraryCreateInfoEXT::pname:flags includes at
3682    least one of and no more than two of
3683    ename:VK_GRAPHICS_PIPELINE_LIBRARY_PRE_RASTERIZATION_SHADERS_BIT_EXT,
3684    ename:VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT, or
3685    ename:VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_OUTPUT_INTERFACE_BIT_EXT, an
3686    element of slink:VkPipelineLibraryCreateInfoKHR::pname:pLibraries
3687    includes one of the other flags, and pname:renderPass is
3688    dlink:VK_NULL_HANDLE, the value of
3689    slink:VkPipelineRenderingCreateInfo::pname:viewMask used by this
3690    pipeline and that specified by the library must: be identical
3691  * [[VUID-VkGraphicsPipelineCreateInfo-pLibraries-06627]]
3692    If one element of slink:VkPipelineLibraryCreateInfoKHR::pname:pLibraries
3693    includes at least one of and no more than two of
3694    ename:VK_GRAPHICS_PIPELINE_LIBRARY_PRE_RASTERIZATION_SHADERS_BIT_EXT,
3695    ename:VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT, or
3696    ename:VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_OUTPUT_INTERFACE_BIT_EXT,
3697    another element of
3698    slink:VkPipelineLibraryCreateInfoKHR::pname:pLibraries includes one of
3699    the other flags, and pname:renderPass was dlink:VK_NULL_HANDLE for both
3700    libraries, the value of
3701    slink:VkPipelineRenderingCreateInfo::pname:viewMask set by each library
3702    must: be identical
3703  * [[VUID-VkGraphicsPipelineCreateInfo-pLibraries-06628]]
3704    If one element of slink:VkPipelineLibraryCreateInfoKHR::pname:pLibraries
3705    includes at least one of and no more than two of
3706    ename:VK_GRAPHICS_PIPELINE_LIBRARY_PRE_RASTERIZATION_SHADERS_BIT_EXT,
3707    ename:VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT, or
3708    ename:VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_OUTPUT_INTERFACE_BIT_EXT,
3709    and another element of
3710    slink:VkPipelineLibraryCreateInfoKHR::pname:pLibraries includes one of
3711    the other flags, the pname:renderPass objects used to create each
3712    library must: be compatible or all equal to dlink:VK_NULL_HANDLE
3713  * [[VUID-VkGraphicsPipelineCreateInfo-renderpass-06631]]
3714    If pname:renderPass is not dlink:VK_NULL_HANDLE, the pipeline requires
3715    <<pipelines-graphics-subsets-fragment-shader, fragment shader state>>,
3716ifdef::VK_EXT_extended_dynamic_state3[]
3717    and the `apiext:VK_EXT_extended_dynamic_state3` extension is not enabled
3718    or any of the ename:VK_DYNAMIC_STATE_RASTERIZATION_SAMPLES_EXT,
3719    ename:VK_DYNAMIC_STATE_SAMPLE_MASK_EXT, or
3720    ename:VK_DYNAMIC_STATE_ALPHA_TO_COVERAGE_ENABLE_EXT dynamic states is
3721    not set, or <<features-alphaToOne,alphaToOne>> is enabled on the device
3722    and ename:VK_DYNAMIC_STATE_ALPHA_TO_ONE_ENABLE_EXT is not set,
3723endif::VK_EXT_extended_dynamic_state3[]
3724    then pname:pMultisampleState must: be a valid pointer to a valid
3725    slink:VkPipelineMultisampleStateCreateInfo structure
3726  * [[VUID-VkGraphicsPipelineCreateInfo-Input-06632]]
3727    If the pipeline requires <<pipelines-graphics-subsets-fragment-shader,
3728    fragment shader state>> with a fragment shader that either enables
3729    <<primsrast-sampleshading, sample shading>> or decorates any variable in
3730    the code:Input storage class with code:Sample,
3731ifdef::VK_EXT_extended_dynamic_state3[]
3732    and the `apiext:VK_EXT_extended_dynamic_state3` extension is not enabled
3733    or any of the ename:VK_DYNAMIC_STATE_RASTERIZATION_SAMPLES_EXT,
3734    ename:VK_DYNAMIC_STATE_SAMPLE_MASK_EXT, or
3735    ename:VK_DYNAMIC_STATE_ALPHA_TO_COVERAGE_ENABLE_EXT dynamic states is
3736    not set, or <<features-alphaToOne,alphaToOne>> is enabled on the device
3737    and ename:VK_DYNAMIC_STATE_ALPHA_TO_ONE_ENABLE_EXT is not set,
3738endif::VK_EXT_extended_dynamic_state3[]
3739    then pname:pMultisampleState must: be a valid pointer to a valid
3740    slink:VkPipelineMultisampleStateCreateInfo structure
3741endif::VK_VERSION_1_3,VK_KHR_dynamic_rendering[]
3742  * [[VUID-VkGraphicsPipelineCreateInfo-flags-06633]]
3743    If slink:VkGraphicsPipelineLibraryCreateInfoEXT::pname:flags includes
3744    ename:VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT with a
3745    pname:pMultisampleState that was not `NULL`, and an element of
3746    slink:VkPipelineLibraryCreateInfoKHR::pname:pLibraries was created with
3747    ename:VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_OUTPUT_INTERFACE_BIT_EXT,
3748    pname:pMultisampleState must: be _identically defined_ to that used to
3749    create the library
3750  * [[VUID-VkGraphicsPipelineCreateInfo-pLibraries-06634]]
3751    If an element of slink:VkPipelineLibraryCreateInfoKHR::pname:pLibraries
3752    was created with
3753    ename:VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT with a
3754    pname:pMultisampleState that was not `NULL`, and if
3755    slink:VkGraphicsPipelineLibraryCreateInfoEXT::pname:flags includes
3756    ename:VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_OUTPUT_INTERFACE_BIT_EXT,
3757    pname:pMultisampleState must: be _identically defined_ to that used to
3758    create the library
3759  * [[VUID-VkGraphicsPipelineCreateInfo-pLibraries-06635]]
3760    If one element of slink:VkPipelineLibraryCreateInfoKHR::pname:pLibraries
3761    was created with
3762    ename:VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT with a
3763    pname:pMultisampleState that was not `NULL`, and if a different element
3764    of slink:VkPipelineLibraryCreateInfoKHR::pname:pLibraries was created
3765    with
3766    ename:VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_OUTPUT_INTERFACE_BIT_EXT,
3767    the pname:pMultisampleState used to create each library must: be
3768    _identically defined_
3769  * [[VUID-VkGraphicsPipelineCreateInfo-pLibraries-06636]]
3770    If one element of slink:VkPipelineLibraryCreateInfoKHR::pname:pLibraries
3771    was created with
3772    ename:VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_OUTPUT_INTERFACE_BIT_EXT and
3773    a value of pname:pMultisampleState->sampleShading equal ename:VK_TRUE,
3774    and if a different element of
3775    slink:VkPipelineLibraryCreateInfoKHR::pname:pLibraries was created with
3776    ename:VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT, the
3777    pname:pMultisampleState used to create each library must: be
3778    _identically defined_
3779  * [[VUID-VkGraphicsPipelineCreateInfo-flags-06637]]
3780    If slink:VkGraphicsPipelineLibraryCreateInfoEXT::pname:flags includes
3781    ename:VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_OUTPUT_INTERFACE_BIT_EXT,
3782    pname:pMultisampleState->sampleShading is ename:VK_TRUE, and an element
3783    of slink:VkPipelineLibraryCreateInfoKHR::pname:pLibraries was created
3784    with ename:VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT, the
3785    pname:pMultisampleState used to create that library must: be
3786    _identically defined_ pname:pMultisampleState
3787ifdef::VK_KHR_fragment_shading_rate[]
3788  * [[VUID-VkGraphicsPipelineCreateInfo-flags-06638]]
3789    If slink:VkGraphicsPipelineLibraryCreateInfoEXT::pname:flags includes
3790    only one of
3791    ename:VK_GRAPHICS_PIPELINE_LIBRARY_PRE_RASTERIZATION_SHADERS_BIT_EXT or
3792    ename:VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT, and an
3793    element of slink:VkPipelineLibraryCreateInfoKHR::pname:pLibraries
3794    includes the other flag, values specified in
3795    slink:VkPipelineFragmentShadingRateStateCreateInfoKHR for both this
3796    pipeline and that library must: be identical
3797  * [[VUID-VkGraphicsPipelineCreateInfo-pLibraries-06639]]
3798    If one element of slink:VkPipelineLibraryCreateInfoKHR::pname:pLibraries
3799    includes
3800    ename:VK_GRAPHICS_PIPELINE_LIBRARY_PRE_RASTERIZATION_SHADERS_BIT_EXT and
3801    another element includes
3802    ename:VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT, values
3803    specified in slink:VkPipelineFragmentShadingRateStateCreateInfoKHR for
3804    both this pipeline and that library must: be identical
3805endif::VK_KHR_fragment_shading_rate[]
3806  * [[VUID-VkGraphicsPipelineCreateInfo-flags-06640]]
3807    If slink:VkGraphicsPipelineLibraryCreateInfoEXT::pname:flags includes
3808    ename:VK_GRAPHICS_PIPELINE_LIBRARY_PRE_RASTERIZATION_SHADERS_BIT_EXT or
3809    ename:VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT,
3810    pname:pStages must: be a valid pointer to an array of pname:stageCount
3811    valid slink:VkPipelineShaderStageCreateInfo structures
3812ifndef::VK_EXT_extended_dynamic_state3[]
3813  * [[VUID-VkGraphicsPipelineCreateInfo-flags-06641]]
3814    If slink:VkGraphicsPipelineLibraryCreateInfoEXT::pname:flags includes
3815    ename:VK_GRAPHICS_PIPELINE_LIBRARY_PRE_RASTERIZATION_SHADERS_BIT_EXT,
3816    pname:pRasterizationState must: be a valid pointer to a valid
3817    slink:VkPipelineRasterizationStateCreateInfo structure
3818endif::VK_EXT_extended_dynamic_state3[]
3819  * [[VUID-VkGraphicsPipelineCreateInfo-flags-06642]]
3820    If slink:VkGraphicsPipelineLibraryCreateInfoEXT::pname:flags includes
3821    ename:VK_GRAPHICS_PIPELINE_LIBRARY_PRE_RASTERIZATION_SHADERS_BIT_EXT or
3822    ename:VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT, pname:layout
3823    must: be a valid slink:VkPipelineLayout handle
3824  * [[VUID-VkGraphicsPipelineCreateInfo-flags-06643]]
3825    If slink:VkGraphicsPipelineLibraryCreateInfoEXT::pname:flags includes
3826    ename:VK_GRAPHICS_PIPELINE_LIBRARY_PRE_RASTERIZATION_SHADERS_BIT_EXT, or
3827    ename:VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT,
3828    ename:VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_OUTPUT_INTERFACE_BIT_EXT,
3829    and pname:renderPass is not dlink:VK_NULL_HANDLE, pname:renderPass must:
3830    be a valid slink:VkRenderPass handle
3831  * [[VUID-VkGraphicsPipelineCreateInfo-flags-06644]]
3832    If slink:VkGraphicsPipelineLibraryCreateInfoEXT::pname:flags includes
3833    ename:VK_GRAPHICS_PIPELINE_LIBRARY_PRE_RASTERIZATION_SHADERS_BIT_EXT or
3834    ename:VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT,
3835    pname:stageCount must: be greater than `0`
3836ifdef::VK_KHR_pipeline_executable_properties[]
3837  * [[VUID-VkGraphicsPipelineCreateInfo-flags-06645]]
3838    If slink:VkGraphicsPipelineLibraryCreateInfoEXT::pname:flags is
3839    non-zero, if pname:flags includes
3840    ename:VK_PIPELINE_CREATE_CAPTURE_INTERNAL_REPRESENTATIONS_BIT_KHR, any
3841    libraries must: have also been created with
3842    ename:VK_PIPELINE_CREATE_CAPTURE_INTERNAL_REPRESENTATIONS_BIT_KHR
3843  * [[VUID-VkGraphicsPipelineCreateInfo-pLibraries-06646]]
3844    If slink:VkPipelineLibraryCreateInfoKHR::pname:pLibraries includes more
3845    than one library, and any library was created with
3846    ename:VK_PIPELINE_CREATE_CAPTURE_INTERNAL_REPRESENTATIONS_BIT_KHR, all
3847    libraries must: have also been created with
3848    ename:VK_PIPELINE_CREATE_CAPTURE_INTERNAL_REPRESENTATIONS_BIT_KHR
3849  * [[VUID-VkGraphicsPipelineCreateInfo-pLibraries-06647]]
3850    If slink:VkPipelineLibraryCreateInfoKHR::pname:pLibraries includes at
3851    least one library,
3852    slink:VkGraphicsPipelineLibraryCreateInfoEXT::pname:flags is non-zero,
3853    and any library was created with
3854    ename:VK_PIPELINE_CREATE_CAPTURE_INTERNAL_REPRESENTATIONS_BIT_KHR,
3855    pname:flags must: include
3856    ename:VK_PIPELINE_CREATE_CAPTURE_INTERNAL_REPRESENTATIONS_BIT_KHR
3857endif::VK_KHR_pipeline_executable_properties[]
3858  * [[VUID-VkGraphicsPipelineCreateInfo-None-07826]]
3859    If the pipeline includes a <<pipelines-graphics-subsets-complete,
3860    complete set of state>>, and there are no libraries included in
3861    slink:VkPipelineLibraryCreateInfoKHR::pname:pLibraries, then
3862    slink:VkPipelineLayout must: be a valid pipeline layout
3863  * [[VUID-VkGraphicsPipelineCreateInfo-layout-07827]]
3864    If the pipeline includes a <<pipelines-graphics-subsets-complete,
3865    complete set of state>> specified entirely by libraries, and each
3866    library was created with a slink:VkPipelineLayout created without
3867    ename:VK_PIPELINE_LAYOUT_CREATE_INDEPENDENT_SETS_BIT_EXT, then
3868    pname:layout must: be <<descriptorsets-compatibility,compatible>> with
3869    the layouts in those libraries
3870  * [[VUID-VkGraphicsPipelineCreateInfo-flags-06729]]
3871    If pname:flags includes
3872    ename:VK_PIPELINE_CREATE_LINK_TIME_OPTIMIZATION_BIT_EXT, the pipeline
3873    includes a <<pipelines-graphics-subsets-complete, complete set of
3874    state>> specified entirely by libraries, and each library was created
3875    with a slink:VkPipelineLayout created with
3876    ename:VK_PIPELINE_LAYOUT_CREATE_INDEPENDENT_SETS_BIT_EXT, then
3877    pname:layout must: be <<descriptorsets-compatibility,compatible>> with
3878    the union of the libraries' pipeline layouts other than the
3879    inclusion/exclusion of
3880    ename:VK_PIPELINE_LAYOUT_CREATE_INDEPENDENT_SETS_BIT_EXT
3881  * [[VUID-VkGraphicsPipelineCreateInfo-flags-06730]]
3882    If pname:flags does not include
3883    ename:VK_PIPELINE_CREATE_LINK_TIME_OPTIMIZATION_BIT_EXT, the pipeline
3884    includes a <<pipelines-graphics-subsets-complete, complete set of
3885    state>> specified entirely by libraries, and each library was created
3886    with a slink:VkPipelineLayout created with
3887    ename:VK_PIPELINE_LAYOUT_CREATE_INDEPENDENT_SETS_BIT_EXT, then
3888    pname:layout must: be <<descriptorsets-compatibility, compatible>> with
3889    the union of the libraries' pipeline layouts
3890endif::VK_EXT_graphics_pipeline_library[]
3891ifdef::VK_EXT_conservative_rasterization[]
3892  * [[VUID-VkGraphicsPipelineCreateInfo-conservativePointAndLineRasterization-08892]]
3893    If <<limits-conservativePointAndLineRasterization,
3894    pname:conservativePointAndLineRasterization>> is not supported; the
3895    pipeline is being created with
3896    <<pipelines-graphics-subsets-vertex-input, vertex input state>> and
3897    <<pipelines-graphics-subsets-pre-rasterization, pre-rasterization shader
3898    state>>; the pipeline does not include a geometry shader; and the value
3899    of slink:VkPipelineInputAssemblyStateCreateInfo::pname:topology is
3900    ename:VK_PRIMITIVE_TOPOLOGY_POINT_LIST,
3901    ename:VK_PRIMITIVE_TOPOLOGY_LINE_LIST, or
3902    ename:VK_PRIMITIVE_TOPOLOGY_LINE_STRIP,
3903ifdef::VK_EXT_extended_dynamic_state3[]
3904    and either ename:VK_DYNAMIC_STATE_PRIMITIVE_TOPOLOGY dynamic state is
3905    not enabled or
3906    <<limits-dynamicPrimitiveTopologyUnrestricted,pname:dynamicPrimitiveTopologyUnrestricted>>
3907    is ename:VK_FALSE,
3908endif::VK_EXT_extended_dynamic_state3[]
3909    then
3910    slink:VkPipelineRasterizationConservativeStateCreateInfoEXT::pname:conservativeRasterizationMode
3911    must: be ename:VK_CONSERVATIVE_RASTERIZATION_MODE_DISABLED_EXT
3912  * [[VUID-VkGraphicsPipelineCreateInfo-conservativePointAndLineRasterization-06760]]
3913    If <<limits-conservativePointAndLineRasterization,
3914    pname:conservativePointAndLineRasterization>> is not supported, the
3915    pipeline requires <<pipelines-graphics-subsets-pre-rasterization,
3916    pre-rasterization shader state>>, and the pipeline includes a geometry
3917    shader with either the code:OutputPoints or code:OutputLineStrip
3918    execution modes,
3919    slink:VkPipelineRasterizationConservativeStateCreateInfoEXT::pname:conservativeRasterizationMode
3920    must: be ename:VK_CONSERVATIVE_RASTERIZATION_MODE_DISABLED_EXT
3921ifdef::VK_NV_mesh_shader[]
3922  * [[VUID-VkGraphicsPipelineCreateInfo-conservativePointAndLineRasterization-06761]]
3923    If <<limits-conservativePointAndLineRasterization,
3924    pname:conservativePointAndLineRasterization>> is not supported, the
3925    pipeline requires <<pipelines-graphics-subsets-pre-rasterization,
3926    pre-rasterization shader state>>, and the pipeline includes a mesh
3927    shader with either the code:OutputPoints or code:OutputLinesNV execution
3928    modes,
3929    slink:VkPipelineRasterizationConservativeStateCreateInfoEXT::pname:conservativeRasterizationMode
3930    must: be ename:VK_CONSERVATIVE_RASTERIZATION_MODE_DISABLED_EXT
3931endif::VK_NV_mesh_shader[]
3932endif::VK_EXT_conservative_rasterization[]
3933  * [[VUID-VkGraphicsPipelineCreateInfo-pStages-06894]]
3934    If the pipeline requires <<pipelines-graphics-subsets-pre-rasterization,
3935    pre-rasterization shader state>> but not
3936    <<pipelines-graphics-subsets-fragment-shader, fragment shader state>>,
3937    elements of pname:pStages must: not have pname:stage set to
3938    ename:VK_SHADER_STAGE_FRAGMENT_BIT
3939  * [[VUID-VkGraphicsPipelineCreateInfo-pStages-06895]]
3940    If the pipeline requires <<pipelines-graphics-subsets-fragment-shader,
3941    fragment shader state>> but not
3942    <<pipelines-graphics-subsets-pre-rasterization, pre-rasterization shader
3943    state>>, elements of pname:pStages must: not have pname:stage set to a
3944    shader stage which participates in pre-rasterization
3945  * [[VUID-VkGraphicsPipelineCreateInfo-pStages-06896]]
3946    If the pipeline requires <<pipelines-graphics-subsets-pre-rasterization,
3947    pre-rasterization shader state>>, all elements of pname:pStages must:
3948    have a pname:stage set to a shader stage which participates in
3949    <<pipelines-graphics-subsets-fragment-shader, fragment shader state>> or
3950    <<pipelines-graphics-subsets-pre-rasterization, pre-rasterization shader
3951    state>>
3952  * [[VUID-VkGraphicsPipelineCreateInfo-stage-06897]]
3953    If the pipeline requires <<pipelines-graphics-subsets-fragment-shader,
3954    fragment shader state>> and/or
3955    <<pipelines-graphics-subsets-pre-rasterization, pre-rasterization shader
3956    state>>, any value of pname:stage must: not be set in more than one
3957    element of pname:pStages
3958ifdef::VK_EXT_extended_dynamic_state3[]
3959  * [[VUID-VkGraphicsPipelineCreateInfo-extendedDynamicState3TessellationDomainOrigin-07370]]
3960    If the <<features-extendedDynamicState3TessellationDomainOrigin,
3961    pname:extendedDynamicState3TessellationDomainOrigin>> feature is not
3962    enabled, there must: be no element of the pname:pDynamicStates member of
3963    pname:pDynamicState set to
3964    ename:VK_DYNAMIC_STATE_TESSELLATION_DOMAIN_ORIGIN_EXT
3965  * [[VUID-VkGraphicsPipelineCreateInfo-extendedDynamicState3DepthClampEnable-07371]]
3966    If the <<features-extendedDynamicState3DepthClampEnable,
3967    pname:extendedDynamicState3DepthClampEnable>> feature is not enabled,
3968    there must: be no element of the pname:pDynamicStates member of
3969    pname:pDynamicState set to ename:VK_DYNAMIC_STATE_DEPTH_CLAMP_ENABLE_EXT
3970  * [[VUID-VkGraphicsPipelineCreateInfo-extendedDynamicState3PolygonMode-07372]]
3971    If the <<features-extendedDynamicState3PolygonMode,
3972    pname:extendedDynamicState3PolygonMode>> feature is not enabled, there
3973    must: be no element of the pname:pDynamicStates member of
3974    pname:pDynamicState set to ename:VK_DYNAMIC_STATE_POLYGON_MODE_EXT
3975  * [[VUID-VkGraphicsPipelineCreateInfo-extendedDynamicState3RasterizationSamples-07373]]
3976    If the <<features-extendedDynamicState3RasterizationSamples,
3977    pname:extendedDynamicState3RasterizationSamples>> feature is not
3978    enabled, there must: be no element of the pname:pDynamicStates member of
3979    pname:pDynamicState set to
3980    ename:VK_DYNAMIC_STATE_RASTERIZATION_SAMPLES_EXT
3981  * [[VUID-VkGraphicsPipelineCreateInfo-extendedDynamicState3SampleMask-07374]]
3982    If the <<features-extendedDynamicState3SampleMask,
3983    pname:extendedDynamicState3SampleMask>> feature is not enabled, there
3984    must: be no element of the pname:pDynamicStates member of
3985    pname:pDynamicState set to ename:VK_DYNAMIC_STATE_SAMPLE_MASK_EXT
3986  * [[VUID-VkGraphicsPipelineCreateInfo-extendedDynamicState3AlphaToCoverageEnable-07375]]
3987    If the <<features-extendedDynamicState3AlphaToCoverageEnable,
3988    pname:extendedDynamicState3AlphaToCoverageEnable>> feature is not
3989    enabled, there must: be no element of the pname:pDynamicStates member of
3990    pname:pDynamicState set to
3991    ename:VK_DYNAMIC_STATE_ALPHA_TO_COVERAGE_ENABLE_EXT
3992  * [[VUID-VkGraphicsPipelineCreateInfo-extendedDynamicState3AlphaToOneEnable-07376]]
3993    If the <<features-extendedDynamicState3AlphaToOneEnable,
3994    pname:extendedDynamicState3AlphaToOneEnable>> feature is not enabled,
3995    there must: be no element of the pname:pDynamicStates member of
3996    pname:pDynamicState set to
3997    ename:VK_DYNAMIC_STATE_ALPHA_TO_ONE_ENABLE_EXT
3998  * [[VUID-VkGraphicsPipelineCreateInfo-extendedDynamicState3LogicOpEnable-07377]]
3999    If the <<features-extendedDynamicState3LogicOpEnable,
4000    pname:extendedDynamicState3LogicOpEnable>> feature is not enabled, there
4001    must: be no element of the pname:pDynamicStates member of
4002    pname:pDynamicState set to ename:VK_DYNAMIC_STATE_LOGIC_OP_ENABLE_EXT
4003  * [[VUID-VkGraphicsPipelineCreateInfo-extendedDynamicState3ColorBlendEnable-07378]]
4004    If the <<features-extendedDynamicState3ColorBlendEnable,
4005    pname:extendedDynamicState3ColorBlendEnable>> feature is not enabled,
4006    there must: be no element of the pname:pDynamicStates member of
4007    pname:pDynamicState set to ename:VK_DYNAMIC_STATE_COLOR_BLEND_ENABLE_EXT
4008  * [[VUID-VkGraphicsPipelineCreateInfo-extendedDynamicState3ColorBlendEquation-07379]]
4009    If the <<features-extendedDynamicState3ColorBlendEquation,
4010    pname:extendedDynamicState3ColorBlendEquation>> feature is not enabled,
4011    there must: be no element of the pname:pDynamicStates member of
4012    pname:pDynamicState set to
4013    ename:VK_DYNAMIC_STATE_COLOR_BLEND_EQUATION_EXT
4014  * [[VUID-VkGraphicsPipelineCreateInfo-extendedDynamicState3ColorWriteMask-07380]]
4015    If the <<features-extendedDynamicState3ColorWriteMask,
4016    pname:extendedDynamicState3ColorWriteMask>> feature is not enabled,
4017    there must: be no element of the pname:pDynamicStates member of
4018    pname:pDynamicState set to ename:VK_DYNAMIC_STATE_COLOR_WRITE_MASK_EXT
4019  * [[VUID-VkGraphicsPipelineCreateInfo-extendedDynamicState3RasterizationStream-07381]]
4020    If the <<features-extendedDynamicState3RasterizationStream,
4021    pname:extendedDynamicState3RasterizationStream>> feature is not enabled,
4022    there must: be no element of the pname:pDynamicStates member of
4023    pname:pDynamicState set to
4024    ename:VK_DYNAMIC_STATE_RASTERIZATION_STREAM_EXT
4025  * [[VUID-VkGraphicsPipelineCreateInfo-extendedDynamicState3ConservativeRasterizationMode-07382]]
4026    If the <<features-extendedDynamicState3ConservativeRasterizationMode,
4027    pname:extendedDynamicState3ConservativeRasterizationMode>> feature is
4028    not enabled, there must: be no element of the pname:pDynamicStates
4029    member of pname:pDynamicState set to
4030    ename:VK_DYNAMIC_STATE_CONSERVATIVE_RASTERIZATION_MODE_EXT
4031  * [[VUID-VkGraphicsPipelineCreateInfo-extendedDynamicState3ExtraPrimitiveOverestimationSize-07383]]
4032    If the <<features-extendedDynamicState3ExtraPrimitiveOverestimationSize,
4033    pname:extendedDynamicState3ExtraPrimitiveOverestimationSize>> feature is
4034    not enabled, there must: be no element of the pname:pDynamicStates
4035    member of pname:pDynamicState set to
4036    ename:VK_DYNAMIC_STATE_EXTRA_PRIMITIVE_OVERESTIMATION_SIZE_EXT
4037  * [[VUID-VkGraphicsPipelineCreateInfo-extendedDynamicState3DepthClipEnable-07384]]
4038    If the <<features-extendedDynamicState3DepthClipEnable,
4039    pname:extendedDynamicState3DepthClipEnable>> feature is not enabled,
4040    there must: be no element of the pname:pDynamicStates member of
4041    pname:pDynamicState set to ename:VK_DYNAMIC_STATE_DEPTH_CLIP_ENABLE_EXT
4042  * [[VUID-VkGraphicsPipelineCreateInfo-extendedDynamicState3SampleLocationsEnable-07385]]
4043    If the <<features-extendedDynamicState3SampleLocationsEnable,
4044    pname:extendedDynamicState3SampleLocationsEnable>> feature is not
4045    enabled, there must: be no element of the pname:pDynamicStates member of
4046    pname:pDynamicState set to
4047    ename:VK_DYNAMIC_STATE_SAMPLE_LOCATIONS_ENABLE_EXT
4048  * [[VUID-VkGraphicsPipelineCreateInfo-extendedDynamicState3ColorBlendAdvanced-07386]]
4049    If the <<features-extendedDynamicState3ColorBlendAdvanced,
4050    pname:extendedDynamicState3ColorBlendAdvanced>> feature is not enabled,
4051    there must: be no element of the pname:pDynamicStates member of
4052    pname:pDynamicState set to
4053    ename:VK_DYNAMIC_STATE_COLOR_BLEND_ADVANCED_EXT
4054  * [[VUID-VkGraphicsPipelineCreateInfo-extendedDynamicState3ProvokingVertexMode-07387]]
4055    If the <<features-extendedDynamicState3ProvokingVertexMode,
4056    pname:extendedDynamicState3ProvokingVertexMode>> feature is not enabled,
4057    there must: be no element of the pname:pDynamicStates member of
4058    pname:pDynamicState set to
4059    ename:VK_DYNAMIC_STATE_PROVOKING_VERTEX_MODE_EXT
4060  * [[VUID-VkGraphicsPipelineCreateInfo-extendedDynamicState3LineRasterizationMode-07388]]
4061    If the <<features-extendedDynamicState3LineRasterizationMode,
4062    pname:extendedDynamicState3LineRasterizationMode>> feature is not
4063    enabled, there must: be no element of the pname:pDynamicStates member of
4064    pname:pDynamicState set to
4065    ename:VK_DYNAMIC_STATE_LINE_RASTERIZATION_MODE_EXT
4066  * [[VUID-VkGraphicsPipelineCreateInfo-extendedDynamicState3LineStippleEnable-07389]]
4067    If the <<features-extendedDynamicState3LineStippleEnable,
4068    pname:extendedDynamicState3LineStippleEnable>> feature is not enabled,
4069    there must: be no element of the pname:pDynamicStates member of
4070    pname:pDynamicState set to
4071    ename:VK_DYNAMIC_STATE_LINE_STIPPLE_ENABLE_EXT
4072  * [[VUID-VkGraphicsPipelineCreateInfo-extendedDynamicState3DepthClipNegativeOneToOne-07390]]
4073    If the <<features-extendedDynamicState3DepthClipNegativeOneToOne,
4074    pname:extendedDynamicState3DepthClipNegativeOneToOne>> feature is not
4075    enabled, there must: be no element of the pname:pDynamicStates member of
4076    pname:pDynamicState set to
4077    ename:VK_DYNAMIC_STATE_DEPTH_CLIP_NEGATIVE_ONE_TO_ONE_EXT
4078  * [[VUID-VkGraphicsPipelineCreateInfo-extendedDynamicState3ViewportWScalingEnable-07391]]
4079    If the <<features-extendedDynamicState3ViewportWScalingEnable,
4080    pname:extendedDynamicState3ViewportWScalingEnable>> feature is not
4081    enabled, there must: be no element of the pname:pDynamicStates member of
4082    pname:pDynamicState set to
4083    ename:VK_DYNAMIC_STATE_VIEWPORT_W_SCALING_ENABLE_NV
4084  * [[VUID-VkGraphicsPipelineCreateInfo-extendedDynamicState3ViewportSwizzle-07392]]
4085    If the <<features-extendedDynamicState3ViewportSwizzle,
4086    pname:extendedDynamicState3ViewportSwizzle>> feature is not enabled,
4087    there must: be no element of the pname:pDynamicStates member of
4088    pname:pDynamicState set to ename:VK_DYNAMIC_STATE_VIEWPORT_SWIZZLE_NV
4089  * [[VUID-VkGraphicsPipelineCreateInfo-extendedDynamicState3CoverageToColorEnable-07393]]
4090    If the <<features-extendedDynamicState3CoverageToColorEnable,
4091    pname:extendedDynamicState3CoverageToColorEnable>> feature is not
4092    enabled, there must: be no element of the pname:pDynamicStates member of
4093    pname:pDynamicState set to
4094    ename:VK_DYNAMIC_STATE_COVERAGE_TO_COLOR_ENABLE_NV
4095  * [[VUID-VkGraphicsPipelineCreateInfo-extendedDynamicState3CoverageToColorLocation-07394]]
4096    If the <<features-extendedDynamicState3CoverageToColorLocation,
4097    pname:extendedDynamicState3CoverageToColorLocation>> feature is not
4098    enabled, there must: be no element of the pname:pDynamicStates member of
4099    pname:pDynamicState set to
4100    ename:VK_DYNAMIC_STATE_COVERAGE_TO_COLOR_LOCATION_NV
4101  * [[VUID-VkGraphicsPipelineCreateInfo-extendedDynamicState3CoverageModulationMode-07395]]
4102    If the <<features-extendedDynamicState3CoverageModulationMode,
4103    pname:extendedDynamicState3CoverageModulationMode>> feature is not
4104    enabled, there must: be no element of the pname:pDynamicStates member of
4105    pname:pDynamicState set to
4106    ename:VK_DYNAMIC_STATE_COVERAGE_MODULATION_MODE_NV
4107  * [[VUID-VkGraphicsPipelineCreateInfo-extendedDynamicState3CoverageModulationTableEnable-07396]]
4108    If the <<features-extendedDynamicState3CoverageModulationTableEnable,
4109    pname:extendedDynamicState3CoverageModulationTableEnable>> feature is
4110    not enabled, there must: be no element of the pname:pDynamicStates
4111    member of pname:pDynamicState set to
4112    ename:VK_DYNAMIC_STATE_COVERAGE_MODULATION_TABLE_ENABLE_NV
4113  * [[VUID-VkGraphicsPipelineCreateInfo-extendedDynamicState3CoverageModulationTable-07397]]
4114    If the <<features-extendedDynamicState3CoverageModulationTable,
4115    pname:extendedDynamicState3CoverageModulationTable>> feature is not
4116    enabled, there must: be no element of the pname:pDynamicStates member of
4117    pname:pDynamicState set to
4118    ename:VK_DYNAMIC_STATE_COVERAGE_MODULATION_TABLE_NV
4119  * [[VUID-VkGraphicsPipelineCreateInfo-extendedDynamicState3CoverageReductionMode-07398]]
4120    If the <<features-extendedDynamicState3CoverageReductionMode,
4121    pname:extendedDynamicState3CoverageReductionMode>> feature is not
4122    enabled, there must: be no element of the pname:pDynamicStates member of
4123    pname:pDynamicState set to
4124    ename:VK_DYNAMIC_STATE_COVERAGE_REDUCTION_MODE_NV
4125  * [[VUID-VkGraphicsPipelineCreateInfo-extendedDynamicState3RepresentativeFragmentTestEnable-07399]]
4126    If the <<features-extendedDynamicState3RepresentativeFragmentTestEnable,
4127    pname:extendedDynamicState3RepresentativeFragmentTestEnable>> feature is
4128    not enabled, there must: be no element of the pname:pDynamicStates
4129    member of pname:pDynamicState set to
4130    ename:VK_DYNAMIC_STATE_REPRESENTATIVE_FRAGMENT_TEST_ENABLE_NV
4131  * [[VUID-VkGraphicsPipelineCreateInfo-extendedDynamicState3ShadingRateImageEnable-07400]]
4132    If the <<features-extendedDynamicState3ShadingRateImageEnable,
4133    pname:extendedDynamicState3ShadingRateImageEnable>> feature is not
4134    enabled, there must: be no element of the pname:pDynamicStates member of
4135    pname:pDynamicState set to
4136    ename:VK_DYNAMIC_STATE_SHADING_RATE_IMAGE_ENABLE_NV
4137endif::VK_EXT_extended_dynamic_state3[]
4138ifdef::VK_EXT_opacity_micromap[]
4139  * [[VUID-VkGraphicsPipelineCreateInfo-flags-07401]]
4140    pname:flags must: not include
4141    ename:VK_PIPELINE_CREATE_RAY_TRACING_OPACITY_MICROMAP_BIT_EXT
4142endif::VK_EXT_opacity_micromap[]
4143ifdef::VK_NV_displacement_micromap[]
4144  * [[VUID-VkGraphicsPipelineCreateInfo-flags-07997]]
4145    pname:flags must: not include
4146    ename:VK_PIPELINE_CREATE_RAY_TRACING_DISPLACEMENT_MICROMAP_BIT_NV
4147endif::VK_NV_displacement_micromap[]
4148ifdef::VK_QCOM_multiview_per_view_viewports[]
4149  * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-07730]]
4150    If the pipeline requires <<pipelines-graphics-subsets-pre-rasterization,
4151    pre-rasterization shader state>>, and no element of the
4152    pname:pDynamicStates member of pname:pDynamicState is
4153    ename:VK_DYNAMIC_STATE_VIEWPORT or
4154    ename:VK_DYNAMIC_STATE_VIEWPORT_WITH_COUNT, and if
4155    <<features-multiview-per-view-viewports,
4156    pname:multiviewPerViewViewports>> is enabled, then the index of the most
4157    significant bit in each element of
4158    slink:VkRenderPassMultiviewCreateInfo::pname:pViewMasks must: be less
4159    than pname:pViewportState->viewportCount
4160  * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicStates-07731]]
4161    If the pipeline requires <<pipelines-graphics-subsets-pre-rasterization,
4162    pre-rasterization shader state>>, and no element of the
4163    pname:pDynamicStates member of pname:pDynamicState is
4164    ename:VK_DYNAMIC_STATE_SCISSOR or
4165    ename:VK_DYNAMIC_STATE_SCISSOR_WITH_COUNT, and if
4166    <<features-multiview-per-view-viewports,
4167    pname:multiviewPerViewViewports>> is enabled, then the index of the most
4168    significant bit in each element of
4169    slink:VkRenderPassMultiviewCreateInfo::pname:pViewMasks must: be less
4170    than pname:pViewportState->scissorCount
4171endif::VK_QCOM_multiview_per_view_viewports[]
4172ifdef::VK_EXT_shader_tile_image[]
4173  * [[VUID-VkGraphicsPipelineCreateInfo-pStages-08711]]
4174    If pname:pStages includes a fragment shader stage,
4175    ename:VK_DYNAMIC_STATE_DEPTH_WRITE_ENABLE is not set in
4176    slink:VkPipelineDynamicStateCreateInfo::pname:pDynamicStates, and the
4177    fragment shader declares the code:EarlyFragmentTests execution mode and
4178    uses code:OpDepthAttachmentReadEXT, the pname:depthWriteEnable member of
4179    slink:VkPipelineDepthStencilStateCreateInfo must: be ename:VK_FALSE
4180  * [[VUID-VkGraphicsPipelineCreateInfo-pStages-08712]]
4181    If pname:pStages includes a fragment shader stage,
4182    ename:VK_DYNAMIC_STATE_STENCIL_WRITE_MASK is not set in
4183    slink:VkPipelineDynamicStateCreateInfo::pname:pDynamicStates, and the
4184    fragment shader declares the code:EarlyFragmentTests execution mode and
4185    uses code:OpStencilAttachmentReadEXT, the value of
4186    slink:VkStencilOpState::pname:writeMask for both pname:front and
4187    pname:back in slink:VkPipelineDepthStencilStateCreateInfo must: be `0`
4188endif::VK_EXT_shader_tile_image[]
4189ifdef::VK_VERSION_1_3,VK_KHR_dynamic_rendering[]
4190  * [[VUID-VkGraphicsPipelineCreateInfo-renderPass-08744]]
4191    If pname:renderPass is dlink:VK_NULL_HANDLE, the pipeline requires
4192    <<pipelines-graphics-subsets-fragment-output, fragment output state>> or
4193    <<pipelines-graphics-subsets-fragment-shader, fragment shader state>>,
4194    the pipeline enables <<primsrast-sampleshading, sample shading>>,
4195    pname:rasterizationSamples is not dynamic, and the pname:pNext chain
4196    includes a slink:VkPipelineRenderingCreateInfo structure,
4197    pname:rasterizationSamples must: be a valid elink:VkSampleCountFlagBits
4198    value that is set in pname:imageCreateSampleCounts (as defined in
4199    <<resources-image-creation-limits,Image Creation Limits>>) for every
4200    element of pname:depthAttachmentFormat, pname:stencilAttachmentFormat
4201    and the pname:pColorAttachmentFormats array which is not
4202    ename:VK_FORMAT_UNDEFINED
4203endif::VK_VERSION_1_3,VK_KHR_dynamic_rendering[]
4204ifndef::VK_EXT_graphics_pipeline_library[]
4205  * [[VUID-VkGraphicsPipelineCreateInfo-None-08893]]
4206    The pipeline must: be created with
4207    <<pipelines-graphics-subsets-pre-rasterization, pre-rasterization shader
4208    state>>
4209  * [[VUID-VkGraphicsPipelineCreateInfo-pStages-08894]]
4210    If pname:pStages includes a vertex shader stage, the pipeline must: be
4211    created with <<pipelines-graphics-subsets-vertex-input, vertex input
4212    state>>
4213  * [[VUID-VkGraphicsPipelineCreateInfo-pDynamicState-08896]]
4214    If
4215ifdef::VK_EXT_extended_dynamic_state2,VK_VERSION_1_3[]
4216    pname:pDynamicState->pDynamicStates includes
4217    ename:VK_DYNAMIC_STATE_RASTERIZER_DISCARD_ENABLE, or if it does not and
4218endif::VK_EXT_extended_dynamic_state2,VK_VERSION_1_3[]
4219    pname:pRasterizationState->rasterizerDiscardEnable is ename:VK_FALSE,
4220    the pipeline must: be created with
4221    <<pipelines-graphics-subsets-fragment-shader, fragment shader state>>
4222    and <<pipelines-graphics-subsets-fragment-output,fragment output
4223    interface state>>
4224endif::VK_EXT_graphics_pipeline_library[]
4225ifdef::VK_EXT_graphics_pipeline_library[]
4226  * [[VUID-VkGraphicsPipelineCreateInfo-flags-08897]]
4227    If slink:VkGraphicsPipelineLibraryCreateInfoEXT::pname:flags includes
4228    ename:VK_GRAPHICS_PIPELINE_LIBRARY_VERTEX_INPUT_INTERFACE_BIT_EXT,
4229    <<pipelines-graphics-subsets-pre-rasterization, pre-rasterization shader
4230    state>> is specified either in a library or by the inclusion of
4231    ename:VK_GRAPHICS_PIPELINE_LIBRARY_PRE_RASTERIZATION_SHADERS_BIT_EXT,
4232    and that state includes a vertex shader stage in pname:pStages, the
4233    pipeline must: define <<pipelines-graphics-subsets-vertex-input, vertex
4234    input state>>
4235  * [[VUID-VkGraphicsPipelineCreateInfo-flags-08898]]
4236    If slink:VkGraphicsPipelineLibraryCreateInfoEXT::pname:flags includes
4237    ename:VK_GRAPHICS_PIPELINE_LIBRARY_VERTEX_INPUT_INTERFACE_BIT_EXT, and
4238    <<pipelines-graphics-subsets-pre-rasterization, pre-rasterization shader
4239    state>> is not specified, the pipeline must: define
4240    <<pipelines-graphics-subsets-vertex-input, vertex input state>>
4241  * [[VUID-VkGraphicsPipelineCreateInfo-flags-08899]]
4242    If pname:flags does not include
4243    ename:VK_PIPELINE_CREATE_LIBRARY_BIT_KHR,
4244    <<pipelines-graphics-subsets-pre-rasterization, pre-rasterization shader
4245    state>> is specified either in a library or by the inclusion of
4246    ename:VK_GRAPHICS_PIPELINE_LIBRARY_PRE_RASTERIZATION_SHADERS_BIT_EXT,
4247    and that state includes a vertex shader stage in pname:pStages, the
4248    pipeline must: either define
4249    <<pipelines-graphics-subsets-pre-rasterization, pre-rasterization shader
4250    state>> or include that state in a linked pipeline library
4251  * [[VUID-VkGraphicsPipelineCreateInfo-flags-08900]]
4252    If slink:VkGraphicsPipelineLibraryCreateInfoEXT::pname:flags includes
4253    ename:VK_GRAPHICS_PIPELINE_LIBRARY_PRE_RASTERIZATION_SHADERS_BIT_EXT the
4254    pipeline must: define <<pipelines-graphics-subsets-pre-rasterization,
4255    pre-rasterization shader state>>
4256  * [[VUID-VkGraphicsPipelineCreateInfo-flags-08901]]
4257    If pname:flags does not include
4258    ename:VK_PIPELINE_CREATE_LIBRARY_BIT_KHR, the pipeline must: either
4259    define <<pipelines-graphics-subsets-pre-rasterization, pre-rasterization
4260    shader state>> or include that state in a linked pipeline library
4261  * [[VUID-VkGraphicsPipelineCreateInfo-flags-08903]]
4262    If slink:VkGraphicsPipelineLibraryCreateInfoEXT::pname:flags includes
4263    ename:VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT,
4264    <<pipelines-graphics-subsets-pre-rasterization, pre-rasterization shader
4265    state>> is specified either in a library or by the inclusion of
4266    ename:VK_GRAPHICS_PIPELINE_LIBRARY_PRE_RASTERIZATION_SHADERS_BIT_EXT,
4267    and that state
4268ifdef::VK_EXT_extended_dynamic_state2,VK_VERSION_1_3[]
4269    either includes ename:VK_DYNAMIC_STATE_RASTERIZER_DISCARD_ENABLE or
4270endif::VK_EXT_extended_dynamic_state2,VK_VERSION_1_3[]
4271    has pname:pRasterizationState->rasterizerDiscardEnable set to
4272    ename:VK_FALSE, the pipeline must: define
4273    <<pipelines-graphics-subsets-fragment-shader, fragment shader state>>
4274  * [[VUID-VkGraphicsPipelineCreateInfo-flags-08904]]
4275    If slink:VkGraphicsPipelineLibraryCreateInfoEXT::pname:flags includes
4276    ename:VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT, and
4277    <<pipelines-graphics-subsets-pre-rasterization, pre-rasterization shader
4278    state>> is not specified, the pipeline must: define
4279    <<pipelines-graphics-subsets-fragment-shader, fragment shader state>>
4280  * [[VUID-VkGraphicsPipelineCreateInfo-flags-08906]]
4281    If slink:VkGraphicsPipelineLibraryCreateInfoEXT::pname:flags includes
4282    ename:VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT,
4283    <<pipelines-graphics-subsets-pre-rasterization, pre-rasterization shader
4284    state>> is specified either in a library or by the inclusion of
4285    ename:VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_OUTPUT_INTERFACE_BIT_EXT,
4286    and that state
4287ifdef::VK_EXT_extended_dynamic_state2,VK_VERSION_1_3[]
4288    either includes ename:VK_DYNAMIC_STATE_RASTERIZER_DISCARD_ENABLE or
4289endif::VK_EXT_extended_dynamic_state2,VK_VERSION_1_3[]
4290    has pname:pRasterizationState->rasterizerDiscardEnable set to
4291    ename:VK_FALSE, the pipeline must: define
4292    <<pipelines-graphics-subsets-fragment-output,fragment output interface
4293    state>>
4294  * [[VUID-VkGraphicsPipelineCreateInfo-flags-08907]]
4295    If slink:VkGraphicsPipelineLibraryCreateInfoEXT::pname:flags includes
4296    ename:VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT, and
4297    <<pipelines-graphics-subsets-pre-rasterization, pre-rasterization shader
4298    state>> is not specified, the pipeline must: define
4299    <<pipelines-graphics-subsets-fragment-output,fragment output interface
4300    state>>
4301  * [[VUID-VkGraphicsPipelineCreateInfo-flags-08909]]
4302    If pname:flags does not include
4303    ename:VK_PIPELINE_CREATE_LIBRARY_BIT_KHR,
4304    <<pipelines-graphics-subsets-pre-rasterization, pre-rasterization shader
4305    state>> is specified either in a library or by the inclusion of
4306    ename:VK_GRAPHICS_PIPELINE_LIBRARY_PRE_RASTERIZATION_SHADERS_BIT_EXT,
4307    and that state
4308ifdef::VK_EXT_extended_dynamic_state2,VK_VERSION_1_3[]
4309    either includes ename:VK_DYNAMIC_STATE_RASTERIZER_DISCARD_ENABLE or
4310endif::VK_EXT_extended_dynamic_state2,VK_VERSION_1_3[]
4311    has pname:pRasterizationState->rasterizerDiscardEnable set to
4312    ename:VK_FALSE, the pipeline must: define
4313    <<pipelines-graphics-subsets-fragment-output,fragment output interface
4314    state>> and <<pipelines-graphics-subsets-fragment-shader, fragment
4315    shader state>> or include those states in linked pipeline libraries
4316endif::VK_EXT_graphics_pipeline_library[]
4317  * [[VUID-VkGraphicsPipelineCreateInfo-None-09043]]
4318    If
4319ifdef::VK_EXT_extended_dynamic_state3[]
4320    pname:pDynamicState->pDynamicStates does not include
4321    ename:VK_DYNAMIC_STATE_COLOR_WRITE_MASK_EXT, and
4322endif::VK_EXT_extended_dynamic_state3[]
4323    the format of any color attachment is
4324    ename:VK_FORMAT_E5B9G9R9_UFLOAT_PACK32, the pname:colorWriteMask member
4325    of the corresponding element of pname:pColorBlendState->pAttachments
4326    must: either include all of ename:VK_COLOR_COMPONENT_R_BIT,
4327    ename:VK_COLOR_COMPONENT_G_BIT, and ename:VK_COLOR_COMPONENT_B_BIT, or
4328    none of them
4329ifdef::VK_ANDROID_external_format_resolve[]
4330ifdef::VK_VERSION_1_3,VK_KHR_dynamic_rendering[]
4331  * [[VUID-VkGraphicsPipelineCreateInfo-externalFormatResolve-09301]]
4332    If the <<features-externalFormatResolve, pname:externalFormatResolve>>
4333    feature is enabled, the pipeline requires
4334    <<pipelines-graphics-subsets-fragment-output, fragment output interface
4335    state>>, pname:renderPass is dlink:VK_NULL_HANDLE, and
4336    slink:VkExternalFormatANDROID::pname:externalFormat is not `0`,
4337    slink:VkPipelineRenderingCreateInfo::pname:viewMask must: be `0`
4338  * [[VUID-VkGraphicsPipelineCreateInfo-externalFormatResolve-09304]]
4339    If the <<features-externalFormatResolve, pname:externalFormatResolve>>
4340    feature is enabled, the pipeline requires
4341    <<pipelines-graphics-subsets-fragment-output, fragment output interface
4342    state>>, pname:renderPass is dlink:VK_NULL_HANDLE,
4343    slink:VkExternalFormatANDROID::pname:externalFormat is not `0`, and
4344    pname:rasterizationSamples is not dynamic,
4345    slink:VkPipelineMultisampleStateCreateInfo::pname:rasterizationSamples
4346    must: be `1`
4347  * [[VUID-VkGraphicsPipelineCreateInfo-externalFormatResolve-09305]]
4348    If the <<features-externalFormatResolve, pname:externalFormatResolve>>
4349    feature is enabled, the pipeline requires
4350    <<pipelines-graphics-subsets-fragment-output, fragment output interface
4351    state>>, pname:renderPass is dlink:VK_NULL_HANDLE, and
4352    slink:VkExternalFormatANDROID::pname:externalFormat is not `0`, and
4353    pname:blendEnable is not dynamic, the pname:blendEnable member of each
4354    element of pname:pColorBlendState->pAttachments must: be ename:VK_FALSE
4355ifdef::VK_KHR_fragment_shading_rate[]
4356  * [[VUID-VkGraphicsPipelineCreateInfo-externalFormatResolve-09306]]
4357    If the <<features-externalFormatResolve, pname:externalFormatResolve>>
4358    feature is enabled, the pipeline requires
4359    <<pipelines-graphics-subsets-fragment-output, fragment output interface
4360    state>>, pname:renderPass is dlink:VK_NULL_HANDLE, and
4361    slink:VkExternalFormatANDROID::pname:externalFormat is not `0`, and
4362    pname:pDynamicState->pDynamicStates does not include
4363    ename:VK_DYNAMIC_STATE_FRAGMENT_SHADING_RATE_KHR,
4364    slink:VkPipelineFragmentShadingRateStateCreateInfoKHR::pname:width must:
4365    be `1`
4366  * [[VUID-VkGraphicsPipelineCreateInfo-externalFormatResolve-09307]]
4367    If the <<features-externalFormatResolve, pname:externalFormatResolve>>
4368    feature is enabled, the pipeline requires
4369    <<pipelines-graphics-subsets-fragment-output, fragment output interface
4370    state>>, pname:renderPass is dlink:VK_NULL_HANDLE, and
4371    slink:VkExternalFormatANDROID::pname:externalFormat is not `0`, and
4372    pname:pDynamicState->pDynamicStates does not include
4373    ename:VK_DYNAMIC_STATE_FRAGMENT_SHADING_RATE_KHR,
4374    slink:VkPipelineFragmentShadingRateStateCreateInfoKHR::pname:height
4375    must: be `1`
4376  * [[VUID-VkGraphicsPipelineCreateInfo-externalFormatResolve-09308]]
4377    If the <<features-externalFormatResolve, pname:externalFormatResolve>>
4378    feature is enabled, the pipeline requires
4379    <<pipelines-graphics-subsets-fragment-output, pre-rasterization shader
4380    state>> and <<pipelines-graphics-subsets-fragment-output, fragment
4381    output interface state>>, pname:renderPass is dlink:VK_NULL_HANDLE, and
4382    slink:VkExternalFormatANDROID::pname:externalFormat is not `0`, the last
4383    <<pipelines-graphics-subsets-pre-rasterization, pre-rasterization shader
4384    stage>> must: not statically use a variable with the
4385    code:PrimitiveShadingRateKHR built-in
4386endif::VK_KHR_fragment_shading_rate[]
4387  * [[VUID-VkGraphicsPipelineCreateInfo-externalFormatResolve-09309]]
4388    If the <<features-externalFormatResolve, pname:externalFormatResolve>>
4389    feature is enabled, the pipeline requires
4390    <<pipelines-graphics-subsets-fragment-output, fragment output interface
4391    state>>, pname:renderPass is dlink:VK_NULL_HANDLE, and
4392    slink:VkExternalFormatANDROID::pname:externalFormat is not `0`,
4393    slink:VkPipelineRenderingCreateInfo::pname:colorAttachmentCount must: be
4394    `1`
4395  * [[VUID-VkGraphicsPipelineCreateInfo-externalFormatResolve-09310]]
4396    If the <<features-externalFormatResolve, pname:externalFormatResolve>>
4397    feature is enabled, the pipeline requires
4398    <<pipelines-graphics-subsets-fragment-shader, fragment shader state>>
4399    and <<pipelines-graphics-subsets-fragment-output, fragment output
4400    interface state>>, pname:renderPass is dlink:VK_NULL_HANDLE, and
4401    slink:VkExternalFormatANDROID::pname:externalFormat is not `0`, the
4402    fragment shader must: not declare the code:DepthReplacing or
4403    code:StencilRefReplacingEXT execution modes
4404endif::VK_VERSION_1_3,VK_KHR_dynamic_rendering[]
4405  * [[VUID-VkGraphicsPipelineCreateInfo-externalFormatResolve-09313]]
4406    If the <<features-externalFormatResolve, pname:externalFormatResolve>>
4407    feature is enabled, the pipeline requires
4408    <<pipelines-graphics-subsets-fragment-output, fragment output interface
4409    state>>, pname:renderPass is not dlink:VK_NULL_HANDLE, pname:subpass
4410    includes an external format resolve attachment, and
4411    pname:rasterizationSamples is not dynamic,
4412    slink:VkPipelineMultisampleStateCreateInfo::pname:rasterizationSamples
4413    must: be ename:VK_SAMPLE_COUNT_1_BIT
4414  * [[VUID-VkGraphicsPipelineCreateInfo-externalFormatResolve-09314]]
4415    If the <<features-externalFormatResolve, pname:externalFormatResolve>>
4416    feature is enabled, the pipeline requires
4417    <<pipelines-graphics-subsets-fragment-output, fragment output interface
4418    state>>, pname:renderPass is not dlink:VK_NULL_HANDLE, pname:subpass
4419    includes an external format resolve attachment, and pname:blendEnable is
4420    not dynamic, the pname:blendEnable member of each element of
4421    pname:pColorBlendState->pAttachments must: be ename:VK_FALSE
4422ifdef::VK_KHR_fragment_shading_rate[]
4423  * [[VUID-VkGraphicsPipelineCreateInfo-externalFormatResolve-09315]]
4424    If the <<features-externalFormatResolve, pname:externalFormatResolve>>
4425    feature is enabled, the pipeline requires
4426    <<pipelines-graphics-subsets-fragment-output, fragment output interface
4427    state>>, pname:renderPass is not dlink:VK_NULL_HANDLE, pname:subpass
4428    includes an external format resolve attachment, and
4429    pname:pDynamicState->pDynamicStates does not include
4430    ename:VK_DYNAMIC_STATE_FRAGMENT_SHADING_RATE_KHR,
4431    slink:VkPipelineFragmentShadingRateStateCreateInfoKHR::pname:width must:
4432    be `1`
4433  * [[VUID-VkGraphicsPipelineCreateInfo-externalFormatResolve-09316]]
4434    If the <<features-externalFormatResolve, pname:externalFormatResolve>>
4435    feature is enabled, the pipeline requires
4436    <<pipelines-graphics-subsets-fragment-output, fragment output interface
4437    state>>, pname:renderPass is not dlink:VK_NULL_HANDLE, pname:subpass
4438    includes an external format resolve attachment, and
4439    pname:pDynamicState->pDynamicStates does not include
4440    ename:VK_DYNAMIC_STATE_FRAGMENT_SHADING_RATE_KHR,
4441    slink:VkPipelineFragmentShadingRateStateCreateInfoKHR::pname:height
4442    must: be `1`
4443  * [[VUID-VkGraphicsPipelineCreateInfo-externalFormatResolve-09317]]
4444    If the <<features-externalFormatResolve, pname:externalFormatResolve>>
4445    feature is enabled, the pipeline requires
4446    <<pipelines-graphics-subsets-fragment-output, pre-rasterization shader
4447    state>> and <<pipelines-graphics-subsets-fragment-output, fragment
4448    output interface state>>, pname:renderPass is not dlink:VK_NULL_HANDLE,
4449    and pname:subpass includes an external format resolve attachment, the
4450    last <<pipelines-graphics-subsets-pre-rasterization, pre-rasterization
4451    shader stage>> must: not statically use a variable with the
4452    code:PrimitiveShadingRateKHR built-in
4453endif::VK_KHR_fragment_shading_rate[]
4454endif::VK_ANDROID_external_format_resolve[]
4455****
4456ifdef::VKSC_VERSION_1_0[]
4457ifdef::hidden[]
4458// tag::scdeviation[]
4459  * slink:VkGraphicsPipelineCreateInfo::pname:basePipelineHandle must: be
4460    dlink:VK_NULL_HANDLE <<SCID-8>>.
4461  * slink:VkGraphicsPipelineCreateInfo::pname:basePipelineIndex must: be
4462    zero <<SCID-8>>.
4463// end::scdeviation[]
4464endif::hidden[]
4465endif::VKSC_VERSION_1_0[]
4466
4467include::{generated}/validity/structs/VkGraphicsPipelineCreateInfo.adoc[]
4468--
4469
4470ifdef::VK_VERSION_1_3,VK_KHR_dynamic_rendering[]
4471[open,refpage='VkPipelineRenderingCreateInfo',desc='Structure specifying attachment formats',type='structs',alias='VkPipelineRenderingCreateInfoKHR']
4472--
4473The sname:VkPipelineRenderingCreateInfo structure is defined as:
4474
4475include::{generated}/api/structs/VkPipelineRenderingCreateInfo.adoc[]
4476
4477ifdef::VK_KHR_dynamic_rendering[]
4478or the equivalent
4479
4480include::{generated}/api/structs/VkPipelineRenderingCreateInfoKHR.adoc[]
4481endif::VK_KHR_dynamic_rendering[]
4482
4483  * pname:sType is a elink:VkStructureType value identifying this structure.
4484  * pname:pNext is `NULL` or a pointer to a structure extending this
4485    structure.
4486  * pname:viewMask is the viewMask used for rendering.
4487  * pname:colorAttachmentCount is the number of entries in
4488    pname:pColorAttachmentFormats
4489  * pname:pColorAttachmentFormats is a pointer to an array of elink:VkFormat
4490    values defining the format of color attachments used in this pipeline.
4491  * pname:depthAttachmentFormat is a elink:VkFormat value defining the
4492    format of the depth attachment used in this pipeline.
4493  * pname:stencilAttachmentFormat is a elink:VkFormat value defining the
4494    format of the stencil attachment used in this pipeline.
4495
4496When a pipeline is created without a slink:VkRenderPass, if the pname:pNext
4497chain of slink:VkGraphicsPipelineCreateInfo includes this structure, it
4498specifies the view mask and format of attachments used for rendering.
4499If this structure is not specified, and the pipeline does not include a
4500slink:VkRenderPass, pname:viewMask and pname:colorAttachmentCount are `0`,
4501and pname:depthAttachmentFormat and pname:stencilAttachmentFormat are
4502ename:VK_FORMAT_UNDEFINED.
4503If a graphics pipeline is created with a valid slink:VkRenderPass,
4504parameters of this structure are ignored.
4505
4506If pname:depthAttachmentFormat, pname:stencilAttachmentFormat, or any
4507element of pname:pColorAttachmentFormats is ename:VK_FORMAT_UNDEFINED, it
4508indicates that the corresponding attachment is unused within the render
4509pass.
4510Valid formats indicate that an attachment can: be used - but it is still
4511valid to set the attachment to `NULL` when beginning rendering.
4512
4513ifdef::VK_ANDROID_external_format_resolve[]
4514If the render pass is going to be used with an external format resolve
4515attachment, a slink:VkExternalFormatANDROID structure must: also be included
4516in the pname:pNext chain of slink:VkGraphicsPipelineCreateInfo, defining the
4517external format of the resolve attachment that will be used.
4518endif::VK_ANDROID_external_format_resolve[]
4519
4520include::{generated}/validity/structs/VkPipelineRenderingCreateInfo.adoc[]
4521--
4522endif::VK_VERSION_1_3,VK_KHR_dynamic_rendering[]
4523
4524ifdef::VK_KHR_maintenance5[]
4525[open,refpage='VkPipelineCreateFlags2CreateInfoKHR',desc='Extended pipeline create flags',type='structs']
4526--
4527The sname:VkPipelineCreateFlags2CreateInfoKHR structure is defined as:
4528
4529include::{generated}/api/structs/VkPipelineCreateFlags2CreateInfoKHR.adoc[]
4530
4531  * pname:sType is a elink:VkStructureType value identifying this structure.
4532  * pname:pNext is `NULL` or a pointer to a structure extending this
4533    structure.
4534  * pname:flags is a bitmask of elink:VkPipelineCreateFlagBits2KHR
4535    specifying how a pipeline will be generated.
4536
4537If this structure is included in the pname:pNext chain of a pipeline
4538creation structure, pname:flags is used instead of the corresponding
4539pname:flags value passed in that creation structure, allowing additional
4540creation flags to be specified.
4541
4542include::{generated}/validity/structs/VkPipelineCreateFlags2CreateInfoKHR.adoc[]
4543--
4544
4545[open,refpage='VkPipelineCreateFlagBits2KHR',desc='Bitmask controlling how a pipeline is created',type='enums']
4546--
4547Bits which can: be set in
4548slink:VkPipelineCreateFlags2CreateInfoKHR::pname:flags, specifying how a
4549pipeline is created, are:
4550
4551include::{generated}/api/enums/VkPipelineCreateFlagBits2KHR.adoc[]
4552
4553// Note - when editing this section, make sure that any relevant changes
4554// are mirrored in VkPipelineCreateFlagBits2KHR/VkPipelineCreateFlagBits
4555
4556  * ename:VK_PIPELINE_CREATE_2_DISABLE_OPTIMIZATION_BIT_KHR specifies that
4557    the created pipeline will not be optimized.
4558    Using this flag may: reduce the time taken to create the pipeline.
4559  * ename:VK_PIPELINE_CREATE_2_ALLOW_DERIVATIVES_BIT_KHR specifies that the
4560    pipeline to be created is allowed to be the parent of a pipeline that
4561    will be created in a subsequent pipeline creation call.
4562  * ename:VK_PIPELINE_CREATE_2_DERIVATIVE_BIT_KHR specifies that the
4563    pipeline to be created will be a child of a previously created parent
4564    pipeline.
4565ifdef::VK_VERSION_1_1,VK_KHR_device_group[]
4566ifdef::VK_VERSION_1_1,VK_KHR_multiview[]
4567  * ename:VK_PIPELINE_CREATE_2_VIEW_INDEX_FROM_DEVICE_INDEX_BIT_KHR
4568    specifies that any shader input variables decorated as code:ViewIndex
4569    will be assigned values as if they were decorated as code:DeviceIndex.
4570endif::VK_VERSION_1_1,VK_KHR_multiview[]
4571  * ename:VK_PIPELINE_CREATE_2_DISPATCH_BASE_BIT_KHR specifies that a
4572    compute pipeline can: be used with flink:vkCmdDispatchBase with a
4573    non-zero base workgroup.
4574endif::VK_VERSION_1_1,VK_KHR_device_group[]
4575ifdef::VK_NV_ray_tracing[]
4576  * ename:VK_PIPELINE_CREATE_2_DEFER_COMPILE_BIT_NV specifies that a
4577    pipeline is created with all shaders in the deferred state.
4578    Before using the pipeline the application must: call
4579    flink:vkCompileDeferredNV exactly once on each shader in the pipeline
4580    before using the pipeline.
4581endif::VK_NV_ray_tracing[]
4582ifdef::VK_KHR_pipeline_executable_properties[]
4583  * ename:VK_PIPELINE_CREATE_2_CAPTURE_STATISTICS_BIT_KHR specifies that the
4584    shader compiler should capture statistics for the pipeline executables
4585    produced by the compile process which can: later be retrieved by calling
4586    flink:vkGetPipelineExecutableStatisticsKHR.
4587    Enabling this flag must: not affect the final compiled pipeline but may:
4588    disable pipeline caching or otherwise affect pipeline creation time.
4589  * ename:VK_PIPELINE_CREATE_2_CAPTURE_INTERNAL_REPRESENTATIONS_BIT_KHR
4590    specifies that the shader compiler should capture the internal
4591    representations of pipeline executables produced by the compile process
4592    which can: later be retrieved by calling
4593    flink:vkGetPipelineExecutableInternalRepresentationsKHR.
4594    Enabling this flag must: not affect the final compiled pipeline but may:
4595    disable pipeline caching or otherwise affect pipeline creation time.
4596ifdef::VK_KHR_pipeline_library[]
4597    When capturing IR from pipelines created with pipeline libraries, there
4598    is no guarantee that IR from libraries can: be retrieved from the linked
4599    pipeline.
4600    Applications should: retrieve IR from each library, and any linked
4601    pipelines, separately.
4602endif::VK_KHR_pipeline_library[]
4603endif::VK_KHR_pipeline_executable_properties[]
4604ifdef::VK_KHR_pipeline_library[]
4605  * ename:VK_PIPELINE_CREATE_2_LIBRARY_BIT_KHR specifies that the pipeline
4606    cannot: be used directly, and instead defines a _pipeline library_ that
4607    can: be combined with other pipelines using the
4608    slink:VkPipelineLibraryCreateInfoKHR structure.
4609ifdef::VK_KHR_ray_tracing_pipeline,VK_EXT_graphics_pipeline_library[]
4610    This is available in
4611ifdef::VK_KHR_ray_tracing_pipeline[ray tracing]
4612ifdef::VK_KHR_ray_tracing_pipeline+VK_EXT_graphics_pipeline_library[and]
4613ifdef::VK_EXT_graphics_pipeline_library[graphics]
4614    pipelines.
4615endif::VK_KHR_ray_tracing_pipeline,VK_EXT_graphics_pipeline_library[]
4616endif::VK_KHR_pipeline_library[]
4617ifdef::VK_KHR_ray_tracing_pipeline[]
4618  * ename:VK_PIPELINE_CREATE_2_RAY_TRACING_NO_NULL_ANY_HIT_SHADERS_BIT_KHR
4619    specifies that an any-hit shader will always be present when an any-hit
4620    shader would be executed.
4621    A NULL any-hit shader is an any-hit shader which is effectively
4622    ename:VK_SHADER_UNUSED_KHR, such as from a shader group consisting
4623    entirely of zeros.
4624  * ename:VK_PIPELINE_CREATE_2_RAY_TRACING_NO_NULL_CLOSEST_HIT_SHADERS_BIT_KHR
4625    specifies that a closest hit shader will always be present when a
4626    closest hit shader would be executed.
4627    A NULL closest hit shader is a closest hit shader which is effectively
4628    ename:VK_SHADER_UNUSED_KHR, such as from a shader group consisting
4629    entirely of zeros.
4630  * ename:VK_PIPELINE_CREATE_2_RAY_TRACING_NO_NULL_MISS_SHADERS_BIT_KHR
4631    specifies that a miss shader will always be present when a miss shader
4632    would be executed.
4633    A NULL miss shader is a miss shader which is effectively
4634    ename:VK_SHADER_UNUSED_KHR, such as from a shader group consisting
4635    entirely of zeros.
4636  * ename:VK_PIPELINE_CREATE_2_RAY_TRACING_NO_NULL_INTERSECTION_SHADERS_BIT_KHR
4637    specifies that an intersection shader will always be present when an
4638    intersection shader would be executed.
4639    A NULL intersection shader is an intersection shader which is
4640    effectively ename:VK_SHADER_UNUSED_KHR, such as from a shader group
4641    consisting entirely of zeros.
4642  * ename:VK_PIPELINE_CREATE_2_RAY_TRACING_SKIP_TRIANGLES_BIT_KHR specifies
4643    that triangle primitives will be skipped during traversal using
4644    <<glossary-pipeline-trace-ray, pipeline trace ray>> instructions.
4645  * ename:VK_PIPELINE_CREATE_2_RAY_TRACING_SKIP_AABBS_BIT_KHR specifies that
4646    AABB primitives will be skipped during traversal using
4647    <<glossary-pipeline-trace-ray, pipeline trace ray>> instructions.
4648  * ename:VK_PIPELINE_CREATE_2_RAY_TRACING_SHADER_GROUP_HANDLE_CAPTURE_REPLAY_BIT_KHR
4649    specifies that the shader group handles can: be saved and reused on a
4650    subsequent run (e.g. for trace capture and replay).
4651endif::VK_KHR_ray_tracing_pipeline[]
4652ifdef::VK_NV_device_generated_commands[]
4653  * ename:VK_PIPELINE_CREATE_2_INDIRECT_BINDABLE_BIT_NV specifies that the
4654    pipeline can be used in combination with <<device-generated-commands>>.
4655endif::VK_NV_device_generated_commands[]
4656ifdef::VK_VERSION_1_3,VK_EXT_pipeline_creation_cache_control[]
4657  * ename:VK_PIPELINE_CREATE_2_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT_KHR
4658    specifies that pipeline creation will fail if a compile is required for
4659    creation of a valid slink:VkPipeline object;
4660    ename:VK_PIPELINE_COMPILE_REQUIRED will be returned by pipeline
4661    creation, and the slink:VkPipeline will be set to dlink:VK_NULL_HANDLE.
4662  * When creating multiple pipelines,
4663    ename:VK_PIPELINE_CREATE_2_EARLY_RETURN_ON_FAILURE_BIT_KHR specifies
4664    that control will be returned to the application if any individual
4665    pipeline returns a result which is not ename:VK_SUCCESS rather than
4666    continuing to create additional pipelines.
4667endif::VK_VERSION_1_3,VK_EXT_pipeline_creation_cache_control[]
4668ifdef::VK_NV_ray_tracing_motion_blur[]
4669  * ename:VK_PIPELINE_CREATE_2_RAY_TRACING_ALLOW_MOTION_BIT_NV specifies
4670    that the pipeline is allowed to use code:OpTraceRayMotionNV.
4671endif::VK_NV_ray_tracing_motion_blur[]
4672ifdef::VK_VERSION_1_3,VK_KHR_dynamic_rendering[]
4673ifdef::VK_KHR_fragment_shading_rate[]
4674  * ename:VK_PIPELINE_CREATE_2_RENDERING_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR
4675    specifies that the pipeline will be used with a fragment shading rate
4676    attachment.
4677endif::VK_KHR_fragment_shading_rate[]
4678ifdef::VK_EXT_fragment_density_map[]
4679  * ename:VK_PIPELINE_CREATE_2_RENDERING_FRAGMENT_DENSITY_MAP_ATTACHMENT_BIT_EXT
4680    specifies that the pipeline will be used with a fragment density map
4681    attachment.
4682endif::VK_EXT_fragment_density_map[]
4683endif::VK_VERSION_1_3,VK_KHR_dynamic_rendering[]
4684ifdef::VK_EXT_graphics_pipeline_library[]
4685  * ename:VK_PIPELINE_CREATE_2_LINK_TIME_OPTIMIZATION_BIT_EXT specifies that
4686    pipeline libraries being linked into this library should: have link time
4687    optimizations applied.
4688    If this bit is omitted, implementations should: instead perform linking
4689    as rapidly as possible.
4690  * ename:VK_PIPELINE_CREATE_2_RETAIN_LINK_TIME_OPTIMIZATION_INFO_BIT_EXT
4691    specifies that pipeline libraries should retain any information
4692    necessary to later perform an optimal link with
4693    ename:VK_PIPELINE_CREATE_2_LINK_TIME_OPTIMIZATION_BIT_EXT.
4694endif::VK_EXT_graphics_pipeline_library[]
4695ifdef::VK_EXT_descriptor_buffer[]
4696  * ename:VK_PIPELINE_CREATE_2_DESCRIPTOR_BUFFER_BIT_EXT specifies that a
4697    pipeline will be used with <<descriptorbuffers,descriptor buffers>>,
4698    rather than <<descriptorsets,descriptor sets>>.
4699endif::VK_EXT_descriptor_buffer[]
4700ifdef::VK_EXT_attachment_feedback_loop_layout[]
4701  * ename:VK_PIPELINE_CREATE_2_COLOR_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT
4702    specifies that the pipeline may: be used with an attachment feedback
4703    loop including color attachments.
4704  * ename:VK_PIPELINE_CREATE_2_DEPTH_STENCIL_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT
4705    specifies that the pipeline may: be used with an attachment feedback
4706    loop including depth-stencil attachments.
4707endif::VK_EXT_attachment_feedback_loop_layout[]
4708ifdef::VK_EXT_opacity_micromap[]
4709  * ename:VK_PIPELINE_CREATE_2_RAY_TRACING_OPACITY_MICROMAP_BIT_EXT
4710    specifies that the ray tracing pipeline can: be used with acceleration
4711    structures which reference an opacity micromap array.
4712endif::VK_EXT_opacity_micromap[]
4713ifdef::VK_NV_displacement_micromap[]
4714  * ename:VK_PIPELINE_CREATE_2_RAY_TRACING_DISPLACEMENT_MICROMAP_BIT_NV
4715    specifies that the ray tracing pipeline can: be used with acceleration
4716    structures which reference a displacement micromap array.
4717endif::VK_NV_displacement_micromap[]
4718ifdef::VK_EXT_pipeline_protected_access[]
4719  * ename:VK_PIPELINE_CREATE_2_NO_PROTECTED_ACCESS_BIT_EXT specifies that
4720    the pipeline must: not be bound to a protected command buffer.
4721  * ename:VK_PIPELINE_CREATE_2_PROTECTED_ACCESS_ONLY_BIT_EXT specifies that
4722    the pipeline must: not be bound to an unprotected command buffer.
4723endif::VK_EXT_pipeline_protected_access[]
4724
4725It is valid to set both ename:VK_PIPELINE_CREATE_2_ALLOW_DERIVATIVES_BIT_KHR
4726and ename:VK_PIPELINE_CREATE_2_DERIVATIVE_BIT_KHR.
4727This allows a pipeline to be both a parent and possibly a child in a
4728pipeline hierarchy.
4729See <<pipelines-pipeline-derivatives,Pipeline Derivatives>> for more
4730information.
4731
4732ifdef::VK_EXT_graphics_pipeline_library[]
4733When an implementation is looking up a pipeline in a
4734<<pipelines-cache,pipeline cache>>, if that pipeline is being created using
4735linked libraries, implementations should: always return an equivalent
4736pipeline created with
4737ename:VK_PIPELINE_CREATE_2_LINK_TIME_OPTIMIZATION_BIT_EXT if available,
4738whether or not that bit was specified.
4739
4740[NOTE]
4741.Note
4742====
4743Using ename:VK_PIPELINE_CREATE_2_LINK_TIME_OPTIMIZATION_BIT_EXT (or not)
4744when linking pipeline libraries is intended as a performance tradeoff
4745between host and device.
4746If the bit is omitted, linking should be faster and produce a pipeline more
4747rapidly, but performance of the pipeline on the target device may be
4748reduced.
4749If the bit is included, linking may be slower but should produce a pipeline
4750with device performance comparable to a monolithically created pipeline.
4751Using both options can allow latency-sensitive applications to generate a
4752suboptimal but usable pipeline quickly, and then perform an optimal link in
4753the background, substituting the result for the suboptimally linked pipeline
4754as soon as it is available.
4755====
4756endif::VK_EXT_graphics_pipeline_library[]
4757--
4758
4759[open,refpage='VkPipelineCreateFlags2KHR',desc='Bitmask of VkPipelineCreateFlagBits2KHR',type='flags']
4760--
4761include::{generated}/api/flags/VkPipelineCreateFlags2KHR.adoc[]
4762
4763tname:VkPipelineCreateFlags2KHR is a bitmask type for setting a mask of zero
4764or more elink:VkPipelineCreateFlagBits2KHR.
4765--
4766endif::VK_KHR_maintenance5[]
4767
4768[open,refpage='VkPipelineCreateFlagBits',desc='Bitmask controlling how a pipeline is created',type='enums']
4769--
4770Bits which can: be set in
4771
4772  * slink:VkGraphicsPipelineCreateInfo::pname:flags
4773  * slink:VkComputePipelineCreateInfo::pname:flags
4774ifdef::VK_KHR_ray_tracing_pipeline[]
4775  * slink:VkRayTracingPipelineCreateInfoKHR::pname:flags
4776endif::VK_KHR_ray_tracing_pipeline[]
4777ifdef::VK_NV_ray_tracing[]
4778  * slink:VkRayTracingPipelineCreateInfoNV::pname:flags
4779endif::VK_NV_ray_tracing[]
4780
4781specify how a pipeline is created, and are:
4782
4783include::{generated}/api/enums/VkPipelineCreateFlagBits.adoc[]
4784
4785// Note - when editing this section, make sure that any relevant changes
4786// are mirrored in VkPipelineCreateFlagBits2KHR/VkPipelineCreateFlagBits
4787
4788  * ename:VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT specifies that the
4789    created pipeline will not be optimized.
4790    Using this flag may: reduce the time taken to create the pipeline.
4791ifndef::VKSC_VERSION_1_0[]
4792  * ename:VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT specifies that the
4793    pipeline to be created is allowed to be the parent of a pipeline that
4794    will be created in a subsequent pipeline creation call.
4795  * ename:VK_PIPELINE_CREATE_DERIVATIVE_BIT specifies that the pipeline to
4796    be created will be a child of a previously created parent pipeline.
4797endif::VKSC_VERSION_1_0[]
4798ifdef::VKSC_VERSION_1_0[]
4799ifdef::hidden[]
4800// tag::scremoved[]
4801  * elink:VkPipelineCreateFlagBits
4802  ** ename:VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT <<SCID-8>>
4803  ** ename:VK_PIPELINE_CREATE_DERIVATIVE_BIT <<SCID-8>>
4804// end::scremoved[]
4805endif::hidden[]
4806endif::VKSC_VERSION_1_0[]
4807ifdef::VK_VERSION_1_1,VK_KHR_device_group[]
4808ifdef::VK_VERSION_1_1,VK_KHR_multiview[]
4809  * ename:VK_PIPELINE_CREATE_VIEW_INDEX_FROM_DEVICE_INDEX_BIT specifies that
4810    any shader input variables decorated as code:ViewIndex will be assigned
4811    values as if they were decorated as code:DeviceIndex.
4812endif::VK_VERSION_1_1,VK_KHR_multiview[]
4813  * ename:VK_PIPELINE_CREATE_DISPATCH_BASE specifies that a compute pipeline
4814    can: be used with flink:vkCmdDispatchBase with a non-zero base
4815    workgroup.
4816endif::VK_VERSION_1_1,VK_KHR_device_group[]
4817ifdef::VK_NV_ray_tracing[]
4818  * ename:VK_PIPELINE_CREATE_DEFER_COMPILE_BIT_NV specifies that a pipeline
4819    is created with all shaders in the deferred state.
4820    Before using the pipeline the application must: call
4821    flink:vkCompileDeferredNV exactly once on each shader in the pipeline
4822    before using the pipeline.
4823endif::VK_NV_ray_tracing[]
4824ifdef::VK_KHR_pipeline_executable_properties[]
4825  * ename:VK_PIPELINE_CREATE_CAPTURE_STATISTICS_BIT_KHR specifies that the
4826    shader compiler should capture statistics for the pipeline executables
4827    produced by the compile process which can: later be retrieved by calling
4828    flink:vkGetPipelineExecutableStatisticsKHR.
4829    Enabling this flag must: not affect the final compiled pipeline but may:
4830    disable pipeline caching or otherwise affect pipeline creation time.
4831  * ename:VK_PIPELINE_CREATE_CAPTURE_INTERNAL_REPRESENTATIONS_BIT_KHR
4832    specifies that the shader compiler should capture the internal
4833    representations of pipeline executables produced by the compile process
4834    which can: later be retrieved by calling
4835    flink:vkGetPipelineExecutableInternalRepresentationsKHR.
4836    Enabling this flag must: not affect the final compiled pipeline but may:
4837    disable pipeline caching or otherwise affect pipeline creation time.
4838ifdef::VK_KHR_pipeline_library[]
4839    When capturing IR from pipelines created with pipeline libraries, there
4840    is no guarantee that IR from libraries can: be retrieved from the linked
4841    pipeline.
4842    Applications should: retrieve IR from each library, and any linked
4843    pipelines, separately.
4844endif::VK_KHR_pipeline_library[]
4845endif::VK_KHR_pipeline_executable_properties[]
4846ifdef::VK_KHR_pipeline_library[]
4847  * ename:VK_PIPELINE_CREATE_LIBRARY_BIT_KHR specifies that the pipeline
4848    cannot: be used directly, and instead defines a _pipeline library_ that
4849    can: be combined with other pipelines using the
4850    slink:VkPipelineLibraryCreateInfoKHR structure.
4851ifdef::VK_KHR_ray_tracing_pipeline,VK_EXT_graphics_pipeline_library[]
4852    This is available in
4853ifdef::VK_KHR_ray_tracing_pipeline[ray tracing]
4854ifdef::VK_KHR_ray_tracing_pipeline+VK_EXT_graphics_pipeline_library[and]
4855ifdef::VK_EXT_graphics_pipeline_library[graphics]
4856    pipelines.
4857endif::VK_KHR_ray_tracing_pipeline,VK_EXT_graphics_pipeline_library[]
4858endif::VK_KHR_pipeline_library[]
4859ifdef::VK_KHR_ray_tracing_pipeline[]
4860  * ename:VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_ANY_HIT_SHADERS_BIT_KHR
4861    specifies that an any-hit shader will always be present when an any-hit
4862    shader would be executed.
4863    A NULL any-hit shader is an any-hit shader which is effectively
4864    ename:VK_SHADER_UNUSED_KHR, such as from a shader group consisting
4865    entirely of zeros.
4866  * ename:VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_CLOSEST_HIT_SHADERS_BIT_KHR
4867    specifies that a closest hit shader will always be present when a
4868    closest hit shader would be executed.
4869    A NULL closest hit shader is a closest hit shader which is effectively
4870    ename:VK_SHADER_UNUSED_KHR, such as from a shader group consisting
4871    entirely of zeros.
4872  * ename:VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_MISS_SHADERS_BIT_KHR
4873    specifies that a miss shader will always be present when a miss shader
4874    would be executed.
4875    A NULL miss shader is a miss shader which is effectively
4876    ename:VK_SHADER_UNUSED_KHR, such as from a shader group consisting
4877    entirely of zeros.
4878  * ename:VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_INTERSECTION_SHADERS_BIT_KHR
4879    specifies that an intersection shader will always be present when an
4880    intersection shader would be executed.
4881    A NULL intersection shader is an intersection shader which is
4882    effectively ename:VK_SHADER_UNUSED_KHR, such as from a shader group
4883    consisting entirely of zeros.
4884  * ename:VK_PIPELINE_CREATE_RAY_TRACING_SKIP_TRIANGLES_BIT_KHR specifies
4885    that triangle primitives will be skipped during traversal using
4886    <<glossary-pipeline-trace-ray, pipeline trace ray>> instructions.
4887  * ename:VK_PIPELINE_CREATE_RAY_TRACING_SKIP_AABBS_BIT_KHR specifies that
4888    AABB primitives will be skipped during traversal using
4889    <<glossary-pipeline-trace-ray, pipeline trace ray>> instructions.
4890  * ename:VK_PIPELINE_CREATE_RAY_TRACING_SHADER_GROUP_HANDLE_CAPTURE_REPLAY_BIT_KHR
4891    specifies that the shader group handles can: be saved and reused on a
4892    subsequent run (e.g. for trace capture and replay).
4893endif::VK_KHR_ray_tracing_pipeline[]
4894ifdef::VK_NV_device_generated_commands[]
4895  * ename:VK_PIPELINE_CREATE_INDIRECT_BINDABLE_BIT_NV specifies that the
4896    pipeline can be used in combination with <<device-generated-commands>>.
4897endif::VK_NV_device_generated_commands[]
4898ifdef::VK_VERSION_1_3,VK_EXT_pipeline_creation_cache_control[]
4899  * ename:VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT specifies
4900    that pipeline creation will fail if a compile is required for creation
4901    of a valid slink:VkPipeline object; ename:VK_PIPELINE_COMPILE_REQUIRED
4902    will be returned by pipeline creation, and the slink:VkPipeline will be
4903    set to dlink:VK_NULL_HANDLE.
4904  * When creating multiple pipelines,
4905    ename:VK_PIPELINE_CREATE_EARLY_RETURN_ON_FAILURE_BIT specifies that
4906    control will be returned to the application if any individual pipeline
4907    returns a result which is not ename:VK_SUCCESS rather than continuing to
4908    create additional pipelines.
4909endif::VK_VERSION_1_3,VK_EXT_pipeline_creation_cache_control[]
4910ifdef::VK_NV_ray_tracing_motion_blur[]
4911  * ename:VK_PIPELINE_CREATE_RAY_TRACING_ALLOW_MOTION_BIT_NV specifies that
4912    the pipeline is allowed to use code:OpTraceRayMotionNV.
4913endif::VK_NV_ray_tracing_motion_blur[]
4914ifdef::VK_VERSION_1_3,VK_KHR_dynamic_rendering[]
4915ifdef::VK_KHR_fragment_shading_rate[]
4916  * ename:VK_PIPELINE_CREATE_RENDERING_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR
4917    specifies that the pipeline will be used with a fragment shading rate
4918    attachment and dynamic rendering.
4919endif::VK_KHR_fragment_shading_rate[]
4920ifdef::VK_EXT_fragment_density_map[]
4921  * ename:VK_PIPELINE_CREATE_RENDERING_FRAGMENT_DENSITY_MAP_ATTACHMENT_BIT_EXT
4922    specifies that the pipeline will be used with a fragment density map
4923    attachment and dynamic rendering.
4924endif::VK_EXT_fragment_density_map[]
4925endif::VK_VERSION_1_3,VK_KHR_dynamic_rendering[]
4926ifdef::VK_EXT_graphics_pipeline_library[]
4927  * ename:VK_PIPELINE_CREATE_LINK_TIME_OPTIMIZATION_BIT_EXT specifies that
4928    pipeline libraries being linked into this library should: have link time
4929    optimizations applied.
4930    If this bit is omitted, implementations should: instead perform linking
4931    as rapidly as possible.
4932  * ename:VK_PIPELINE_CREATE_RETAIN_LINK_TIME_OPTIMIZATION_INFO_BIT_EXT
4933    specifies that pipeline libraries should retain any information
4934    necessary to later perform an optimal link with
4935    ename:VK_PIPELINE_CREATE_LINK_TIME_OPTIMIZATION_BIT_EXT.
4936endif::VK_EXT_graphics_pipeline_library[]
4937ifdef::VK_EXT_descriptor_buffer[]
4938  * ename:VK_PIPELINE_CREATE_DESCRIPTOR_BUFFER_BIT_EXT specifies that a
4939    pipeline will be used with <<descriptorbuffers,descriptor buffers>>,
4940    rather than <<descriptorsets,descriptor sets>>.
4941endif::VK_EXT_descriptor_buffer[]
4942ifdef::VK_EXT_attachment_feedback_loop_layout[]
4943  * ename:VK_PIPELINE_CREATE_COLOR_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT
4944    specifies that the pipeline may: be used with an attachment feedback
4945    loop including color attachments.
4946ifdef::VK_EXT_attachment_feedback_loop_dynamic_state[]
4947    It is ignored if
4948    ename:VK_DYNAMIC_STATE_ATTACHMENT_FEEDBACK_LOOP_ENABLE_EXT is set in
4949    pname:pDynamicStates.
4950endif::VK_EXT_attachment_feedback_loop_dynamic_state[]
4951  * ename:VK_PIPELINE_CREATE_DEPTH_STENCIL_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT
4952    specifies that the pipeline may: be used with an attachment feedback
4953    loop including depth-stencil attachments.
4954ifdef::VK_EXT_attachment_feedback_loop_dynamic_state[]
4955    It is ignored if
4956    ename:VK_DYNAMIC_STATE_ATTACHMENT_FEEDBACK_LOOP_ENABLE_EXT is set in
4957    pname:pDynamicStates.
4958endif::VK_EXT_attachment_feedback_loop_dynamic_state[]
4959endif::VK_EXT_attachment_feedback_loop_layout[]
4960ifdef::VK_EXT_opacity_micromap[]
4961  * ename:VK_PIPELINE_CREATE_RAY_TRACING_OPACITY_MICROMAP_BIT_EXT specifies
4962    that the ray tracing pipeline can: be used with acceleration structures
4963    which reference an opacity micromap array.
4964endif::VK_EXT_opacity_micromap[]
4965ifdef::VK_NV_displacement_micromap[]
4966  * ename:VK_PIPELINE_CREATE_RAY_TRACING_DISPLACEMENT_MICROMAP_BIT_NV
4967    specifies that the ray tracing pipeline can: be used with acceleration
4968    structures which reference a displacement micromap array.
4969endif::VK_NV_displacement_micromap[]
4970ifdef::VK_EXT_pipeline_protected_access[]
4971  * ename:VK_PIPELINE_CREATE_NO_PROTECTED_ACCESS_BIT_EXT specifies that the
4972    pipeline must: not be bound to a protected command buffer.
4973  * ename:VK_PIPELINE_CREATE_PROTECTED_ACCESS_ONLY_BIT_EXT specifies that
4974    the pipeline must: not be bound to an unprotected command buffer.
4975endif::VK_EXT_pipeline_protected_access[]
4976
4977ifndef::VKSC_VERSION_1_0[]
4978It is valid to set both ename:VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT and
4979ename:VK_PIPELINE_CREATE_DERIVATIVE_BIT.
4980This allows a pipeline to be both a parent and possibly a child in a
4981pipeline hierarchy.
4982See <<pipelines-pipeline-derivatives,Pipeline Derivatives>> for more
4983information.
4984endif::VKSC_VERSION_1_0[]
4985
4986ifdef::VK_EXT_graphics_pipeline_library[]
4987When an implementation is looking up a pipeline in a
4988<<pipelines-cache,pipeline cache>>, if that pipeline is being created using
4989linked libraries, implementations should: always return an equivalent
4990pipeline created with
4991ename:VK_PIPELINE_CREATE_LINK_TIME_OPTIMIZATION_BIT_EXT if available,
4992whether or not that bit was specified.
4993
4994[NOTE]
4995.Note
4996====
4997Using ename:VK_PIPELINE_CREATE_LINK_TIME_OPTIMIZATION_BIT_EXT (or not) when
4998linking pipeline libraries is intended as a performance tradeoff between
4999host and device.
5000If the bit is omitted, linking should be faster and produce a pipeline more
5001rapidly, but performance of the pipeline on the target device may be
5002reduced.
5003If the bit is included, linking may be slower but should produce a pipeline
5004with device performance comparable to a monolithically created pipeline.
5005Using both options can allow latency-sensitive applications to generate a
5006suboptimal but usable pipeline quickly, and then perform an optimal link in
5007the background, substituting the result for the suboptimally linked pipeline
5008as soon as it is available.
5009====
5010endif::VK_EXT_graphics_pipeline_library[]
5011--
5012
5013[open,refpage='VkPipelineCreateFlags',desc='Bitmask of VkPipelineCreateFlagBits',type='flags']
5014--
5015include::{generated}/api/flags/VkPipelineCreateFlags.adoc[]
5016
5017tname:VkPipelineCreateFlags is a bitmask type for setting a mask of zero or
5018more elink:VkPipelineCreateFlagBits.
5019--
5020
5021ifdef::VK_EXT_graphics_pipeline_library[]
5022[open,refpage='VkGraphicsPipelineLibraryCreateInfoEXT',desc='Structure specifying the subsets of the graphics pipeline being compiled',type='structs']
5023--
5024The sname:VkGraphicsPipelineLibraryCreateInfoEXT structure is defined as:
5025
5026include::{generated}/api/structs/VkGraphicsPipelineLibraryCreateInfoEXT.adoc[]
5027
5028  * pname:sType is a elink:VkStructureType value identifying this structure.
5029  * pname:pNext is `NULL` or a pointer to a structure extending this
5030    structure.
5031  * pname:flags is a bitmask of elink:VkGraphicsPipelineLibraryFlagBitsEXT
5032    specifying the subsets of the graphics pipeline that are being compiled.
5033
5034If a sname:VkGraphicsPipelineLibraryCreateInfoEXT structure is included in
5035the pname:pNext chain of slink:VkGraphicsPipelineCreateInfo, it specifies
5036the <<pipelines-graphics-subsets,subsets of the graphics pipeline>> being
5037created, excluding any subsets from linked pipeline libraries.
5038If the pipeline is created with pipeline libraries, state from those
5039libraries is aggregated with said subset.
5040
5041If this structure is omitted, and either
5042slink:VkGraphicsPipelineCreateInfo::pname:flags includes
5043ename:VK_PIPELINE_CREATE_LIBRARY_BIT_KHR or the
5044slink:VkGraphicsPipelineCreateInfo::pname:pNext chain includes a
5045slink:VkPipelineLibraryCreateInfoKHR structure with a pname:libraryCount
5046greater than `0`, it is as if pname:flags is `0`.
5047Otherwise if this structure is omitted, it is as if pname:flags includes all
5048possible subsets of the graphics pipeline (i.e. a
5049<<pipelines-graphics-subsets-complete,complete graphics pipeline>>).
5050
5051include::{generated}/validity/structs/VkGraphicsPipelineLibraryCreateInfoEXT.adoc[]
5052--
5053
5054[open,refpage='VkGraphicsPipelineLibraryFlagsEXT', desc='Bitmask of VkGraphicsPipelineLibraryFlagBitsEXT', type='flags']
5055--
5056include::{generated}/api/flags/VkGraphicsPipelineLibraryFlagsEXT.adoc[]
5057
5058tname:VkGraphicsPipelineLibraryFlagsEXT is a bitmask type for setting a mask
5059of zero or more elink:VkGraphicsPipelineLibraryFlagBitsEXT.
5060--
5061
5062[open,refpage='VkGraphicsPipelineLibraryFlagBitsEXT',desc='Bitmask specifying the subset of a graphics pipeline to compile',type='enums']
5063--
5064Possible values of the pname:flags member of
5065slink:VkGraphicsPipelineLibraryCreateInfoEXT, specifying the subsets of a
5066graphics pipeline to compile are:
5067
5068include::{generated}/api/enums/VkGraphicsPipelineLibraryFlagBitsEXT.adoc[]
5069
5070  * ename:VK_GRAPHICS_PIPELINE_LIBRARY_VERTEX_INPUT_INTERFACE_BIT_EXT
5071    specifies that a pipeline will include
5072    <<pipelines-graphics-subsets-vertex-input,vertex input interface
5073    state>>.
5074  * ename:VK_GRAPHICS_PIPELINE_LIBRARY_PRE_RASTERIZATION_SHADERS_BIT_EXT
5075    specifies that a pipeline will include
5076    <<pipelines-graphics-subsets-pre-rasterization,pre-rasterization shader
5077    state>>.
5078  * ename:VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT specifies
5079    that a pipeline will include
5080    <<pipelines-graphics-subsets-fragment-shader,fragment shader state>>.
5081  * ename:VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_OUTPUT_INTERFACE_BIT_EXT
5082    specifies that a pipeline will include
5083    <<pipelines-graphics-subsets-fragment-output,fragment output interface
5084    state>>.
5085--
5086endif::VK_EXT_graphics_pipeline_library[]
5087
5088[open,refpage='VkPipelineDynamicStateCreateInfo',desc='Structure specifying parameters of a newly created pipeline dynamic state',type='structs']
5089--
5090The sname:VkPipelineDynamicStateCreateInfo structure is defined as:
5091
5092include::{generated}/api/structs/VkPipelineDynamicStateCreateInfo.adoc[]
5093
5094  * pname:sType is a elink:VkStructureType value identifying this structure.
5095  * pname:pNext is `NULL` or a pointer to a structure extending this
5096    structure.
5097  * pname:flags is reserved for future use.
5098  * pname:dynamicStateCount is the number of elements in the
5099    pname:pDynamicStates array.
5100  * pname:pDynamicStates is a pointer to an array of elink:VkDynamicState
5101    values specifying which pieces of pipeline state will use the values
5102    from dynamic state commands rather than from pipeline state creation
5103    information.
5104
5105.Valid Usage
5106****
5107  * [[VUID-VkPipelineDynamicStateCreateInfo-pDynamicStates-01442]]
5108    Each element of pname:pDynamicStates must: be unique
5109****
5110
5111include::{generated}/validity/structs/VkPipelineDynamicStateCreateInfo.adoc[]
5112--
5113
5114[open,refpage='VkPipelineDynamicStateCreateFlags',desc='Reserved for future use',type='flags']
5115--
5116include::{generated}/api/flags/VkPipelineDynamicStateCreateFlags.adoc[]
5117
5118tname:VkPipelineDynamicStateCreateFlags is a bitmask type for setting a
5119mask, but is currently reserved for future use.
5120--
5121
5122[open,refpage='VkDynamicState',desc='Indicate which dynamic state is taken from dynamic state commands',type='enums']
5123--
5124The source of different pieces of dynamic state is specified by the
5125slink:VkPipelineDynamicStateCreateInfo::pname:pDynamicStates property of the
5126currently active pipeline, each of whose elements must: be one of the
5127values:
5128
5129include::{generated}/api/enums/VkDynamicState.adoc[]
5130
5131  * ename:VK_DYNAMIC_STATE_VIEWPORT specifies that the pname:pViewports
5132    state in slink:VkPipelineViewportStateCreateInfo will be ignored and
5133    must: be set dynamically with flink:vkCmdSetViewport before any drawing
5134    commands.
5135    The number of viewports used by a pipeline is still specified by the
5136    pname:viewportCount member of slink:VkPipelineViewportStateCreateInfo.
5137  * ename:VK_DYNAMIC_STATE_SCISSOR specifies that the pname:pScissors state
5138    in slink:VkPipelineViewportStateCreateInfo will be ignored and must: be
5139    set dynamically with flink:vkCmdSetScissor before any drawing commands.
5140    The number of scissor rectangles used by a pipeline is still specified
5141    by the pname:scissorCount member of
5142    slink:VkPipelineViewportStateCreateInfo.
5143  * ename:VK_DYNAMIC_STATE_LINE_WIDTH specifies that the pname:lineWidth
5144    state in slink:VkPipelineRasterizationStateCreateInfo will be ignored
5145    and must: be set dynamically with flink:vkCmdSetLineWidth before any
5146    drawing commands that generate line primitives for the rasterizer.
5147  * ename:VK_DYNAMIC_STATE_DEPTH_BIAS specifies that
5148ifdef::VK_EXT_depth_bias_control[]
5149    any instance of slink:VkDepthBiasRepresentationInfoEXT included in the
5150    pname:pNext chain of slink:VkPipelineRasterizationStateCreateInfo as
5151    well as
5152endif::VK_EXT_depth_bias_control[]
5153    the pname:depthBiasConstantFactor, pname:depthBiasClamp and
5154    pname:depthBiasSlopeFactor states in
5155    slink:VkPipelineRasterizationStateCreateInfo will be ignored and must:
5156    be set dynamically with flink:vkCmdSetDepthBias
5157ifdef::VK_EXT_depth_bias_control[or flink:vkCmdSetDepthBias2EXT]
5158    before any draws are performed with <<primsrast-depthbias-enable, depth
5159    bias enabled>>.
5160  * ename:VK_DYNAMIC_STATE_BLEND_CONSTANTS specifies that the
5161    pname:blendConstants state in slink:VkPipelineColorBlendStateCreateInfo
5162    will be ignored and must: be set dynamically with
5163    flink:vkCmdSetBlendConstants before any draws are performed with a
5164    pipeline state with sname:VkPipelineColorBlendAttachmentState member
5165    pname:blendEnable set to ename:VK_TRUE and any of the blend functions
5166    using a constant blend color.
5167  * ename:VK_DYNAMIC_STATE_DEPTH_BOUNDS specifies that the
5168    pname:minDepthBounds and pname:maxDepthBounds states of
5169    slink:VkPipelineDepthStencilStateCreateInfo will be ignored and must: be
5170    set dynamically with flink:vkCmdSetDepthBounds before any draws are
5171    performed with a pipeline state with
5172    slink:VkPipelineDepthStencilStateCreateInfo member
5173    pname:depthBoundsTestEnable set to ename:VK_TRUE.
5174  * ename:VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK specifies that the
5175    pname:compareMask state in slink:VkPipelineDepthStencilStateCreateInfo
5176    for both pname:front and pname:back will be ignored and must: be set
5177    dynamically with flink:vkCmdSetStencilCompareMask before any draws are
5178    performed with a pipeline state with
5179    slink:VkPipelineDepthStencilStateCreateInfo member
5180    pname:stencilTestEnable set to ename:VK_TRUE
5181  * ename:VK_DYNAMIC_STATE_STENCIL_WRITE_MASK specifies that the
5182    pname:writeMask state in slink:VkPipelineDepthStencilStateCreateInfo for
5183    both pname:front and pname:back will be ignored and must: be set
5184    dynamically with flink:vkCmdSetStencilWriteMask before any draws are
5185    performed with a pipeline state with
5186    slink:VkPipelineDepthStencilStateCreateInfo member
5187    pname:stencilTestEnable set to ename:VK_TRUE
5188  * ename:VK_DYNAMIC_STATE_STENCIL_REFERENCE specifies that the
5189    pname:reference state in slink:VkPipelineDepthStencilStateCreateInfo for
5190    both pname:front and pname:back will be ignored and must: be set
5191    dynamically with flink:vkCmdSetStencilReference before any draws are
5192    performed with a pipeline state with
5193    slink:VkPipelineDepthStencilStateCreateInfo member
5194    pname:stencilTestEnable set to ename:VK_TRUE
5195ifdef::VK_NV_clip_space_w_scaling[]
5196  * ename:VK_DYNAMIC_STATE_VIEWPORT_W_SCALING_NV specifies that the
5197    pname:pViewportWScalings state in
5198    slink:VkPipelineViewportWScalingStateCreateInfoNV will be ignored and
5199    must: be set dynamically with flink:vkCmdSetViewportWScalingNV before
5200    any draws are performed with a pipeline state with
5201    slink:VkPipelineViewportWScalingStateCreateInfoNV member
5202    pname:viewportScalingEnable set to ename:VK_TRUE
5203endif::VK_NV_clip_space_w_scaling[]
5204ifdef::VK_EXT_discard_rectangles[]
5205  * ename:VK_DYNAMIC_STATE_DISCARD_RECTANGLE_EXT specifies that the
5206    pname:pDiscardRectangles state in
5207    slink:VkPipelineDiscardRectangleStateCreateInfoEXT will be ignored and
5208    must: be set dynamically with flink:vkCmdSetDiscardRectangleEXT before
5209    any draw or clear commands.
5210  * ename:VK_DYNAMIC_STATE_DISCARD_RECTANGLE_ENABLE_EXT specifies that the
5211    presence of the slink:VkPipelineDiscardRectangleStateCreateInfoEXT
5212    structure in the slink:VkGraphicsPipelineCreateInfo chain with a
5213    pname:discardRectangleCount greater than zero does not implicitly enable
5214    discard rectangles and they must: be enabled dynamically with
5215    flink:vkCmdSetDiscardRectangleEnableEXT before any draw commands.
5216    This is available on implementations that support at least
5217    pname:specVersion `2` of the `apiext:VK_EXT_discard_rectangles`
5218    extension.
5219  * ename:VK_DYNAMIC_STATE_DISCARD_RECTANGLE_MODE_EXT specifies that the
5220    pname:discardRectangleMode state in
5221    slink:VkPipelineDiscardRectangleStateCreateInfoEXT will be ignored and
5222    must: be set dynamically with flink:vkCmdSetDiscardRectangleModeEXT
5223    before any draw commands.
5224    This is available on implementations that support at least
5225    pname:specVersion `2` of the `apiext:VK_EXT_discard_rectangles`
5226    extension.
5227endif::VK_EXT_discard_rectangles[]
5228ifdef::VK_EXT_sample_locations[]
5229  * ename:VK_DYNAMIC_STATE_SAMPLE_LOCATIONS_EXT specifies that the
5230    pname:sampleLocationsInfo state in
5231    slink:VkPipelineSampleLocationsStateCreateInfoEXT will be ignored and
5232    must: be set dynamically with flink:vkCmdSetSampleLocationsEXT before
5233    any draw or clear commands.
5234    Enabling custom sample locations is still indicated by the
5235    pname:sampleLocationsEnable member of
5236    slink:VkPipelineSampleLocationsStateCreateInfoEXT.
5237endif::VK_EXT_sample_locations[]
5238ifdef::VK_NV_scissor_exclusive[]
5239  * ename:VK_DYNAMIC_STATE_EXCLUSIVE_SCISSOR_NV specifies that the
5240    pname:pExclusiveScissors state in
5241    slink:VkPipelineViewportExclusiveScissorStateCreateInfoNV will be
5242    ignored and must: be set dynamically with
5243    flink:vkCmdSetExclusiveScissorNV before any drawing commands.
5244  * ename:VK_DYNAMIC_STATE_EXCLUSIVE_SCISSOR_ENABLE_NV specifies that the
5245    exclusive scissors must: be explicitly enabled with
5246    flink:vkCmdSetExclusiveScissorEnableNV and the
5247    pname:exclusiveScissorCount value in
5248    slink:VkPipelineViewportExclusiveScissorStateCreateInfoNV will not
5249    implicitly enable them.
5250    This is available on implementations that support at least
5251    pname:specVersion `2` of the `apiext:VK_NV_scissor_exclusive` extension.
5252endif::VK_NV_scissor_exclusive[]
5253ifdef::VK_NV_shading_rate_image[]
5254  * ename:VK_DYNAMIC_STATE_VIEWPORT_SHADING_RATE_PALETTE_NV specifies that
5255    the pname:pShadingRatePalettes state in
5256    slink:VkPipelineViewportShadingRateImageStateCreateInfoNV will be
5257    ignored and must: be set dynamically with
5258    flink:vkCmdSetViewportShadingRatePaletteNV before any drawing commands.
5259  * ename:VK_DYNAMIC_STATE_VIEWPORT_COARSE_SAMPLE_ORDER_NV specifies that
5260    the coarse sample order state in
5261    slink:VkPipelineViewportCoarseSampleOrderStateCreateInfoNV will be
5262    ignored and must: be set dynamically with
5263    flink:vkCmdSetCoarseSampleOrderNV before any drawing commands.
5264endif::VK_NV_shading_rate_image[]
5265ifdef::VK_EXT_line_rasterization[]
5266  * ename:VK_DYNAMIC_STATE_LINE_STIPPLE_EXT specifies that the
5267    pname:lineStippleFactor and pname:lineStipplePattern state in
5268    slink:VkPipelineRasterizationLineStateCreateInfoEXT will be ignored and
5269    must: be set dynamically with flink:vkCmdSetLineStippleEXT before any
5270    draws are performed with a pipeline state with
5271    slink:VkPipelineRasterizationLineStateCreateInfoEXT member
5272    pname:stippledLineEnable set to ename:VK_TRUE.
5273endif::VK_EXT_line_rasterization[]
5274ifdef::VK_VERSION_1_3,VK_EXT_extended_dynamic_state[]
5275  * ename:VK_DYNAMIC_STATE_CULL_MODE specifies that the pname:cullMode state
5276    in slink:VkPipelineRasterizationStateCreateInfo will be ignored and
5277    must: be set dynamically with flink:vkCmdSetCullMode before any drawing
5278    commands.
5279  * ename:VK_DYNAMIC_STATE_FRONT_FACE specifies that the pname:frontFace
5280    state in slink:VkPipelineRasterizationStateCreateInfo will be ignored
5281    and must: be set dynamically with flink:vkCmdSetFrontFace before any
5282    drawing commands.
5283  * ename:VK_DYNAMIC_STATE_PRIMITIVE_TOPOLOGY specifies that the
5284    pname:topology state in slink:VkPipelineInputAssemblyStateCreateInfo
5285    only specifies the <<drawing-primitive-topology-class, topology class>>,
5286    and the specific topology order and adjacency must: be set dynamically
5287    with flink:vkCmdSetPrimitiveTopology before any drawing commands.
5288  * ename:VK_DYNAMIC_STATE_VIEWPORT_WITH_COUNT specifies that the
5289    pname:viewportCount and pname:pViewports state in
5290    slink:VkPipelineViewportStateCreateInfo will be ignored and must: be set
5291    dynamically with flink:vkCmdSetViewportWithCount before any draw call.
5292  * ename:VK_DYNAMIC_STATE_SCISSOR_WITH_COUNT specifies that the
5293    pname:scissorCount and pname:pScissors state in
5294    slink:VkPipelineViewportStateCreateInfo will be ignored and must: be set
5295    dynamically with flink:vkCmdSetScissorWithCount before any draw call.
5296  * ename:VK_DYNAMIC_STATE_VERTEX_INPUT_BINDING_STRIDE specifies that the
5297    pname:stride state in slink:VkVertexInputBindingDescription will be
5298    ignored and must: be set dynamically with flink:vkCmdBindVertexBuffers2
5299    before any draw call.
5300  * ename:VK_DYNAMIC_STATE_DEPTH_TEST_ENABLE specifies that the
5301    pname:depthTestEnable state in
5302    slink:VkPipelineDepthStencilStateCreateInfo will be ignored and must: be
5303    set dynamically with flink:vkCmdSetDepthTestEnable before any draw call.
5304  * ename:VK_DYNAMIC_STATE_DEPTH_WRITE_ENABLE specifies that the
5305    pname:depthWriteEnable state in
5306    slink:VkPipelineDepthStencilStateCreateInfo will be ignored and must: be
5307    set dynamically with flink:vkCmdSetDepthWriteEnable before any draw
5308    call.
5309  * ename:VK_DYNAMIC_STATE_DEPTH_COMPARE_OP specifies that the
5310    pname:depthCompareOp state in
5311    slink:VkPipelineDepthStencilStateCreateInfo will be ignored and must: be
5312    set dynamically with flink:vkCmdSetDepthCompareOp before any draw call.
5313  * ename:VK_DYNAMIC_STATE_DEPTH_BOUNDS_TEST_ENABLE specifies that the
5314    pname:depthBoundsTestEnable state in
5315    slink:VkPipelineDepthStencilStateCreateInfo will be ignored and must: be
5316    set dynamically with flink:vkCmdSetDepthBoundsTestEnable before any draw
5317    call.
5318  * ename:VK_DYNAMIC_STATE_STENCIL_TEST_ENABLE specifies that the
5319    pname:stencilTestEnable state in
5320    slink:VkPipelineDepthStencilStateCreateInfo will be ignored and must: be
5321    set dynamically with flink:vkCmdSetStencilTestEnable before any draw
5322    call.
5323  * ename:VK_DYNAMIC_STATE_STENCIL_OP specifies that the pname:failOp,
5324    pname:passOp, pname:depthFailOp, and pname:compareOp states in
5325    sname:VkPipelineDepthStencilStateCreateInfo for both pname:front and
5326    pname:back will be ignored and must: be set dynamically with
5327    flink:vkCmdSetStencilOp before any draws are performed with a pipeline
5328    state with sname:VkPipelineDepthStencilStateCreateInfo member
5329    pname:stencilTestEnable set to ename:VK_TRUE
5330endif::VK_VERSION_1_3,VK_EXT_extended_dynamic_state[]
5331ifdef::VK_VERSION_1_3,VK_EXT_extended_dynamic_state2[]
5332ifdef::VK_EXT_extended_dynamic_state2[]
5333  * ename:VK_DYNAMIC_STATE_PATCH_CONTROL_POINTS_EXT specifies that the
5334    pname:patchControlPoints state in
5335    slink:VkPipelineTessellationStateCreateInfo will be ignored and must: be
5336    set dynamically with flink:vkCmdSetPatchControlPointsEXT before any
5337    drawing commands.
5338endif::VK_EXT_extended_dynamic_state2[]
5339  * ename:VK_DYNAMIC_STATE_RASTERIZER_DISCARD_ENABLE specifies that the
5340    pname:rasterizerDiscardEnable state in
5341    slink:VkPipelineRasterizationStateCreateInfo will be ignored and must:
5342    be set dynamically with flink:vkCmdSetRasterizerDiscardEnable before any
5343    drawing commands.
5344  * ename:VK_DYNAMIC_STATE_DEPTH_BIAS_ENABLE specifies that the
5345    pname:depthBiasEnable state in
5346    slink:VkPipelineRasterizationStateCreateInfo will be ignored and must:
5347    be set dynamically with flink:vkCmdSetDepthBiasEnable before any drawing
5348    commands.
5349ifdef::VK_EXT_extended_dynamic_state2[]
5350  * ename:VK_DYNAMIC_STATE_LOGIC_OP_EXT specifies that the pname:logicOp
5351    state in slink:VkPipelineColorBlendStateCreateInfo will be ignored and
5352    must: be set dynamically with flink:vkCmdSetLogicOpEXT before any
5353    drawing commands.
5354endif::VK_EXT_extended_dynamic_state2[]
5355  * ename:VK_DYNAMIC_STATE_PRIMITIVE_RESTART_ENABLE specifies that the
5356    pname:primitiveRestartEnable state in
5357    slink:VkPipelineInputAssemblyStateCreateInfo will be ignored and must:
5358    be set dynamically with flink:vkCmdSetPrimitiveRestartEnable before any
5359    drawing commands.
5360endif::VK_VERSION_1_3,VK_EXT_extended_dynamic_state2[]
5361ifdef::VK_KHR_fragment_shading_rate[]
5362  * ename:VK_DYNAMIC_STATE_FRAGMENT_SHADING_RATE_KHR specifies that state in
5363    slink:VkPipelineFragmentShadingRateStateCreateInfoKHR
5364ifdef::VK_NV_fragment_shading_rate_enums[]
5365    and slink:VkPipelineFragmentShadingRateEnumStateCreateInfoNV
5366endif::VK_NV_fragment_shading_rate_enums[]
5367    will be ignored and must: be set dynamically with
5368    flink:vkCmdSetFragmentShadingRateKHR
5369ifdef::VK_NV_fragment_shading_rate_enums[]
5370    or flink:vkCmdSetFragmentShadingRateEnumNV
5371endif::VK_NV_fragment_shading_rate_enums[]
5372    before any drawing commands.
5373endif::VK_KHR_fragment_shading_rate[]
5374ifdef::VK_KHR_ray_tracing_pipeline[]
5375  * ename:VK_DYNAMIC_STATE_RAY_TRACING_PIPELINE_STACK_SIZE_KHR specifies
5376    that the default stack size computation for the pipeline will be ignored
5377    and must: be set dynamically with
5378    flink:vkCmdSetRayTracingPipelineStackSizeKHR before any ray tracing
5379    calls are performed.
5380endif::VK_KHR_ray_tracing_pipeline[]
5381ifdef::VK_EXT_vertex_input_dynamic_state[]
5382  * ename:VK_DYNAMIC_STATE_VERTEX_INPUT_EXT specifies that the
5383    pname:pVertexInputState state will be ignored and must: be set
5384    dynamically with flink:vkCmdSetVertexInputEXT before any drawing
5385    commands
5386endif::VK_EXT_vertex_input_dynamic_state[]
5387ifdef::VK_EXT_color_write_enable[]
5388  * ename:VK_DYNAMIC_STATE_COLOR_WRITE_ENABLE_EXT specifies that the
5389    pname:pColorWriteEnables state in
5390    slink:VkPipelineColorWriteCreateInfoEXT will be ignored and must: be set
5391    dynamically with flink:vkCmdSetColorWriteEnableEXT before any draw call.
5392endif::VK_EXT_color_write_enable[]
5393ifdef::VK_EXT_extended_dynamic_state3[]
5394  * ename:VK_DYNAMIC_STATE_TESSELLATION_DOMAIN_ORIGIN_EXT specifies that the
5395    pname:domainOrigin state in
5396    slink:VkPipelineTessellationDomainOriginStateCreateInfo will be ignored
5397    and must: be set dynamically with
5398    flink:vkCmdSetTessellationDomainOriginEXT before any draw call.
5399  * ename:VK_DYNAMIC_STATE_DEPTH_CLAMP_ENABLE_EXT specifies that the
5400    pname:depthClampEnable state in
5401    slink:VkPipelineRasterizationStateCreateInfo will be ignored and must:
5402    be set dynamically with flink:vkCmdSetDepthClampEnableEXT before any
5403    draw call.
5404  * ename:VK_DYNAMIC_STATE_POLYGON_MODE_EXT specifies that the
5405    pname:polygonMode state in slink:VkPipelineRasterizationStateCreateInfo
5406    will be ignored and must: be set dynamically with
5407    flink:vkCmdSetPolygonModeEXT before any draw call.
5408  * ename:VK_DYNAMIC_STATE_RASTERIZATION_SAMPLES_EXT specifies that the
5409    pname:rasterizationSamples state in
5410    slink:VkPipelineMultisampleStateCreateInfo will be ignored and must: be
5411    set dynamically with flink:vkCmdSetRasterizationSamplesEXT before any
5412    draw call.
5413  * ename:VK_DYNAMIC_STATE_SAMPLE_MASK_EXT specifies that the
5414    pname:pSampleMask state in slink:VkPipelineMultisampleStateCreateInfo
5415    will be ignored and must: be set dynamically with
5416    flink:vkCmdSetSampleMaskEXT before any draw call.
5417  * ename:VK_DYNAMIC_STATE_ALPHA_TO_COVERAGE_ENABLE_EXT specifies that the
5418    pname:alphaToCoverageEnable state in
5419    slink:VkPipelineMultisampleStateCreateInfo will be ignored and must: be
5420    set dynamically with flink:vkCmdSetAlphaToCoverageEnableEXT before any
5421    draw call.
5422  * ename:VK_DYNAMIC_STATE_ALPHA_TO_ONE_ENABLE_EXT specifies that the
5423    pname:alphaToOneEnable state in
5424    slink:VkPipelineMultisampleStateCreateInfo will be ignored and must: be
5425    set dynamically with flink:vkCmdSetAlphaToOneEnableEXT before any draw
5426    call.
5427  * ename:VK_DYNAMIC_STATE_LOGIC_OP_ENABLE_EXT specifies that the
5428    pname:logicOpEnable state in slink:VkPipelineColorBlendStateCreateInfo
5429    will be ignored and must: be set dynamically with
5430    flink:vkCmdSetLogicOpEnableEXT before any draw call.
5431  * ename:VK_DYNAMIC_STATE_COLOR_BLEND_ENABLE_EXT specifies that the
5432    pname:blendEnable state in slink:VkPipelineColorBlendAttachmentState
5433    will be ignored and must: be set dynamically with
5434    flink:vkCmdSetColorBlendEnableEXT before any draw call.
5435  * ename:VK_DYNAMIC_STATE_COLOR_BLEND_EQUATION_EXT specifies that the
5436    pname:srcColorBlendFactor, pname:dstColorBlendFactor,
5437    pname:colorBlendOp, pname:srcAlphaBlendFactor,
5438    pname:dstAlphaBlendFactor, and pname:alphaBlendOp states in
5439    slink:VkPipelineColorBlendAttachmentState will be ignored and must: be
5440    set dynamically with flink:vkCmdSetColorBlendEquationEXT before any draw
5441    call.
5442  * ename:VK_DYNAMIC_STATE_COLOR_WRITE_MASK_EXT specifies that the
5443    pname:colorWriteMask state in slink:VkPipelineColorBlendAttachmentState
5444    will be ignored and must: be set dynamically with
5445    flink:vkCmdSetColorWriteMaskEXT before any draw call.
5446ifdef::VK_EXT_transform_feedback[]
5447  * ename:VK_DYNAMIC_STATE_RASTERIZATION_STREAM_EXT specifies that the
5448    pname:rasterizationStream state in
5449    slink:VkPipelineRasterizationStateStreamCreateInfoEXT will be ignored
5450    and must: be set dynamically with flink:vkCmdSetRasterizationStreamEXT
5451    before any draw call.
5452endif::VK_EXT_transform_feedback[]
5453ifdef::VK_EXT_conservative_rasterization[]
5454  * ename:VK_DYNAMIC_STATE_CONSERVATIVE_RASTERIZATION_MODE_EXT specifies
5455    that the pname:conservativeRasterizationMode state in
5456    slink:VkPipelineRasterizationConservativeStateCreateInfoEXT will be
5457    ignored and must: be set dynamically with
5458    flink:vkCmdSetConservativeRasterizationModeEXT before any draw call.
5459  * ename:VK_DYNAMIC_STATE_EXTRA_PRIMITIVE_OVERESTIMATION_SIZE_EXT specifies
5460    that the pname:extraPrimitiveOverestimationSize state in
5461    slink:VkPipelineRasterizationConservativeStateCreateInfoEXT will be
5462    ignored and must: be set dynamically with
5463    flink:vkCmdSetExtraPrimitiveOverestimationSizeEXT before any draw call.
5464endif::VK_EXT_conservative_rasterization[]
5465ifdef::VK_EXT_depth_clip_enable[]
5466  * ename:VK_DYNAMIC_STATE_DEPTH_CLIP_ENABLE_EXT specifies that the
5467    pname:depthClipEnable state in
5468    slink:VkPipelineRasterizationDepthClipStateCreateInfoEXT will be ignored
5469    and must: be set dynamically with flink:vkCmdSetDepthClipEnableEXT
5470    before any draw call.
5471endif::VK_EXT_depth_clip_enable[]
5472ifdef::VK_EXT_sample_locations[]
5473  * ename:VK_DYNAMIC_STATE_SAMPLE_LOCATIONS_ENABLE_EXT specifies that the
5474    pname:sampleLocationsEnable state in
5475    slink:VkPipelineSampleLocationsStateCreateInfoEXT will be ignored and
5476    must: be set dynamically with flink:vkCmdSetSampleLocationsEnableEXT
5477    before any draw call.
5478endif::VK_EXT_sample_locations[]
5479ifdef::VK_EXT_blend_operation_advanced[]
5480  * ename:VK_DYNAMIC_STATE_COLOR_BLEND_ADVANCED_EXT specifies that the
5481    pname:colorBlendOp state in slink:VkPipelineColorBlendAttachmentState,
5482    and pname:srcPremultiplied, pname:dstPremultiplied, and
5483    pname:blendOverlap states in
5484    slink:VkPipelineColorBlendAdvancedStateCreateInfoEXT will be ignored and
5485    must: be set dynamically with flink:vkCmdSetColorBlendAdvancedEXT before
5486    any draw call.
5487endif::VK_EXT_blend_operation_advanced[]
5488ifdef::VK_EXT_provoking_vertex[]
5489  * ename:VK_DYNAMIC_STATE_PROVOKING_VERTEX_MODE_EXT specifies that the
5490    pname:provokingVertexMode state in
5491    slink:VkPipelineRasterizationProvokingVertexStateCreateInfoEXT will be
5492    ignored and must: be set dynamically with
5493    flink:vkCmdSetProvokingVertexModeEXT before any draw call.
5494endif::VK_EXT_provoking_vertex[]
5495ifdef::VK_EXT_line_rasterization[]
5496  * ename:VK_DYNAMIC_STATE_LINE_RASTERIZATION_MODE_EXT specifies that the
5497    pname:lineRasterizationMode state in
5498    slink:VkPipelineRasterizationLineStateCreateInfoEXT will be ignored and
5499    must: be set dynamically with flink:vkCmdSetLineRasterizationModeEXT
5500    before any draw call.
5501  * ename:VK_DYNAMIC_STATE_LINE_STIPPLE_ENABLE_EXT specifies that the
5502    pname:stippledLineEnable state in
5503    slink:VkPipelineRasterizationLineStateCreateInfoEXT will be ignored and
5504    must: be set dynamically with flink:vkCmdSetLineStippleEnableEXT before
5505    any draw call.
5506endif::VK_EXT_line_rasterization[]
5507ifdef::VK_EXT_depth_clip_control[]
5508  * ename:VK_DYNAMIC_STATE_DEPTH_CLIP_NEGATIVE_ONE_TO_ONE_EXT specifies that
5509    the pname:negativeOneToOne state in
5510    slink:VkPipelineViewportDepthClipControlCreateInfoEXT will be ignored
5511    and must: be set dynamically with
5512    flink:vkCmdSetDepthClipNegativeOneToOneEXT before any draw call.
5513endif::VK_EXT_depth_clip_control[]
5514ifdef::VK_NV_clip_space_w_scaling[]
5515  * ename:VK_DYNAMIC_STATE_VIEWPORT_W_SCALING_ENABLE_NV specifies that the
5516    pname:viewportWScalingEnable state in
5517    slink:VkPipelineViewportWScalingStateCreateInfoNV will be ignored and
5518    must: be set dynamically with flink:vkCmdSetViewportWScalingEnableNV
5519    before any draw call.
5520endif::VK_NV_clip_space_w_scaling[]
5521ifdef::VK_NV_viewport_swizzle[]
5522  * ename:VK_DYNAMIC_STATE_VIEWPORT_SWIZZLE_NV specifies that the
5523    pname:viewportCount, and pname:pViewportSwizzles states in
5524    slink:VkPipelineViewportSwizzleStateCreateInfoNV will be ignored and
5525    must: be set dynamically with flink:vkCmdSetViewportSwizzleNV before any
5526    draw call.
5527endif::VK_NV_viewport_swizzle[]
5528ifdef::VK_NV_fragment_coverage_to_color[]
5529  * ename:VK_DYNAMIC_STATE_COVERAGE_TO_COLOR_ENABLE_NV specifies that the
5530    pname:coverageToColorEnable state in
5531    slink:VkPipelineCoverageToColorStateCreateInfoNV will be ignored and
5532    must: be set dynamically with flink:vkCmdSetCoverageToColorEnableNV
5533    before any draw call.
5534  * ename:VK_DYNAMIC_STATE_COVERAGE_TO_COLOR_LOCATION_NV specifies that the
5535    pname:coverageToColorLocation state in
5536    slink:VkPipelineCoverageToColorStateCreateInfoNV will be ignored and
5537    must: be set dynamically with flink:vkCmdSetCoverageToColorLocationNV
5538    before any draw call.
5539endif::VK_NV_fragment_coverage_to_color[]
5540ifdef::VK_NV_framebuffer_mixed_samples[]
5541  * ename:VK_DYNAMIC_STATE_COVERAGE_MODULATION_MODE_NV specifies that the
5542    pname:coverageModulationMode state in
5543    slink:VkPipelineCoverageModulationStateCreateInfoNV will be ignored and
5544    must: be set dynamically with flink:vkCmdSetCoverageModulationModeNV
5545    before any draw call.
5546  * ename:VK_DYNAMIC_STATE_COVERAGE_MODULATION_TABLE_ENABLE_NV specifies
5547    that the pname:coverageModulationTableEnable state in
5548    slink:VkPipelineCoverageModulationStateCreateInfoNV will be ignored and
5549    must: be set dynamically with
5550    flink:vkCmdSetCoverageModulationTableEnableNV before any draw call.
5551  * ename:VK_DYNAMIC_STATE_COVERAGE_MODULATION_TABLE_NV specifies that the
5552    pname:coverageModulationTableCount, and pname:pCoverageModulationTable
5553    states in slink:VkPipelineCoverageModulationStateCreateInfoNV will be
5554    ignored and must: be set dynamically with
5555    flink:vkCmdSetCoverageModulationTableNV before any draw call.
5556endif::VK_NV_framebuffer_mixed_samples[]
5557ifdef::VK_NV_shading_rate_image[]
5558  * ename:VK_DYNAMIC_STATE_SHADING_RATE_IMAGE_ENABLE_NV specifies that the
5559    pname:shadingRateImageEnable state in
5560    slink:VkPipelineViewportShadingRateImageStateCreateInfoNV will be
5561    ignored and must: be set dynamically with
5562    flink:vkCmdSetShadingRateImageEnableNV before any draw call.
5563endif::VK_NV_shading_rate_image[]
5564ifdef::VK_NV_representative_fragment_test[]
5565  * ename:VK_DYNAMIC_STATE_REPRESENTATIVE_FRAGMENT_TEST_ENABLE_NV specifies
5566    that the pname:representativeFragmentTestEnable state in
5567    slink:VkPipelineRepresentativeFragmentTestStateCreateInfoNV will be
5568    ignored and must: be set dynamically with
5569    flink:vkCmdSetRepresentativeFragmentTestEnableNV before any draw call.
5570endif::VK_NV_representative_fragment_test[]
5571ifdef::VK_NV_coverage_reduction_mode[]
5572  * ename:VK_DYNAMIC_STATE_COVERAGE_REDUCTION_MODE_NV specifies that the
5573    pname:coverageReductionMode state in
5574    slink:VkPipelineCoverageReductionStateCreateInfoNV will be ignored and
5575    must: be set dynamically with flink:vkCmdSetCoverageReductionModeNV
5576    before any draw call.
5577endif::VK_NV_coverage_reduction_mode[]
5578ifdef::VK_EXT_attachment_feedback_loop_dynamic_state[]
5579  * ename:VK_DYNAMIC_STATE_ATTACHMENT_FEEDBACK_LOOP_ENABLE_EXT specifies
5580    that the ename:VK_PIPELINE_CREATE_COLOR_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT
5581    and
5582    ename:VK_PIPELINE_CREATE_DEPTH_STENCIL_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT
5583    flags will be ignored and must: be set dynamically with
5584    flink:vkCmdSetAttachmentFeedbackLoopEnableEXT before any draw call.
5585endif::VK_EXT_attachment_feedback_loop_dynamic_state[]
5586endif::VK_EXT_extended_dynamic_state3[]
5587--
5588
5589
5590=== Valid Combinations of Stages for Graphics Pipelines
5591
5592ifdef::VK_NV_mesh_shader,VK_EXT_mesh_shader[]
5593Primitive processing can be handled either on a per primitive basis by the
5594vertex, tessellation, and geometry shader stages, or on a per mesh basis
5595using task and mesh shader stages.
5596If the pipeline includes a mesh shader stage, it uses the mesh pipeline,
5597otherwise it uses the primitive pipeline.
5598
5599If a task shader is omitted, the task shading stage is skipped.
5600endif::VK_NV_mesh_shader,VK_EXT_mesh_shader[]
5601
5602If tessellation shader stages are omitted, the tessellation shading and
5603fixed-function stages of the pipeline are skipped.
5604
5605If a geometry shader is omitted, the geometry shading stage is skipped.
5606
5607If a fragment shader is omitted, fragment color outputs have undefined:
5608values, and the fragment depth value is determined by <<fragops, Fragment
5609Operations>> state.
5610This can: be useful for depth-only rendering.
5611
5612ifdef::VKSC_VERSION_1_0[]
5613Presence of a shader stage in a pipeline is derived from the
5614<<pipelines-cache,pipeline cache>> entry identified by
5615slink:VkPipelineOfflineCreateInfo::pname:pipelineIdentifier.
5616endif::VKSC_VERSION_1_0[]
5617ifndef::VKSC_VERSION_1_0[]
5618Presence of a shader stage in a pipeline is indicated by including a valid
5619slink:VkPipelineShaderStageCreateInfo with pname:module and pname:pName
5620selecting an entry point from a shader module, where that entry point is
5621valid for the stage specified by pname:stage.
5622endif::VKSC_VERSION_1_0[]
5623
5624Presence of some of the fixed-function stages in the pipeline is implicitly
5625derived from enabled shaders and provided state.
5626For example, the fixed-function tessellator is always present when the
5627pipeline has valid Tessellation Control and Tessellation Evaluation shaders.
5628
5629.For example:
5630  * Depth/stencil-only rendering in a subpass with no color attachments
5631  ** Active Pipeline Shader Stages
5632  *** Vertex Shader
5633  ** Required: Fixed-Function Pipeline Stages
5634  *** slink:VkPipelineVertexInputStateCreateInfo
5635  *** slink:VkPipelineInputAssemblyStateCreateInfo
5636  *** slink:VkPipelineViewportStateCreateInfo
5637  *** slink:VkPipelineRasterizationStateCreateInfo
5638  *** slink:VkPipelineMultisampleStateCreateInfo
5639  *** slink:VkPipelineDepthStencilStateCreateInfo
5640  * Color-only rendering in a subpass with no depth/stencil attachment
5641  ** Active Pipeline Shader Stages
5642  *** Vertex Shader
5643  *** Fragment Shader
5644  ** Required: Fixed-Function Pipeline Stages
5645  *** slink:VkPipelineVertexInputStateCreateInfo
5646  *** slink:VkPipelineInputAssemblyStateCreateInfo
5647  *** slink:VkPipelineViewportStateCreateInfo
5648  *** slink:VkPipelineRasterizationStateCreateInfo
5649  *** slink:VkPipelineMultisampleStateCreateInfo
5650  *** slink:VkPipelineColorBlendStateCreateInfo
5651  * Rendering pipeline with tessellation and geometry shaders
5652  ** Active Pipeline Shader Stages
5653  *** Vertex Shader
5654  *** Tessellation Control Shader
5655  *** Tessellation Evaluation Shader
5656  *** Geometry Shader
5657  *** Fragment Shader
5658  ** Required: Fixed-Function Pipeline Stages
5659  *** slink:VkPipelineVertexInputStateCreateInfo
5660  *** slink:VkPipelineInputAssemblyStateCreateInfo
5661  *** slink:VkPipelineTessellationStateCreateInfo
5662  *** slink:VkPipelineViewportStateCreateInfo
5663  *** slink:VkPipelineRasterizationStateCreateInfo
5664  *** slink:VkPipelineMultisampleStateCreateInfo
5665  *** slink:VkPipelineDepthStencilStateCreateInfo
5666  *** slink:VkPipelineColorBlendStateCreateInfo
5667ifdef::VK_NV_mesh_shader,VK_EXT_mesh_shader[]
5668  * Rendering pipeline with task and mesh shaders
5669  ** Active Pipeline Shader Stages
5670  *** Task Shader
5671  *** Mesh Shader
5672  *** Fragment Shader
5673  ** Required: Fixed-Function Pipeline Stages
5674  *** slink:VkPipelineViewportStateCreateInfo
5675  *** slink:VkPipelineRasterizationStateCreateInfo
5676  *** slink:VkPipelineMultisampleStateCreateInfo
5677  *** slink:VkPipelineDepthStencilStateCreateInfo
5678  *** slink:VkPipelineColorBlendStateCreateInfo
5679endif::VK_NV_mesh_shader,VK_EXT_mesh_shader[]
5680
5681
5682ifdef::VK_NV_device_generated_commands[]
5683[[graphics-shadergroups]]
5684=== Graphics Pipeline Shader Groups
5685
5686Graphics pipelines can contain multiple shader groups that can be bound
5687individually.
5688Each shader group behaves as if it was a pipeline using the shader group's
5689state.
5690When the pipeline is bound by regular means, it behaves as if the state of
5691group `0` is active, use flink:vkCmdBindPipelineShaderGroupNV to bind an
5692individual shader group.
5693
5694The primary purpose of shader groups is allowing the device to bind
5695different pipeline state using <<device-generated-commands>>.
5696
5697[open,refpage='VkGraphicsPipelineShaderGroupsCreateInfoNV',desc='Structure specifying parameters of a newly created multi shader group pipeline',type='structs']
5698--
5699The sname:VkGraphicsPipelineShaderGroupsCreateInfoNV structure is defined
5700as:
5701
5702include::{generated}/api/structs/VkGraphicsPipelineShaderGroupsCreateInfoNV.adoc[]
5703
5704  * pname:sType is a elink:VkStructureType value identifying this structure.
5705  * pname:pNext is `NULL` or a pointer to a structure extending this
5706    structure.
5707  * pname:groupCount is the number of elements in the pname:pGroups array.
5708  * pname:pGroups is a pointer to an array of
5709    slink:VkGraphicsShaderGroupCreateInfoNV structures specifying which
5710    state of the original slink:VkGraphicsPipelineCreateInfo each shader
5711    group overrides.
5712  * pname:pipelineCount is the number of elements in the pname:pPipelines
5713    array.
5714  * pname:pPipelines is a pointer to an array of graphics sname:VkPipeline
5715    structures which are referenced within the created pipeline, including
5716    all their shader groups.
5717
5718When referencing shader groups by index, groups defined in the referenced
5719pipelines are treated as if they were defined as additional entries in
5720pname:pGroups.
5721They are appended in the order they appear in the pname:pPipelines array and
5722in the pname:pGroups array when those pipelines were defined.
5723
5724The application must: maintain the lifetime of all such referenced pipelines
5725based on the pipelines that make use of them.
5726
5727.Valid Usage
5728****
5729  * [[VUID-VkGraphicsPipelineShaderGroupsCreateInfoNV-groupCount-02879]]
5730    pname:groupCount must: be at least `1` and as maximum
5731    sname:VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV::pname:maxGraphicsShaderGroupCount
5732  * [[VUID-VkGraphicsPipelineShaderGroupsCreateInfoNV-groupCount-02880]]
5733    The sum of pname:groupCount including those groups added from referenced
5734    pname:pPipelines must: also be as maximum
5735    sname:VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV::pname:maxGraphicsShaderGroupCount
5736  * [[VUID-VkGraphicsPipelineShaderGroupsCreateInfoNV-pGroups-02881]]
5737    The state of the first element of pname:pGroups must: match its
5738    equivalent within the parent's slink:VkGraphicsPipelineCreateInfo
5739  * [[VUID-VkGraphicsPipelineShaderGroupsCreateInfoNV-pGroups-02882]]
5740    Each element of pname:pGroups must: in combination with the rest of the
5741    pipeline state yield a valid state configuration
5742  * [[VUID-VkGraphicsPipelineShaderGroupsCreateInfoNV-pGroups-02884]]
5743    All elements of pname:pGroups must: use the same shader stage
5744    combinations
5745ifdef::VK_NV_mesh_shader,VK_EXT_mesh_shader[]
5746    unless any mesh shader stage is used, then either combination of task
5747    and mesh or just mesh shader is valid
5748endif::VK_NV_mesh_shader,VK_EXT_mesh_shader[]
5749ifdef::VK_NV_mesh_shader,VK_EXT_mesh_shader[]
5750  * [[VUID-VkGraphicsPipelineShaderGroupsCreateInfoNV-pGroups-02885]]
5751    Mesh and regular primitive shading stages cannot be mixed across
5752    pname:pGroups
5753endif::VK_NV_mesh_shader,VK_EXT_mesh_shader[]
5754  * [[VUID-VkGraphicsPipelineShaderGroupsCreateInfoNV-pPipelines-02886]]
5755    Each element of pname:pPipelines must: have been created with identical
5756    state to the pipeline currently created except the state that can be
5757    overridden by slink:VkGraphicsShaderGroupCreateInfoNV
5758  * [[VUID-VkGraphicsPipelineShaderGroupsCreateInfoNV-deviceGeneratedCommands-02887]]
5759    The <<features-deviceGeneratedCommands, pname:deviceGeneratedCommands>>
5760    feature must: be enabled
5761****
5762
5763include::{generated}/validity/structs/VkGraphicsPipelineShaderGroupsCreateInfoNV.adoc[]
5764--
5765
5766[open,refpage='VkGraphicsShaderGroupCreateInfoNV',desc='Structure specifying override parameters for each shader group',type='structs']
5767--
5768The sname:VkGraphicsShaderGroupCreateInfoNV structure provides the state
5769overrides for each shader group.
5770Each shader group behaves like a pipeline that was created from its state as
5771well as the remaining parent's state.
5772It is defined as:
5773
5774include::{generated}/api/structs/VkGraphicsShaderGroupCreateInfoNV.adoc[]
5775
5776  * pname:sType is a elink:VkStructureType value identifying this structure.
5777  * pname:pNext is `NULL` or a pointer to a structure extending this
5778    structure.
5779  * pname:stageCount is the number of entries in the pname:pStages array.
5780  * pname:pStages is a pointer to an array
5781    slink:VkPipelineShaderStageCreateInfo structures specifying the set of
5782    the shader stages to be included in this shader group.
5783  * pname:pVertexInputState is a pointer to a
5784    slink:VkPipelineVertexInputStateCreateInfo structure.
5785  * pname:pTessellationState is a pointer to a
5786    slink:VkPipelineTessellationStateCreateInfo structure, and is ignored if
5787    the shader group does not include a tessellation control shader stage
5788    and tessellation evaluation shader stage.
5789
5790.Valid Usage
5791****
5792  * [[VUID-VkGraphicsShaderGroupCreateInfoNV-stageCount-02888]]
5793    For pname:stageCount, the same restrictions as in
5794    slink:VkGraphicsPipelineCreateInfo::pname:stageCount apply
5795  * [[VUID-VkGraphicsShaderGroupCreateInfoNV-pStages-02889]]
5796    For pname:pStages, the same restrictions as in
5797    slink:VkGraphicsPipelineCreateInfo::pname:pStages apply
5798  * [[VUID-VkGraphicsShaderGroupCreateInfoNV-pVertexInputState-02890]]
5799    For pname:pVertexInputState, the same restrictions as in
5800    slink:VkGraphicsPipelineCreateInfo::pname:pVertexInputState apply
5801  * [[VUID-VkGraphicsShaderGroupCreateInfoNV-pTessellationState-02891]]
5802    For pname:pTessellationState, the same restrictions as in
5803    slink:VkGraphicsPipelineCreateInfo::pname:pTessellationState apply
5804****
5805
5806include::{generated}/validity/structs/VkGraphicsShaderGroupCreateInfoNV.adoc[]
5807--
5808endif::VK_NV_device_generated_commands[]
5809
5810
5811ifdef::VK_NV_ray_tracing,VK_KHR_ray_tracing_pipeline[]
5812[[pipelines-ray-tracing]]
5813== Ray Tracing Pipelines
5814
5815Ray tracing pipelines consist of multiple shader stages, fixed-function
5816traversal stages, and a pipeline layout.
5817
5818[open,refpage='VK_SHADER_UNUSED_KHR',desc='Sentinel for an unused shader index',type='consts',alias='VK_SHADER_UNUSED_NV']
5819--
5820ename:VK_SHADER_UNUSED_KHR is a special shader index used to indicate that a
5821ray generation, miss, or callable shader member is not used.
5822
5823include::{generated}/api/enums/VK_SHADER_UNUSED_KHR.adoc[]
5824
5825ifdef::VK_NV_ray_tracing[]
5826or the equivalent
5827
5828include::{generated}/api/enums/VK_SHADER_UNUSED_NV.adoc[]
5829endif::VK_NV_ray_tracing[]
5830--
5831
5832ifdef::VK_NV_ray_tracing[]
5833[open,refpage='vkCreateRayTracingPipelinesNV',desc='Creates a new ray tracing pipeline object',type='protos']
5834--
5835:refpage: vkCreateRayTracingPipelinesNV
5836
5837To create ray tracing pipelines, call:
5838
5839include::{generated}/api/protos/vkCreateRayTracingPipelinesNV.adoc[]
5840
5841  * pname:device is the logical device that creates the ray tracing
5842    pipelines.
5843ifndef::VKSC_VERSION_1_0[]
5844  * pname:pipelineCache is either dlink:VK_NULL_HANDLE, indicating that
5845    pipeline caching is disabled, or the handle of a valid
5846    <<pipelines-cache,pipeline cache>> object, in which case use of that
5847    cache is enabled for the duration of the command.
5848endif::VKSC_VERSION_1_0[]
5849ifdef::VKSC_VERSION_1_0[]
5850  * pname:pipelineCache is the handle of a valid <<pipelines-cache,pipeline
5851    cache>> object.
5852endif::VKSC_VERSION_1_0[]
5853  * pname:createInfoCount is the length of the pname:pCreateInfos and
5854    pname:pPipelines arrays.
5855  * pname:pCreateInfos is a pointer to an array of
5856    slink:VkRayTracingPipelineCreateInfoNV structures.
5857  * pname:pAllocator controls host memory allocation as described in the
5858    <<memory-allocation, Memory Allocation>> chapter.
5859  * pname:pPipelines is a pointer to an array in which the resulting ray
5860    tracing pipeline objects are returned.
5861
5862Pipelines are created and returned as described for <<pipelines-multiple,
5863Multiple Pipeline Creation>>.
5864
5865ifdef::VKSC_VERSION_1_0[]
5866If a pipeline creation fails due to:
5867
5868  * The identified pipeline not being present in pname:pipelineCache
5869  * The pname:pNext chain not including a slink:VkPipelineOfflineCreateInfo
5870    structure
5871
5872the operation will continue as specified in <<pipelines-multiple, Multiple
5873Pipeline Creation>> and the command will return
5874ename:VK_ERROR_NO_PIPELINE_MATCH.
5875ifdef::hidden[]
5876// tag::scdeviation[]
5877ifdef::VK_NV_ray_tracing[]
5878  * flink:vkCreateRayTracingPipelinesNV returns
5879    ename:VK_ERROR_NO_PIPELINE_MATCH if the
5880    slink:VkRayTracingPipelineCreateInfoNV::pname:pNext chain does not
5881    include a valid slink:VkPipelineOfflineCreateInfo structure <<SCID-1>>.
5882endif::VK_NV_ray_tracing[]
5883// end::scdeviation[]
5884endif::hidden[]
5885endif::VKSC_VERSION_1_0[]
5886
5887.Valid Usage
5888****
5889include::{chapters}/commonvalidity/create_ray_tracing_pipelines_common.adoc[]
5890****
5891ifdef::VKSC_VERSION_1_0[]
5892ifdef::hidden[]
5893// tag::scdeviation[]
5894ifdef::VK_NV_ray_tracing[]
5895  * flink:vkCreateRayTracingPipelinesNV::pname:pipelineCache must: not be
5896    dlink:VK_NULL_HANDLE <<SCID-1>>, <<SCID-8>>.
5897endif::VK_NV_ray_tracing[]
5898// end::scdeviation[]
5899endif::hidden[]
5900endif::VKSC_VERSION_1_0[]
5901
5902include::{generated}/validity/protos/vkCreateRayTracingPipelinesNV.adoc[]
5903--
5904endif::VK_NV_ray_tracing[]
5905
5906ifdef::VK_KHR_ray_tracing_pipeline[]
5907[open,refpage='vkCreateRayTracingPipelinesKHR',desc='Creates a new ray tracing pipeline object',type='protos']
5908--
5909:refpage: vkCreateRayTracingPipelinesKHR
5910
5911To create ray tracing pipelines, call:
5912
5913include::{generated}/api/protos/vkCreateRayTracingPipelinesKHR.adoc[]
5914
5915  * pname:device is the logical device that creates the ray tracing
5916    pipelines.
5917  * pname:deferredOperation is dlink:VK_NULL_HANDLE or the handle of a valid
5918    slink:VkDeferredOperationKHR <<deferred-host-operations-requesting,
5919    request deferral>> object for this command.
5920ifndef::VKSC_VERSION_1_0[]
5921  * pname:pipelineCache is either dlink:VK_NULL_HANDLE, indicating that
5922    pipeline caching is disabled, or the handle of a valid
5923    <<pipelines-cache,pipeline cache>> object, in which case use of that
5924    cache is enabled for the duration of the command.
5925endif::VKSC_VERSION_1_0[]
5926ifdef::VKSC_VERSION_1_0[]
5927  * pname:pipelineCache is the handle of a valid <<pipelines-cache,pipeline
5928    cache>> object.
5929endif::VKSC_VERSION_1_0[]
5930  * pname:createInfoCount is the length of the pname:pCreateInfos and
5931    pname:pPipelines arrays.
5932  * pname:pCreateInfos is a pointer to an array of
5933    slink:VkRayTracingPipelineCreateInfoKHR structures.
5934  * pname:pAllocator controls host memory allocation as described in the
5935    <<memory-allocation, Memory Allocation>> chapter.
5936  * pname:pPipelines is a pointer to an array in which the resulting ray
5937    tracing pipeline objects are returned.
5938
5939The ename:VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS error is returned if the
5940implementation is unable to reuse the shader group handles provided in
5941slink:VkRayTracingShaderGroupCreateInfoKHR::pname:pShaderGroupCaptureReplayHandle
5942when
5943slink:VkPhysicalDeviceRayTracingPipelineFeaturesKHR::pname:rayTracingPipelineShaderGroupHandleCaptureReplay
5944is enabled.
5945
5946Pipelines are created and returned as described for <<pipelines-multiple,
5947Multiple Pipeline Creation>>.
5948
5949ifdef::VKSC_VERSION_1_0[]
5950If a pipeline creation fails due to:
5951
5952  * The identified pipeline not being present in pname:pipelineCache
5953  * The pname:pNext chain not including a slink:VkPipelineOfflineCreateInfo
5954    structure
5955
5956the operation will continue as specified in <<pipelines-multiple, Multiple
5957Pipeline Creation>> and the command will return
5958ename:VK_ERROR_NO_PIPELINE_MATCH.
5959ifdef::hidden[]
5960// tag::scdeviation[]
5961ifdef::VK_KHR_ray_tracing_pipeline[]
5962  * flink:vkCreateRayTracingPipelinesKHR returns
5963    ename:VK_ERROR_NO_PIPELINE_MATCH if the
5964    slink:VkRayTracingPipelineCreateInfoKHR::pname:pNext chain does not
5965    include a valid slink:VkPipelineOfflineCreateInfo structure <<SCID-1>>.
5966endif::VK_KHR_ray_tracing_pipeline[]
5967// end::scdeviation[]
5968endif::hidden[]
5969endif::VKSC_VERSION_1_0[]
5970
5971.Valid Usage
5972****
5973include::{chapters}/commonvalidity/create_ray_tracing_pipelines_common.adoc[]
5974include::{chapters}/commonvalidity/deferred_operations_common.adoc[]
5975  * [[VUID-vkCreateRayTracingPipelinesKHR-rayTracingPipeline-03586]]
5976    The <<features-rayTracingPipeline, pname:rayTracingPipeline>> feature
5977    must: be enabled
5978ifdef::VK_VERSION_1_3,VK_EXT_pipeline_creation_cache_control[]
5979ifdef::VK_KHR_deferred_host_operations[]
5980  * [[VUID-vkCreateRayTracingPipelinesKHR-deferredOperation-03587]]
5981    If pname:deferredOperation is not dlink:VK_NULL_HANDLE, the pname:flags
5982    member of elements of pname:pCreateInfos must: not include
5983    ename:VK_PIPELINE_CREATE_EARLY_RETURN_ON_FAILURE_BIT
5984endif::VK_KHR_deferred_host_operations[]
5985endif::VK_VERSION_1_3,VK_EXT_pipeline_creation_cache_control[]
5986****
5987ifdef::VKSC_VERSION_1_0[]
5988ifdef::hidden[]
5989// tag::scdeviation[]
5990ifdef::VK_KHR_ray_tracing_pipeline[]
5991  * flink:vkCreateRayTracingPipelinesKHR::pname:pipelineCache must: not be
5992    dlink:VK_NULL_HANDLE <<SCID-1>>, <<SCID-8>>.
5993endif::VK_KHR_ray_tracing_pipeline[]
5994// end::scdeviation[]
5995endif::hidden[]
5996endif::VKSC_VERSION_1_0[]
5997
5998include::{generated}/validity/protos/vkCreateRayTracingPipelinesKHR.adoc[]
5999--
6000endif::VK_KHR_ray_tracing_pipeline[]
6001
6002ifdef::VK_NV_ray_tracing[]
6003[open,refpage='VkRayTracingPipelineCreateInfoNV',desc='Structure specifying parameters of a newly created ray tracing pipeline',type='structs']
6004--
6005:refpage: VkRayTracingPipelineCreateInfoNV
6006
6007The sname:VkRayTracingPipelineCreateInfoNV structure is defined as:
6008
6009include::{generated}/api/structs/VkRayTracingPipelineCreateInfoNV.adoc[]
6010
6011  * pname:sType is a elink:VkStructureType value identifying this structure.
6012  * pname:pNext is `NULL` or a pointer to a structure extending this
6013    structure.
6014  * pname:flags is a bitmask of elink:VkPipelineCreateFlagBits specifying
6015    how the pipeline will be generated.
6016  * pname:stageCount is the number of entries in the pname:pStages array.
6017  * pname:pStages is a pointer to an array of
6018    slink:VkPipelineShaderStageCreateInfo structures specifying the set of
6019    the shader stages to be included in the ray tracing pipeline.
6020  * pname:groupCount is the number of entries in the pname:pGroups array.
6021  * pname:pGroups is a pointer to an array of
6022    slink:VkRayTracingShaderGroupCreateInfoNV structures describing the set
6023    of the shader stages to be included in each shader group in the ray
6024    tracing pipeline.
6025  * pname:maxRecursionDepth is the <<ray-tracing-recursion-depth, maximum
6026    recursion depth>> of shaders executed by this pipeline.
6027  * pname:layout is the description of binding locations used by both the
6028    pipeline and descriptor sets used with the pipeline.
6029  * pname:basePipelineHandle is a pipeline to derive from.
6030ifdef::VKSC_VERSION_1_0[]
6031    This is not used in Vulkan SC <<SCID-8>>.
6032endif::VKSC_VERSION_1_0[]
6033  * pname:basePipelineIndex is an index into the pname:pCreateInfos
6034    parameter to use as a pipeline to derive from.
6035ifdef::VKSC_VERSION_1_0[]
6036    This is not used in Vulkan SC <<SCID-8>>.
6037endif::VKSC_VERSION_1_0[]
6038
6039The parameters pname:basePipelineHandle and pname:basePipelineIndex are
6040described in more detail in <<pipelines-pipeline-derivatives,Pipeline
6041Derivatives>>.
6042
6043ifdef::VK_KHR_maintenance5[]
6044If a slink:VkPipelineCreateFlags2CreateInfoKHR structure is present in the
6045pname:pNext chain, slink:VkPipelineCreateFlags2CreateInfoKHR::pname:flags
6046from that structure is used instead of pname:flags from this structure.
6047endif::VK_KHR_maintenance5[]
6048
6049.Valid Usage
6050****
6051:pipelineType: ray tracing
6052include::{chapters}/commonvalidity/pipeline_create_info_common.adoc[]
6053include::{chapters}/commonvalidity/ray_tracing_pipeline_create_info_common.adoc[]
6054  * [[VUID-VkRayTracingPipelineCreateInfoNV-stage-06232]]
6055    The pname:stage member of at least one element of pname:pStages must: be
6056    ename:VK_SHADER_STAGE_RAYGEN_BIT_KHR
6057ifdef::VK_KHR_pipeline_library[]
6058  * [[VUID-VkRayTracingPipelineCreateInfoNV-flags-03456]]
6059    pname:flags must: not include ename:VK_PIPELINE_CREATE_LIBRARY_BIT_KHR
6060endif::VK_KHR_pipeline_library[]
6061  * [[VUID-VkRayTracingPipelineCreateInfoNV-maxRecursionDepth-03457]]
6062    pname:maxRecursionDepth must: be less than or equal to
6063    slink:VkPhysicalDeviceRayTracingPropertiesNV::pname:maxRecursionDepth
6064ifdef::VK_KHR_ray_tracing_pipeline[]
6065  * [[VUID-VkRayTracingPipelineCreateInfoNV-flags-03458]]
6066    pname:flags must: not include
6067    ename:VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_ANY_HIT_SHADERS_BIT_KHR
6068  * [[VUID-VkRayTracingPipelineCreateInfoNV-flags-03459]]
6069    pname:flags must: not include
6070    ename:VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_CLOSEST_HIT_SHADERS_BIT_KHR
6071  * [[VUID-VkRayTracingPipelineCreateInfoNV-flags-03460]]
6072    pname:flags must: not include
6073    ename:VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_MISS_SHADERS_BIT_KHR
6074  * [[VUID-VkRayTracingPipelineCreateInfoNV-flags-03461]]
6075    pname:flags must: not include
6076    ename:VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_INTERSECTION_SHADERS_BIT_KHR
6077  * [[VUID-VkRayTracingPipelineCreateInfoNV-flags-03462]]
6078    pname:flags must: not include
6079    ename:VK_PIPELINE_CREATE_RAY_TRACING_SKIP_AABBS_BIT_KHR
6080  * [[VUID-VkRayTracingPipelineCreateInfoNV-flags-03463]]
6081    pname:flags must: not include
6082    ename:VK_PIPELINE_CREATE_RAY_TRACING_SKIP_TRIANGLES_BIT_KHR
6083  * [[VUID-VkRayTracingPipelineCreateInfoNV-flags-03588]]
6084    pname:flags must: not include
6085    ename:VK_PIPELINE_CREATE_RAY_TRACING_SHADER_GROUP_HANDLE_CAPTURE_REPLAY_BIT_KHR
6086endif::VK_KHR_ray_tracing_pipeline[]
6087ifdef::VK_NV_ray_tracing_motion_blur[]
6088  * [[VUID-VkRayTracingPipelineCreateInfoNV-flags-04948]]
6089    pname:flags must: not include
6090    ename:VK_PIPELINE_CREATE_RAY_TRACING_ALLOW_MOTION_BIT_NV
6091endif::VK_NV_ray_tracing_motion_blur[]
6092ifdef::VK_VERSION_1_3,VK_EXT_pipeline_creation_cache_control[]
6093  * [[VUID-VkRayTracingPipelineCreateInfoNV-flags-02957]]
6094    pname:flags must: not include both
6095    ename:VK_PIPELINE_CREATE_DEFER_COMPILE_BIT_NV and
6096    ename:VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT at the
6097    same time
6098endif::VK_VERSION_1_3,VK_EXT_pipeline_creation_cache_control[]
6099ifdef::VK_EXT_pipeline_creation_feedback,VK_VERSION_1_3[]
6100  * [[VUID-VkRayTracingPipelineCreateInfoNV-pipelineStageCreationFeedbackCount-06651]]
6101    If
6102    slink:VkPipelineCreationFeedbackCreateInfo::pname:pipelineStageCreationFeedbackCount
6103    is not `0`, it must: be equal to pname:stageCount
6104endif::VK_EXT_pipeline_creation_feedback,VK_VERSION_1_3[]
6105  * [[VUID-VkRayTracingPipelineCreateInfoNV-stage-06898]]
6106    The pname:stage value in all pname:pStages elements must: be one of
6107    ename:VK_SHADER_STAGE_RAYGEN_BIT_KHR,
6108    ename:VK_SHADER_STAGE_ANY_HIT_BIT_KHR,
6109    ename:VK_SHADER_STAGE_CLOSEST_HIT_BIT_KHR,
6110    ename:VK_SHADER_STAGE_MISS_BIT_KHR,
6111    ename:VK_SHADER_STAGE_INTERSECTION_BIT_KHR, or
6112    ename:VK_SHADER_STAGE_CALLABLE_BIT_KHR
6113ifdef::VK_EXT_opacity_micromap[]
6114  * [[VUID-VkRayTracingPipelineCreateInfoNV-flags-07402]]
6115    pname:flags must: not include
6116    ename:VK_PIPELINE_CREATE_RAY_TRACING_OPACITY_MICROMAP_BIT_EXT
6117endif::VK_EXT_opacity_micromap[]
6118ifdef::VK_NV_displacement_micromap[]
6119  * [[VUID-VkRayTracingPipelineCreateInfoNV-flags-07998]]
6120    pname:flags must: not include
6121    ename:VK_PIPELINE_CREATE_RAY_TRACING_DISPLACEMENT_MICROMAP_BIT_NV
6122endif::VK_NV_displacement_micromap[]
6123****
6124ifdef::VKSC_VERSION_1_0[]
6125ifdef::hidden[]
6126// tag::scdeviation[]
6127ifdef::VK_NV_ray_tracing[]
6128  * slink:VkRayTracingPipelineCreateInfoNV::pname:basePipelineHandle must:
6129    be dlink:VK_NULL_HANDLE <<SCID-8>>.
6130  * slink:VkRayTracingPipelineCreateInfoNV::pname:basePipelineIndex must: be
6131    zero <<SCID-8>>.
6132endif::VK_NV_ray_tracing[]
6133// end::scdeviation[]
6134endif::hidden[]
6135endif::VKSC_VERSION_1_0[]
6136
6137include::{generated}/validity/structs/VkRayTracingPipelineCreateInfoNV.adoc[]
6138--
6139endif::VK_NV_ray_tracing[]
6140
6141ifdef::VK_KHR_ray_tracing_pipeline[]
6142[open,refpage='VkRayTracingPipelineCreateInfoKHR',desc='Structure specifying parameters of a newly created ray tracing pipeline',type='structs']
6143--
6144:refpage: VkRayTracingPipelineCreateInfoKHR
6145
6146The sname:VkRayTracingPipelineCreateInfoKHR structure is defined as:
6147
6148include::{generated}/api/structs/VkRayTracingPipelineCreateInfoKHR.adoc[]
6149
6150  * pname:sType is a elink:VkStructureType value identifying this structure.
6151  * pname:pNext is `NULL` or a pointer to a structure extending this
6152    structure.
6153  * pname:flags is a bitmask of elink:VkPipelineCreateFlagBits specifying
6154    how the pipeline will be generated.
6155  * pname:stageCount is the number of entries in the pname:pStages array.
6156  * pname:pStages is a pointer to an array of pname:stageCount
6157    slink:VkPipelineShaderStageCreateInfo structures describing the set of
6158    the shader stages to be included in the ray tracing pipeline.
6159  * pname:groupCount is the number of entries in the pname:pGroups array.
6160  * pname:pGroups is a pointer to an array of pname:groupCount
6161    slink:VkRayTracingShaderGroupCreateInfoKHR structures describing the set
6162    of the shader stages to be included in each shader group in the ray
6163    tracing pipeline.
6164  * pname:maxPipelineRayRecursionDepth is the <<ray-tracing-recursion-depth,
6165    maximum recursion depth>> of shaders executed by this pipeline.
6166  * pname:pLibraryInfo is a pointer to a
6167    slink:VkPipelineLibraryCreateInfoKHR structure defining pipeline
6168    libraries to include.
6169  * pname:pLibraryInterface is a pointer to a
6170    slink:VkRayTracingPipelineInterfaceCreateInfoKHR structure defining
6171    additional information when using pipeline libraries.
6172  * pname:pDynamicState is a pointer to a
6173    slink:VkPipelineDynamicStateCreateInfo structure, and is used to
6174    indicate which properties of the pipeline state object are dynamic and
6175    can: be changed independently of the pipeline state.
6176    This can: be `NULL`, which means no state in the pipeline is considered
6177    dynamic.
6178  * pname:layout is the description of binding locations used by both the
6179    pipeline and descriptor sets used with the pipeline.
6180  * pname:basePipelineHandle is a pipeline to derive from.
6181ifdef::VKSC_VERSION_1_0[]
6182    This is not used in Vulkan SC <<SCID-8>>.
6183endif::VKSC_VERSION_1_0[]
6184  * pname:basePipelineIndex is an index into the pname:pCreateInfos
6185    parameter to use as a pipeline to derive from.
6186ifdef::VKSC_VERSION_1_0[]
6187    This is not used in Vulkan SC <<SCID-8>>.
6188endif::VKSC_VERSION_1_0[]
6189
6190The parameters pname:basePipelineHandle and pname:basePipelineIndex are
6191described in more detail in <<pipelines-pipeline-derivatives,Pipeline
6192Derivatives>>.
6193
6194ifdef::VK_KHR_pipeline_library[]
6195When ename:VK_PIPELINE_CREATE_LIBRARY_BIT_KHR is specified, this pipeline
6196defines a _pipeline library_ which cannot: be bound as a ray tracing
6197pipeline directly.
6198Instead, pipeline libraries define common shaders and shader groups which
6199can: be included in future pipeline creation.
6200
6201If pipeline libraries are included in pname:pLibraryInfo, shaders defined in
6202those libraries are treated as if they were defined as additional entries in
6203pname:pStages, appended in the order they appear in the pname:pLibraries
6204array and in the pname:pStages array when those libraries were defined.
6205
6206When referencing shader groups in order to obtain a shader group handle,
6207groups defined in those libraries are treated as if they were defined as
6208additional entries in pname:pGroups, appended in the order they appear in
6209the pname:pLibraries array and in the pname:pGroups array when those
6210libraries were defined.
6211The shaders these groups reference are set when the pipeline library is
6212created, referencing those specified in the pipeline library, not in the
6213pipeline that includes it.
6214endif::VK_KHR_pipeline_library[]
6215
6216The default stack size for a pipeline if
6217ename:VK_DYNAMIC_STATE_RAY_TRACING_PIPELINE_STACK_SIZE_KHR is not provided
6218is computed as described in <<ray-tracing-pipeline-stack, Ray Tracing
6219Pipeline Stack>>.
6220
6221ifdef::VK_KHR_maintenance5[]
6222If a slink:VkPipelineCreateFlags2CreateInfoKHR structure is present in the
6223pname:pNext chain, slink:VkPipelineCreateFlags2CreateInfoKHR::pname:flags
6224from that structure is used instead of pname:flags from this structure.
6225endif::VK_KHR_maintenance5[]
6226
6227.Valid Usage
6228****
6229:pipelineType: ray tracing
6230include::{chapters}/commonvalidity/pipeline_create_info_common.adoc[]
6231include::{chapters}/commonvalidity/ray_tracing_pipeline_create_info_common.adoc[]
6232  * [[VUID-VkRayTracingPipelineCreateInfoKHR-stage-03425]]
6233    If pname:flags does not include
6234    ename:VK_PIPELINE_CREATE_LIBRARY_BIT_KHR, the pname:stage member of at
6235    least one element of pname:pStages, including those implicitly added by
6236    pname:pLibraryInfo, must: be ename:VK_SHADER_STAGE_RAYGEN_BIT_KHR
6237  * [[VUID-VkRayTracingPipelineCreateInfoKHR-maxPipelineRayRecursionDepth-03589]]
6238    pname:maxPipelineRayRecursionDepth must: be less than or equal to
6239    slink:VkPhysicalDeviceRayTracingPipelinePropertiesKHR::pname:maxRayRecursionDepth
6240ifdef::VK_KHR_pipeline_library[]
6241  * [[VUID-VkRayTracingPipelineCreateInfoKHR-flags-03465]]
6242    If pname:flags includes ename:VK_PIPELINE_CREATE_LIBRARY_BIT_KHR,
6243    pname:pLibraryInterface must: not be `NULL`
6244  * [[VUID-VkRayTracingPipelineCreateInfoKHR-pLibraryInfo-03590]]
6245    If pname:pLibraryInfo is not `NULL` and its pname:libraryCount member is
6246    greater than `0`, pname:pLibraryInterface must: not be `NULL`
6247  * [[VUID-VkRayTracingPipelineCreateInfoKHR-pLibraries-03591]]
6248    Each element of pname:pLibraryInfo->pLibraries must: have been created
6249    with the value of pname:maxPipelineRayRecursionDepth equal to that in
6250    this pipeline
6251  * [[VUID-VkRayTracingPipelineCreateInfoKHR-pLibraryInfo-03592]]
6252    If pname:pLibraryInfo is not `NULL`, each element of its
6253    pname:pLibraries member must: have been created with a pname:layout that
6254    is compatible with the pname:layout in this pipeline
6255  * [[VUID-VkRayTracingPipelineCreateInfoKHR-pLibraryInfo-03593]]
6256    If pname:pLibraryInfo is not `NULL`, each element of its
6257    pname:pLibraries member must: have been created with values of the
6258    pname:maxPipelineRayPayloadSize and pname:maxPipelineRayHitAttributeSize
6259    members of pname:pLibraryInterface equal to those in this pipeline
6260  * [[VUID-VkRayTracingPipelineCreateInfoKHR-flags-03594]]
6261    If pname:flags includes
6262    ename:VK_PIPELINE_CREATE_RAY_TRACING_SHADER_GROUP_HANDLE_CAPTURE_REPLAY_BIT_KHR,
6263    each element of pname:pLibraryInfo->pLibraries must: have been created
6264    with the
6265    ename:VK_PIPELINE_CREATE_RAY_TRACING_SHADER_GROUP_HANDLE_CAPTURE_REPLAY_BIT_KHR
6266    bit set
6267  * [[VUID-VkRayTracingPipelineCreateInfoKHR-flags-04718]]
6268    If pname:flags includes
6269    ename:VK_PIPELINE_CREATE_RAY_TRACING_SKIP_AABBS_BIT_KHR, each element of
6270    pname:pLibraryInfo->pLibraries must: have been created with the
6271    ename:VK_PIPELINE_CREATE_RAY_TRACING_SKIP_AABBS_BIT_KHR bit set
6272  * [[VUID-VkRayTracingPipelineCreateInfoKHR-flags-04719]]
6273    If pname:flags includes
6274    ename:VK_PIPELINE_CREATE_RAY_TRACING_SKIP_TRIANGLES_BIT_KHR, each
6275    element of pname:pLibraryInfo->pLibraries must: have been created with
6276    the ename:VK_PIPELINE_CREATE_RAY_TRACING_SKIP_TRIANGLES_BIT_KHR bit set
6277  * [[VUID-VkRayTracingPipelineCreateInfoKHR-flags-04720]]
6278    If pname:flags includes
6279    ename:VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_ANY_HIT_SHADERS_BIT_KHR,
6280    each element of pname:pLibraryInfo->pLibraries must: have been created
6281    with the
6282    ename:VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_ANY_HIT_SHADERS_BIT_KHR bit
6283    set
6284  * [[VUID-VkRayTracingPipelineCreateInfoKHR-flags-04721]]
6285    If pname:flags includes
6286    ename:VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_CLOSEST_HIT_SHADERS_BIT_KHR,
6287    each element of pname:pLibraryInfo->pLibraries must: have been created
6288    with the
6289    ename:VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_CLOSEST_HIT_SHADERS_BIT_KHR
6290    bit set
6291  * [[VUID-VkRayTracingPipelineCreateInfoKHR-flags-04722]]
6292    If pname:flags includes
6293    ename:VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_INTERSECTION_SHADERS_BIT_KHR,
6294    each element of pname:pLibraryInfo->pLibraries must: have been created
6295    with the
6296    ename:VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_INTERSECTION_SHADERS_BIT_KHR
6297    bit set
6298  * [[VUID-VkRayTracingPipelineCreateInfoKHR-flags-04723]]
6299    If pname:flags includes
6300    ename:VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_MISS_SHADERS_BIT_KHR, each
6301    element of pname:pLibraryInfo->pLibraries must: have been created with
6302    the ename:VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_MISS_SHADERS_BIT_KHR
6303    bit set
6304endif::VK_KHR_pipeline_library[]
6305  * [[VUID-VkRayTracingPipelineCreateInfoKHR-pLibraryInfo-03595]]
6306    If the `apiext:VK_KHR_pipeline_library` extension is not enabled,
6307    pname:pLibraryInfo and pname:pLibraryInterface must: be `NULL`
6308  * [[VUID-VkRayTracingPipelineCreateInfoKHR-flags-03470]]
6309    If pname:flags includes
6310    ename:VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_ANY_HIT_SHADERS_BIT_KHR,
6311    for any element of pname:pGroups with a pname:type of
6312    ename:VK_RAY_TRACING_SHADER_GROUP_TYPE_TRIANGLES_HIT_GROUP_KHR or
6313    ename:VK_RAY_TRACING_SHADER_GROUP_TYPE_PROCEDURAL_HIT_GROUP_KHR, the
6314    pname:anyHitShader of that element must: not be
6315    ename:VK_SHADER_UNUSED_KHR
6316  * [[VUID-VkRayTracingPipelineCreateInfoKHR-flags-03471]]
6317    If pname:flags includes
6318    ename:VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_CLOSEST_HIT_SHADERS_BIT_KHR,
6319    for any element of pname:pGroups with a pname:type of
6320    ename:VK_RAY_TRACING_SHADER_GROUP_TYPE_TRIANGLES_HIT_GROUP_KHR or
6321    ename:VK_RAY_TRACING_SHADER_GROUP_TYPE_PROCEDURAL_HIT_GROUP_KHR, the
6322    pname:closestHitShader of that element must: not be
6323    ename:VK_SHADER_UNUSED_KHR
6324  * [[VUID-VkRayTracingPipelineCreateInfoKHR-rayTraversalPrimitiveCulling-03596]]
6325    If the <<features-rayTraversalPrimitiveCulling,
6326    pname:rayTraversalPrimitiveCulling>> feature is not enabled, pname:flags
6327    must: not include
6328    ename:VK_PIPELINE_CREATE_RAY_TRACING_SKIP_AABBS_BIT_KHR
6329  * [[VUID-VkRayTracingPipelineCreateInfoKHR-rayTraversalPrimitiveCulling-03597]]
6330    If the <<features-rayTraversalPrimitiveCulling,
6331    pname:rayTraversalPrimitiveCulling>> feature is not enabled, pname:flags
6332    must: not include
6333    ename:VK_PIPELINE_CREATE_RAY_TRACING_SKIP_TRIANGLES_BIT_KHR
6334  * [[VUID-VkRayTracingPipelineCreateInfoKHR-flags-06546]]
6335    pname:flags must: not include both
6336    ename:VK_PIPELINE_CREATE_RAY_TRACING_SKIP_TRIANGLES_BIT_KHR and
6337    ename:VK_PIPELINE_CREATE_RAY_TRACING_SKIP_AABBS_BIT_KHR
6338  * [[VUID-VkRayTracingPipelineCreateInfoKHR-flags-03598]]
6339    If pname:flags includes
6340    ename:VK_PIPELINE_CREATE_RAY_TRACING_SHADER_GROUP_HANDLE_CAPTURE_REPLAY_BIT_KHR,
6341    <<features-rayTracingPipelineShaderGroupHandleCaptureReplay,
6342    pname:rayTracingPipelineShaderGroupHandleCaptureReplay>> must: be
6343    enabled
6344  * [[VUID-VkRayTracingPipelineCreateInfoKHR-rayTracingPipelineShaderGroupHandleCaptureReplay-03599]]
6345    If
6346    slink:VkPhysicalDeviceRayTracingPipelineFeaturesKHR::pname:rayTracingPipelineShaderGroupHandleCaptureReplay
6347    is ename:VK_TRUE and the pname:pShaderGroupCaptureReplayHandle member of
6348    any element of pname:pGroups is not `NULL`, pname:flags must: include
6349    ename:VK_PIPELINE_CREATE_RAY_TRACING_SHADER_GROUP_HANDLE_CAPTURE_REPLAY_BIT_KHR
6350  * [[VUID-VkRayTracingPipelineCreateInfoKHR-pLibraryInfo-07999]]
6351    If pname:pLibraryInfo is `NULL` or its pname:libraryCount is `0`,
6352    pname:stageCount must: not be `0`
6353  * [[VUID-VkRayTracingPipelineCreateInfoKHR-flags-08700]]
6354    If pname:flags does not include ename:VK_PIPELINE_CREATE_LIBRARY_BIT_KHR
6355    and either pname:pLibraryInfo is `NULL` or its pname:libraryCount is
6356    `0`, pname:groupCount must: not be `0`
6357  * [[VUID-VkRayTracingPipelineCreateInfoKHR-pDynamicStates-03602]]
6358    Any element of the pname:pDynamicStates member of pname:pDynamicState
6359    must: be ename:VK_DYNAMIC_STATE_RAY_TRACING_PIPELINE_STACK_SIZE_KHR
6360ifdef::VK_EXT_pipeline_creation_feedback,VK_VERSION_1_3[]
6361  * [[VUID-VkRayTracingPipelineCreateInfoKHR-pipelineStageCreationFeedbackCount-06652]]
6362    If
6363    slink:VkPipelineCreationFeedbackCreateInfo::pname:pipelineStageCreationFeedbackCount
6364    is not `0`, it must: be equal to pname:stageCount
6365endif::VK_EXT_pipeline_creation_feedback,VK_VERSION_1_3[]
6366  * [[VUID-VkRayTracingPipelineCreateInfoKHR-stage-06899]]
6367    The pname:stage value in all pname:pStages elements must: be one of
6368    ename:VK_SHADER_STAGE_RAYGEN_BIT_KHR,
6369    ename:VK_SHADER_STAGE_ANY_HIT_BIT_KHR,
6370    ename:VK_SHADER_STAGE_CLOSEST_HIT_BIT_KHR,
6371    ename:VK_SHADER_STAGE_MISS_BIT_KHR,
6372    ename:VK_SHADER_STAGE_INTERSECTION_BIT_KHR, or
6373    ename:VK_SHADER_STAGE_CALLABLE_BIT_KHR
6374ifdef::VK_EXT_opacity_micromap[]
6375  * [[VUID-VkRayTracingPipelineCreateInfoKHR-flags-07403]]
6376    If pname:flags includes
6377    ename:VK_PIPELINE_CREATE_RAY_TRACING_OPACITY_MICROMAP_BIT_EXT, each
6378    element of pname:pLibraryInfo->pLibraries must: have been created with
6379    the ename:VK_PIPELINE_CREATE_RAY_TRACING_OPACITY_MICROMAP_BIT_EXT bit
6380    set
6381endif::VK_EXT_opacity_micromap[]
6382ifdef::VK_NV_displacement_micromap[]
6383  * [[VUID-VkRayTracingPipelineCreateInfoKHR-flags-08701]]
6384    If pname:flags includes
6385    ename:VK_PIPELINE_CREATE_RAY_TRACING_DISPLACEMENT_MICROMAP_BIT_NV, each
6386    element of pname:pLibraryInfo->pLibraries must: have been created with
6387    the ename:VK_PIPELINE_CREATE_RAY_TRACING_DISPLACEMENT_MICROMAP_BIT_NV
6388    bit set
6389endif::VK_NV_displacement_micromap[]
6390****
6391ifdef::VKSC_VERSION_1_0[]
6392ifdef::hidden[]
6393// tag::scdeviation[]
6394ifdef::VK_KHR_ray_tracing_pipeline[]
6395  * slink:VkRayTracingPipelineCreateInfoKHR::pname:flags must: not contain
6396    the ename:VK_PIPELINE_CREATE_DERIVATIVE_BIT flag <<SCID-8>>.
6397  * slink:VkRayTracingPipelineCreateInfoKHR::pname:basePipelineHandle must:
6398    be dlink:VK_NULL_HANDLE <<SCID-8>>.
6399  * slink:VkRayTracingPipelineCreateInfoKHR::pname:basePipelineIndex must:
6400    be zero <<SCID-8>>.
6401endif::VK_KHR_ray_tracing_pipeline[]
6402// end::scdeviation[]
6403endif::hidden[]
6404endif::VKSC_VERSION_1_0[]
6405
6406include::{generated}/validity/structs/VkRayTracingPipelineCreateInfoKHR.adoc[]
6407--
6408endif::VK_KHR_ray_tracing_pipeline[]
6409
6410ifdef::VK_NV_ray_tracing[]
6411[open,refpage='VkRayTracingShaderGroupCreateInfoNV',desc='Structure specifying shaders in a shader group',type='structs']
6412--
6413:refpage: VkRayTracingShaderGroupCreateInfoNV
6414
6415The sname:VkRayTracingShaderGroupCreateInfoNV structure is defined as:
6416
6417include::{generated}/api/structs/VkRayTracingShaderGroupCreateInfoNV.adoc[]
6418
6419  * pname:sType is a elink:VkStructureType value identifying this structure.
6420  * pname:pNext is `NULL` or a pointer to a structure extending this
6421    structure.
6422  * pname:type is the type of hit group specified in this structure.
6423  * pname:generalShader is the index of the ray generation, miss, or
6424    callable shader from
6425    slink:VkRayTracingPipelineCreateInfoNV::pname:pStages in the group if
6426    the shader group has pname:type of
6427    ename:VK_RAY_TRACING_SHADER_GROUP_TYPE_GENERAL_NV, and
6428    ename:VK_SHADER_UNUSED_NV otherwise.
6429  * pname:closestHitShader is the optional index of the closest hit shader
6430    from slink:VkRayTracingPipelineCreateInfoNV::pname:pStages in the group
6431    if the shader group has pname:type of
6432    ename:VK_RAY_TRACING_SHADER_GROUP_TYPE_TRIANGLES_HIT_GROUP_NV or
6433    ename:VK_RAY_TRACING_SHADER_GROUP_TYPE_PROCEDURAL_HIT_GROUP_NV, and
6434    ename:VK_SHADER_UNUSED_NV otherwise.
6435  * pname:anyHitShader is the optional index of the any-hit shader from
6436    slink:VkRayTracingPipelineCreateInfoNV::pname:pStages in the group if
6437    the shader group has pname:type of
6438    ename:VK_RAY_TRACING_SHADER_GROUP_TYPE_TRIANGLES_HIT_GROUP_NV or
6439    ename:VK_RAY_TRACING_SHADER_GROUP_TYPE_PROCEDURAL_HIT_GROUP_NV, and
6440    ename:VK_SHADER_UNUSED_NV otherwise.
6441  * pname:intersectionShader is the index of the intersection shader from
6442    slink:VkRayTracingPipelineCreateInfoNV::pname:pStages in the group if
6443    the shader group has pname:type of
6444    ename:VK_RAY_TRACING_SHADER_GROUP_TYPE_PROCEDURAL_HIT_GROUP_NV, and
6445    ename:VK_SHADER_UNUSED_NV otherwise.
6446
6447.Valid Usage
6448****
6449  * [[VUID-VkRayTracingShaderGroupCreateInfoNV-type-02413]]
6450    If pname:type is ename:VK_RAY_TRACING_SHADER_GROUP_TYPE_GENERAL_NV then
6451    pname:generalShader must: be a valid index into
6452    slink:VkRayTracingPipelineCreateInfoNV::pname:pStages referring to a
6453    shader of ename:VK_SHADER_STAGE_RAYGEN_BIT_NV,
6454    ename:VK_SHADER_STAGE_MISS_BIT_NV, or
6455    ename:VK_SHADER_STAGE_CALLABLE_BIT_NV
6456  * [[VUID-VkRayTracingShaderGroupCreateInfoNV-type-02414]]
6457    If pname:type is ename:VK_RAY_TRACING_SHADER_GROUP_TYPE_GENERAL_NV then
6458    pname:closestHitShader, pname:anyHitShader, and pname:intersectionShader
6459    must: be ename:VK_SHADER_UNUSED_NV
6460  * [[VUID-VkRayTracingShaderGroupCreateInfoNV-type-02415]]
6461    If pname:type is
6462    ename:VK_RAY_TRACING_SHADER_GROUP_TYPE_PROCEDURAL_HIT_GROUP_NV then
6463    pname:intersectionShader must: be a valid index into
6464    slink:VkRayTracingPipelineCreateInfoNV::pname:pStages referring to a
6465    shader of ename:VK_SHADER_STAGE_INTERSECTION_BIT_NV
6466  * [[VUID-VkRayTracingShaderGroupCreateInfoNV-type-02416]]
6467    If pname:type is
6468    ename:VK_RAY_TRACING_SHADER_GROUP_TYPE_TRIANGLES_HIT_GROUP_NV then
6469    pname:intersectionShader must: be ename:VK_SHADER_UNUSED_NV
6470  * [[VUID-VkRayTracingShaderGroupCreateInfoNV-closestHitShader-02417]]
6471    pname:closestHitShader must: be either ename:VK_SHADER_UNUSED_NV or a
6472    valid index into slink:VkRayTracingPipelineCreateInfoNV::pname:pStages
6473    referring to a shader of ename:VK_SHADER_STAGE_CLOSEST_HIT_BIT_NV
6474  * [[VUID-VkRayTracingShaderGroupCreateInfoNV-anyHitShader-02418]]
6475    pname:anyHitShader must: be either ename:VK_SHADER_UNUSED_NV or a valid
6476    index into slink:VkRayTracingPipelineCreateInfoNV::pname:pStages
6477    referring to a shader of ename:VK_SHADER_STAGE_ANY_HIT_BIT_NV
6478****
6479
6480include::{generated}/validity/structs/VkRayTracingShaderGroupCreateInfoNV.adoc[]
6481--
6482
6483endif::VK_NV_ray_tracing[]
6484
6485ifdef::VK_KHR_ray_tracing_pipeline[]
6486[open,refpage='VkRayTracingShaderGroupCreateInfoKHR',desc='Structure specifying shaders in a shader group',type='structs']
6487--
6488:refpage: VkRayTracingShaderGroupCreateInfoKHR
6489
6490The sname:VkRayTracingShaderGroupCreateInfoKHR structure is defined as:
6491
6492include::{generated}/api/structs/VkRayTracingShaderGroupCreateInfoKHR.adoc[]
6493
6494  * pname:sType is a elink:VkStructureType value identifying this structure.
6495  * pname:pNext is `NULL` or a pointer to a structure extending this
6496    structure.
6497  * pname:type is the type of hit group specified in this structure.
6498  * pname:generalShader is the index of the ray generation, miss, or
6499    callable shader from
6500    slink:VkRayTracingPipelineCreateInfoKHR::pname:pStages in the group if
6501    the shader group has pname:type of
6502    ename:VK_RAY_TRACING_SHADER_GROUP_TYPE_GENERAL_KHR, and
6503    ename:VK_SHADER_UNUSED_KHR otherwise.
6504  * pname:closestHitShader is the optional index of the closest hit shader
6505    from slink:VkRayTracingPipelineCreateInfoKHR::pname:pStages in the group
6506    if the shader group has pname:type of
6507    ename:VK_RAY_TRACING_SHADER_GROUP_TYPE_TRIANGLES_HIT_GROUP_KHR or
6508    ename:VK_RAY_TRACING_SHADER_GROUP_TYPE_PROCEDURAL_HIT_GROUP_KHR, and
6509    ename:VK_SHADER_UNUSED_KHR otherwise.
6510  * pname:anyHitShader is the optional index of the any-hit shader from
6511    slink:VkRayTracingPipelineCreateInfoKHR::pname:pStages in the group if
6512    the shader group has pname:type of
6513    ename:VK_RAY_TRACING_SHADER_GROUP_TYPE_TRIANGLES_HIT_GROUP_KHR or
6514    ename:VK_RAY_TRACING_SHADER_GROUP_TYPE_PROCEDURAL_HIT_GROUP_KHR, and
6515    ename:VK_SHADER_UNUSED_KHR otherwise.
6516  * pname:intersectionShader is the index of the intersection shader from
6517    slink:VkRayTracingPipelineCreateInfoKHR::pname:pStages in the group if
6518    the shader group has pname:type of
6519    ename:VK_RAY_TRACING_SHADER_GROUP_TYPE_PROCEDURAL_HIT_GROUP_KHR, and
6520    ename:VK_SHADER_UNUSED_KHR otherwise.
6521  * pname:pShaderGroupCaptureReplayHandle is `NULL` or a pointer to replay
6522    information for this shader group queried from
6523    flink:vkGetRayTracingCaptureReplayShaderGroupHandlesKHR, as described in
6524    <<ray-tracing-capture-replay, Ray Tracing Capture Replay>>.
6525    Ignored if
6526    slink:VkPhysicalDeviceRayTracingPipelineFeaturesKHR::pname:rayTracingPipelineShaderGroupHandleCaptureReplay
6527    is ename:VK_FALSE.
6528
6529ifdef::VK_EXT_pipeline_library_group_handles[]
6530If the pipeline is created with ename:VK_PIPELINE_CREATE_LIBRARY_BIT_KHR and
6531the <<features-pipelineLibraryGroupHandles,pipelineLibraryGroupHandles>>
6532feature is enabled, pname:pShaderGroupCaptureReplayHandle is inherited by
6533all pipelines which link against this pipeline and remains bitwise identical
6534for any pipeline which references this pipeline library.
6535endif::VK_EXT_pipeline_library_group_handles[]
6536
6537.Valid Usage
6538****
6539  * [[VUID-VkRayTracingShaderGroupCreateInfoKHR-type-03474]]
6540    If pname:type is ename:VK_RAY_TRACING_SHADER_GROUP_TYPE_GENERAL_KHR then
6541    pname:generalShader must: be a valid index into
6542    slink:VkRayTracingPipelineCreateInfoKHR::pname:pStages referring to a
6543    shader of ename:VK_SHADER_STAGE_RAYGEN_BIT_KHR,
6544    ename:VK_SHADER_STAGE_MISS_BIT_KHR, or
6545    ename:VK_SHADER_STAGE_CALLABLE_BIT_KHR
6546  * [[VUID-VkRayTracingShaderGroupCreateInfoKHR-type-03475]]
6547    If pname:type is ename:VK_RAY_TRACING_SHADER_GROUP_TYPE_GENERAL_KHR then
6548    pname:closestHitShader, pname:anyHitShader, and pname:intersectionShader
6549    must: be ename:VK_SHADER_UNUSED_KHR
6550  * [[VUID-VkRayTracingShaderGroupCreateInfoKHR-type-03476]]
6551    If pname:type is
6552    ename:VK_RAY_TRACING_SHADER_GROUP_TYPE_PROCEDURAL_HIT_GROUP_KHR then
6553    pname:intersectionShader must: be a valid index into
6554    slink:VkRayTracingPipelineCreateInfoKHR::pname:pStages referring to a
6555    shader of ename:VK_SHADER_STAGE_INTERSECTION_BIT_KHR
6556  * [[VUID-VkRayTracingShaderGroupCreateInfoKHR-type-03477]]
6557    If pname:type is
6558    ename:VK_RAY_TRACING_SHADER_GROUP_TYPE_TRIANGLES_HIT_GROUP_KHR then
6559    pname:intersectionShader must: be ename:VK_SHADER_UNUSED_KHR
6560  * [[VUID-VkRayTracingShaderGroupCreateInfoKHR-closestHitShader-03478]]
6561    pname:closestHitShader must: be either ename:VK_SHADER_UNUSED_KHR or a
6562    valid index into slink:VkRayTracingPipelineCreateInfoKHR::pname:pStages
6563    referring to a shader of ename:VK_SHADER_STAGE_CLOSEST_HIT_BIT_KHR
6564  * [[VUID-VkRayTracingShaderGroupCreateInfoKHR-anyHitShader-03479]]
6565    pname:anyHitShader must: be either ename:VK_SHADER_UNUSED_KHR or a valid
6566    index into slink:VkRayTracingPipelineCreateInfoKHR::pname:pStages
6567    referring to a shader of ename:VK_SHADER_STAGE_ANY_HIT_BIT_KHR
6568  * [[VUID-VkRayTracingShaderGroupCreateInfoKHR-rayTracingPipelineShaderGroupHandleCaptureReplayMixed-03603]]
6569    If
6570    slink:VkPhysicalDeviceRayTracingPipelineFeaturesKHR::pname:rayTracingPipelineShaderGroupHandleCaptureReplayMixed
6571    is ename:VK_FALSE then pname:pShaderGroupCaptureReplayHandle must: not
6572    be provided if it has not been provided on a previous call to ray
6573    tracing pipeline creation
6574  * [[VUID-VkRayTracingShaderGroupCreateInfoKHR-rayTracingPipelineShaderGroupHandleCaptureReplayMixed-03604]]
6575    If
6576    slink:VkPhysicalDeviceRayTracingPipelineFeaturesKHR::pname:rayTracingPipelineShaderGroupHandleCaptureReplayMixed
6577    is ename:VK_FALSE then the caller must: guarantee that no ray tracing
6578    pipeline creation commands with pname:pShaderGroupCaptureReplayHandle
6579    provided execute simultaneously with ray tracing pipeline creation
6580    commands without pname:pShaderGroupCaptureReplayHandle provided
6581****
6582
6583include::{generated}/validity/structs/VkRayTracingShaderGroupCreateInfoKHR.adoc[]
6584--
6585endif::VK_KHR_ray_tracing_pipeline[]
6586
6587[open,refpage='VkRayTracingShaderGroupTypeKHR',desc='Shader group types',type='enums',alias='VkRayTracingShaderGroupTypeNV']
6588--
6589:refpage: VkRayTracingShaderGroupTypeKHR
6590
6591Possible values of pname:type in sname:VkRayTracingShaderGroupCreateInfoKHR
6592are:
6593
6594include::{generated}/api/enums/VkRayTracingShaderGroupTypeKHR.adoc[]
6595
6596ifdef::VK_NV_ray_tracing[]
6597or the equivalent
6598
6599include::{generated}/api/enums/VkRayTracingShaderGroupTypeNV.adoc[]
6600endif::VK_NV_ray_tracing[]
6601
6602  * ename:VK_RAY_TRACING_SHADER_GROUP_TYPE_GENERAL_KHR indicates a shader
6603    group with a single ename:VK_SHADER_STAGE_RAYGEN_BIT_KHR,
6604    ename:VK_SHADER_STAGE_MISS_BIT_KHR, or
6605    ename:VK_SHADER_STAGE_CALLABLE_BIT_KHR shader in it.
6606  * ename:VK_RAY_TRACING_SHADER_GROUP_TYPE_TRIANGLES_HIT_GROUP_KHR specifies
6607    a shader group that only hits triangles and must: not contain an
6608    intersection shader, only closest hit and any-hit shaders.
6609  * ename:VK_RAY_TRACING_SHADER_GROUP_TYPE_PROCEDURAL_HIT_GROUP_KHR
6610    specifies a shader group that only intersects with custom geometry and
6611    must: contain an intersection shader and may: contain closest hit and
6612    any-hit shaders.
6613
6614[NOTE]
6615.Note
6616====
6617For current group types, the hit group type could be inferred from the
6618presence or absence of the intersection shader, but we provide the type
6619explicitly for future hit groups that do not have that property.
6620====
6621--
6622
6623ifdef::VK_KHR_ray_tracing_pipeline[]
6624[open,refpage='VkRayTracingPipelineInterfaceCreateInfoKHR',desc='Structure specifying additional interface information when using libraries',type='structs']
6625--
6626:refpage: VkRayTracingPipelineInterfaceCreateInfoKHR
6627
6628The sname:VkRayTracingPipelineInterfaceCreateInfoKHR structure is defined
6629as:
6630
6631include::{generated}/api/structs/VkRayTracingPipelineInterfaceCreateInfoKHR.adoc[]
6632
6633  * pname:sType is a elink:VkStructureType value identifying this structure.
6634  * pname:pNext is `NULL` or a pointer to a structure extending this
6635    structure.
6636  * pname:maxPipelineRayPayloadSize is the maximum payload size in bytes
6637    used by any shader in the pipeline.
6638  * pname:maxPipelineRayHitAttributeSize is the maximum attribute structure
6639    size in bytes used by any shader in the pipeline.
6640
6641pname:maxPipelineRayPayloadSize is calculated as the maximum number of bytes
6642used by any block declared in the code:RayPayloadKHR or
6643code:IncomingRayPayloadKHR storage classes.
6644pname:maxPipelineRayHitAttributeSize is calculated as the maximum number of
6645bytes used by any block declared in the code:HitAttributeKHR storage class.
6646As variables in these storage classes do not have explicit offsets, the size
6647should be calculated as if each variable has a
6648<<interfaces-alignment-requirements, scalar alignment>> equal to the largest
6649scalar alignment of any of the block's members.
6650
6651[NOTE]
6652.Note
6653====
6654There is no explicit upper limit for pname:maxPipelineRayPayloadSize, but in
6655practice it should be kept as small as possible.
6656Similar to invocation local memory, it must be allocated for each shader
6657invocation and for devices which support many simultaneous invocations, this
6658storage can rapidly be exhausted, resulting in failure.
6659====
6660
6661.Valid Usage
6662****
6663  * [[VUID-VkRayTracingPipelineInterfaceCreateInfoKHR-maxPipelineRayHitAttributeSize-03605]]
6664    pname:maxPipelineRayHitAttributeSize must: be less than or equal to
6665    slink:VkPhysicalDeviceRayTracingPipelinePropertiesKHR::pname:maxRayHitAttributeSize
6666****
6667
6668include::{generated}/validity/structs/VkRayTracingPipelineInterfaceCreateInfoKHR.adoc[]
6669--
6670endif::VK_KHR_ray_tracing_pipeline[]
6671
6672[open,refpage='vkGetRayTracingShaderGroupHandlesKHR',desc='Query ray tracing pipeline shader group handles',type='protos',alias='vkGetRayTracingShaderGroupHandlesNV']
6673--
6674:refpage: vkGetRayTracingShaderGroupHandlesKHR
6675
6676To query the opaque handles of shaders in the ray tracing pipeline, call:
6677
6678ifdef::VK_KHR_ray_tracing_pipeline[]
6679include::{generated}/api/protos/vkGetRayTracingShaderGroupHandlesKHR.adoc[]
6680endif::VK_KHR_ray_tracing_pipeline[]
6681
6682ifdef::VK_KHR_ray_tracing_pipeline+VK_NV_ray_tracing[or the equivalent command]
6683
6684ifdef::VK_NV_ray_tracing[]
6685include::{generated}/api/protos/vkGetRayTracingShaderGroupHandlesNV.adoc[]
6686endif::VK_NV_ray_tracing[]
6687
6688  * pname:device is the logical device containing the ray tracing pipeline.
6689  * pname:pipeline is the ray tracing pipeline object containing the
6690    shaders.
6691  * pname:firstGroup is the index of the first group to retrieve a handle
6692    for from the
6693ifdef::VK_KHR_ray_tracing_pipeline[]
6694slink:VkRayTracingPipelineCreateInfoKHR::pname:pGroups
6695endif::VK_KHR_ray_tracing_pipeline[]
6696ifdef::VK_KHR_ray_tracing_pipeline+VK_NV_ray_tracing[or]
6697ifdef::VK_NV_ray_tracing[]
6698slink:VkRayTracingPipelineCreateInfoNV::pname:pGroups
6699endif::VK_NV_ray_tracing[]
6700    array.
6701  * pname:groupCount is the number of shader handles to retrieve.
6702  * pname:dataSize is the size in bytes of the buffer pointed to by
6703    pname:pData.
6704  * pname:pData is a pointer to a user-allocated buffer where the results
6705    will be written.
6706
6707ifdef::VK_EXT_pipeline_library_group_handles[]
6708If pname:pipeline was created with ename:VK_PIPELINE_CREATE_LIBRARY_BIT_KHR
6709and the <<features-pipelineLibraryGroupHandles,pipelineLibraryGroupHandles>>
6710feature is enabled applications can: query group handles from that pipeline,
6711even if the pipeline is a library and is never bound to a command buffer.
6712These group handles remain bitwise identical for any pname:pipeline which
6713references the pipeline library.
6714Group indices are assigned as-if the pipeline was created without
6715ename:VK_PIPELINE_CREATE_LIBRARY_BIT_KHR.
6716endif::VK_EXT_pipeline_library_group_handles[]
6717
6718.Valid Usage
6719****
6720  * [[VUID-vkGetRayTracingShaderGroupHandlesKHR-pipeline-04619]]
6721    pname:pipeline must: be a ray tracing pipeline
6722  * [[VUID-vkGetRayTracingShaderGroupHandlesKHR-firstGroup-04050]]
6723    pname:firstGroup must: be less than the number of shader groups in
6724    pname:pipeline
6725  * [[VUID-vkGetRayTracingShaderGroupHandlesKHR-firstGroup-02419]]
6726    The sum of pname:firstGroup and pname:groupCount must: be less than or
6727    equal to the number of shader groups in pname:pipeline
6728  * [[VUID-vkGetRayTracingShaderGroupHandlesKHR-dataSize-02420]]
6729    pname:dataSize must: be at least
6730    [eq]#slink:VkPhysicalDeviceRayTracingPipelinePropertiesKHR::pname:shaderGroupHandleSize
6731    {times} pname:groupCount#
6732ifdef::VK_KHR_pipeline_library[]
6733  * [[VUID-vkGetRayTracingShaderGroupHandlesKHR-pipeline-07828]]
6734ifdef::VK_EXT_pipeline_library_group_handles[]
6735    If the
6736    <<features-pipelineLibraryGroupHandles,pipelineLibraryGroupHandles>>
6737    feature is not enabled,
6738endif::VK_EXT_pipeline_library_group_handles[]
6739    pname:pipeline must: not have been created with
6740    ename:VK_PIPELINE_CREATE_LIBRARY_BIT_KHR
6741endif::VK_KHR_pipeline_library[]
6742****
6743
6744include::{generated}/validity/protos/vkGetRayTracingShaderGroupHandlesKHR.adoc[]
6745--
6746
6747ifdef::VK_KHR_ray_tracing_pipeline[]
6748[open,refpage='vkGetRayTracingCaptureReplayShaderGroupHandlesKHR',desc='Query opaque capture replay data for pipeline shader group handles',type='protos']
6749--
6750:refpage: vkGetRayTracingCaptureReplayShaderGroupHandlesKHR
6751
6752To query the opaque capture data of shader groups in a ray tracing pipeline,
6753call:
6754
6755include::{generated}/api/protos/vkGetRayTracingCaptureReplayShaderGroupHandlesKHR.adoc[]
6756
6757  * pname:device is the logical device containing the ray tracing pipeline.
6758  * pname:pipeline is the ray tracing pipeline object containing the
6759    shaders.
6760  * pname:firstGroup is the index of the first group to retrieve a handle
6761    for from the slink:VkRayTracingPipelineCreateInfoKHR::pname:pGroups
6762    array.
6763  * pname:groupCount is the number of shader handles to retrieve.
6764  * pname:dataSize is the size in bytes of the buffer pointed to by
6765    pname:pData.
6766  * pname:pData is a pointer to a user-allocated buffer where the results
6767    will be written.
6768
6769Once queried, this opaque data can: be provided at pipeline creation time
6770(in a subsequent execution), using
6771slink:VkRayTracingShaderGroupCreateInfoKHR::pname:pShaderGroupCaptureReplayHandle,
6772as described in <<ray-tracing-capture-replay, Ray Tracing Capture Replay>>.
6773
6774ifdef::VK_EXT_pipeline_library_group_handles[]
6775If pname:pipeline was created with ename:VK_PIPELINE_CREATE_LIBRARY_BIT_KHR
6776and the <<features-pipelineLibraryGroupHandles,pipelineLibraryGroupHandles>>
6777feature is enabled applications can: query capture replay group handles from
6778that pipeline.
6779The capture replay handle remains bitwise identical for any pname:pipeline
6780which references the pipeline library.
6781Group indices are assigned as-if the pipeline was created without
6782ename:VK_PIPELINE_CREATE_LIBRARY_BIT_KHR.
6783endif::VK_EXT_pipeline_library_group_handles[]
6784
6785.Valid Usage
6786****
6787  * [[VUID-vkGetRayTracingCaptureReplayShaderGroupHandlesKHR-pipeline-04620]]
6788    pname:pipeline must: be a ray tracing pipeline
6789  * [[VUID-vkGetRayTracingCaptureReplayShaderGroupHandlesKHR-firstGroup-04051]]
6790    pname:firstGroup must: be less than the number of shader groups in
6791    pname:pipeline
6792  * [[VUID-vkGetRayTracingCaptureReplayShaderGroupHandlesKHR-firstGroup-03483]]
6793    The sum of pname:firstGroup and pname:groupCount must: be less than or
6794    equal to the number of shader groups in pname:pipeline
6795  * [[VUID-vkGetRayTracingCaptureReplayShaderGroupHandlesKHR-dataSize-03484]]
6796    pname:dataSize must: be at least
6797    [eq]#slink:VkPhysicalDeviceRayTracingPipelinePropertiesKHR::pname:shaderGroupHandleCaptureReplaySize
6798    {times} pname:groupCount#
6799  * [[VUID-vkGetRayTracingCaptureReplayShaderGroupHandlesKHR-rayTracingPipelineShaderGroupHandleCaptureReplay-03606]]
6800    sname:VkPhysicalDeviceRayTracingPipelineFeaturesKHR::pname:rayTracingPipelineShaderGroupHandleCaptureReplay
6801    must: be enabled to call this function
6802  * [[VUID-vkGetRayTracingCaptureReplayShaderGroupHandlesKHR-pipeline-03607]]
6803    pname:pipeline must: have been created with a pname:flags that included
6804    ename:VK_PIPELINE_CREATE_RAY_TRACING_SHADER_GROUP_HANDLE_CAPTURE_REPLAY_BIT_KHR
6805ifdef::VK_KHR_pipeline_library[]
6806  * [[VUID-vkGetRayTracingCaptureReplayShaderGroupHandlesKHR-pipeline-07829]]
6807ifdef::VK_EXT_pipeline_library_group_handles[]
6808    If the
6809    <<features-pipelineLibraryGroupHandles,pipelineLibraryGroupHandles>>
6810    feature is not enabled,
6811endif::VK_EXT_pipeline_library_group_handles[]
6812    pname:pipeline must: not have been created with
6813    ename:VK_PIPELINE_CREATE_LIBRARY_BIT_KHR
6814endif::VK_KHR_pipeline_library[]
6815****
6816
6817include::{generated}/validity/protos/vkGetRayTracingCaptureReplayShaderGroupHandlesKHR.adoc[]
6818--
6819endif::VK_KHR_ray_tracing_pipeline[]
6820
6821ifdef::VK_NV_ray_tracing[]
6822Ray tracing pipelines can: contain more shaders than a graphics or compute
6823pipeline, so to allow parallel compilation of shaders within a pipeline, an
6824application can: choose to defer compilation until a later point in time.
6825
6826[open,refpage='vkCompileDeferredNV',desc='Deferred compilation of shaders',type='protos']
6827--
6828:refpage: vkCompileDeferredNV
6829
6830To compile a deferred shader in a pipeline call:
6831
6832include::{generated}/api/protos/vkCompileDeferredNV.adoc[]
6833
6834  * pname:device is the logical device containing the ray tracing pipeline.
6835  * pname:pipeline is the ray tracing pipeline object containing the
6836    shaders.
6837  * pname:shader is the index of the shader to compile.
6838
6839.Valid Usage
6840****
6841  * [[VUID-vkCompileDeferredNV-pipeline-04621]]
6842    pname:pipeline must: be a ray tracing pipeline
6843  * [[VUID-vkCompileDeferredNV-pipeline-02237]]
6844    pname:pipeline must: have been created with
6845    ename:VK_PIPELINE_CREATE_DEFER_COMPILE_BIT_NV
6846  * [[VUID-vkCompileDeferredNV-shader-02238]]
6847    pname:shader must: not have been called as a deferred compile before
6848****
6849
6850include::{generated}/validity/protos/vkCompileDeferredNV.adoc[]
6851--
6852endif::VK_NV_ray_tracing[]
6853
6854ifdef::VK_KHR_ray_tracing_pipeline[]
6855[open,refpage='vkGetRayTracingShaderGroupStackSizeKHR',desc='Query ray tracing pipeline shader group shader stack size',type='protos']
6856--
6857To query the pipeline stack size of shaders in a shader group in the ray
6858tracing pipeline, call:
6859
6860include::{generated}/api/protos/vkGetRayTracingShaderGroupStackSizeKHR.adoc[]
6861
6862  * pname:device is the logical device containing the ray tracing pipeline.
6863  * pname:pipeline is the ray tracing pipeline object containing the shaders
6864    groups.
6865  * pname:group is the index of the shader group to query.
6866  * pname:groupShader is the type of shader from the group to query.
6867
6868The return value is the ray tracing pipeline stack size in bytes for the
6869specified shader as called from the specified shader group.
6870
6871.Valid Usage
6872****
6873  * [[VUID-vkGetRayTracingShaderGroupStackSizeKHR-pipeline-04622]]
6874    pname:pipeline must: be a ray tracing pipeline
6875  * [[VUID-vkGetRayTracingShaderGroupStackSizeKHR-group-03608]]
6876    The value of pname:group must be less than the number of shader groups
6877    in pname:pipeline
6878  * [[VUID-vkGetRayTracingShaderGroupStackSizeKHR-groupShader-03609]]
6879    The shader identified by pname:groupShader in pname:group must: not be
6880    ename:VK_SHADER_UNUSED_KHR
6881****
6882
6883include::{generated}/validity/protos/vkGetRayTracingShaderGroupStackSizeKHR.adoc[]
6884--
6885
6886[open,refpage='VkShaderGroupShaderKHR',desc='Shader group shaders',type='enums']
6887--
6888Possible values of pname:groupShader in
6889flink:vkGetRayTracingShaderGroupStackSizeKHR are:
6890
6891include::{generated}/api/enums/VkShaderGroupShaderKHR.adoc[]
6892
6893  * ename:VK_SHADER_GROUP_SHADER_GENERAL_KHR uses the shader specified in
6894    the group with
6895    slink:VkRayTracingShaderGroupCreateInfoKHR::pname:generalShader
6896  * ename:VK_SHADER_GROUP_SHADER_CLOSEST_HIT_KHR uses the shader specified
6897    in the group with
6898    slink:VkRayTracingShaderGroupCreateInfoKHR::pname:closestHitShader
6899  * ename:VK_SHADER_GROUP_SHADER_ANY_HIT_KHR uses the shader specified in
6900    the group with
6901    slink:VkRayTracingShaderGroupCreateInfoKHR::pname:anyHitShader
6902  * ename:VK_SHADER_GROUP_SHADER_INTERSECTION_KHR uses the shader specified
6903    in the group with
6904    slink:VkRayTracingShaderGroupCreateInfoKHR::pname:intersectionShader
6905--
6906
6907[open,refpage='vkCmdSetRayTracingPipelineStackSizeKHR',desc='Set the stack size dynamically for a ray tracing pipeline',type='protos']
6908--
6909:refpage: vkCmdSetRayTracingPipelineStackSizeKHR
6910
6911To <<pipelines-dynamic-state, dynamically set>> the stack size for a ray
6912tracing pipeline, call:
6913
6914include::{generated}/api/protos/vkCmdSetRayTracingPipelineStackSizeKHR.adoc[]
6915
6916  * pname:commandBuffer is the command buffer into which the command will be
6917    recorded.
6918  * pname:pipelineStackSize is the stack size to use for subsequent ray
6919    tracing trace commands.
6920
6921This command sets the stack size for subsequent ray tracing commands when
6922the ray tracing pipeline is created with
6923ename:VK_DYNAMIC_STATE_RAY_TRACING_PIPELINE_STACK_SIZE_KHR set in
6924slink:VkPipelineDynamicStateCreateInfo::pname:pDynamicStates.
6925Otherwise, the stack size is computed as described in
6926<<ray-tracing-pipeline-stack, Ray Tracing Pipeline Stack>>.
6927
6928.Valid Usage
6929****
6930  * [[VUID-vkCmdSetRayTracingPipelineStackSizeKHR-pipelineStackSize-03610]]
6931    pname:pipelineStackSize must: be large enough for any dynamic execution
6932    through the shaders in the ray tracing pipeline used by a subsequent
6933    trace call
6934****
6935include::{generated}/validity/protos/vkCmdSetRayTracingPipelineStackSizeKHR.adoc[]
6936--
6937endif::VK_KHR_ray_tracing_pipeline[]
6938endif::VK_NV_ray_tracing,VK_KHR_ray_tracing_pipeline[]
6939
6940
6941[[pipelines-destruction]]
6942== Pipeline Destruction
6943
6944[open,refpage='vkDestroyPipeline',desc='Destroy a pipeline object',type='protos']
6945--
6946To destroy a pipeline, call:
6947
6948include::{generated}/api/protos/vkDestroyPipeline.adoc[]
6949
6950  * pname:device is the logical device that destroys the pipeline.
6951  * pname:pipeline is the handle of the pipeline to destroy.
6952  * pname:pAllocator controls host memory allocation as described in the
6953    <<memory-allocation, Memory Allocation>> chapter.
6954
6955.Valid Usage
6956****
6957  * [[VUID-vkDestroyPipeline-pipeline-00765]]
6958    All submitted commands that refer to pname:pipeline must: have completed
6959    execution
6960ifndef::VKSC_VERSION_1_0[]
6961  * [[VUID-vkDestroyPipeline-pipeline-00766]]
6962    If sname:VkAllocationCallbacks were provided when pname:pipeline was
6963    created, a compatible set of callbacks must: be provided here
6964  * [[VUID-vkDestroyPipeline-pipeline-00767]]
6965    If no sname:VkAllocationCallbacks were provided when pname:pipeline was
6966    created, pname:pAllocator must: be `NULL`
6967endif::VKSC_VERSION_1_0[]
6968****
6969
6970include::{generated}/validity/protos/vkDestroyPipeline.adoc[]
6971--
6972
6973
6974[[pipelines-pipeline-derivatives]]
6975== Pipeline Derivatives
6976
6977
6978A pipeline derivative is a child pipeline created from a parent pipeline,
6979where the child and parent are expected to have much commonality.
6980
6981ifndef::VKSC_VERSION_1_0[]
6982The goal of derivative pipelines is that they be cheaper to create using the
6983parent as a starting point, and that it be more efficient (on either host or
6984device) to switch/bind between children of the same parent.
6985
6986A derivative pipeline is created by setting the
6987ename:VK_PIPELINE_CREATE_DERIVATIVE_BIT flag in the
6988stext:Vk*PipelineCreateInfo structure.
6989If this is set, then exactly one of pname:basePipelineHandle or
6990pname:basePipelineIndex members of the structure must: have a valid
6991handle/index, and specifies the parent pipeline.
6992If pname:basePipelineHandle is used, the parent pipeline must: have already
6993been created.
6994If pname:basePipelineIndex is used, then the parent is being created in the
6995same command.
6996dlink:VK_NULL_HANDLE acts as the invalid handle for
6997pname:basePipelineHandle, and -1 is the invalid index for
6998pname:basePipelineIndex.
6999If pname:basePipelineIndex is used, the base pipeline must: appear earlier
7000in the array.
7001The base pipeline must: have been created with the
7002ename:VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT flag set.
7003endif::VKSC_VERSION_1_0[]
7004ifdef::VKSC_VERSION_1_0[]
7005Pipeline derivatives are not supported in Vulkan SC due to the use of
7006read-only offline generated pipeline caches <<SCID-8>>.
7007endif::VKSC_VERSION_1_0[]
7008
7009[[pipelines-cache]]
7010== Pipeline Cache
7011
7012[open,refpage='VkPipelineCache',desc='Opaque handle to a pipeline cache object',type='handles']
7013--
7014ifndef::VKSC_VERSION_1_0[]
7015Pipeline cache objects allow the result of pipeline construction to be
7016reused between pipelines and between runs of an application.
7017Reuse between pipelines is achieved by passing the same pipeline cache
7018object when creating multiple related pipelines.
7019Reuse across runs of an application is achieved by retrieving pipeline cache
7020contents in one run of an application, saving the contents, and using them
7021to preinitialize a pipeline cache on a subsequent run.
7022The contents of the pipeline cache objects are managed by the
7023implementation.
7024Applications can: manage the host memory consumed by a pipeline cache object
7025and control the amount of data retrieved from a pipeline cache object.
7026endif::VKSC_VERSION_1_0[]
7027ifdef::VKSC_VERSION_1_0[]
7028Pipeline cache objects allow the application to load multiple binary
7029pipeline objects generated by an offline cache creation tool into pipeline
7030cache objects.
7031The cache can then be used during pipeline creation to load offline pipeline
7032data.
7033endif::VKSC_VERSION_1_0[]
7034
7035Pipeline cache objects are represented by sname:VkPipelineCache handles:
7036
7037include::{generated}/api/handles/VkPipelineCache.adoc[]
7038--
7039
7040
7041[[pipelines-cache-create]]
7042=== Creating a Pipeline Cache
7043
7044[open,refpage='vkCreatePipelineCache',desc='Creates a new pipeline cache',type='protos']
7045--
7046:refpage: vkCreatePipelineCache
7047:objectnameplural: pipeline caches
7048:objectnamecamelcase: pipelineCache
7049:objectcount: 1
7050
7051To create pipeline cache objects, call:
7052
7053include::{generated}/api/protos/vkCreatePipelineCache.adoc[]
7054
7055  * pname:device is the logical device that creates the pipeline cache
7056    object.
7057  * pname:pCreateInfo is a pointer to a slink:VkPipelineCacheCreateInfo
7058    structure containing initial parameters for the pipeline cache object.
7059  * pname:pAllocator controls host memory allocation as described in the
7060    <<memory-allocation, Memory Allocation>> chapter.
7061  * pname:pPipelineCache is a pointer to a slink:VkPipelineCache handle in
7062    which the resulting pipeline cache object is returned.
7063
7064ifndef::VKSC_VERSION_1_0[]
7065[NOTE]
7066.Note
7067====
7068Applications can: track and manage the total host memory size of a pipeline
7069cache object using the pname:pAllocator.
7070Applications can: limit the amount of data retrieved from a pipeline cache
7071object in fname:vkGetPipelineCacheData.
7072Implementations should: not internally limit the total number of entries
7073added to a pipeline cache object or the total host memory consumed.
7074====
7075endif::VKSC_VERSION_1_0[]
7076
7077ifdef::VKSC_VERSION_1_0[]
7078If the pipeline cache data pointed to by
7079slink:VkPipelineCacheCreateInfo::pname:pInitialData is not compatible with
7080the device, pipeline cache creation will fail and
7081ename:VK_ERROR_INVALID_PIPELINE_CACHE_DATA will be returned.
7082endif::VKSC_VERSION_1_0[]
7083
7084Once created, a pipeline cache can: be passed to the
7085flink:vkCreateGraphicsPipelines
7086ifdef::VK_KHR_ray_tracing_pipeline[flink:vkCreateRayTracingPipelinesKHR,]
7087ifdef::VK_NV_ray_tracing[flink:vkCreateRayTracingPipelinesNV,]
7088and flink:vkCreateComputePipelines commands.
7089ifndef::VKSC_VERSION_1_0[]
7090If the pipeline cache passed into these commands is not
7091dlink:VK_NULL_HANDLE, the implementation will query it for possible reuse
7092opportunities and update it with new content.
7093endif::VKSC_VERSION_1_0[]
7094ifdef::VKSC_VERSION_1_0[]
7095The pipeline cache passed into these commands will be queried by the
7096implementation for matching pipelines on pipeline creation.
7097After the cache is created, its contents cannot be updated.
7098endif::VKSC_VERSION_1_0[]
7099The use of the pipeline cache object in these commands is internally
7100synchronized, and the same pipeline cache object can: be used in multiple
7101threads simultaneously.
7102
7103ifdef::VK_VERSION_1_3,VK_EXT_pipeline_creation_cache_control[]
7104If pname:flags of pname:pCreateInfo includes
7105ename:VK_PIPELINE_CACHE_CREATE_EXTERNALLY_SYNCHRONIZED_BIT, all commands
7106that modify the returned pipeline cache object must: be
7107<<fundamentals-threadingbehavior,externally synchronized>>.
7108endif::VK_VERSION_1_3,VK_EXT_pipeline_creation_cache_control[]
7109
7110ifndef::VKSC_VERSION_1_0[]
7111[NOTE]
7112.Note
7113====
7114Implementations should: make every effort to limit any critical sections to
7115the actual accesses to the cache, which is expected to be significantly
7116shorter than the duration of the ftext:vkCreate*Pipelines commands.
7117====
7118endif::VKSC_VERSION_1_0[]
7119
7120include::{chapters}/commonvalidity/no_dynamic_allocations_common.adoc[]
7121
7122ifdef::VKSC_VERSION_1_0[]
7123.Valid Usage
7124****
7125  * [[VUID-vkCreatePipelineCache-pCreateInfo-05045]]
7126    The contents of the structure pointed to by pname:pCreateInfo and the
7127    data pointed to by pname:pCreateInfo->pInitialData must: be the same as
7128    specified in one of the
7129    slink:VkDeviceObjectReservationCreateInfo::pname:pPipelineCacheCreateInfos
7130    structures when the device was created
7131include::{chapters}/commonvalidity/memory_reservation_request_count_common.adoc[]
7132****
7133endif::VKSC_VERSION_1_0[]
7134
7135include::{generated}/validity/protos/vkCreatePipelineCache.adoc[]
7136--
7137
7138[open,refpage='VkPipelineCacheCreateInfo',desc='Structure specifying parameters of a newly created pipeline cache',type='structs']
7139--
7140The sname:VkPipelineCacheCreateInfo structure is defined as:
7141
7142include::{generated}/api/structs/VkPipelineCacheCreateInfo.adoc[]
7143
7144  * pname:sType is a elink:VkStructureType value identifying this structure.
7145  * pname:pNext is `NULL` or a pointer to a structure extending this
7146    structure.
7147ifdef::VK_VERSION_1_3,VK_EXT_pipeline_creation_cache_control,VKSC_VERSION_1_0[]
7148  * pname:flags is a bitmask of elink:VkPipelineCacheCreateFlagBits
7149    specifying the behavior of the pipeline cache.
7150endif::VK_VERSION_1_3,VK_EXT_pipeline_creation_cache_control,VKSC_VERSION_1_0[]
7151ifndef::VK_VERSION_1_3,VK_EXT_pipeline_creation_cache_control,VKSC_VERSION_1_0[]
7152  * pname:flags is reserved for future use.
7153endif::VK_VERSION_1_3,VK_EXT_pipeline_creation_cache_control,VKSC_VERSION_1_0[]
7154  * pname:initialDataSize is the number of bytes in pname:pInitialData.
7155ifndef::VKSC_VERSION_1_0[]
7156    If pname:initialDataSize is zero, the pipeline cache will initially be
7157    empty.
7158  * pname:pInitialData is a pointer to previously retrieved pipeline cache
7159    data.
7160    If the pipeline cache data is incompatible (as defined below) with the
7161    device, the pipeline cache will be initially empty.
7162    If pname:initialDataSize is zero, pname:pInitialData is ignored.
7163endif::VKSC_VERSION_1_0[]
7164ifdef::VKSC_VERSION_1_0[]
7165  * pname:pInitialData is a pointer to pipeline cache data that has been
7166    generated offline.
7167    If the pipeline cache data is incompatible (as defined below) with the
7168    device, ename:VK_ERROR_INVALID_PIPELINE_CACHE_DATA is returned.
7169ifdef::hidden[]
7170// tag::scdeviation[]
7171  * slink:VkPipelineCacheCreateInfo::pname:pInitialData must: point to a
7172    valid pipeline cache that has been generated offline <<SCID-1>>,
7173    <<SCID-8>>.
7174// end::scdeviation[]
7175endif::hidden[]
7176endif::VKSC_VERSION_1_0[]
7177
7178.Valid Usage
7179****
7180ifndef::VKSC_VERSION_1_0[]
7181  * [[VUID-VkPipelineCacheCreateInfo-initialDataSize-00768]]
7182    If pname:initialDataSize is not `0`, it must: be equal to the size of
7183    pname:pInitialData, as returned by fname:vkGetPipelineCacheData when
7184    pname:pInitialData was originally retrieved
7185  * [[VUID-VkPipelineCacheCreateInfo-initialDataSize-00769]]
7186    If pname:initialDataSize is not `0`, pname:pInitialData must: have been
7187    retrieved from a previous call to fname:vkGetPipelineCacheData
7188endif::VKSC_VERSION_1_0[]
7189ifdef::VK_VERSION_1_3,VK_EXT_pipeline_creation_cache_control[]
7190  * [[VUID-VkPipelineCacheCreateInfo-pipelineCreationCacheControl-02892]]
7191    If the <<features-pipelineCreationCacheControl,
7192    pname:pipelineCreationCacheControl>> feature is not enabled, pname:flags
7193    must: not include
7194    ename:VK_PIPELINE_CACHE_CREATE_EXTERNALLY_SYNCHRONIZED_BIT
7195endif::VK_VERSION_1_3,VK_EXT_pipeline_creation_cache_control[]
7196ifdef::VKSC_VERSION_1_0[]
7197  * [[VUID-VkPipelineCacheCreateInfo-flags-05043]]
7198    pname:flags must: include ename:VK_PIPELINE_CACHE_CREATE_READ_ONLY_BIT
7199  * [[VUID-VkPipelineCacheCreateInfo-flags-05044]]
7200    pname:flags must: include
7201    ename:VK_PIPELINE_CACHE_CREATE_USE_APPLICATION_STORAGE_BIT
7202  * [[VUID-VkPipelineCacheCreateInfo-pInitialData-05139]]
7203    The pipeline cache data pointed to by pname:pInitialData must: not
7204    contain any pipelines with duplicate pipeline identifiers.
7205endif::VKSC_VERSION_1_0[]
7206****
7207ifdef::VKSC_VERSION_1_0[]
7208ifdef::hidden[]
7209// tag::scdeviation[]
7210  * slink:VkPipelineCacheCreateInfo::pname:initialDataSize must: not be `0`
7211    <<SCID-1>>, <<SCID-8>>.
7212  * slink:VkPipelineCacheCreateInfo::pname:pInitialData must: not be `NULL`
7213    <<SCID-1>>, <<SCID-8>>.
7214  * slink:VkPipelineCacheCreateInfo::pname:flags must: include
7215    ename:VK_PIPELINE_CACHE_CREATE_READ_ONLY_BIT <<SCID-1>>, <<SCID-8>>.
7216  * slink:VkPipelineCacheCreateInfo::pname:flags must: include
7217    ename:VK_PIPELINE_CACHE_CREATE_USE_APPLICATION_STORAGE_BIT <<SCID-2>>.
7218  * The contents of slink:VkPipelineCacheCreateInfo, including the data
7219    pointed to by slink:VkPipelineCacheCreateInfo::pname:pInitialData,
7220    passed to flink:vkCreatePipelineCache must: be the same as specified in
7221    one of the
7222    slink:VkDeviceObjectReservationCreateInfo::pname:pPipelineCacheCreateInfos
7223    structures when the device was created <<SCID-1>>.
7224// end::scdeviation[]
7225endif::hidden[]
7226endif::VKSC_VERSION_1_0[]
7227
7228include::{generated}/validity/structs/VkPipelineCacheCreateInfo.adoc[]
7229--
7230
7231[open,refpage='VkPipelineCacheCreateFlags', desc='Bitmask of VkPipelineCreateFlagBits', type='flags']
7232--
7233include::{generated}/api/flags/VkPipelineCacheCreateFlags.adoc[]
7234
7235ifdef::VK_VERSION_1_3,VK_EXT_pipeline_creation_cache_control,VKSC_VERSION_1_0[]
7236tname:VkPipelineCacheCreateFlags is a bitmask type for setting a mask of
7237zero or more elink:VkPipelineCacheCreateFlagBits.
7238endif::VK_VERSION_1_3,VK_EXT_pipeline_creation_cache_control,VKSC_VERSION_1_0[]
7239ifndef::VK_VERSION_1_3,VK_EXT_pipeline_creation_cache_control,VKSC_VERSION_1_0[]
7240tname:VkPipelineCacheCreateFlags is a bitmask type for setting a mask, but
7241is currently reserved for future use.
7242endif::VK_VERSION_1_3,VK_EXT_pipeline_creation_cache_control,VKSC_VERSION_1_0[]
7243--
7244
7245ifdef::VK_VERSION_1_3,VK_EXT_pipeline_creation_cache_control,VKSC_VERSION_1_0[]
7246[open,refpage='VkPipelineCacheCreateFlagBits',desc='Bitmask specifying the behavior of the pipeline cache',type='enums']
7247--
7248Bits which can: be set in slink:VkPipelineCacheCreateInfo::pname:flags,
7249specifying behavior of the pipeline cache, are:
7250
7251include::{generated}/api/enums/VkPipelineCacheCreateFlagBits.adoc[]
7252
7253ifdef::VK_VERSION_1_3,VK_EXT_pipeline_creation_cache_control[]
7254  * ename:VK_PIPELINE_CACHE_CREATE_EXTERNALLY_SYNCHRONIZED_BIT specifies
7255    that all commands that modify the created slink:VkPipelineCache will be
7256    <<fundamentals-threadingbehavior,externally synchronized>>.
7257    When set, the implementation may: skip any unnecessary processing needed
7258    to support simultaneous modification from multiple threads where
7259    allowed.
7260endif::VK_VERSION_1_3,VK_EXT_pipeline_creation_cache_control[]
7261ifdef::VKSC_VERSION_1_0[]
7262  * ename:VK_PIPELINE_CACHE_CREATE_READ_ONLY_BIT specifies that the new
7263    pipeline cache will be read-only.
7264  * ename:VK_PIPELINE_CACHE_CREATE_USE_APPLICATION_STORAGE_BIT specifies
7265    that the application will maintain the contents of the memory pointed to
7266    by pname:pInitialData for the lifetime of the pipeline cache object
7267    created, avoiding the need for the implementation to make a copy of the
7268    data.
7269    The memory pointed to by pname:pInitialData can: be modified or released
7270    by the application only after any pipeline cache objects created using
7271    it have been destroyed.
7272ifdef::hidden[]
7273// tag::scaddition[]
7274  * extending elink:VkPipelineCacheCreateFlagBits
7275  ** ename:VK_PIPELINE_CACHE_CREATE_READ_ONLY_BIT <<SCID-1>>, <<SCID-8>>
7276  ** ename:VK_PIPELINE_CACHE_CREATE_USE_APPLICATION_STORAGE_BIT <<SCID-2>>
7277// end::scaddition[]
7278endif::hidden[]
7279endif::VKSC_VERSION_1_0[]
7280--
7281endif::VK_VERSION_1_3,VK_EXT_pipeline_creation_cache_control,VKSC_VERSION_1_0[]
7282
7283ifdef::VKSC_VERSION_1_0[]
7284ifdef::hidden[]
7285// tag::scremoved[]
7286  * fname:vkMergePipelineCaches, fname:vkGetPipelineCacheData <<SCID-1>>,
7287    <<SCID-8>>
7288// end::scremoved[]
7289endif::hidden[]
7290endif::VKSC_VERSION_1_0[]
7291ifndef::VKSC_VERSION_1_0[]
7292
7293
7294[[pipelines-cache-merge]]
7295=== Merging Pipeline Caches
7296
7297[open,refpage='vkMergePipelineCaches',desc='Combine the data stores of pipeline caches',type='protos']
7298--
7299Pipeline cache objects can: be merged using the command:
7300
7301include::{generated}/api/protos/vkMergePipelineCaches.adoc[]
7302
7303  * pname:device is the logical device that owns the pipeline cache objects.
7304  * pname:dstCache is the handle of the pipeline cache to merge results
7305    into.
7306  * pname:srcCacheCount is the length of the pname:pSrcCaches array.
7307  * pname:pSrcCaches is a pointer to an array of pipeline cache handles,
7308    which will be merged into pname:dstCache.
7309    The previous contents of pname:dstCache are included after the merge.
7310
7311[NOTE]
7312.Note
7313====
7314The details of the merge operation are implementation-dependent, but
7315implementations should: merge the contents of the specified pipelines and
7316prune duplicate entries.
7317====
7318
7319.Valid Usage
7320****
7321  * [[VUID-vkMergePipelineCaches-dstCache-00770]]
7322    pname:dstCache must: not appear in the list of source caches
7323****
7324
7325include::{generated}/validity/protos/vkMergePipelineCaches.adoc[]
7326--
7327endif::VKSC_VERSION_1_0[]
7328ifndef::VKSC_VERSION_1_0[]
7329
7330
7331[[pipelines-cache-retrieval]]
7332=== Retrieving Pipeline Cache Data
7333
7334[open,refpage='vkGetPipelineCacheData',desc='Get the data store from a pipeline cache',type='protos']
7335--
7336Data can: be retrieved from a pipeline cache object using the command:
7337
7338include::{generated}/api/protos/vkGetPipelineCacheData.adoc[]
7339
7340  * pname:device is the logical device that owns the pipeline cache.
7341  * pname:pipelineCache is the pipeline cache to retrieve data from.
7342  * pname:pDataSize is a pointer to a code:size_t value related to the
7343    amount of data in the pipeline cache, as described below.
7344  * pname:pData is either `NULL` or a pointer to a buffer.
7345
7346If pname:pData is `NULL`, then the maximum size of the data that can: be
7347retrieved from the pipeline cache, in bytes, is returned in pname:pDataSize.
7348Otherwise, pname:pDataSize must: point to a variable set by the user to the
7349size of the buffer, in bytes, pointed to by pname:pData, and on return the
7350variable is overwritten with the amount of data actually written to
7351pname:pData.
7352If pname:pDataSize is less than the maximum size that can: be retrieved by
7353the pipeline cache, at most pname:pDataSize bytes will be written to
7354pname:pData, and ename:VK_INCOMPLETE will be returned instead of
7355ename:VK_SUCCESS, to indicate that not all of the pipeline cache was
7356returned.
7357
7358Any data written to pname:pData is valid and can: be provided as the
7359pname:pInitialData member of the slink:VkPipelineCacheCreateInfo structure
7360passed to fname:vkCreatePipelineCache.
7361
7362Two calls to fname:vkGetPipelineCacheData with the same parameters must:
7363retrieve the same data unless a command that modifies the contents of the
7364cache is called between them.
7365
7366The initial bytes written to pname:pData must: be a header as described in
7367the <<pipelines-cache-header, Pipeline Cache Header>> section.
7368
7369If pname:pDataSize is less than what is necessary to store this header,
7370nothing will be written to pname:pData and zero will be written to
7371pname:pDataSize.
7372
7373include::{generated}/validity/protos/vkGetPipelineCacheData.adoc[]
7374--
7375endif::VKSC_VERSION_1_0[]
7376
7377
7378[[pipelines-cache-header]]
7379=== Pipeline Cache Header
7380
7381ifdef::VKSC_VERSION_1_0[]
7382Applications must: load data from <<pipelines-offline-compilation,offline
7383compiled>> pipeline caches into pipeline cache objects.
7384The results of pipeline compilations may: depend on the vendor ID, device
7385ID, driver version, and other details of the target device.
7386To allow detection of pipeline cache data that is incompatible with the
7387device, the pipeline cache data must: begin with a valid pipeline cache
7388header.
7389endif::VKSC_VERSION_1_0[]
7390
7391ifndef::VKSC_VERSION_1_0[]
7392Applications can: store the data retrieved from the pipeline cache, and use
7393these data, possibly in a future run of the application, to populate new
7394pipeline cache objects.
7395The results of pipeline compiles, however, may: depend on the vendor ID,
7396device ID, driver version, and other details of the device.
7397To enable applications to detect when previously retrieved data is
7398incompatible with the device, the pipeline cache data must: begin with a
7399valid pipeline cache header.
7400endif::VKSC_VERSION_1_0[]
7401
7402[NOTE]
7403.Note
7404====
7405Structures described in this section are not part of the Vulkan API and are
7406only used to describe the representation of data elements in pipeline cache
7407data.
7408Accordingly, the valid usage clauses defined for structures defined in this
7409section do not define valid usage conditions for APIs accepting pipeline
7410cache data as input, as providing invalid pipeline cache data as input to
7411any Vulkan API commands will result
7412ifndef::VKSC_VERSION_1_0[]
7413in the provided pipeline cache data being ignored.
7414endif::VKSC_VERSION_1_0[]
7415ifdef::VKSC_VERSION_1_0[]
7416in the runtime error ename:VK_ERROR_INVALID_PIPELINE_CACHE_DATA.
7417endif::VKSC_VERSION_1_0[]
7418====
7419
7420[open,refpage='VkPipelineCacheHeaderVersionOne',desc='Structure describing the layout of the pipeline cache header',type='structs']
7421--
7422Version one of the pipeline cache header is defined as:
7423
7424include::{generated}/api/structs/VkPipelineCacheHeaderVersionOne.adoc[]
7425
7426  * pname:headerSize is the length in bytes of the pipeline cache header.
7427  * pname:headerVersion is a elink:VkPipelineCacheHeaderVersion value
7428    specifying the version of the header.
7429    A consumer of the pipeline cache should: use the cache version to
7430    interpret the remainder of the cache header.
7431  * pname:vendorID is the sname:VkPhysicalDeviceProperties::pname:vendorID
7432    of the implementation.
7433  * pname:deviceID is the sname:VkPhysicalDeviceProperties::pname:deviceID
7434    of the implementation.
7435  * pname:pipelineCacheUUID is the
7436    sname:VkPhysicalDeviceProperties::pname:pipelineCacheUUID of the
7437    implementation.
7438
7439Unlike most structures declared by the Vulkan API, all fields of this
7440structure are written with the least significant byte first, regardless of
7441host byte-order.
7442
7443The C language specification does not define the packing of structure
7444members.
7445This layout assumes tight structure member packing, with members laid out in
7446the order listed in the structure, and the intended size of the structure is
744732 bytes.
7448If a compiler produces code that diverges from that pattern, applications
7449must: employ another method to set values at the correct offsets.
7450
7451.Valid Usage
7452****
7453ifndef::VKSC_VERSION_1_0[]
7454  * [[VUID-VkPipelineCacheHeaderVersionOne-headerSize-04967]]
7455    pname:headerSize must: be 32
7456  * [[VUID-VkPipelineCacheHeaderVersionOne-headerVersion-04968]]
7457    pname:headerVersion must: be ename:VK_PIPELINE_CACHE_HEADER_VERSION_ONE
7458endif::VKSC_VERSION_1_0[]
7459ifdef::VKSC_VERSION_1_0[]
7460  * [[VUID-VkPipelineCacheHeaderVersionOne-headerSize-05075]]
7461    pname:headerSize must: be 56
7462  * [[VUID-VkPipelineCacheHeaderVersionOne-headerVersion-05076]]
7463    pname:headerVersion must: be
7464    ename:VK_PIPELINE_CACHE_HEADER_VERSION_SAFETY_CRITICAL_ONE
7465endif::VKSC_VERSION_1_0[]
7466  * [[VUID-VkPipelineCacheHeaderVersionOne-headerSize-08990]]
7467    pname:headerSize must: not exceed the size of the pipeline cache
7468****
7469ifdef::VKSC_VERSION_1_0[]
7470ifdef::hidden[]
7471// tag::scdeviation[]
7472  * slink:VkPipelineCacheHeaderVersionOne::pname:headerSize must: be 56
7473    <<SCID-1>>.
7474  * slink:VkPipelineCacheHeaderVersionOne::pname:headerVersion must: be
7475    ename:VK_PIPELINE_CACHE_HEADER_VERSION_SAFETY_CRITICAL_ONE <<SCID-1>>.
7476// end::scdeviation[]
7477endif::hidden[]
7478endif::VKSC_VERSION_1_0[]
7479
7480include::{generated}/validity/structs/VkPipelineCacheHeaderVersionOne.adoc[]
7481--
7482
7483[open,refpage='VkPipelineCacheHeaderVersion',desc='Encode pipeline cache version',type='enums',xrefs='vkCreatePipelineCache vkGetPipelineCacheData']
7484--
7485Possible values of the pname:headerVersion value of the pipeline cache
7486header are:
7487
7488include::{generated}/api/enums/VkPipelineCacheHeaderVersion.adoc[]
7489
7490  * ename:VK_PIPELINE_CACHE_HEADER_VERSION_ONE specifies version one of the
7491    pipeline cache, described by slink:VkPipelineCacheHeaderVersionOne.
7492ifdef::VKSC_VERSION_1_0[]
7493  * ename:VK_PIPELINE_CACHE_HEADER_VERSION_SAFETY_CRITICAL_ONE specifies
7494    version one of the pipeline cache for Vulkan SC, described by
7495    slink:VkPipelineCacheHeaderVersionSafetyCriticalOne.
7496endif::VKSC_VERSION_1_0[]
7497--
7498
7499ifdef::VKSC_VERSION_1_0[]
7500[open,refpage='VkPipelineCacheHeaderVersionSafetyCriticalOne',desc='Structure describing the layout of the pipeline cache header for safety critical',type='structs']
7501--
7502Version one of the pipeline cache header for Vulkan SC is defined as:
7503
7504include::{generated}/api/structs/VkPipelineCacheHeaderVersionSafetyCriticalOne.adoc[]
7505
7506  * pname:headerVersionOne is a slink:VkPipelineCacheHeaderVersionOne
7507    structure.
7508  * pname:validationVersion is a elink:VkPipelineCacheValidationVersion enum
7509    value specifying the version of any validation information that is
7510    included in this pipeline cache.
7511  * pname:implementationData is 4 bytes of padding to ensure structure
7512    members are consistently aligned on all platforms.
7513    The contents of this field may: be used for implementation-specific
7514    information.
7515  * pname:pipelineIndexCount is the number of entries contained in the
7516    pipeline cache index.
7517  * pname:pipelineIndexStride is the number of bytes between consecutive
7518    pipeline cache index entries.
7519  * pname:pipelineIndexOffset is the offset in bytes from the beginning of
7520    the pipeline cache header to the pipeline cache index.
7521
7522The <<pipelines-cache-index, pipeline cache index>> consists of
7523pname:pipelineIndexCount slink:VkPipelineCacheSafetyCriticalIndexEntry
7524structures containing an index of all the pipelines in this cache.
7525The pipeline cache index is located starting at pname:pipelineIndexOffset
7526bytes into the cache and the location of pipeline code:i is calculated as:
7527[eq]#pname:pipelineIndexOffset + code:i {times} pname:pipelineIndexStride#.
7528The slink:VkPipelineCacheSafetyCriticalIndexEntry structures may: not be
7529tightly packed, enabling additional implementation-specific data to be
7530stored with each entry, or for future extensibility.
7531
7532[NOTE]
7533.Note
7534====
7535Because the pipeline cache index is keyed by pipeline identifier,
7536applications and offline compilers must ensure that there are no pipelines
7537with identical pipeline identifiers in the same pipeline cache.
7538====
7539
7540Unlike most structures declared by the Vulkan API, all fields of this
7541structure are written with the least significant byte first, regardless of
7542host byte-order.
7543
7544The C language specification does not define the packing of structure
7545members.
7546This layout assumes tight structure member packing, with members laid out in
7547the order listed in the structure, and the intended size of the structure is
754856 bytes.
7549If a compiler produces code that diverges from that pattern, applications
7550must: employ another method to set values at the correct offsets.
7551
7552.Valid Usage
7553****
7554  * [[VUID-VkPipelineCacheHeaderVersionSafetyCriticalOne-validationVersion-05077]]
7555    pname:validationVersion must: be
7556    ename:VK_PIPELINE_CACHE_VALIDATION_VERSION_SAFETY_CRITICAL_ONE
7557  * [[VUID-VkPipelineCacheHeaderVersionSafetyCriticalOne-pipelineIndexStride-05078]]
7558    pname:pipelineIndexStride must: be greater than or equal to 56 (the size
7559    of the slink:VkPipelineCacheSafetyCriticalIndexEntry structure)
7560  * [[VUID-VkPipelineCacheHeaderVersionSafetyCriticalOne-pipelineIndexOffset-05079]]
7561    [eq]#pname:pipelineIndexOffset + pname:pipelineIndexCount {times}
7562    pname:pipelineIndexStride# must: not exceed the size of the pipeline
7563    cache
7564****
7565
7566include::{generated}/validity/structs/VkPipelineCacheHeaderVersionSafetyCriticalOne.adoc[]
7567--
7568
7569[open,refpage='VkPipelineCacheValidationVersion',desc='Encode pipeline cache validation version',type='enums']
7570--
7571The elink:VkPipelineCacheValidationVersion enumeration determines the
7572contents of the pipeline cache validation information.
7573Possible values are:
7574
7575include::{generated}/api/enums/VkPipelineCacheValidationVersion.adoc[]
7576
7577  * ename:VK_PIPELINE_CACHE_VALIDATION_VERSION_SAFETY_CRITICAL_ONE specifies
7578    version one of the pipeline cache validation information for Vulkan SC.
7579--
7580
7581[[pipelines-cache-index]]
7582[open,refpage='VkPipelineCacheSafetyCriticalIndexEntry',desc='Structure describing the pipeline cache index entry',type='structs']
7583--
7584Each pipeline cache index entry consists of a
7585sname:VkPipelineCacheSafetyCriticalIndexEntry structure:
7586
7587include::{generated}/api/structs/VkPipelineCacheSafetyCriticalIndexEntry.adoc[]
7588
7589  * pname:pipelineIdentifier is the <<pipelines-identifier, pipeline
7590    identifier>> indicating which pipeline the information is associated
7591    with.
7592  * pname:pipelineMemorySize is the number of bytes of pipeline memory
7593    required for this pipeline.
7594    This is the minimum value that can: be successfully used for
7595    slink:VkPipelineOfflineCreateInfo::pname:poolEntrySize when this
7596    pipeline is used.
7597  * pname:jsonSize is the size in bytes of the pipeline JSON data
7598    representing the pipeline state for this pipeline.
7599    This value may: be zero, indicating the JSON data is not present in the
7600    pipeline cache for this pipeline.
7601  * pname:jsonOffset is the offset in bytes from the beginning of the
7602    pipeline cache header to the pipeline JSON data for this pipeline.
7603    This value must: be zero if the JSON data is not present in the pipeline
7604    cache for this pipeline.
7605  * pname:stageIndexCount is the number of entries in the pipeline cache
7606    stage validation index for this pipeline.
7607    This value may: be zero, indicating that no stage validation information
7608    is present in the pipeline cache for this pipeline.
7609  * pname:stageIndexStride is the number of bytes between consecutive stage
7610    validation index entries.
7611  * pname:stageIndexOffset is the offset in bytes from the beginning of the
7612    pipeline cache header to the <<pipelines-cache-stage-validation-index,
7613    stage validation index>> for this pipeline.
7614    This value must: be zero if no stage validation information is present
7615    for this pipeline.
7616
7617The JSON data and the stage validation index are optionally: included in the
7618pipeline cache index entry.
7619They are only intended to be used for validation and debugging.
7620If present they must: include both the JSON data and the corresponding
7621SPIR-V modules that were used by the offline compiler to compile the
7622pipeline cache entry.
7623
7624The data at pname:jsonOffset consists of a byte stream of pname:jsonSize
7625bytes of UTF-8 encoded JSON that was used by the
7626<<pipelines-offline-compilation, offline pipeline compiler>> to create this
7627pipeline cache entry.
7628
7629The <<pipelines-cache-stage-validation-index, stage validation index>>
7630consists of pname:stageIndexCount
7631slink:VkPipelineCacheStageValidationIndexEntry structures which provide the
7632SPIR-V modules used by this pipeline and these are provided in the same
7633order as provided to the slink:VkPipelineShaderStageCreateInfo structure(s)
7634in the stext:Vk*PipelineCreateInfo structure for this pipeline.
7635The stage validation index is located at pname:stageIndexOffset bytes into
7636the cache and the location of stage code:i is calculated as:
7637[eq]#pname:stageIndexOffset {plus} code:i {times} pname:stageIndexStride#.
7638The slink:VkPipelineCacheStageValidationIndexEntry structures may: not be
7639tightly packed, enabling additional implementation-specific data to be
7640stored with each entry, or for future extensibility.
7641
7642Unlike most structures declared by the Vulkan API, all fields of this
7643structure are written with the least significant byte first, regardless of
7644host byte-order.
7645
7646The C language specification does not define the packing of structure
7647members.
7648This layout assumes tight structure member packing, with members laid out in
7649the order listed in the structure, and the intended size of the structure is
765056 bytes.
7651If a compiler produces code that diverges from that pattern, applications
7652must: employ another method to set values at the correct offsets.
7653
7654.Valid Usage
7655****
7656  * [[VUID-VkPipelineCacheSafetyCriticalIndexEntry-jsonSize-05080]]
7657    If pname:jsonSize is 0, pname:jsonOffset must: be 0
7658  * [[VUID-VkPipelineCacheSafetyCriticalIndexEntry-jsonSize-05081]]
7659    If pname:jsonSize is 0, pname:stageIndexCount must: be 0
7660  * [[VUID-VkPipelineCacheSafetyCriticalIndexEntry-jsonSize-08991]]
7661    If pname:jsonSize is not 0, [eq]#pname:jsonOffset {plus} pname:jsonSize#
7662    must: not exceed the size of the pipeline cache
7663  * [[VUID-VkPipelineCacheSafetyCriticalIndexEntry-stageIndexCount-05082]]
7664    If pname:stageIndexCount is 0, pname:stageIndexOffset and
7665    pname:stageIndexStride must: be 0
7666  * [[VUID-VkPipelineCacheSafetyCriticalIndexEntry-stageIndexCount-05083]]
7667    If pname:stageIndexCount is not 0, pname:stageIndexStride must: be
7668    greater than or equal to 16 (the size of the
7669    slink:VkPipelineCacheStageValidationIndexEntry structure)
7670  * [[VUID-VkPipelineCacheSafetyCriticalIndexEntry-stageIndexCount-05084]]
7671    If pname:stageIndexCount is not 0, [eq]#pname:stageIndexOffset {plus}
7672    pname:stageIndexCount {times} pname:stageIndexStride# must: not exceed
7673    the size of the pipeline cache
7674****
7675
7676include::{generated}/validity/structs/VkPipelineCacheSafetyCriticalIndexEntry.adoc[]
7677--
7678
7679[[pipelines-cache-stage-validation-index]]
7680[open,refpage='VkPipelineCacheStageValidationIndexEntry',desc='Structure describing the pipeline cache stage validation index',type='structs']
7681--
7682Each pipeline cache stage validation index entry consists of a
7683sname:VkPipelineCacheStageValidationIndexEntry structure:
7684
7685include::{generated}/api/structs/VkPipelineCacheStageValidationIndexEntry.adoc[]
7686
7687  * pname:codeSize is the size in bytes of the SPIR-V module for this
7688    pipeline stage.
7689  * pname:codeOffset is the offset in bytes from the beginning of the
7690    pipeline cache header to the SPIR-V module for this pipeline stage.
7691
7692The data at pname:codeOffset consists of pname:codeSize bytes of SPIR-V
7693module as described in <<spirvenv, Appendix A>> that was used by the
7694<<pipelines-offline-compilation, offline pipeline compiler>> for this shader
7695stage when creating this pipeline cache entry.
7696
7697Unlike most structures declared by the Vulkan API, all fields of this
7698structure are written with the least significant byte first, regardless of
7699host byte-order.
7700
7701The C language specification does not define the packing of structure
7702members.
7703This layout assumes tight structure member packing, with members laid out in
7704the order listed in the structure, and the intended size of the structure is
770516 bytes.
7706If a compiler produces code that diverges from that pattern, applications
7707must: employ another method to set values at the correct offsets.
7708
7709.Valid Usage
7710****
7711  * [[VUID-VkPipelineCacheStageValidationIndexEntry-codeSize-05085]]
7712    pname:codeSize must: be greater than 0
7713  * [[VUID-VkPipelineCacheStageValidationIndexEntry-codeSize-05086]]
7714    pname:codeSize must: be a multiple of 4
7715  * [[VUID-VkPipelineCacheStageValidationIndexEntry-codeOffset-05087]]
7716    [eq]#pname:codeOffset {plus} pname:codeSize# must: not exceed the size
7717    of the pipeline cache
7718****
7719
7720include::{generated}/validity/structs/VkPipelineCacheStageValidationIndexEntry.adoc[]
7721--
7722
7723ifdef::hidden[]
7724// tag::scaddition[]
7725  * extending elink:VkPipelineCacheHeaderVersion
7726  ** ename:VK_PIPELINE_CACHE_HEADER_VERSION_SAFETY_CRITICAL_ONE <<SCID-1>>,
7727     <<SCID-8>>
7728  * slink:VkPipelineCacheHeaderVersionSafetyCriticalOne <<SCID-1>>,
7729    <<SCID-8>>
7730  * elink:VkPipelineCacheValidationVersion <<SCID-1>>, <<SCID-8>>
7731  * slink:VkPipelineCacheSafetyCriticalIndexEntry <<SCID-1>>, <<SCID-8>>
7732  * slink:VkPipelineCacheStageValidationIndexEntry<<SCID-1>>, <<SCID-8>>
7733// end::scaddition[]
7734endif::hidden[]
7735endif::VKSC_VERSION_1_0[]
7736
7737
7738[[pipelines-cache-destroy]]
7739=== Destroying a Pipeline Cache
7740
7741[open,refpage='vkDestroyPipelineCache',desc='Destroy a pipeline cache object',type='protos']
7742--
7743To destroy a pipeline cache, call:
7744
7745include::{generated}/api/protos/vkDestroyPipelineCache.adoc[]
7746
7747  * pname:device is the logical device that destroys the pipeline cache
7748    object.
7749  * pname:pipelineCache is the handle of the pipeline cache to destroy.
7750  * pname:pAllocator controls host memory allocation as described in the
7751    <<memory-allocation, Memory Allocation>> chapter.
7752
7753ifndef::VKSC_VERSION_1_0[]
7754.Valid Usage
7755****
7756  * [[VUID-vkDestroyPipelineCache-pipelineCache-00771]]
7757    If sname:VkAllocationCallbacks were provided when pname:pipelineCache
7758    was created, a compatible set of callbacks must: be provided here
7759  * [[VUID-vkDestroyPipelineCache-pipelineCache-00772]]
7760    If no sname:VkAllocationCallbacks were provided when pname:pipelineCache
7761    was created, pname:pAllocator must: be `NULL`
7762****
7763endif::VKSC_VERSION_1_0[]
7764
7765include::{generated}/validity/protos/vkDestroyPipelineCache.adoc[]
7766--
7767
7768ifdef::VKSC_VERSION_1_0[]
7769[[pipelines-offline-compilation]]
7770== Offline Pipeline Compilation
7771
7772In Vulkan SC, the pipeline compilation process occurs offline <<SCID-8>>.
7773
7774The <<shader-modules,SPIR-V shader module>> and pipeline state are supplied
7775to an offline pipeline cache compiler which creates a pipeline cache entry
7776for the pipeline.
7777The set of pipeline cache entries are combined offline into one or more
7778<<pipelines-cache, pipeline caches>>.
7779At application run-time, the offline generated pipeline cache is provided to
7780device creation as part of the slink:VkDeviceObjectReservationCreateInfo
7781structure and then loaded into a slink:VkPipelineCache object by the
7782application.
7783The device, pipeline, and pipeline cache creation functions can: extract
7784implementation-specific information from the pipeline cache.
7785The specific pipeline to be loaded from the cache is specified at pipeline
7786creation time using a <<pipelines-identifier,pipeline identifier>>.
7787The pipeline state that is provided at runtime to pipeline creation must:
7788match the state that was specified to the offline pipeline cache compiler
7789when the pipeline cache entry was created offline (with the exception of the
7790slink:VkPipelineShaderStageCreateInfo structure).
7791
7792In order to assist with the specification of pipeline state for the offline
7793pipeline cache compiler, Khronos has defined a _pipeline JSON schema_ to
7794represent the pipeline state required to compile a SPIR-V module to
7795device-specific machine code and a set of utilities to help with reading and
7796writing of the JSON files.
7797See https://github.com/KhronosGroup/VulkanSC-Docs/wiki/JSON-schema for more
7798information.
7799
7800[[pipelines-memory-reservation]]
7801== Pipeline Memory Reservation
7802
7803Pipeline memory is allocated from a pool that is reserved at device creation
7804time.
7805The offline pipeline cache compiler writes the pipeline memory size
7806requirements for each pipeline into the pipeline's
7807slink:VkPipelineCacheSafetyCriticalIndexEntry::pname:pipelineMemorySize
7808entry in the <<pipelines-cache-index,pipeline cache index>>.
7809The offline pipeline cache compiler may: also report it separately.
7810The elements of
7811slink:VkDeviceObjectReservationCreateInfo::pname:pPipelinePoolSizes are
7812requests for pname:poolEntryCount pool entries each of pool size
7813pname:poolEntrySize, and any pipeline with a
7814slink:VkPipelineCacheSafetyCriticalIndexEntry::pname:pipelineMemorySize less
7815than or equal to slink:VkPipelineOfflineCreateInfo::pname:poolEntrySize can:
7816be placed in one of those pool entries.
7817The application should: request a set of pool sizes that best suits its
7818anticipated worst-case usage.
7819
7820On implementations where
7821slink:VkPhysicalDeviceVulkanSC10Properties::pname:recyclePipelineMemory is
7822ename:VK_FALSE, the memory for the pipeline pool is not recycled when a
7823pipeline is destroyed, and once an entry has been used it cannot: be reused.
7824On implementations where
7825slink:VkPhysicalDeviceVulkanSC10Properties::pname:recyclePipelineMemory is
7826ename:VK_TRUE, the memory for the pipeline pool is recycled when a pipeline
7827is destroyed, and the entry it was using becomes available to be reused.
7828
7829[[pipelines-identifier]]
7830== Pipeline Identifier
7831
7832A _pipeline identifier_ is an identifier that can be used to identify a
7833specific pipeline independently from the pipeline description, shader stages
7834and any relevant fixed-function stages, that were used to create the
7835pipeline object.
7836
7837The slink:VkPipelineOfflineCreateInfo structure allows an identifier to be
7838specified for the pipeline at pipeline creation via the pname:pNext field of
7839the slink:VkGraphicsPipelineCreateInfo,
7840ifdef::VK_KHR_ray_tracing_pipeline[slink:VkRayTracingPipelineCreateInfoKHR,]
7841ifdef::VK_NV_ray_tracing[slink:VkRayTracingPipelineCreateInfoNV,]
7842and slink:VkComputePipelineCreateInfo structures.
7843If a sname:VkPipelineOfflineCreateInfo structure is not included in the
7844pname:pNext chain then pipeline creation will fail and
7845ename:VK_ERROR_NO_PIPELINE_MATCH will be returned by the corresponding
7846ftext:vkCreate*Pipelines command.
7847
7848The identifier must: be used by the implementation to match against the
7849existing content of the pipeline cache at pipeline creation.
7850This is required for Vulkan SC where pipelines are generated offline and
7851there is no shader code in the pipeline cache to match at runtime.
7852
7853[NOTE]
7854.Note
7855====
7856The identifier values must be specified or generated during the offline
7857pipeline cache generation and embedded in to the pipeline cache blob.
7858====
7859
7860[open,refpage='VkPipelineOfflineCreateInfo',desc='Structure specifying pipeline UUID and pipeline pool size to use',type='structs']
7861--
7862The sname:VkPipelineOfflineCreateInfo structure is defined as:
7863
7864include::{generated}/api/structs/VkPipelineOfflineCreateInfo.adoc[]
7865
7866  * pname:sType is a elink:VkStructureType value identifying this structure.
7867  * pname:pNext is `NULL` or a pointer to a structure extending this
7868    structure.
7869  * pname:pipelineIdentifier is an array of ename:VK_UUID_SIZE code:uint8_t
7870    values representing an identifier for the pipeline.
7871  * pname:matchControl is a elink:VkPipelineMatchControl value specifying
7872    the type of identifier being used and how the match should be performed.
7873  * pname:poolEntrySize is the size of the entry in pipeline memory to use
7874    for this pipeline.
7875    It must: be a size that was requested via slink:VkPipelinePoolSize when
7876    the device was created.
7877
7878If a match in the pipeline cache is not found then
7879ename:VK_ERROR_NO_PIPELINE_MATCH will be returned to the application.
7880
7881If pname:poolEntrySize is too small for the pipeline, or the number of
7882entries for the requested pool size exceeds the reserved count for that pool
7883size, pipeline creation will fail and ename:VK_ERROR_OUT_OF_POOL_MEMORY will
7884be returned by the corresponding ftext:vkCreate*Pipelines command.
7885
7886.Valid Usage
7887****
7888  * [[VUID-VkPipelineOfflineCreateInfo-poolEntrySize-05028]]
7889    pname:poolEntrySize must: be one of the sizes requested via
7890    slink:VkPipelinePoolSize when the device was created
7891  * [[VUID-VkPipelineOfflineCreateInfo-recyclePipelineMemory-05029]]
7892    If
7893    slink:VkPhysicalDeviceVulkanSC10Properties::pname:recyclePipelineMemory
7894    is ename:VK_TRUE, the number of currently existing pipelines created
7895    with this same value of pname:poolEntrySize plus 1 must: be less than or
7896    equal to the sum of the slink:VkPipelinePoolSize::pname:poolEntryCount
7897    values with the same value of pname:poolEntrySize
7898  * [[VUID-VkPipelineOfflineCreateInfo-recyclePipelineMemory-05030]]
7899    If
7900    slink:VkPhysicalDeviceVulkanSC10Properties::pname:recyclePipelineMemory
7901    is ename:VK_FALSE, the total number of pipelines ever created with this
7902    same value of pname:poolEntrySize plus 1 must: be less than or equal to
7903    the sum of the slink:VkPipelinePoolSize::pname:poolEntryCount values
7904    with the same value of pname:poolEntrySize
7905****
7906ifdef::hidden[]
7907// tag::scaddition[]
7908  * slink:VkPipelineOfflineCreateInfo <<SCID-1>>, <<SCID-8>>
7909  * elink:VkPipelineMatchControl <<SCID-1>>
7910// end::scaddition[]
7911endif::hidden[]
7912
7913include::{generated}/validity/structs/VkPipelineOfflineCreateInfo.adoc[]
7914--
7915
7916[open,refpage='VkPipelineMatchControl',desc='Describes the type of Identifier and Match being used',type='enums',xrefs='VkPipelineOfflineCreateInfo']
7917--
7918Possible values of the pname:matchControl member of
7919sname:VkPipelineOfflineCreateInfo
7920
7921include::{generated}/api/enums/VkPipelineMatchControl.adoc[]
7922
7923are:
7924
7925  * ename:VK_PIPELINE_MATCH_CONTROL_APPLICATION_UUID_EXACT_MATCH specifies
7926    that the identifier is a UUID generated by the application and the
7927    identifiers must be an exact match.
7928
7929--
7930endif::VKSC_VERSION_1_0[]
7931
7932[[pipelines-specialization-constants]]
7933== Specialization Constants
7934
7935ifndef::VKSC_VERSION_1_0[]
7936Specialization constants are a mechanism whereby constants in a SPIR-V
7937module can: have their constant value specified at the time the
7938sname:VkPipeline is created.
7939This allows a SPIR-V module to have constants that can: be modified while
7940executing an application that uses the Vulkan API.
7941
7942[NOTE]
7943.Note
7944====
7945Specialization constants are useful to allow a compute shader to have its
7946local workgroup size changed at runtime by the user, for example.
7947====
7948
7949endif::VKSC_VERSION_1_0[]
7950ifdef::VKSC_VERSION_1_0[]
7951Specialization constants are a mechanism whereby constants in a SPIR-V
7952module can: have their constant value specified at the time the
7953sname:VkPipeline is compiled offline.
7954This allows a SPIR-V module to have constants that can: be modified at
7955compilation time rather than in the SPIR-V source.
7956The pname:pSpecializationInfo parameters are not used at runtime and should:
7957be ignored by the implementation.
7958If provided, the application must: set the pname:pSpecializationInfo
7959parameters to the values that were specified for the offline compilation of
7960this pipeline.
7961
7962[NOTE]
7963.Note
7964====
7965Specialization constants are useful to allow a compute shader to have its
7966local workgroup size changed at pipeline compilation time, for example.
7967====
7968endif::VKSC_VERSION_1_0[]
7969
7970Each slink:VkPipelineShaderStageCreateInfo structure contains a
7971pname:pSpecializationInfo member, which can: be `NULL` to indicate no
7972specialization constants, or point to a sname:VkSpecializationInfo
7973structure.
7974
7975[open,refpage='VkSpecializationInfo',desc='Structure specifying specialization information',type='structs']
7976--
7977The sname:VkSpecializationInfo structure is defined as:
7978
7979include::{generated}/api/structs/VkSpecializationInfo.adoc[]
7980
7981  * pname:mapEntryCount is the number of entries in the pname:pMapEntries
7982    array.
7983  * pname:pMapEntries is a pointer to an array of
7984    sname:VkSpecializationMapEntry structures, which map constant IDs to
7985    offsets in pname:pData.
7986  * pname:dataSize is the byte size of the pname:pData buffer.
7987  * pname:pData contains the actual constant values to specialize with.
7988
7989.Valid Usage
7990****
7991  * [[VUID-VkSpecializationInfo-offset-00773]]
7992    The pname:offset member of each element of pname:pMapEntries must: be
7993    less than pname:dataSize
7994  * [[VUID-VkSpecializationInfo-pMapEntries-00774]]
7995    The pname:size member of each element of pname:pMapEntries must: be less
7996    than or equal to pname:dataSize minus pname:offset
7997  * [[VUID-VkSpecializationInfo-constantID-04911]]
7998    The pname:constantID value of each element of pname:pMapEntries must: be
7999    unique within pname:pMapEntries
8000****
8001
8002include::{generated}/validity/structs/VkSpecializationInfo.adoc[]
8003--
8004
8005[open,refpage='VkSpecializationMapEntry',desc='Structure specifying a specialization map entry',type='structs']
8006--
8007The sname:VkSpecializationMapEntry structure is defined as:
8008
8009include::{generated}/api/structs/VkSpecializationMapEntry.adoc[]
8010
8011  * pname:constantID is the ID of the specialization constant in SPIR-V.
8012  * pname:offset is the byte offset of the specialization constant value
8013    within the supplied data buffer.
8014  * pname:size is the byte size of the specialization constant value within
8015    the supplied data buffer.
8016
8017If a pname:constantID value is not a specialization constant ID used in the
8018shader, that map entry does not affect the behavior of the pipeline.
8019
8020.Valid Usage
8021****
8022  * [[VUID-VkSpecializationMapEntry-constantID-00776]]
8023    For a pname:constantID specialization constant declared in a shader,
8024    pname:size must: match the byte size of the pname:constantID.
8025    If the specialization constant is of type code:boolean, pname:size must:
8026    be the byte size of basetype:VkBool32
8027****
8028
8029include::{generated}/validity/structs/VkSpecializationMapEntry.adoc[]
8030--
8031
8032In human readable SPIR-V:
8033
8034[source,glsl]
8035----
8036OpDecorate %x SpecId 13 ; decorate .x component of WorkgroupSize with ID 13
8037OpDecorate %y SpecId 42 ; decorate .y component of WorkgroupSize with ID 42
8038OpDecorate %z SpecId 3  ; decorate .z component of WorkgroupSize with ID 3
8039OpDecorate %wgsize BuiltIn WorkgroupSize ; decorate WorkgroupSize onto constant
8040%i32 = OpTypeInt 32 0 ; declare an unsigned 32-bit type
8041%uvec3 = OpTypeVector %i32 3 ; declare a 3 element vector type of unsigned 32-bit
8042%x = OpSpecConstant %i32 1 ; declare the .x component of WorkgroupSize
8043%y = OpSpecConstant %i32 1 ; declare the .y component of WorkgroupSize
8044%z = OpSpecConstant %i32 1 ; declare the .z component of WorkgroupSize
8045%wgsize = OpSpecConstantComposite %uvec3 %x %y %z ; declare WorkgroupSize
8046----
8047
8048From the above we have three specialization constants, one for each of the
8049x, y & z elements of the WorkgroupSize vector.
8050
8051Now to specialize the above via the specialization constants mechanism:
8052
8053[source,c++]
8054----
8055const VkSpecializationMapEntry entries[] =
8056{
8057    {
8058        .constantID = 13,
8059        .offset = 0 * sizeof(uint32_t),
8060        .size = sizeof(uint32_t)
8061    },
8062    {
8063        .constantID = 42,
8064        .offset = 1 * sizeof(uint32_t),
8065        .size = sizeof(uint32_t)
8066    },
8067    {
8068        .constantID = 3,
8069        .offset = 2 * sizeof(uint32_t),
8070        .size = sizeof(uint32_t)
8071    }
8072};
8073
8074const uint32_t data[] = { 16, 8, 4 }; // our workgroup size is 16x8x4
8075
8076const VkSpecializationInfo info =
8077{
8078    .mapEntryCount = 3,
8079    .pMapEntries  = entries,
8080    .dataSize = 3 * sizeof(uint32_t),
8081    .pData = data,
8082};
8083----
8084
8085Then when calling flink:vkCreateComputePipelines, and passing the
8086sname:VkSpecializationInfo we defined as the pname:pSpecializationInfo
8087parameter of slink:VkPipelineShaderStageCreateInfo, we will create a compute
8088pipeline with the runtime specified local workgroup size.
8089
8090Another example would be that an application has a SPIR-V module that has
8091some platform-dependent constants they wish to use.
8092
8093In human readable SPIR-V:
8094
8095// [source,glsl]
8096[source,glsl]
8097----
8098OpDecorate %1 SpecId 0  ; decorate our signed 32-bit integer constant
8099OpDecorate %2 SpecId 12 ; decorate our 32-bit floating-point constant
8100%i32 = OpTypeInt 32 1   ; declare a signed 32-bit type
8101%float = OpTypeFloat 32 ; declare a 32-bit floating-point type
8102%1 = OpSpecConstant %i32 -1 ; some signed 32-bit integer constant
8103%2 = OpSpecConstant %float 0.5 ; some 32-bit floating-point constant
8104----
8105
8106From the above we have two specialization constants, one is a signed 32-bit
8107integer and the second is a 32-bit floating-point value.
8108
8109Now to specialize the above via the specialization constants mechanism:
8110
8111[source,c++]
8112----
8113struct SpecializationData {
8114    int32_t data0;
8115    float data1;
8116};
8117
8118const VkSpecializationMapEntry entries[] =
8119{
8120    {
8121        .constantID = 0,
8122        .offset = offsetof(SpecializationData, data0),
8123        .size = sizeof(SpecializationData::data0)
8124    },
8125    {
8126        .constantID = 12,
8127        .offset = offsetof(SpecializationData, data1),
8128        .size = sizeof(SpecializationData::data1)
8129    }
8130};
8131
8132SpecializationData data;
8133data.data0 = -42;    // set the data for the 32-bit integer
8134data.data1 = 42.0f;  // set the data for the 32-bit floating-point
8135
8136const VkSpecializationInfo info =
8137{
8138    .mapEntryCount = 2,
8139    .pMapEntries = entries,
8140    .dataSize = sizeof(data),
8141    .pdata = &data,
8142};
8143----
8144
8145It is legal for a SPIR-V module with specializations to be compiled into a
8146pipeline where no specialization information was provided.
8147SPIR-V specialization constants contain default values such that if a
8148specialization is not provided, the default value will be used.
8149In the examples above, it would be valid for an application to only
8150specialize some of the specialization constants within the SPIR-V module,
8151and let the other constants use their default values encoded within the
8152OpSpecConstant declarations.
8153
8154
8155ifdef::VK_KHR_pipeline_library[]
8156[[pipelines-library]]
8157== Pipeline Libraries
8158
8159A pipeline library is a special pipeline that was created using the
8160ename:VK_PIPELINE_CREATE_LIBRARY_BIT_KHR and cannot be bound, instead it
8161defines a set of pipeline state which can be linked into other pipelines.
8162ifdef::VK_KHR_ray_tracing_pipeline[]
8163For ray tracing pipelines this includes shaders and shader groups.
8164endif::VK_KHR_ray_tracing_pipeline[]
8165ifdef::VK_EXT_graphics_pipeline_library[]
8166For graphics pipelines this includes distinct library types defined by
8167elink:VkGraphicsPipelineLibraryFlagBitsEXT.
8168endif::VK_EXT_graphics_pipeline_library[]
8169The application must: maintain the lifetime of a pipeline library based on
8170the pipelines that link with it.
8171
8172This linkage is achieved by using the following structure within the
8173appropriate creation mechanisms:
8174
8175[open,refpage='VkPipelineLibraryCreateInfoKHR',desc='Structure specifying pipeline libraries to use when creating a pipeline',type='structs']
8176--
8177The sname:VkPipelineLibraryCreateInfoKHR structure is defined as:
8178
8179include::{generated}/api/structs/VkPipelineLibraryCreateInfoKHR.adoc[]
8180
8181  * pname:sType is a elink:VkStructureType value identifying this structure.
8182  * pname:pNext is `NULL` or a pointer to a structure extending this
8183    structure.
8184  * pname:libraryCount is the number of pipeline libraries in
8185    pname:pLibraries.
8186  * pname:pLibraries is a pointer to an array of slink:VkPipeline structures
8187    specifying pipeline libraries to use when creating a pipeline.
8188
8189.Valid Usage
8190****
8191  * [[VUID-VkPipelineLibraryCreateInfoKHR-pLibraries-03381]]
8192    Each element of pname:pLibraries must: have been created with
8193    ename:VK_PIPELINE_CREATE_LIBRARY_BIT_KHR
8194ifdef::VK_EXT_shader_module_identifier[]
8195  * [[VUID-VkPipelineLibraryCreateInfoKHR-pLibraries-06855]]
8196    If any library in pname:pLibraries was created with a shader stage with
8197    slink:VkPipelineShaderStageModuleIdentifierCreateInfoEXT and
8198    pname:identifierSize not equal to 0, the pipeline must: be created with
8199    the ename:VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT flag
8200    set
8201endif::VK_EXT_shader_module_identifier[]
8202ifdef::VK_EXT_descriptor_buffer[]
8203  * [[VUID-VkPipelineLibraryCreateInfoKHR-pLibraries-08096]]
8204    If any element of pname:pLibraries was created with
8205    ename:VK_PIPELINE_CREATE_DESCRIPTOR_BUFFER_BIT_EXT, all elements must:
8206    have been created with
8207    ename:VK_PIPELINE_CREATE_DESCRIPTOR_BUFFER_BIT_EXT
8208endif::VK_EXT_descriptor_buffer[]
8209ifdef::VK_EXT_pipeline_protected_access[]
8210  * [[VUID-VkPipelineLibraryCreateInfoKHR-pipeline-07404]]
8211    If pname:pipeline is being created with
8212    ename:VK_PIPELINE_CREATE_NO_PROTECTED_ACCESS_BIT_EXT, every element of
8213    pname:pLibraries must: have been created with
8214    ename:VK_PIPELINE_CREATE_NO_PROTECTED_ACCESS_BIT_EXT
8215  * [[VUID-VkPipelineLibraryCreateInfoKHR-pipeline-07405]]
8216    If pname:pipeline is being created without
8217    ename:VK_PIPELINE_CREATE_NO_PROTECTED_ACCESS_BIT_EXT, every element of
8218    pname:pLibraries must: have been created without
8219    ename:VK_PIPELINE_CREATE_NO_PROTECTED_ACCESS_BIT_EXT
8220  * [[VUID-VkPipelineLibraryCreateInfoKHR-pipeline-07406]]
8221    If pname:pipeline is being created with
8222    ename:VK_PIPELINE_CREATE_PROTECTED_ACCESS_ONLY_BIT_EXT, every element of
8223    pname:pLibraries must: have been created with
8224    ename:VK_PIPELINE_CREATE_PROTECTED_ACCESS_ONLY_BIT_EXT
8225  * [[VUID-VkPipelineLibraryCreateInfoKHR-pipeline-07407]]
8226    If pname:pipeline is being created without
8227    ename:VK_PIPELINE_CREATE_PROTECTED_ACCESS_ONLY_BIT_EXT, every element of
8228    pname:pLibraries must: have been created without
8229    ename:VK_PIPELINE_CREATE_PROTECTED_ACCESS_ONLY_BIT_EXT
8230endif::VK_EXT_pipeline_protected_access[]
8231****
8232
8233include::{generated}/validity/structs/VkPipelineLibraryCreateInfoKHR.adoc[]
8234--
8235
8236Pipelines created with ename:VK_PIPELINE_CREATE_LIBRARY_BIT_KHR libraries
8237can: depend on other pipeline libraries in
8238slink:VkPipelineLibraryCreateInfoKHR.
8239
8240A pipeline library is considered in-use, as long as one of the linking
8241pipelines is in-use.
8242This applies recursively if a pipeline library includes other pipeline
8243libraries.
8244
8245endif::VK_KHR_pipeline_library[]
8246
8247
8248[[pipelines-binding]]
8249== Pipeline Binding
8250
8251[open,refpage='vkCmdBindPipeline',desc='Bind a pipeline object to a command buffer',type='protos']
8252--
8253Once a pipeline has been created, it can: be bound to the command buffer
8254using the command:
8255
8256include::{generated}/api/protos/vkCmdBindPipeline.adoc[]
8257
8258  * pname:commandBuffer is the command buffer that the pipeline will be
8259    bound to.
8260  * pname:pipelineBindPoint is a elink:VkPipelineBindPoint value specifying
8261    to which bind point the pipeline is bound.
8262    Binding one does not disturb the others.
8263  * pname:pipeline is the pipeline to be bound.
8264
8265[[pipelines-bindpoint-commands]]
8266Once bound, a pipeline binding affects subsequent commands that interact
8267with the given pipeline type in the command buffer until a different
8268pipeline of the same type is bound to the bind
8269ifdef::VK_EXT_shader_object[]
8270point, or until the pipeline bind point is disturbed by binding a
8271<<shaders-objects, shader object>> as described in
8272<<shaders-objects-pipeline-interaction, Interaction with Pipelines>>.
8273endif::VK_EXT_shader_object[]
8274ifndef::VK_EXT_shader_object[]
8275point.
8276endif::VK_EXT_shader_object[]
8277Commands that do not interact with the <<shaders-binding,given pipeline>>
8278type must: not be affected by the pipeline state.
8279
8280.Valid Usage
8281****
8282  * [[VUID-vkCmdBindPipeline-pipelineBindPoint-00777]]
8283    If pname:pipelineBindPoint is ename:VK_PIPELINE_BIND_POINT_COMPUTE, the
8284    sname:VkCommandPool that pname:commandBuffer was allocated from must:
8285    support compute operations
8286  * [[VUID-vkCmdBindPipeline-pipelineBindPoint-00778]]
8287    If pname:pipelineBindPoint is ename:VK_PIPELINE_BIND_POINT_GRAPHICS, the
8288    sname:VkCommandPool that pname:commandBuffer was allocated from must:
8289    support graphics operations
8290  * [[VUID-vkCmdBindPipeline-pipelineBindPoint-00779]]
8291    If pname:pipelineBindPoint is ename:VK_PIPELINE_BIND_POINT_COMPUTE,
8292    pname:pipeline must: be a compute pipeline
8293  * [[VUID-vkCmdBindPipeline-pipelineBindPoint-00780]]
8294    If pname:pipelineBindPoint is ename:VK_PIPELINE_BIND_POINT_GRAPHICS,
8295    pname:pipeline must: be a graphics pipeline
8296  * [[VUID-vkCmdBindPipeline-pipeline-00781]]
8297    If the <<features-variableMultisampleRate,
8298    pname:variableMultisampleRate>> feature is not supported, pname:pipeline
8299    is a graphics pipeline, the current subpass <<renderpass-noattachments,
8300    uses no attachments>>, and this is not the first call to this function
8301    with a graphics pipeline after transitioning to the current subpass,
8302    then the sample count specified by this pipeline must: match that set in
8303    the previous pipeline
8304ifdef::VK_EXT_sample_locations[]
8305  * [[VUID-vkCmdBindPipeline-variableSampleLocations-01525]]
8306    If
8307    slink:VkPhysicalDeviceSampleLocationsPropertiesEXT::pname:variableSampleLocations
8308    is ename:VK_FALSE, and pname:pipeline is a graphics pipeline created
8309    with a slink:VkPipelineSampleLocationsStateCreateInfoEXT structure
8310    having its pname:sampleLocationsEnable member set to ename:VK_TRUE but
8311    without ename:VK_DYNAMIC_STATE_SAMPLE_LOCATIONS_EXT enabled then the
8312    current render pass instance must: have been begun by specifying a
8313    slink:VkRenderPassSampleLocationsBeginInfoEXT structure whose
8314    pname:pPostSubpassSampleLocations member contains an element with a
8315    pname:subpassIndex matching the current subpass index and the
8316    pname:sampleLocationsInfo member of that element must: match the
8317    pname:sampleLocationsInfo specified in
8318    slink:VkPipelineSampleLocationsStateCreateInfoEXT when the pipeline was
8319    created
8320endif::VK_EXT_sample_locations[]
8321ifdef::VK_EXT_transform_feedback[]
8322  * [[VUID-vkCmdBindPipeline-None-02323]]
8323    This command must: not be recorded when transform feedback is active
8324endif::VK_EXT_transform_feedback[]
8325ifdef::VK_NV_ray_tracing,VK_KHR_ray_tracing_pipeline[]
8326  * [[VUID-vkCmdBindPipeline-pipelineBindPoint-02391]]
8327    If pname:pipelineBindPoint is
8328    ename:VK_PIPELINE_BIND_POINT_RAY_TRACING_KHR, the sname:VkCommandPool
8329    that pname:commandBuffer was allocated from must: support compute
8330    operations
8331  * [[VUID-vkCmdBindPipeline-pipelineBindPoint-02392]]
8332    If pname:pipelineBindPoint is
8333    ename:VK_PIPELINE_BIND_POINT_RAY_TRACING_KHR, pname:pipeline must: be a
8334    ray tracing pipeline
8335  * [[VUID-vkCmdBindPipeline-pipelineBindPoint-06721]]
8336    If pname:pipelineBindPoint is
8337    ename:VK_PIPELINE_BIND_POINT_RAY_TRACING_KHR, pname:commandBuffer must:
8338    not be a protected command buffer
8339endif::VK_NV_ray_tracing,VK_KHR_ray_tracing_pipeline[]
8340ifdef::VK_EXT_pipeline_protected_access[]
8341  * [[VUID-vkCmdBindPipeline-pipelineProtectedAccess-07408]]
8342    If the <<features-pipelineProtectedAccess,
8343    pname:pipelineProtectedAccess>> feature is enabled, and
8344    pname:commandBuffer is a protected command buffer, pname:pipeline must:
8345    have been created without
8346    ename:VK_PIPELINE_CREATE_NO_PROTECTED_ACCESS_BIT_EXT
8347  * [[VUID-vkCmdBindPipeline-pipelineProtectedAccess-07409]]
8348    If the <<features-pipelineProtectedAccess,
8349    pname:pipelineProtectedAccess>> feature is enabled, and
8350    pname:commandBuffer is not a protected command buffer, pname:pipeline
8351    must: have been created without
8352    ename:VK_PIPELINE_CREATE_PROTECTED_ACCESS_ONLY_BIT_EXT
8353endif::VK_EXT_pipeline_protected_access[]
8354ifdef::VK_KHR_pipeline_library[]
8355  * [[VUID-vkCmdBindPipeline-pipeline-03382]]
8356    pname:pipeline must: not have been created with
8357    ename:VK_PIPELINE_CREATE_LIBRARY_BIT_KHR set
8358endif::VK_KHR_pipeline_library[]
8359ifdef::VK_NV_inherited_viewport_scissor[]
8360  * [[VUID-vkCmdBindPipeline-commandBuffer-04808]]
8361    If pname:commandBuffer is a secondary command buffer with
8362    slink:VkCommandBufferInheritanceViewportScissorInfoNV::pname:viewportScissor2D
8363    enabled and pname:pipelineBindPoint is
8364    ename:VK_PIPELINE_BIND_POINT_GRAPHICS, then the pname:pipeline must:
8365    have been created with ename:VK_DYNAMIC_STATE_VIEWPORT_WITH_COUNT or
8366    ename:VK_DYNAMIC_STATE_VIEWPORT, and
8367    ename:VK_DYNAMIC_STATE_SCISSOR_WITH_COUNT or
8368    ename:VK_DYNAMIC_STATE_SCISSOR enabled
8369endif::VK_NV_inherited_viewport_scissor[]
8370ifdef::VK_NV_inherited_viewport_scissor,VK_EXT_discard_rectangles[]
8371  * [[VUID-vkCmdBindPipeline-commandBuffer-04809]]
8372    If pname:commandBuffer is a secondary command buffer with
8373    slink:VkCommandBufferInheritanceViewportScissorInfoNV::pname:viewportScissor2D
8374    enabled and pname:pipelineBindPoint is
8375    ename:VK_PIPELINE_BIND_POINT_GRAPHICS and pname:pipeline was created
8376    with slink:VkPipelineDiscardRectangleStateCreateInfoEXT structure and
8377    its pname:discardRectangleCount member is not `0`, or the pipeline was
8378    created with ename:VK_DYNAMIC_STATE_DISCARD_RECTANGLE_ENABLE_EXT
8379    enabled, then the pipeline must: have been created with
8380    ename:VK_DYNAMIC_STATE_DISCARD_RECTANGLE_EXT enabled
8381endif::VK_NV_inherited_viewport_scissor,VK_EXT_discard_rectangles[]
8382ifdef::VK_EXT_provoking_vertex[]
8383  * [[VUID-vkCmdBindPipeline-pipelineBindPoint-04881]]
8384    If pname:pipelineBindPoint is ename:VK_PIPELINE_BIND_POINT_GRAPHICS and
8385    the <<limits-provokingVertexModePerPipeline,
8386    pname:provokingVertexModePerPipeline>> limit is ename:VK_FALSE, then
8387    pipeline's
8388    slink:VkPipelineRasterizationProvokingVertexStateCreateInfoEXT::pname:provokingVertexMode
8389    must: be the same as that of any other pipelines previously bound to
8390    this bind point within the current render pass instance, including any
8391    pipeline already bound when beginning the render pass instance
8392endif::VK_EXT_provoking_vertex[]
8393ifdef::VK_HUAWEI_subpass_shading[]
8394  * [[VUID-vkCmdBindPipeline-pipelineBindPoint-04949]]
8395    If pname:pipelineBindPoint is
8396    ename:VK_PIPELINE_BIND_POINT_SUBPASS_SHADING_HUAWEI, the
8397    sname:VkCommandPool that pname:commandBuffer was allocated from must:
8398    support compute operations
8399  * [[VUID-vkCmdBindPipeline-pipelineBindPoint-04950]]
8400    If pname:pipelineBindPoint is
8401    ename:VK_PIPELINE_BIND_POINT_SUBPASS_SHADING_HUAWEI, pname:pipeline
8402    must: be a subpass shading pipeline
8403endif::VK_HUAWEI_subpass_shading[]
8404****
8405
8406include::{generated}/validity/protos/vkCmdBindPipeline.adoc[]
8407--
8408
8409[open,refpage='VkPipelineBindPoint',desc='Specify the bind point of a pipeline object to a command buffer',type='enums']
8410--
8411Possible values of flink:vkCmdBindPipeline::pname:pipelineBindPoint,
8412specifying the bind point of a pipeline object, are:
8413
8414include::{generated}/api/enums/VkPipelineBindPoint.adoc[]
8415
8416  * ename:VK_PIPELINE_BIND_POINT_COMPUTE specifies binding as a compute
8417    pipeline.
8418  * ename:VK_PIPELINE_BIND_POINT_GRAPHICS specifies binding as a graphics
8419    pipeline.
8420ifdef::VK_NV_ray_tracing,VK_KHR_ray_tracing_pipeline[]
8421  * ename:VK_PIPELINE_BIND_POINT_RAY_TRACING_KHR specifies binding as a ray
8422    tracing pipeline.
8423endif::VK_NV_ray_tracing,VK_KHR_ray_tracing_pipeline[]
8424ifdef::VK_HUAWEI_subpass_shading[]
8425  * ename:VK_PIPELINE_BIND_POINT_SUBPASS_SHADING_HUAWEI specifies binding as
8426    a subpass shading pipeline.
8427endif::VK_HUAWEI_subpass_shading[]
8428ifdef::VK_AMDX_shader_enqueue[]
8429  * ename:VK_PIPELINE_BIND_POINT_EXECUTION_GRAPH_AMDX specifies binding as
8430    an <<executiongraphs, execution graph pipeline>>.
8431endif::VK_AMDX_shader_enqueue[]
8432--
8433
8434ifdef::VK_NV_device_generated_commands[]
8435[open,refpage='vkCmdBindPipelineShaderGroupNV',desc='Bind a pipeline object's shader group to a command buffer',type='protos']
8436--
8437For pipelines that were created with the support of multiple shader groups
8438(see <<graphics-shadergroups,Graphics Pipeline Shader Groups>>), the regular
8439fname:vkCmdBindPipeline command will bind Shader Group `0`.
8440To explicitly bind a shader group use:
8441
8442include::{generated}/api/protos/vkCmdBindPipelineShaderGroupNV.adoc[]
8443
8444  * pname:commandBuffer is the command buffer that the pipeline will be
8445    bound to.
8446  * pname:pipelineBindPoint is a elink:VkPipelineBindPoint value specifying
8447    the bind point to which the pipeline will be bound.
8448  * pname:pipeline is the pipeline to be bound.
8449  * pname:groupIndex is the shader group to be bound.
8450
8451
8452.Valid Usage
8453****
8454  * [[VUID-vkCmdBindPipelineShaderGroupNV-groupIndex-02893]]
8455    pname:groupIndex must: be `0` or less than the effective
8456    slink:VkGraphicsPipelineShaderGroupsCreateInfoNV::pname:groupCount
8457    including the referenced pipelines
8458  * [[VUID-vkCmdBindPipelineShaderGroupNV-pipelineBindPoint-02894]]
8459    The pname:pipelineBindPoint must: be
8460    ename:VK_PIPELINE_BIND_POINT_GRAPHICS
8461  * [[VUID-vkCmdBindPipelineShaderGroupNV-groupIndex-02895]]
8462    The same restrictions as flink:vkCmdBindPipeline apply as if the bound
8463    pipeline was created only with the Shader Group from the
8464    pname:groupIndex information
8465  * [[VUID-vkCmdBindPipelineShaderGroupNV-deviceGeneratedCommands-02896]]
8466    The <<features-deviceGeneratedCommands, pname:deviceGeneratedCommands>>
8467    feature must: be enabled
8468****
8469
8470include::{generated}/validity/protos/vkCmdBindPipelineShaderGroupNV.adoc[]
8471--
8472endif::VK_NV_device_generated_commands[]
8473
8474ifdef::VK_EXT_shader_object[]
8475[[pipelines-shader-object-interaction]]
8476=== Interaction With Shader Objects
8477
8478If the <<features-shaderObject, pname:shaderObject>> feature is enabled,
8479applications can: use both pipelines and <<shaders-objects, shader objects>>
8480at the same time.
8481The interaction between pipelines and shader objects is described in
8482<<shaders-objects-pipeline-interaction, Interaction with Pipelines>>.
8483endif::VK_EXT_shader_object[]
8484
8485[[pipelines-dynamic-state]]
8486== Dynamic State
8487
8488When a pipeline object is bound, any pipeline object state that is not
8489specified as dynamic is applied to the command buffer state.
8490Pipeline object state that is specified as dynamic is not applied to the
8491command buffer state at this time.
8492Instead, dynamic state can: be modified at any time and persists for the
8493lifetime of the command buffer, or until modified by another dynamic state
8494setting command, or made invalid by another pipeline bind with that state
8495specified as static.
8496
8497When a pipeline object is bound, the following applies to each state
8498parameter:
8499
8500  * If the state is not specified as dynamic in the new pipeline object,
8501    then that command buffer state is overwritten by the state in the new
8502    pipeline object.
8503    Before any draw or dispatch call with this pipeline there must: not have
8504    been any calls to any of the corresponding dynamic state setting
8505    commands after this pipeline was bound.
8506  * If the state is specified as dynamic in the new pipeline object, then
8507    that command buffer state is not disturbed.
8508    Before any draw or dispatch call with this pipeline there must: have
8509    been at least one call to each of the corresponding dynamic state
8510    setting commands.
8511    The state-setting commands must: be recorded after command buffer
8512    recording was begun, or after the last command binding a pipeline object
8513    with that state specified as static, whichever was the latter.
8514  * If the state is not included (corresponding pointer in
8515    slink:VkGraphicsPipelineCreateInfo was `NULL` or was ignored) in the new
8516    pipeline object, then that command buffer state is not disturbed.
8517ifdef::VK_NV_mesh_shader,VK_EXT_mesh_shader[]
8518    For example, mesh shading pipelines do not include vertex input state
8519    and therefore do not disturb any such command buffer state.
8520endif::VK_NV_mesh_shader,VK_EXT_mesh_shader[]
8521
8522Dynamic state that does not affect the result of operations can: be left
8523undefined:.
8524
8525[NOTE]
8526.Note
8527====
8528For example, if blending is disabled by the pipeline object state then the
8529dynamic color blend constants do not need to be specified in the command
8530buffer, even if this state is specified as dynamic in the pipeline object.
8531====
8532
8533
8534ifdef::VK_AMD_shader_info,VK_KHR_pipeline_executable_properties,VK_EXT_pipeline_properties[]
8535[[pipelines-shader-information]]
8536== Pipeline Properties and Shader Information
8537endif::VK_AMD_shader_info,VK_KHR_pipeline_executable_properties,VK_EXT_pipeline_properties[]
8538
8539ifdef::VK_KHR_pipeline_executable_properties[]
8540[open,refpage='vkGetPipelineExecutablePropertiesKHR',desc='Get the executables associated with a pipeline',type='protos']
8541--
8542When a pipeline is created, its state and shaders are compiled into zero or
8543more device-specific executables, which are used when executing commands
8544against that pipeline.
8545To query the properties of these pipeline executables, call:
8546
8547include::{generated}/api/protos/vkGetPipelineExecutablePropertiesKHR.adoc[]
8548
8549  * pname:device is the device that created the pipeline.
8550  * pname:pPipelineInfo describes the pipeline being queried.
8551  * pname:pExecutableCount is a pointer to an integer related to the number
8552    of pipeline executables available or queried, as described below.
8553  * pname:pProperties is either `NULL` or a pointer to an array of
8554    slink:VkPipelineExecutablePropertiesKHR structures.
8555
8556If pname:pProperties is `NULL`, then the number of pipeline executables
8557associated with the pipeline is returned in pname:pExecutableCount.
8558Otherwise, pname:pExecutableCount must: point to a variable set by the user
8559to the number of elements in the pname:pProperties array, and on return the
8560variable is overwritten with the number of structures actually written to
8561pname:pProperties.
8562If pname:pExecutableCount is less than the number of pipeline executables
8563associated with the pipeline, at most pname:pExecutableCount structures will
8564be written, and ename:VK_INCOMPLETE will be returned instead of
8565ename:VK_SUCCESS, to indicate that not all the available properties were
8566returned.
8567
8568.Valid Usage
8569****
8570  * [[VUID-vkGetPipelineExecutablePropertiesKHR-pipelineExecutableInfo-03270]]
8571    The <<features-pipelineExecutableInfo, pname:pipelineExecutableInfo>>
8572    feature must: be enabled
8573  * [[VUID-vkGetPipelineExecutablePropertiesKHR-pipeline-03271]]
8574    The pname:pipeline member of pname:pPipelineInfo must: have been created
8575    with pname:device
8576****
8577
8578include::{generated}/validity/protos/vkGetPipelineExecutablePropertiesKHR.adoc[]
8579--
8580
8581[open,refpage='VkPipelineExecutablePropertiesKHR',desc='Structure describing a pipeline executable',type='structs']
8582--
8583The sname:VkPipelineExecutablePropertiesKHR structure is defined as:
8584
8585include::{generated}/api/structs/VkPipelineExecutablePropertiesKHR.adoc[]
8586
8587  * pname:sType is a elink:VkStructureType value identifying this structure.
8588  * pname:pNext is `NULL` or a pointer to a structure extending this
8589    structure.
8590  * pname:stages is a bitmask of zero or more elink:VkShaderStageFlagBits
8591    indicating which shader stages (if any) were principally used as inputs
8592    to compile this pipeline executable.
8593  * pname:name is an array of ename:VK_MAX_DESCRIPTION_SIZE code:char
8594    containing a null-terminated UTF-8 string which is a short human
8595    readable name for this pipeline executable.
8596  * pname:description is an array of ename:VK_MAX_DESCRIPTION_SIZE code:char
8597    containing a null-terminated UTF-8 string which is a human readable
8598    description for this pipeline executable.
8599  * pname:subgroupSize is the subgroup size with which this pipeline
8600    executable is dispatched.
8601
8602Not all implementations have a 1:1 mapping between shader stages and
8603pipeline executables and some implementations may: reduce a given shader
8604stage to fixed function hardware programming such that no pipeline
8605executable is available.
8606No guarantees are provided about the mapping between shader stages and
8607pipeline executables and pname:stages should: be considered a best effort
8608hint.
8609Because the application cannot: rely on the pname:stages field to provide an
8610exact description, pname:name and pname:description provide a human readable
8611name and description which more accurately describes the given pipeline
8612executable.
8613
8614include::{generated}/validity/structs/VkPipelineExecutablePropertiesKHR.adoc[]
8615--
8616endif::VK_KHR_pipeline_executable_properties[]
8617
8618ifdef::VK_EXT_pipeline_properties[]
8619[open,refpage='vkGetPipelinePropertiesEXT',desc='Query pipeline properties',type='protos']
8620--
8621To query the pipeline properties call:
8622
8623include::{generated}/api/protos/vkGetPipelinePropertiesEXT.adoc[]
8624
8625  * pname:device is the logical device that created the pipeline.
8626  * pname:pPipelineInfo is a pointer to a slink:VkPipelineInfoEXT structure
8627    which describes the pipeline being queried.
8628  * pname:pPipelineProperties is a pointer to a slink:VkBaseOutStructure
8629    structure in which the pipeline properties will be written.
8630
8631To query a pipeline's pname:pipelineIdentifier pass a
8632slink:VkPipelinePropertiesIdentifierEXT structure in
8633pname:pPipelineProperties.
8634Each pipeline is associated with a pname:pipelineIdentifier and the
8635identifier is implementation specific.
8636
8637.Valid Usage
8638****
8639  * [[VUID-vkGetPipelinePropertiesEXT-pipeline-06738]]
8640    The pname:pipeline member of pname:pPipelineInfo must: have been created
8641    with pname:device
8642  * [[VUID-vkGetPipelinePropertiesEXT-pPipelineProperties-06739]]
8643    pname:pPipelineProperties must: be a valid pointer to a
8644    slink:VkPipelinePropertiesIdentifierEXT structure
8645  * [[VUID-vkGetPipelinePropertiesEXT-None-06766]]
8646    The <<features-pipelinePropertiesIdentifier,
8647    pname:pipelinePropertiesIdentifier>> feature must: be enabled
8648****
8649
8650include::{generated}/validity/protos/vkGetPipelinePropertiesEXT.adoc[]
8651--
8652
8653[open,refpage='VkPipelinePropertiesIdentifierEXT',desc='Structure used to retrieve pipeline properties',type='structs']
8654--
8655The sname:VkPipelinePropertiesIdentifierEXT structure is defined as:
8656
8657include::{generated}/api/structs/VkPipelinePropertiesIdentifierEXT.adoc[]
8658
8659  * pname:sType is a elink:VkStructureType value identifying this structure.
8660  * pname:pNext is `NULL` or a pointer to a structure extending this
8661    structure.
8662  * pname:pipelineIdentifier is an array of ename:VK_UUID_SIZE code:uint8_t
8663    values into which the pipeline identifier will be written.
8664
8665include::{generated}/validity/structs/VkPipelinePropertiesIdentifierEXT.adoc[]
8666--
8667endif::VK_EXT_pipeline_properties[]
8668
8669// This structure is used by both vkGetPipelineExecutablePropertiesKHR and
8670// vkGetPipelinePropertiesEXT above, placing it in a nonstandard position.
8671ifdef::VK_KHR_pipeline_executable_properties,VK_EXT_pipeline_properties[]
8672[open,refpage='VkPipelineInfoKHR',desc='Structure describing a pipeline',type='structs',alias='VkPipelineInfoEXT']
8673--
8674The sname:VkPipelineInfoKHR structure is defined as:
8675
8676include::{generated}/api/structs/VkPipelineInfoKHR.adoc[]
8677
8678ifdef::VK_EXT_pipeline_properties[]
8679or the equivalent
8680
8681include::{generated}/api/structs/VkPipelineInfoEXT.adoc[]
8682endif::VK_EXT_pipeline_properties[]
8683
8684  * pname:sType is a elink:VkStructureType value identifying this structure.
8685  * pname:pNext is `NULL` or a pointer to a structure extending this
8686    structure.
8687  * pname:pipeline is a sname:VkPipeline handle.
8688
8689include::{generated}/validity/structs/VkPipelineInfoKHR.adoc[]
8690--
8691endif::VK_KHR_pipeline_executable_properties,VK_EXT_pipeline_properties[]
8692
8693ifdef::VK_KHR_pipeline_executable_properties[]
8694[open,refpage='vkGetPipelineExecutableStatisticsKHR',desc='Get compile time statistics associated with a pipeline executable',type='protos']
8695--
8696Each pipeline executable may: have a set of statistics associated with it
8697that are generated by the pipeline compilation process.
8698These statistics may: include things such as instruction counts, amount of
8699spilling (if any), maximum number of simultaneous threads, or anything else
8700which may: aid developers in evaluating the expected performance of a
8701shader.
8702To query the compile time statistics associated with a pipeline executable,
8703call:
8704
8705include::{generated}/api/protos/vkGetPipelineExecutableStatisticsKHR.adoc[]
8706
8707  * pname:device is the device that created the pipeline.
8708  * pname:pExecutableInfo describes the pipeline executable being queried.
8709  * pname:pStatisticCount is a pointer to an integer related to the number
8710    of statistics available or queried, as described below.
8711  * pname:pStatistics is either `NULL` or a pointer to an array of
8712    slink:VkPipelineExecutableStatisticKHR structures.
8713
8714If pname:pStatistics is `NULL`, then the number of statistics associated
8715with the pipeline executable is returned in pname:pStatisticCount.
8716Otherwise, pname:pStatisticCount must: point to a variable set by the user
8717to the number of elements in the pname:pStatistics array, and on return the
8718variable is overwritten with the number of structures actually written to
8719pname:pStatistics.
8720If pname:pStatisticCount is less than the number of statistics associated
8721with the pipeline executable, at most pname:pStatisticCount structures will
8722be written, and ename:VK_INCOMPLETE will be returned instead of
8723ename:VK_SUCCESS, to indicate that not all the available statistics were
8724returned.
8725
8726.Valid Usage
8727****
8728  * [[VUID-vkGetPipelineExecutableStatisticsKHR-pipelineExecutableInfo-03272]]
8729    The <<features-pipelineExecutableInfo, pname:pipelineExecutableInfo>>
8730    feature must: be enabled
8731  * [[VUID-vkGetPipelineExecutableStatisticsKHR-pipeline-03273]]
8732    The pname:pipeline member of pname:pExecutableInfo must: have been
8733    created with pname:device
8734  * [[VUID-vkGetPipelineExecutableStatisticsKHR-pipeline-03274]]
8735    The pname:pipeline member of pname:pExecutableInfo must: have been
8736    created with ename:VK_PIPELINE_CREATE_CAPTURE_STATISTICS_BIT_KHR
8737****
8738
8739include::{generated}/validity/protos/vkGetPipelineExecutableStatisticsKHR.adoc[]
8740--
8741
8742[open,refpage='VkPipelineExecutableInfoKHR',desc='Structure describing a pipeline executable to query for associated statistics or internal representations',type='structs']
8743--
8744The sname:VkPipelineExecutableInfoKHR structure is defined as:
8745
8746include::{generated}/api/structs/VkPipelineExecutableInfoKHR.adoc[]
8747
8748  * pname:sType is a elink:VkStructureType value identifying this structure.
8749  * pname:pNext is `NULL` or a pointer to a structure extending this
8750    structure.
8751  * pname:pipeline is the pipeline to query.
8752  * pname:executableIndex is the index of the pipeline executable to query
8753    in the array of executable properties returned by
8754    flink:vkGetPipelineExecutablePropertiesKHR.
8755
8756.Valid Usage
8757****
8758  * [[VUID-VkPipelineExecutableInfoKHR-executableIndex-03275]]
8759    pname:executableIndex must: be less than the number of pipeline
8760    executables associated with pname:pipeline as returned in the
8761    pname:pExecutableCount parameter of
8762    fname:vkGetPipelineExecutablePropertiesKHR
8763****
8764
8765include::{generated}/validity/structs/VkPipelineExecutableInfoKHR.adoc[]
8766--
8767
8768[open,refpage='VkPipelineExecutableStatisticKHR',desc='Structure describing a compile time pipeline executable statistic',type='structs']
8769--
8770The sname:VkPipelineExecutableStatisticKHR structure is defined as:
8771
8772include::{generated}/api/structs/VkPipelineExecutableStatisticKHR.adoc[]
8773
8774  * pname:sType is a elink:VkStructureType value identifying this structure.
8775  * pname:pNext is `NULL` or a pointer to a structure extending this
8776    structure.
8777  * pname:name is an array of ename:VK_MAX_DESCRIPTION_SIZE code:char
8778    containing a null-terminated UTF-8 string which is a short human
8779    readable name for this statistic.
8780  * pname:description is an array of ename:VK_MAX_DESCRIPTION_SIZE code:char
8781    containing a null-terminated UTF-8 string which is a human readable
8782    description for this statistic.
8783  * pname:format is a elink:VkPipelineExecutableStatisticFormatKHR value
8784    specifying the format of the data found in pname:value.
8785  * pname:value is the value of this statistic.
8786
8787include::{generated}/validity/structs/VkPipelineExecutableStatisticKHR.adoc[]
8788--
8789
8790[open,refpage='VkPipelineExecutableStatisticFormatKHR',desc='Enum describing a pipeline executable statistic's data format',type='enums']
8791--
8792The ename:VkPipelineExecutableStatisticFormatKHR enum is defined as:
8793
8794include::{generated}/api/enums/VkPipelineExecutableStatisticFormatKHR.adoc[]
8795
8796  * ename:VK_PIPELINE_EXECUTABLE_STATISTIC_FORMAT_BOOL32_KHR specifies that
8797    the statistic is returned as a 32-bit boolean value which must: be
8798    either ename:VK_TRUE or ename:VK_FALSE and should: be read from the
8799    fname:b32 field of sname:VkPipelineExecutableStatisticValueKHR.
8800  * ename:VK_PIPELINE_EXECUTABLE_STATISTIC_FORMAT_INT64_KHR specifies that
8801    the statistic is returned as a signed 64-bit integer and should: be read
8802    from the fname:i64 field of sname:VkPipelineExecutableStatisticValueKHR.
8803  * ename:VK_PIPELINE_EXECUTABLE_STATISTIC_FORMAT_UINT64_KHR specifies that
8804    the statistic is returned as an unsigned 64-bit integer and should: be
8805    read from the fname:u64 field of
8806    sname:VkPipelineExecutableStatisticValueKHR.
8807  * ename:VK_PIPELINE_EXECUTABLE_STATISTIC_FORMAT_FLOAT64_KHR specifies that
8808    the statistic is returned as a 64-bit floating-point value and should:
8809    be read from the fname:f64 field of
8810    sname:VkPipelineExecutableStatisticValueKHR.
8811--
8812
8813[open,refpage='VkPipelineExecutableStatisticValueKHR',desc='A union describing a pipeline executable statistic's value',type='structs']
8814--
8815The sname:VkPipelineExecutableStatisticValueKHR union is defined as:
8816
8817include::{generated}/api/structs/VkPipelineExecutableStatisticValueKHR.adoc[]
8818
8819  * pname:b32 is the 32-bit boolean value if the
8820    ename:VkPipelineExecutableStatisticFormatKHR is
8821    ename:VK_PIPELINE_EXECUTABLE_STATISTIC_FORMAT_BOOL32_KHR.
8822  * pname:i64 is the signed 64-bit integer value if the
8823    ename:VkPipelineExecutableStatisticFormatKHR is
8824    ename:VK_PIPELINE_EXECUTABLE_STATISTIC_FORMAT_INT64_KHR.
8825  * pname:u64 is the unsigned 64-bit integer value if the
8826    ename:VkPipelineExecutableStatisticFormatKHR is
8827    ename:VK_PIPELINE_EXECUTABLE_STATISTIC_FORMAT_UINT64_KHR.
8828  * pname:f64 is the 64-bit floating-point value if the
8829    ename:VkPipelineExecutableStatisticFormatKHR is
8830    ename:VK_PIPELINE_EXECUTABLE_STATISTIC_FORMAT_FLOAT64_KHR.
8831
8832include::{generated}/validity/structs/VkPipelineExecutableStatisticValueKHR.adoc[]
8833--
8834
8835[open,refpage='vkGetPipelineExecutableInternalRepresentationsKHR',desc='Get internal representations of the pipeline executable',type='protos']
8836--
8837Each pipeline executable may: have one or more text or binary internal
8838representations associated with it which are generated as part of the
8839compile process.
8840These may: include the final shader assembly, a binary form of the compiled
8841shader, or the shader compiler's internal representation at any number of
8842intermediate compile steps.
8843To query the internal representations associated with a pipeline executable,
8844call:
8845
8846include::{generated}/api/protos/vkGetPipelineExecutableInternalRepresentationsKHR.adoc[]
8847
8848  * pname:device is the device that created the pipeline.
8849  * pname:pExecutableInfo describes the pipeline executable being queried.
8850  * pname:pInternalRepresentationCount is a pointer to an integer related to
8851    the number of internal representations available or queried, as
8852    described below.
8853  * pname:pInternalRepresentations is either `NULL` or a pointer to an array
8854    of slink:VkPipelineExecutableInternalRepresentationKHR structures.
8855
8856If pname:pInternalRepresentations is `NULL`, then the number of internal
8857representations associated with the pipeline executable is returned in
8858pname:pInternalRepresentationCount.
8859Otherwise, pname:pInternalRepresentationCount must: point to a variable set
8860by the user to the number of elements in the pname:pInternalRepresentations
8861array, and on return the variable is overwritten with the number of
8862structures actually written to pname:pInternalRepresentations.
8863If pname:pInternalRepresentationCount is less than the number of internal
8864representations associated with the pipeline executable, at most
8865pname:pInternalRepresentationCount structures will be written, and
8866ename:VK_INCOMPLETE will be returned instead of ename:VK_SUCCESS, to
8867indicate that not all the available representations were returned.
8868
8869While the details of the internal representations remain
8870implementation-dependent, the implementation should: order the internal
8871representations in the order in which they occur in the compiled pipeline
8872with the final shader assembly (if any) last.
8873
8874.Valid Usage
8875****
8876  * [[VUID-vkGetPipelineExecutableInternalRepresentationsKHR-pipelineExecutableInfo-03276]]
8877    The <<features-pipelineExecutableInfo, pname:pipelineExecutableInfo>>
8878    feature must: be enabled
8879  * [[VUID-vkGetPipelineExecutableInternalRepresentationsKHR-pipeline-03277]]
8880    The pname:pipeline member of pname:pExecutableInfo must: have been
8881    created with pname:device
8882  * [[VUID-vkGetPipelineExecutableInternalRepresentationsKHR-pipeline-03278]]
8883    The pname:pipeline member of pname:pExecutableInfo must: have been
8884    created with
8885    ename:VK_PIPELINE_CREATE_CAPTURE_INTERNAL_REPRESENTATIONS_BIT_KHR
8886****
8887
8888include::{generated}/validity/protos/vkGetPipelineExecutableInternalRepresentationsKHR.adoc[]
8889--
8890
8891[open,refpage='VkPipelineExecutableInternalRepresentationKHR',desc='Structure describing the textual form of a pipeline executable internal representation',type='structs']
8892--
8893The sname:VkPipelineExecutableInternalRepresentationKHR structure is defined
8894as:
8895
8896include::{generated}/api/structs/VkPipelineExecutableInternalRepresentationKHR.adoc[]
8897
8898  * pname:sType is a elink:VkStructureType value identifying this structure.
8899  * pname:pNext is `NULL` or a pointer to a structure extending this
8900    structure.
8901  * pname:name is an array of ename:VK_MAX_DESCRIPTION_SIZE code:char
8902    containing a null-terminated UTF-8 string which is a short human
8903    readable name for this internal representation.
8904  * pname:description is an array of ename:VK_MAX_DESCRIPTION_SIZE code:char
8905    containing a null-terminated UTF-8 string which is a human readable
8906    description for this internal representation.
8907  * pname:isText specifies whether the returned data is text or opaque data.
8908    If pname:isText is ename:VK_TRUE then the data returned in pname:pData
8909    is text and is guaranteed to be a null-terminated UTF-8 string.
8910  * pname:dataSize is an integer related to the size, in bytes, of the
8911    internal representation's data, as described below.
8912  * pname:pData is either `NULL` or a pointer to a block of data into which
8913    the implementation will write the internal representation.
8914
8915If pname:pData is `NULL`, then the size, in bytes, of the internal
8916representation data is returned in pname:dataSize.
8917Otherwise, pname:dataSize must be the size of the buffer, in bytes, pointed
8918to by pname:pData and on return pname:dataSize is overwritten with the
8919number of bytes of data actually written to pname:pData including any
8920trailing null character.
8921If pname:dataSize is less than the size, in bytes, of the internal
8922representation's data, at most pname:dataSize bytes of data will be written
8923to pname:pData, and ename:VK_INCOMPLETE will be returned instead of
8924ename:VK_SUCCESS, to indicate that not all the available representation was
8925returned.
8926
8927If pname:isText is ename:VK_TRUE and pname:pData is not `NULL` and
8928pname:dataSize is not zero, the last byte written to pname:pData will be a
8929null character.
8930
8931include::{generated}/validity/structs/VkPipelineExecutableInternalRepresentationKHR.adoc[]
8932--
8933endif::VK_KHR_pipeline_executable_properties[]
8934
8935
8936ifdef::VK_AMD_shader_info[]
8937include::{chapters}/VK_AMD_shader_info.adoc[]
8938endif::VK_AMD_shader_info[]
8939
8940
8941// These includes have their own section headers
8942
8943ifdef::VK_AMD_pipeline_compiler_control[]
8944include::{chapters}/VK_AMD_pipeline_compiler_control.adoc[]
8945endif::VK_AMD_pipeline_compiler_control[]
8946
8947ifdef::VK_VERSION_1_3,VK_EXT_pipeline_creation_feedback[]
8948include::{chapters}/VK_EXT_pipeline_creation_feedback/pipelines.adoc[]
8949endif::VK_VERSION_1_3,VK_EXT_pipeline_creation_feedback[]
8950