How it works...

Input attachments allow us to read data inside fragment shaders from images used as render pass attachments (typically, for input attachments, images that were previously color or depth stencil attachments will be used).

Input attachments are used for descriptors of a VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT type.

In Vulkan, rendering operations are gathered into render passes. Each render pass has at least one subpass, but can have more. If we render to an attachment in one subpass, we can then use it as an input attachment and read data from it in subsequent subpasses of the same render pass. It is in fact the only way to read data from attachments in a given render pass--images serving as attachments in a given render pass can ...

Get Vulkan Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.