Synchronization is one of the most powerful but also most complex parts of using Vulkan. The application developer is now responsible for managing synchronization using the various Vulkan synchronization primitives. Improper use of synchronization can lead to hard-to-find bugs as well as poor performance in cases where the the GPU is unnecessarily idle.
There are a set of examples provided by Khronos on how to use some of the synchronization primitives. The goal is to keep the GPU fed with data as described in this great presentation from Tobias Hector: part 1 slides (video) and part 2 slides (video).
Pipeline Barriers give control over which pipeline stages need to wait on previous pipeline stages when a command buffer is executed.
While Pipeline Barriers might be hard to understand at first, there are many great Khronos talks and other resources that go more in depth on the topic.
- Vulkanised 2018 - Low-level mysteries of pipeline barriers (video)
- Vulkanised 2019 - Live Long and Optimise (video) Pipeline Analysis starting slide 12
- Vulkan barriers explained blog post
- Yet another blog explaining Vulkan synchronization post