Hello.
I'm looking into adding Vulkan support through an abstraction I'm writing so that I can switch between OGL and VK easily and test it out. I'm looking into how my postprocessing would map to render passes in Vulkan right now, and it's not looking very good. I thought it would be easy to make each fullscreen pass a subpass in one big render pass, but it seems very easy to "break" a render pass.
- Changing the width and height of the framebuffer requires a completely new render pass, not just a new subpass. This messes with my bloom processor, since I repeatedly downsample the scene and blur it. Each mipmap would require its own render pass.
- It might be possible to work around this by packing all my bloom mipmaps into a single texture. The bloom texture starts at half resolution and goes down, and I need two to pingpong between for the blurring. I could pack both these mip chains into one full-resolution buffer and only have a tiny bit of wasted area to avoid having to switch resolution when downsampling, but this would require the same functionality as NV_texture_barrier provides, which I don't think is available in Vulkan without breaking the render pass.
- According to the spec "Image subresources used as attachments must not be used via any non-attachment usage for the duration of a render pass instance.". I suppose this is partly replaced by input attachments, but input attachment loads are always unfiltered. This breaks bloom even more since I use a bilinear filtering accelerated gaussian blur for each blur pass, meaning I'd not only need one render pass for each mipmap level, I also need 2 render passes per gaussian blur pass (one horizontal and one vertical pass). It'd also break FXAA which uses bilinear filtering of the input buffer.
- I mainly develop for PC. Is it even important in the first place to have as few render passes as possible if I'm not on a tiled architecture? Do transient attachments have any advantages at all on desktop GPUs? Is there any point at all in trying to force all postprocessing into the same render pass and make pretty much all intermediate images transient?
- Is it legal to use the same image multiple times in a Vulkan framebuffer? Let's say I have 2 fullscreen passes I need done. I have 3 attachments defined in my render pass create info. The first pass reads from the first attachment and writes to the second. The second pass reads the second and writes to the third. Would it be legal for me to have the same image as the first and third attachments when I create my framebuffer? I don't see anything specifically disallowing this in the spec, and it seems to allow multiple image-views both using the same underlying image as attachments, so I believe this is 100% OK to do.