VKCREATESHADERMODULE(3)

NAME
vkCreateShaderModule - Creates a new shader module object.

C SPECIFICATION

    VkResult vkCreateShaderModule(
        VkDevice                                    device,
        const VkShaderModuleCreateInfo*             pCreateInfo,
        const VkAllocationCallbacks*                pAllocator,
        VkShaderModule*                             pShaderModule);

PARAMETERS

device
    Logical device to own the new object.

pCreateInfo
    A pointer to a structure defining the shader module object to be created.

pShaderModule
    Pointer to the variable to receive a handle to the new object.

DESCRIPTION

vkCreateShaderModule creates a new shader module from shader source provided by the caller. device is a handle to the device that is to be used to create the shader module. pCreateInfo is a pointer to an instance of the VkShaderModuleCreateInfo structure which contains information needed to construct the module. The definition of VkShaderModuleCreateInfo is:

    typedef struct VkShaderModuleCreateInfo {
        VkStructureType              sType;
        const void*                  pNext;
        VkShaderModuleCreateFlags    flags;
        size_t                       codeSize;
        const uint32_t*              pCode;
    } VkShaderModuleCreateInfo;

The pCode member of pCreateInfo contains a pointer to an opaque code structure describing the content of the shader module. The codeSize member specifies the length of the data pointed to by pCreateInfo in bytes. The flags member of pCreateInfo is used to further control construction of the shader module. However, no flags are currently defined, flags is therefore reserved and should be set to zero.

Upon success, a handle to the newly created shader module object is placed in the variable that is pointed to by pShaderModule.

VALID USAGE

    • device must be a valid VkDevice handle

    • pCreateInfo must be a pointer to a valid VkShaderModuleCreateInfo structure

    • If pAllocator is not NULL, pAllocator must be a pointer to a valid VkAllocationCallbacks structure

    • pShaderModule must be a pointer to a VkShaderModule handle

RETURN CODES

On success, this command returns

        • VK_SUCCESS

On failure, this command returns

        • VK_ERROR_OUT_OF_HOST_MEMORY

        • VK_ERROR_OUT_OF_DEVICE_MEMORY

SEE ALSO

vkDestroyShaderModule

COPYRIGHT

Copyright © 2014-2016 Khronos Group. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. http://opencontent.org/openpub/.

AUTHOR

Khronos Group
    Author.