I'm working on a GLSL raytracer, and I need to be able to edit gl_FragDepth in the FS. However, doing so disables early-z culling. The scene is rendered front-to-back and the FS can only push points further away, so the results of the z-test shouldn't affect the final render, even with a long pipeline.
Is there anyway to force early-z culling to run, or otherwise get around the "no fragdepth" restriction? I suppose I could do a z-test in the FS, but I'd rather let the hardware take care of it if possible.