Tips on implementing SSAO using MSAA?

Hey all, I’ve recently been learning Vulkan for some toy VR applications and I wanted some advice on how best to implement SSAO in a way that also lets me use MSAA. Here’s my current setup:

  1. render a depth and normal buffer (currently using MSAA, later sampling from the resolved outputs)
  2. computing SSAO (I’m still working on this part- I’m quite a slow programmer)
    1. related: would it be better to render full-screen quads using traditional graphics pipelines or to use a compute shader?
    2. afaik, the two steps here are two “draw the rest of the owl” and then blur/denoise it.
  3. sample the SSAO buffer in my “main” render pass, which currently does not re-use the depth buffer for depth testing.

My questions then are:

  1. would it be better to not use multi-sampling for computing SSAO?
  2. are there any advantages to having a multi-sampled depth gbuffer (as opposed to either resolved or single-sampled)?
  3. I’m targeting a tiler architecture, and most of the advice I can find in writing says that a writeback of a multi-sampled buffer to main memory is a Bad Idea. Would it be better for performance (on average, in a relatively small scene) to render the depth buffer twice-over or to render it once and eat the cost of writing a multi-sampled buffer to main memory?

Thanks, I eagerly await help. :slight_smile:

I would not use MSAA for the SSAO step. MSAA is expensive, and might interfere with how SSAO sampling work

To clarify, do you mean that I shouldn’t compute the depth/normal buffers with MSAA during step 1? I was not planning on using MSAA at all during step 2.