Depth with custom stencil for post processing causes flickering

Any ideas?