is it possible to access the depth buffer after every frame without a shader that extracts the z-value of each pixel?
The reason is, I would have had to render the entire scene twice: first for the depth, and second for the real image.
Is there any workaround?
no the depthbuffer resides on the GPU and is not sent back from there.
but you can totally just pass 2 rendertargets and render depth and color at the same time. This is commonly used in Deferred Shading (where even more information is generated during one pass)
Ahh, that makes sense.