createShadersEXT :: MonadIO io=> Devicedeviceis the logical device that creates the shader objects.->"createInfos"
::: Vector (SomeStruct ShaderCreateInfoEXT)pCreateInfosis a pointer to an array of ShaderCreateInfoEXT structures.->"allocator"
::: Maybe AllocationCallbackspAllocatorcontrols host memory allocation as described in the Memory Allocation chapter.-> io (Result,"shaders"
::: Vector ShaderEXT)
vkCreateShadersEXT - Create one or more new shaders
Description
When this function returns, whether or not it succeeds, it is guaranteed
that every element of pShaders will have been overwritten by either
NULL_HANDLE or a valid
ShaderEXT handle.
This means that whenever shader creation fails, the application can
determine which shader the returned error pertains to by locating the
first NULL_HANDLE element in pShaders. It
also means that an application can reliably clean up from a failed
call by iterating over the pShaders array and destroying every element
that is not NULL_HANDLE.
Valid Usage
If the
stagemember of any element ofpCreateInfosis SHADER_STAGE_COMPUTE_BIT,devicemust support at least one queue family with the QUEUE_COMPUTE_BIT capability
If the
stagemember of any element ofpCreateInfosis SHADER_STAGE_TASK_BIT_EXT, SHADER_STAGE_MESH_BIT_EXT, SHADER_STAGE_VERTEX_BIT, SHADER_STAGE_TESSELLATION_CONTROL_BIT, SHADER_STAGE_TESSELLATION_EVALUATION_BIT, SHADER_STAGE_GEOMETRY_BIT, or SHADER_STAGE_FRAGMENT_BIT,devicemust support at least one queue family with the QUEUE_GRAPHICS_BIT capabilityThe shaderObject feature must be enabled
If the
flagsmember of any element ofpCreateInfosincludes SHADER_CREATE_LINK_STAGE_BIT_EXT, theflagsmember of all other elements ofpCreateInfoswhosestageis SHADER_STAGE_VERTEX_BIT, SHADER_STAGE_TESSELLATION_CONTROL_BIT, SHADER_STAGE_TESSELLATION_EVALUATION_BIT, SHADER_STAGE_GEOMETRY_BIT, or SHADER_STAGE_FRAGMENT_BIT must also include SHADER_CREATE_LINK_STAGE_BIT_EXTIf the
flagsmember of any element ofpCreateInfosincludes SHADER_CREATE_LINK_STAGE_BIT_EXT, theflagsmember of all other elements ofpCreateInfoswhosestageis SHADER_STAGE_TASK_BIT_EXT or SHADER_STAGE_MESH_BIT_EXT must also include SHADER_CREATE_LINK_STAGE_BIT_EXTIf the
flagsmember of any element ofpCreateInfoswhosestageis SHADER_STAGE_TASK_BIT_EXT or SHADER_STAGE_MESH_BIT_EXT includes SHADER_CREATE_LINK_STAGE_BIT_EXT, there must be no member ofpCreateInfoswhoseflagsmember includes SHADER_CREATE_LINK_STAGE_BIT_EXT and whosestageis any of SHADER_STAGE_VERTEX_BIT, SHADER_STAGE_GEOMETRY_BIT, SHADER_STAGE_TESSELLATION_CONTROL_BIT, or SHADER_STAGE_TESSELLATION_EVALUATION_BITIf there is any element of
pCreateInfoswhosestageis SHADER_STAGE_MESH_BIT_EXT and whoseflagsmember includes both SHADER_CREATE_LINK_STAGE_BIT_EXT and SHADER_CREATE_NO_TASK_SHADER_BIT_EXT, there must be no element ofpCreateInfoswhosestageis SHADER_STAGE_TASK_BIT_EXT and whoseflagsmember includes SHADER_CREATE_LINK_STAGE_BIT_EXTFor each element of
pCreateInfoswhoseflagsmember includes SHADER_CREATE_LINK_STAGE_BIT_EXT, if there is any other element ofpCreateInfoswhosestageis logically later than thestageof the former and whoseflagsmember also includes SHADER_CREATE_LINK_STAGE_BIT_EXT, thenextStageof the former must be equal to thestageof the element with the logically earlieststagefollowing thestageof the former whoseflagsmember also includes SHADER_CREATE_LINK_STAGE_BIT_EXTThe
stagemember of each element ofpCreateInfoswhoseflagsmember includes SHADER_CREATE_LINK_STAGE_BIT_EXT must be uniqueThe
codeTypemember of all elements ofpCreateInfoswhoseflagsmember includes SHADER_CREATE_LINK_STAGE_BIT_EXT must be the sameIf
pCreateInfoscontains elements with both SHADER_STAGE_TESSELLATION_CONTROL_BIT and SHADER_STAGE_TESSELLATION_EVALUATION_BIT, both elements'flagsinclude SHADER_CREATE_LINK_STAGE_BIT_EXT, both elements'codeTypeis SHADER_CODE_TYPE_SPIRV_EXT, at least one must contain anOpExecutionModeinstruction specifying the orientation of triangles generated by the tessellatorIf
pCreateInfoscontains elements with both SHADER_STAGE_TESSELLATION_CONTROL_BIT and SHADER_STAGE_TESSELLATION_EVALUATION_BIT, both elements'flagsinclude SHADER_CREATE_LINK_STAGE_BIT_EXT, both elements'codeTypeis SHADER_CODE_TYPE_SPIRV_EXT, at least one must contain anOpExecutionModeinstruction specifying the spacing of segments on the edges of tessellated primitivesIf
pCreateInfoscontains elements with both SHADER_STAGE_TESSELLATION_CONTROL_BIT and SHADER_STAGE_TESSELLATION_EVALUATION_BIT, both elements'flagsinclude SHADER_CREATE_LINK_STAGE_BIT_EXT, both elements'codeTypeis SHADER_CODE_TYPE_SPIRV_EXT, and both stages contains anOpExecutionModeinstruction specifying the type of subdivision, they must be the sameIf
pCreateInfoscontains elements with both SHADER_STAGE_TESSELLATION_CONTROL_BIT and SHADER_STAGE_TESSELLATION_EVALUATION_BIT, both elements'flagsinclude SHADER_CREATE_LINK_STAGE_BIT_EXT, both elements'codeTypeis SHADER_CODE_TYPE_SPIRV_EXT, and both stages contains anOpExecutionModeinstruction specifying the orientation of triangles, they must be the sameIf
pCreateInfoscontains elements with both SHADER_STAGE_TESSELLATION_CONTROL_BIT and SHADER_STAGE_TESSELLATION_EVALUATION_BIT, both elements'flagsinclude SHADER_CREATE_LINK_STAGE_BIT_EXT, both elements'codeTypeis SHADER_CODE_TYPE_SPIRV_EXT, and both stages contains anOpExecutionModeinstruction specifying the spacing of segments on the edges of tessellated primitives, they must be the sameIf
pCreateInfoscontains elements with both SHADER_STAGE_TESSELLATION_CONTROL_BIT and SHADER_STAGE_TESSELLATION_EVALUATION_BIT, both elements'flagsinclude SHADER_CREATE_LINK_STAGE_BIT_EXT, both elements'codeTypeis SHADER_CODE_TYPE_SPIRV_EXT, and both stages contains anOpExecutionModeinstruction specifying the output patch size, they must be the sameIf
pCreateInfoscontains a SHADER_STAGE_MESH_BIT_EXT withcodeTypeof SHADER_CODE_TYPE_SPIRV_EXT and SHADER_CREATE_NO_TASK_SHADER_BIT_EXT is not set, then the mesh shader’s entry point must not declare a variable with aDrawIndexBuiltIndecorationIf any element of
pCreateInfossets SHADER_CREATE_DESCRIPTOR_HEAP_BIT_EXT and includes embedded sampler mappings, there must be less than (maxSamplerAllocationCount(minSamplerHeapReservedRangeWithEmbedded / samplerDescriptorSize)) Sampler objects currently created on the device
If any element of
pCreateInfossets SHADER_CREATE_DESCRIPTOR_HEAP_BIT_EXT and includes embedded sampler mappings, this command must not cause the total number of unique embedded samplers in pipelines and shaders on this device to exceed maxDescriptorHeapEmbeddedSamplersIf the
flagsmember of any element ofpCreateInfosincludes SHADER_CREATE_LINK_STAGE_BIT_EXT and SHADER_CREATE_DESCRIPTOR_HEAP_BIT_EXT, theflagsmember of all other elements ofpCreateInfoswhosestageis SHADER_STAGE_VERTEX_BIT, SHADER_STAGE_TESSELLATION_CONTROL_BIT, SHADER_STAGE_TESSELLATION_EVALUATION_BIT, SHADER_STAGE_GEOMETRY_BIT, SHADER_STAGE_TASK_BIT_EXT, SHADER_STAGE_MESH_BIT_EXT, or SHADER_STAGE_FRAGMENT_BIT must also include SHADER_CREATE_DESCRIPTOR_HEAP_BIT_EXT
Valid Usage (Implicit)
devicemust be a valid Device handle
pCreateInfosmust be a valid pointer to an array ofcreateInfoCountvalid ShaderCreateInfoEXT structuresIf
pAllocatoris notNULL,pAllocatormust be a valid pointer to a valid AllocationCallbacks structurepShadersmust be a valid pointer to an array ofcreateInfoCountShaderEXT handlescreateInfoCountmust be greater than0
Return Codes
See Also
VK_EXT_shader_object, AllocationCallbacks, Device, ShaderCreateInfoEXT, ShaderEXT