VKCREATEFENCE(3)

NAME
vkCreateFence - Create a new fence object.

C SPECIFICATION

    VkResult vkCreateFence(
        VkDevice                                    device,
        const VkFenceCreateInfo*                    pCreateInfo,
        const VkAllocationCallbacks*                pAllocator,
        VkFence*                                    pFence);

PARAMETERS

device
    A handle to the device with which to create the fence.

pCreateInfo
    A pointer to a structure containing information about how to create the fence.

pFence
    A pointer to a variable to receive the handle to the newly created fence object.

DESCRIPTION

vkCreateFence creates a new fence object using the device specified by device and places the resulting object handle in the variable pointed to by pFence. Information about how the fence should be created is passed in an instance of VkFenceCreateInfo whose address is given in pCreateInfo. The definition of VkFenceCreateInfo is:

    typedef struct VkFenceCreateInfo {
        VkStructureType       sType;
        const void*           pNext;
        VkFenceCreateFlags    flags;
    } VkFenceCreateInfo;

The sType member of the VkFenceCreateInfo structure should be set to VK_STRUCTURE_TYPE_FENCE_CREATE_INFO. The pNext member is reserved for use by extensions and should be set to NULL.

The flags member specifies additional information about the fence to be created. It is a bitfield made up from the members of the VkFenceCreateFlagBits enumeration, the definition of which is:

    typedef enum VkFenceCreateFlagBits {
        VK_FENCE_CREATE_SIGNALED_BIT = 0x00000001,
    } VkFenceCreateFlagBits;

If VK_FENCE_CREATE_SIGNALED_BIT is set then the fence is created already signaled, otherwise, the fence is created in an unsignaled state.

A fence becomes signaled when it is submitted to a queue with a call to vkQueueSubmit. A fence may be reset to unsignaled state with a call to vkResetFences.

VALID USAGE

    • device must be a valid VkDevice handle

    • pCreateInfo must be a pointer to a valid VkFenceCreateInfo structure

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

    • pFence must be a pointer to a VkFence 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

vkWaitForFences, vkDestroyFence, vkResetFences, vkQueueSubmit

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.