how to add depth prepass to 2018 forward rendering path

Hey guys.
Is there anyway to add a depth prepass in unity 2018 Legcay Forward rendering path?

this is the way i found:
1.rendering depth only with other camea. which is cause two time culling
2.use srp to do this stuff , is good ,but it's experment feature

is there any other way to do this?

Nothing built in, no.

However the built in forward renderer already renders a depth pre-pass, but not the kind you're thinking of. It renders all opaque objects in a depth only pass to produce the camera depth texture, then renders the main forward passes using completely different depth buffer. And the built in forward renderer uses the camera depth texture by default on almost all platforms, as all directional light shadows make use of it.

The reason why it doesn't reuse that original depth buffer it rendered for the camera depth texture is because the camera depth texture is rendered without any MSAA enabled. So if MSAA is enabled the depth buffer can't be reused from that depth only pass. It doesn't render the depth texture with MSAA because hardware resolving a depth texture produces incorrect results, and Unity didn't add support for custom resolves or otherwise directly sampling a multi-sample texture until relatively recently.

Now, if you're not using MSAA, you can render the camera depth texture back into the main camera's depth. Not quite as efficient as using the existing depth buffer to begin with, but in some scenarios it can be a performance improvement.

Though that's going to be the main thing to remember, there's no guarantee it'll actually be a performance improvement. If the opaque sorting is doing its job well enough that's going to do more than enough on its own. And if your on mobile it's not going to help at all since those devices already do a depth prepass in hardware.