gl_ClipDistance read in fragment shader

I have a Q regarding the clipping against custom clipping planes. I write gl_ClipDistance[0] in the vertex shader to clip the geometry behind the camera (I need it because I write the gl_FragDepth in fragment shader which prevents the clipping for Zc). But when does the clipping actually occurs - after the fragment shader executes or the execution does not occur for the clipped fragments at all? If I read the interpolated value of gl_ClipDistance[0] in fragment shader - does it change the clipping behavior (so the FS executes even for clipped fragments)? Does it makes sense at all to use clipping plane for the geometry behind camera in case gl_FragDepth is calculated manually?

Clipping occurs before rasterisation, clipped geometry doesn’t generate fragments. Reading gl_ClipDistance in the fragment shader does not change this.

Thank you! :slight_smile: