SSAO renders the scene twice

After enabling SSAO, SceneKit renders my scene twice:



Under SceneKit_SSAO_DEPTH there are many calls to drawPrimitives. Same with SceneKit_renderScene.


This is particularly expensive because my scene is very high polygon count.


AFAIK, SSAO should be a post-processing step, and not require a separate render. An initial pass renders the scene, with lighting, saving the z-buffer. Post processing darkens occluded areas by looking at the z-buffer.


Is there something I could change to improve performance? Switch to deferred lighting perhaps?

SSAO renders the scene twice
 
 
Q