OpenGL layered rendering with multiple additional clip planes per view
The GS is responsible for assigning a particular primitive to a particular layer. The GS is also responsible for writing values for gl_ClipDistance for a particular primitive. So the GS is perfectly capable of doing both of those things: assigning a primitive to a layer and doing the clip-plane computations for that layer.
And if you need to &quot;deactivate&quot; a clip plane for a particular primitive assigned to a particular layer, just assign the gl_ClipDistance[i] for that to 1.0 for all of its vertices.