VkPipelineShaderStageCreateInfo - Structure specifying parameters of a
newly created pipeline shader stage
The rationale for the relaxed requirement on implementations to return a
pipeline with
PipelineShaderStageModuleIdentifierCreateInfoEXT
is that layers or tools may intercept pipeline creation calls and
require the full SPIR-V context to operate correctly. ICDs are not
expected to fail pipeline compilation if the pipeline exists in a cache
somewhere.
If the pNext
chain specifies a
descriptor mapping
using
DESCRIPTOR_MAPPING_SOURCE_PUSH_DATA_EXT,
DESCRIPTOR_MAPPING_SOURCE_SHADER_RECORD_DATA_EXT,
or
DESCRIPTOR_MAPPING_SOURCE_RESOURCE_HEAP_DATA_EXT,
the mapped resource in the shader must be a variable with a
structure type decorated with Block in the Uniform Storage
Class
If the pNext
chain specifies a
descriptor mapping
using
DESCRIPTOR_MAPPING_SOURCE_PUSH_DATA_EXT,
the mapped structure must not be larger than the sum of
pushDataOffset used in the mapping and
maxPushDataSize
If the pNext
chain specifies a
descriptor mapping
using
DESCRIPTOR_MAPPING_SOURCE_SHADER_RECORD_DATA_EXT,
the sum of mapped structure size and shaderRecordDataOffset used
in the mapping must not be larger than
maxShaderGroupStride
If the pNext
chain specifies a
descriptor mapping
using
DESCRIPTOR_MAPPING_SOURCE_SHADER_RECORD_ADDRESS_EXT
or
DESCRIPTOR_MAPPING_SOURCE_PUSH_ADDRESS_EXT,
the mapped resource in the shader must be one of:
A variable with a structure type decorated with Block in the
Uniform Storage Class
A variable with a structure type decorated with BufferBlock in
the Uniform Storage Class
A variable with a structure type decorated with Block in the
StorageBuffer Storage Class
A OpTypeAccelerationStructureKHR variable
A OpTypeAccelerationStructureNV variable
If the pNext
chain specifies a
descriptor mapping
using
DESCRIPTOR_MAPPING_SOURCE_PUSH_ADDRESS_EXT,
DESCRIPTOR_MAPPING_SOURCE_SHADER_RECORD_ADDRESS_EXT,
or
DESCRIPTOR_MAPPING_SOURCE_INDIRECT_ADDRESS_EXT,
the OpArrayLength or OpUntypedArrayLengthKHR instruction must
not be used on that resource
If the pNext
chain specifies a
descriptor mapping
using
DESCRIPTOR_MAPPING_SOURCE_HEAP_WITH_CONSTANT_OFFSET_EXT,
DESCRIPTOR_MAPPING_SOURCE_HEAP_WITH_PUSH_INDEX_EXT,
DESCRIPTOR_MAPPING_SOURCE_HEAP_WITH_SHADER_RECORD_INDEX_EXT,
DESCRIPTOR_MAPPING_SOURCE_HEAP_WITH_INDIRECT_INDEX_EXT,
or
DESCRIPTOR_MAPPING_SOURCE_HEAP_WITH_INDIRECT_INDEX_ARRAY_EXT,
and the mapped resource declaration is an array, the
pEmbeddedSampler member of the corresponding mapping structure
must be NULL
If the
geometryShader
feature is not enabled, stage must not be
SHADER_STAGE_GEOMETRY_BIT
If the
tessellationShader
feature is not enabled, stage must not be
SHADER_STAGE_TESSELLATION_CONTROL_BIT
or
SHADER_STAGE_TESSELLATION_EVALUATION_BIT
If the
meshShaders
feature is not enabled, stage must not be
SHADER_STAGE_MESH_BIT_EXT
If the
taskShaders
feature is not enabled, stage must not be
SHADER_STAGE_TASK_BIT_EXT
If
the
clustercullingShader
feature is not enabled, stage must not be
SHADER_STAGE_CLUSTER_CULLING_BIT_HUAWEI
stage must
not be
SHADER_STAGE_ALL_GRAPHICS,
or SHADER_STAGE_ALL
pName must be
the name of an OpEntryPoint in module with an execution model
that matches stage
If the
identified entry point includes any variable in its interface that
is declared with the ClipDistance BuiltIn decoration, that
variable must not have an array size greater than
PhysicalDeviceLimits::maxClipDistances
If the
identified entry point includes any variable in its interface that
is declared with the CullDistance BuiltIn decoration, that
variable must not have an array size greater than
PhysicalDeviceLimits::maxCullDistances
If the identified entry point includes variables in its interface
that are declared with the ClipDistance BuiltIn decoration and
variables in its interface that are declared with the CullDistance
BuiltIn decoration, those variables must not have array sizes
which sum to more than
PhysicalDeviceLimits::maxCombinedClipAndCullDistances
If
the identified entry point includes any variable in its interface
that is declared with the
SampleMask BuiltIn decoration,
that variable must not have an array size greater than
PhysicalDeviceLimits::maxSampleMaskWords
If stage is
SHADER_STAGE_TESSELLATION_CONTROL_BIT
or
SHADER_STAGE_TESSELLATION_EVALUATION_BIT,
and the identified entry point has an OpExecutionMode instruction
specifying a patch size with OutputVertices, the patch size must
be greater than 0 and less than or equal to
PhysicalDeviceLimits::maxTessellationPatchSize
If stage is
SHADER_STAGE_GEOMETRY_BIT,
the identified entry point must have an OpExecutionMode
instruction specifying a maximum output vertex count that is greater
than 0 and less than or equal to
PhysicalDeviceLimits::maxGeometryOutputVertices
If stage is
SHADER_STAGE_GEOMETRY_BIT,
the identified entry point must have an OpExecutionMode
instruction specifying an invocation count that is greater than 0
and less than or equal to
PhysicalDeviceLimits::maxGeometryShaderInvocations
If stage is
either
SHADER_STAGE_VERTEX_BIT,
SHADER_STAGE_TESSELLATION_CONTROL_BIT,
SHADER_STAGE_TESSELLATION_EVALUATION_BIT,
or
SHADER_STAGE_GEOMETRY_BIT,
and the identified entry point writes to Layer for any primitive,
it must write the same value to Layer for all vertices of a
given primitive
If stage is
either
SHADER_STAGE_VERTEX_BIT,
SHADER_STAGE_TESSELLATION_CONTROL_BIT,
SHADER_STAGE_TESSELLATION_EVALUATION_BIT,
or
SHADER_STAGE_GEOMETRY_BIT,
and the identified entry point writes to ViewportIndex for any
primitive, it must write the same value to ViewportIndex for all
vertices of a given primitive
If stage is
SHADER_STAGE_FRAGMENT_BIT,
and the identified entry point writes to FragDepth in any
execution path, all execution paths that are not exclusive to helper
invocations must either discard the fragment, or write or
initialize the value of FragDepth
If stage is
SHADER_STAGE_FRAGMENT_BIT,
and the identified entry point writes to FragStencilRefEXT in any
execution path, all execution paths that are not exclusive to helper
invocations must either discard the fragment, or write or
initialize the value of FragStencilRefEXT
If flags has
the
PIPELINE_SHADER_STAGE_CREATE_ALLOW_VARYING_SUBGROUP_SIZE_BIT
flag set, the
subgroupSizeControl
feature must be enabled
If flags has
the
PIPELINE_SHADER_STAGE_CREATE_REQUIRE_FULL_SUBGROUPS_BIT
flag set, the
computeFullSubgroups
feature must be enabled
If flags
includes
PIPELINE_SHADER_STAGE_CREATE_REQUIRE_FULL_SUBGROUPS_BIT,
stage must be one of
SHADER_STAGE_MESH_BIT_EXT,
SHADER_STAGE_TASK_BIT_EXT,
or
SHADER_STAGE_COMPUTE_BIT
If a
PipelineShaderStageRequiredSubgroupSizeCreateInfo
structure is included in the pNext chain, flags must not have
the
PIPELINE_SHADER_STAGE_CREATE_ALLOW_VARYING_SUBGROUP_SIZE_BIT
flag set
If a
PipelineShaderStageRequiredSubgroupSizeCreateInfo
structure is included in the pNext chain, the
subgroupSizeControl
feature must be enabled, and stage must be a valid bit
specified in
requiredSubgroupSizeStages
If a
PipelineShaderStageRequiredSubgroupSizeCreateInfo
structure is included in the pNext chain and stage is
SHADER_STAGE_COMPUTE_BIT,
SHADER_STAGE_MESH_BIT_EXT,
or
SHADER_STAGE_TASK_BIT_EXT,
the local workgroup size of the shader must be less than or equal
to the product of
PipelineShaderStageRequiredSubgroupSizeCreateInfo::requiredSubgroupSize
and
maxComputeWorkgroupSubgroups
If a
PipelineShaderStageRequiredSubgroupSizeCreateInfo
structure is included in the pNext chain, and flags has the
PIPELINE_SHADER_STAGE_CREATE_REQUIRE_FULL_SUBGROUPS_BIT
flag set, the local workgroup size in the X dimension of the
pipeline must be a multiple of
PipelineShaderStageRequiredSubgroupSizeCreateInfo::requiredSubgroupSize
If flags has
both the
PIPELINE_SHADER_STAGE_CREATE_REQUIRE_FULL_SUBGROUPS_BIT
and
PIPELINE_SHADER_STAGE_CREATE_ALLOW_VARYING_SUBGROUP_SIZE_BIT
flags set, the local workgroup size in the X dimension of the
pipeline must be a multiple of
maxSubgroupSize
If flags has
the
PIPELINE_SHADER_STAGE_CREATE_REQUIRE_FULL_SUBGROUPS_BIT
flag set and flags does not have the
PIPELINE_SHADER_STAGE_CREATE_ALLOW_VARYING_SUBGROUP_SIZE_BIT
flag set and no
PipelineShaderStageRequiredSubgroupSizeCreateInfo
structure is included in the pNext chain, the local workgroup size
in the X dimension of the pipeline must be a multiple of
subgroupSize
If module uses
the OpTypeCooperativeMatrixKHR instruction with a Scope equal to
Subgroup, then the local workgroup size in the X dimension of the
pipeline must be a multiple of the
effective subgroup size
If module uses
the OpTypeCooperativeMatrixKHR instruction with a Scope equal to
Workgroup, then the local workgroup size in the X dimension of the
pipeline must be a multiple of the
effective subgroup size
and the total local workgroup size must be a power of two multiple
of the
effective subgroup size
and must be less than or equal to
cooperativeMatrixWorkgroupScopeMaxWorkgroupSize
If a shader
module identifier is not specified for this stage, module must
be a valid ShaderModule , or the pNext
chain of the parent Vk*CreateInfo structure must set
PipelineBinaryInfoKHR::binaryCount
to a value greater than 0, if none of the following features are
enabled:
If a shader
module identifier is not specified for this stage, module must
be a valid ShaderModule, or there must be
a valid ShaderModuleCreateInfo structure in
the pNext chain , or the pNext chain of the parent
Vk*CreateInfo structure must set
PipelineBinaryInfoKHR::binaryCount
to a value greater than 0,
If a shader
module identifier is specified for this stage, the pNext chain
must not include a ShaderModuleCreateInfo
structure
If a shader
module identifier is specified for this stage, module must be
NULL_HANDLE
If
a shader module identifier is not specified, the shader code used by
the pipeline must be valid as described by the
Khronos SPIR-V Specification
after applying the specializations provided in
pSpecializationInfo, if any, and then converting all
specialization constants into fixed constants