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
#Pipelines and multiple Renderpasses
1 messages · Page 1 of 1 (latest)
use VK_KHR_dynamic_rendering
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
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
dynamic rendering only removes the requirement of creating a renderpass object
the issue on mobile isn't overhead, the issue on mobile is that it relies heavily on subpasses which until recently you couldn't do with dynamic rendering
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.
so , would you say a solution like "just bite the bullet and test the renderpass compatibity on the code side using a hashmap" is common approach ?
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.
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
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
i see , so there's no way around it other than making sure that every new unique renderpass is matched with an adequate pipeline
*per unique layout
you can use it how ever many times you want in how ever many renderpasses if the layout is the same
yes , that's what i was getting it but thanks for the double check , and thnx for the help