#Pipelines and multiple Renderpasses

1 messages · Page 1 of 1 (latest)

thorny anvil
#

Hi , i dunno if this is a duplicate question but i didn't find it posed in the forum.
Regarding pipelines in the case of multiple renderpasses , as far as the spec mentions " we can use the same pipeline with different renderpasses as long as they are compatible with the one used on pipeline creation."
I'm aware of that , now with that outta the way , what if the renderpasses are not compatible ? the obvious choice would be "just create a pipeline per renderpass , duh" but i wanted to know if there's other ways to tackle this other than just duplicating pipelines since i assume this should be a common situation

median root
#

use VK_KHR_dynamic_rendering

tulip violet
#

that alone doesn't fix the "one pipeline per renderpass" situation

#

you need dynamic states for that, even then if the format or attachment changes you still create a new pipeline

thorny anvil
# median root use VK_KHR_dynamic_rendering

i'm aware of that existing , but i read that it still adds some overhead in the case of mobile GPUs , plus i think a complete answer would give me more insight into how to do stuff the "vulkan" way

tulip violet
#

dynamic rendering only removes the requirement of creating a renderpass object

tulip violet
midnight valve
#

Not all pipeline changes are made equal. If all that's changed is the renderpass or renderingInfo struct, it probabally won't be a performance killer, just developer pain.

thorny anvil
midnight valve
#

I wouldn't even worry about comatibility too much, just make the pipelines you need. You're not likely to have a large amount of render passes/unique renderInfo structs unless you're something extremely general purpose like a console emulator.

thorny anvil
#

oh , just to add a detail , im talking mostly about using the same "shader" (which implies same pipeline for me) for different renderpasses.
Okay gotcha , thnx for the info

tulip violet
#

no matter what you do, you will always need one pipeline per unique renderpass layout (attachment number and format)

#

the rest can be made easier with dynamic states

thorny anvil
#

i see , so there's no way around it other than making sure that every new unique renderpass is matched with an adequate pipeline

tulip violet
#

*per unique layout
you can use it how ever many times you want in how ever many renderpasses if the layout is the same

thorny anvil
#

yes , that's what i was getting it but thanks for the double check , and thnx for the help

tulip violet
#

note that static pipeline states includes viewport size

#

so you need to recreate them to change the viewport too if you don't use dynamic states