You would do this the same way you would do for the color buffer, only you would use GL_DEPTH_BUFFER_BIT
and make sure you use GL_NEAREST
for the filter mode. If you want linear filtering on a depth/stencil buffer, for whatever reason, you can actually do this in GLSL if you use a depth texture (of course this still remains invalid for MSAA textures) - but it is invalid to do this using glBlitFramebuffer (...)
.
You do not have to do any of the glReadBuffer (...)
nonsense like you do when you want to select an individual color buffer, glBlitFramebuffer (...)
will copy the depth buffer from the bound GL_READ_FRAMEBUFFER
to the bound GL_DRAW_FRAMEBUFFER
.