Structures

VkShaderModuleCreateInfo

Structure specifying parameters of a newly created shader module

The VkShaderModuleCreateInfo structure is defined as:

typedef struct VkShaderModuleCreateInfo {
    VkStructureType sType;
    const void* pNext;
    VkShaderModuleCreateFlags flags;
    size_t codeSize;
    const uint32_t* pCode;
} VkShaderModuleCreateInfo;
  • sType is a VkStructureType value identifying this structure.
  • pNext is NULL or a pointer to a structure extending this structure.
  • flags is reserved for future use.
  • codeSize is the size, in bytes, of the code pointed to by pCode.
  • pCode is a pointer to code that is used to create the shader module. The type and format of the code is determined from the content of the memory addressed by pCode.

Valid Usage

VUID-VkShaderModuleCreateInfo-codeSize-08735

If pCode is a pointer to SPIR-V code, codeSize must be a multiple of 4

VUID-VkShaderModuleCreateInfo-pCode-08736

If pCode is a pointer to SPIR-V code, pCode must point to valid SPIR-V code, formatted and packed as described by the Khronos SPIR-V Specification

VUID-VkShaderModuleCreateInfo-pCode-08737

If pCode is a pointer to SPIR-V code, pCode must adhere to the validation rules described by the Validation Rules within a Module section of the SPIR-V Environment appendix

VUID-VkShaderModuleCreateInfo-pCode-08738

If pCode is a pointer to SPIR-V code, pCode must declare the Shader capability for SPIR-V code

VUID-VkShaderModuleCreateInfo-pCode-08739

If pCode is a pointer to SPIR-V code, pCode must not declare any capability that is not supported by the API, as described by the Capabilities section of the SPIR-V Environment appendix

VUID-VkShaderModuleCreateInfo-pCode-08740

If pCode is a pointer to SPIR-V code, and pCode declares any of the capabilities listed in the SPIR-V Environment appendix, one of the corresponding requirements must be satisfied

VUID-VkShaderModuleCreateInfo-pCode-08741

If pCode is a pointer to SPIR-V code, pCode must not declare any SPIR-V extension that is not supported by the API, as described by the Extension section of the SPIR-V Environment appendix

VUID-VkShaderModuleCreateInfo-pCode-08742

If pCode is a pointer to SPIR-V code, and pCode declares any of the SPIR-V extensions listed in the SPIR-V Environment appendix, one of the corresponding requirements must be satisfied

VUID-VkShaderModuleCreateInfo-pCode-07912

If the VK_NV_glsl_shader extension is not enabled, pCodemust be a pointer to SPIR-V code

VUID-VkShaderModuleCreateInfo-pCode-01379

If pCode is a pointer to GLSL code, it must be valid GLSL code written to the GL_KHR_vulkan_glsl GLSL extension specification

VUID-VkShaderModuleCreateInfo-codeSize-01085

codeSize must be greater than 0

Valid Usage (Implicit)

VUID-VkShaderModuleCreateInfo-sType-sType

sType must be VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO

VUID-VkShaderModuleCreateInfo-pCode-parameter

pCode must be a valid pointer to an array of codeSize4\textrm{codeSize} \over 4 uint32_t values