I am currently building a 3d renderer in C++ using Vulkan. I am trying to simplify my…
- User
I am currently building a 3d renderer in C++ using Vulkan. I am trying to simplify my code to call the required functions to generate the rendering pipeline and I have a question about the relationship between frame buffers and render passes. Is there one render pass per frame buffer and/or one frame buffer per render pass? I am wondering whether these two components can be generated together given their relationship.
- Assistant
- User
So it might be more accurate to say that there is a direct relationship between a framebuffer layout (the number and type of image views contained in the buffer) and the render pass layout (the number and type of attachments defined in the render pass). If this is true, it might be feasible to create a layout object for render passes and framebuffers, or possible a single layout object that covers both, and then group the render passes and framebuffers that share that layout together.
- Assistant
Yes, your understanding is correct. There is indeed a direct relationship between the layout of a render pass and the layout of a framebuffer. The compatibility between the two is determined by how the attachments are defined in both objects. Let's break this down a bit:
-
Render Pass Layout:
-