Graphics‎ > ‎Graphic API‎ > ‎Vulkan‎ > ‎

Synchronize

With all these queues and everything one might need keep everyone synchronize with each other. There are four ways to do that in Vulkan.

VkFence
A way for the host to determine completion of submissions to queues

A fence can be used to detect the when work submitted to a queue has completed. The fence is sent in with the submit to the queue and when all command buffers in the submit is finished it will signal the fence. To host can check if the fence is signal or wait until it is signal.

How to create a fence - vkCreateFence

Get the status of a fence - vkGetFenceStatus

Wait for the fence to change - vkWaitForFences

Reset to fence for reuse - vkResetFences

How to destroy a fence - vkDestroyFence


VkSemaphore
Use to coordinate operations between queues or within a single queue

Create a semaphore - vkCreateSemaphore

Destroy a semaphore - vkDestroySemaphore

How to wait on a semaphore
pWaitSemaphores in VkSubmitInfo.

How to signal a semaphore
pSignalSemaphores in VkSubmitInfo.


VkEvent
How to create an event - vkCreateEvent

Host

How to get the state of the event - vkGetEventStatus

How to set the state of the event - vkSetEvent

How to reset the event - vkResetEvent

Device

How to set the state of the even
t - vkCmdSetEvent

How to reset the event - vkCmdResetEvent

How to wait for the event - vkCmdWaitEvents

How to destroy an event vkDestroyEvent

Barriers
vkCmdPipelineBarrier
VkMemoryBarrier
VkBufferMemoryBarrier
VkImageMemoryBarrier


Comments