Multi pipeline each frame

I am new to Vulkan interface. I learned a lot from Vulkan tutorial through website and YouTube. I have some questions about multi-pipeline handling each frame. One of vulkan demo on GitHub explains about multi-pipeline processes. Each pipeline process showed that in that Vulkan demo but it looks like possible overhead between render pass/command buffer blocks to me.

For multi GLSL vertex/fragment codes, it requires each vertex/fragment codes per pipeline that Vulkan tutorial explains but did not show how to process multi-pipelines each frame (only single-pipeline each frame).

Begin command buffer
Begin Render Pass
Pipeline
End Render Pass
End Command buffer
:
:

Is that possible to handle multi-pipeline each render pass to reduce overhead?

Begin Command Buffer
Begin Render Pass
Pipeline
Pipeline
Pipeline
:
End Render Pass
End Command Buffer

or

Begin Command Buffer
Begin Render Pass
Pipeline
End Render Pass
Begin Render Pass
Pipeline
End Render Pass
:
:
End Command Buffer

Does anyone have any better Vulkan tutorial about multi-pipeline handling? I can’t find any tutorial mention but only teach single-pipeline processes.

Tim

You don’t “process” a pipeline. A pipeline is a set of state and programs which will be used to execute a rendering or dispatch calls. You render with a pipeline.

Tutorials don’t say anything special about using multiple pipelines for the same reason programming tutorials don’t say anything special about the difference between calling one function and calling two. You bind a pipeline, then issue rendering or dispatch calls using that pipeline, then you bind a different pipeline and issue rendering or dispatch calls using that pipeline.

It’s exactly like rendering with one pipeline; you just do that stuff again. Issues with resource usage between different pipelines are something to think about, but other than that, it’s fairly obvious.

Well, I now found vulkan session tutorial show screen split rendering on YouTube. It showed about multi pipeline processing each render pass. I finally got it.

Begin command buffer
Begin render pass
(clear screen image)

Bind Vertex/Index/Descriptor Sets
Bind pipeline
Set viewport/scissor (left screen area)
Draw indexed

Bind vertex/index/descriptor sets
Bind pipeline (different polygon mode like wireframe or different GLSL code, etc.)
Set viewport/scissor (right screen area)
Draw indexed

:
:

End render pass
End command buffer
Submit queue