Preparing a render pass for geometry rendering and postprocess subpasses
When developing applications such as games or CAD tools there are often situations in which we need to draw a geometry and then, when the whole scene is rendered, we apply additional image effects called postprocessing.
In this sample recipe, we will see how to prepare a render pass in which we will have two subpasses. The first subpass renders into two attachments--color and depth. The second subpass reads data from the first color attachment and renders into another color attachment--a swapchain image that can be presented (displayed on screen) after the render pass.
Getting ready
To lower the number of parameters that need to be provided, in this recipe we use a custom structure of type SubpassParameters
(refer to the Specifying subpass descriptions recipe).
How to do it...
- Create a variable of type
std::vector<VkAttachmentDescription>
namedattachments_descriptions
. Add an element to theattachments_descriptions...