How it works...

In Vulkan, operations that are submitted to queues are executed in order, but they are independent. Sometimes, it is possible for some operations to start before the previous operations have finished. This parallel execution is one of the most important performance factors of current graphics hardware. But sometimes, it is crucial that some operations should wait for the results of earlier operations: this is when memory barriers come in handy.

Memory barriers are used to define moments in command buffers' executions, in which later commands should wait for the earlier commands to finish their job. They also cause the results of these operations to become visible for other operations.

In the case of buffers, through memory ...

Get Vulkan Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.