Creating a render pass
Rendering (drawing a geometry) can only be performed inside render passes. When we also want to perform other operations such as image postprocessing or preparing geometry and light prepass data, we need to order these operations into subpasses. For this, we specify descriptions of all the required attachments, all subpasses into which operations are grouped, and the necessary dependencies between those operations. When this data is prepared, we can create a 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,
in which we specify descriptions of all render pass attachments (refer to the Specifying attachment descriptions recipe). - Prepare a variable of type
std::vector<VkSubpassDescription>
named...