C Specification

The VkShaderCreateInfoEXT structure is defined as:

// Provided by VK_EXT_shader_object
typedef struct VkShaderCreateInfoEXT {
    VkStructureType                 sType;
    const void*                     pNext;
    VkShaderCreateFlagsEXT          flags;
    VkShaderStageFlagBits           stage;
    VkShaderStageFlags              nextStage;
    VkShaderCodeTypeEXT             codeType;
    size_t                          codeSize;
    const void*                     pCode;
    const char*                     pName;
    uint32_t                        setLayoutCount;
    const VkDescriptorSetLayout*    pSetLayouts;
    uint32_t                        pushConstantRangeCount;
    const VkPushConstantRange*      pPushConstantRanges;
    const VkSpecializationInfo*     pSpecializationInfo;
} VkShaderCreateInfoEXT;

Members

  • sType is a VkStructureType value identifying this structure.

  • pNext is NULL or a pointer to a structure extending this structure.

  • flags is a bitmask of VkShaderCreateFlagBitsEXT describing additional parameters of the shader.

  • stage is a VkShaderStageFlagBits value specifying a single shader stage.

  • nextStage is a bitmask of VkShaderStageFlagBits specifying which stages may be used as a logically next bound stage when drawing with the shader bound. A value of zero indicates this shader stage must be the last one.

  • codeType is a VkShaderCodeTypeEXT value specifying the type of the shader code pointed to be pCode.

  • codeSize is the size in bytes of the shader code pointed to be pCode.

  • pCode is a pointer to the shader code to use to create the shader.

  • pName is a pointer to a null-terminated UTF-8 string specifying the entry point name of the shader for this stage.

  • setLayoutCount is the number of descriptor set layouts pointed to by pSetLayouts.

  • pSetLayouts is a pointer to an array of VkDescriptorSetLayout objects used by the shader stage. The implementation must not access these objects outside of the duration of the command this structure is passed to.

  • pushConstantRangeCount is the number of push constant ranges pointed to by pPushConstantRanges.

  • pPushConstantRanges is a pointer to an array of VkPushConstantRange structures used by the shader stage.

  • pSpecializationInfo is a pointer to a VkSpecializationInfo structure, as described in Specialization Constants, or NULL.

Description

When specifying descriptor heap mappings, only mappings corresponding to bindings that are actually present in the SPIR-V shader affect compilation. Mappings are ignored when codeType is VK_SHADER_CODE_TYPE_BINARY_EXT. The resulting compiled binary from two different SPIR-V shaders which would have identical bit patterns must remain identical even if the mapping entries vary in any of the following ways:

  • Different numbers of unused mapping structures

  • Different binding counts for unused bindings

  • Unused parameters in mapping structures (e.g. sampler offsets)

  • Ignored parameters in mapping structures

  • Different order of mapping structures, used or unused

Note
Calculating the same offset in a mapping via different parameter values is not guaranteed to provide identical results.
Valid Usage
Valid Usage (Implicit)
  • VUID-VkShaderCreateInfoEXT-sType-sType
    sType must be VK_STRUCTURE_TYPE_SHADER_CREATE_INFO_EXT

  • VUID-VkShaderCreateInfoEXT-pNext-pNext
    Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkCustomResolveCreateInfoEXT, VkPipelineShaderStageRequiredSubgroupSizeCreateInfo, VkShaderDescriptorSetAndBindingMappingInfoEXT, or VkValidationFeaturesEXT

  • VUID-VkShaderCreateInfoEXT-sType-unique
    The sType value of each structure in the pNext chain must be unique

  • VUID-VkShaderCreateInfoEXT-flags-parameter
    flags must be a valid combination of VkShaderCreateFlagBitsEXT values

  • VUID-VkShaderCreateInfoEXT-stage-parameter
    stage must be a valid VkShaderStageFlagBits value

  • VUID-VkShaderCreateInfoEXT-nextStage-parameter
    nextStage must be a valid combination of VkShaderStageFlagBits values

  • VUID-VkShaderCreateInfoEXT-codeType-parameter
    codeType must be a valid VkShaderCodeTypeEXT value

  • VUID-VkShaderCreateInfoEXT-pCode-parameter
    pCode must be a valid pointer to an array of codeSize bytes

  • VUID-VkShaderCreateInfoEXT-pName-parameter
    If pName is not NULL, pName must be a null-terminated UTF-8 string

  • VUID-VkShaderCreateInfoEXT-pSetLayouts-parameter
    If setLayoutCount is not 0, and pSetLayouts is not NULL, pSetLayouts must be a valid pointer to an array of setLayoutCount valid VkDescriptorSetLayout handles

  • VUID-VkShaderCreateInfoEXT-pPushConstantRanges-parameter
    If pushConstantRangeCount is not 0, and pPushConstantRanges is not NULL, pPushConstantRanges must be a valid pointer to an array of pushConstantRangeCount valid VkPushConstantRange structures

  • VUID-VkShaderCreateInfoEXT-pSpecializationInfo-parameter
    If pSpecializationInfo is not NULL, pSpecializationInfo must be a valid pointer to a valid VkSpecializationInfo structure

  • VUID-VkShaderCreateInfoEXT-codeSize-arraylength
    codeSize must be greater than 0

See Also

Document Notes

For more information, see the Vulkan Specification.

This page is extracted from the Vulkan Specification. Fixes and changes should be made to the Specification, not directly.

Copyright 2014-2026 The Khronos Group Inc.

SPDX-License-Identifier: CC-BY-4.0