Creating framebuffers
While the render pass object contains information about what to do with each attachment and their initial and final layouts, a framebuffer contains actual references to the attachments used in the render pass, which are provided in the form of VkImageViews
.
In this recipe, you will learn how to create a framebuffer object.
Getting ready
In the repository, Vulkan framebuffers are encapsulated by the VulkanCore::Framebuffer
class.
How to do it…
Framebuffers refer to attachments (it answers the question “Which attachments will we be using for this render pass?”).
- The references are image views and are passed as a list, along with the handle of the render pass, to the
vkCreateFramebuffer
framebuffer creation function:uint32_t width, height; // Width and height of attachments VkDevice device; // Valid Vulkan Device std::vector<VkImageView> imageViews; // Valid Image Views const VkFramebufferCreateInfo framebufferInfo...