64 lines
2.1 KiB
Plaintext
64 lines
2.1 KiB
Plaintext
VkSharingMode(3)
|
|
================
|
|
|
|
Name
|
|
----
|
|
VkSharingMode - Specifies the mode of resource sharing.
|
|
|
|
C Specification
|
|
---------------
|
|
|
|
include::../enums/VkSharingMode.txt[]
|
|
|
|
Constants
|
|
---------
|
|
|
|
ename: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.
|
|
|
|
ename: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 ename: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 slink:VkImageMemoryBarrier) on a queue from the source
|
|
queue family where it must set the ptext:srcQueueFamilyIndex parameter of
|
|
the barrier to the source queue family's index, and the
|
|
ptext: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 ename: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
|
|
--------
|
|
|
|
slink:VkImageCreateInfo, slink:VkBufferCreateInfo
|
|
|
|
include::footer.txt[]
|