title: How to copy depth buffer to a texture on the GPU?
body: <p>I want to get the current depth buffer to a texture, to access it in a shader. For various reasons I can't do a separate depth pass, but would need to copy the already-rendered depth.</p>
  
  <p><code>glReadPixels</code> would involve the CPU and potentially kill performance, and as far as I know <code>glBlitFramebuffer</code> can't blit depth-to-color, only depth-to-depth.</p>
  
  <p>How to do this on the GPU?</p>