Always adding code to emit gl_ClipDistance can break GS shaders
Since the compiler doesn't know whether the GS shader will actually emit the clip distance the additional outputs must be reserved, On radeonsi this may lead to an assertion failure when host mesa is build in debug mode (or undefined behavior when it is not):
src/gallium/drivers/radeonsi/si_shader_llvm_gs.c:380: si_preload_gs_rings: Assertion `stride < (1 << 14)' failed.
This assertion failures can be triggered by running the GLES cts test:
dEQP-GLES31.functional.geometry_shading.basic.output_256
Edited by Gert Wollny