VKSHARINGMODE(3)

NAME
VkSharingMode - Specifies the mode of resource sharing.

C SPECIFICATION

    typedef enum VkSharingMode {
        VK_SHARING_MODE_EXCLUSIVE = 0,
        VK_SHARING_MODE_CONCURRENT = 1,
    } VkSharingMode;

CONSTANTS

VK_SHARING_MODE_EXCLUSIVE
    Objects created using this sharing mode can only be accessed by queues of the same queue family at any given time.

VK_SHARING_MODE_CONCURRENT
    Objects created using this sharing mode can be accessed by queues from different queue families simultaneously.

DESCRIPTION

The constants of this enumeration are used to specify the intended resource sharing mode used by a buffer or image object.

Buffers and images created using VK_SHARING_MODE_EXCLUSIVE can only be accessed by queues of the same queue family at any given time. Before being able to access the object using a queue from a different queue family the application has to transfer exclusive ownership of the object between the source and destination queue families. In order to do that the application has to perform the following operations:

    1. Release exclusive ownership from the source queue family to the destination queue family.

    2. Use semaphores to ensure proper execution control for the ownership transfer.

    3. Acquire exclusive ownership for the destination queue family from the source queue family.

To release exclusive ownership the application should execute an image memory barrier (see VkImageMemoryBarrier) on a queue from the source queue family where it must set the srcQueueFamilyIndex parameter of the barrier to the source queue family’s index, and the dstQueueFamilyIndex parameter of the barrier to the destination queue family’s index.

To acquire exclusive ownership the application should execute the same image memory barrier on a queue from the destination queue family.

Buffers and images created using VK_SHARING_MODE_CONCURRENT can be simultaneously accessed by queues from different queue families. Accesses of buffers and images created using this sharing mode may have lower performance characteristics.

SEE ALSO

VkImageCreateInfo, VkBufferCreateInfo

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.