Reputation: 910
My question is in the title.
The swap chain need multiple images and I understand why, so it seems logical to have the same image views amount because they are like a pointer to these. And finally, I understand why it needs multiple framebuffers, because you attach image views to these.
But, the framebuffer needs a render pass handle. But there is no direct link on an image or an image view in a render pass, it only describe with what the rendering will be done.
Then a graphics pipeline only needs a render pass handle. And finally the vkCmdBeginRenderPass() function specifies separately which framebuffer and which render pass it will use.
So why sometimes I saw multiple render passes within a swap chain ? It forces to have a graphics pipeline for each frame which are totally the same.
Upvotes: 0
Views: 862
Reputation: 131
Yes, you can reuse the same renderpass every frame (and I suggest you do, for most applications). You may want multiple renderpasses, for example if you want to apply post-processing effects onto a rendered image, but they would still be reused, in that case it would work like this, every frame:
Begin renderpass 1.
Draw some thing(s).
End renderpass 1.
Begin renderpass 2.
Draw some thing(s), possibly using attachments from 1st pass.
End renderpass 2.
Present to screen.
Repeat for next frame.
Upvotes: 1