How it works...

Image post-processing can be performed using compute shaders. However, when we want to display an image on screen, we must use a swapchain. Storing data in an image from within shaders requires images to be created with the storage image use. Unfortunately, such usage may not be supported on swapchain images, so it would require the creation of additional, intermediate resources, which further increase the complexity of a code.

Using a graphics pipeline allows us to process image data inside fragment shaders and store the results in color attachments. Such usage is mandatory for swapchain images, so this way feels more natural for image processing implemented with the Vulkan API. On the other hand, the graphics pipeline requires ...

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.