Framebuffers are used along with render passes. They specify what image resources should be used for corresponding attachments defined in a render pass. They also define the size of a renderable area. That's why when we want to record drawing operations, we not only need to create a render pass, but also a framebuffer.
Creating a framebuffer
How to do it...
- Take the handle of a render pass that should be compatible with the framebuffer and use it to initialize a variable of type VkRenderPass named render_pass.
- Prepare a list of image view handles that represent the images' subresources, which should be used for the render pass attachments. Store all the prepared image views in a variable of type std::vector<VkImageView> named attachments.
- Create...