Specifying subpass descriptions
Operations performed in a render pass are grouped into subpasses. Each subpass represents a stage or a phase of our rendering commands in which a subset of render pass's attachments are used (into which we render or from which we read data).
A render pass always requires at least one subpass that is automatically started when we begin a render pass. And for each subpass, we need to prepare a description.
Getting ready
To lower the number of parameters required to prepare for each subpass, a custom structure type is introduced for this recipe. It is a simplified version of a VkSubpassDescription
structure defined in the Vulkan header. It has the following definition:
struct SubpassParameters { VkPipelineBindPoint PipelineType; std::vector<VkAttachmentReference> InputAttachments; std::vector<VkAttachmentReference> ColorAttachments; std::vector<VkAttachmentReference> ResolveAttachments; VkAttachmentReference...