Skip to content

mesa/st: add lowering pass for clip plane enable/disable

Mike Blumenkrantz requested to merge zmike/mesa:clip_enable_lowering into master

This adds a pass that's run when PIPE_CAP_CLIP_PLANES isn't set by a driver and a shader contains an output for VARYING_SLOT_CLIP_DIST0, replacing (in this specific case) the nir_lower_clip_vs pass. The idea here is to walk the shader instructions and assign undef to any gl_ClipDistance components which correspond to disabled clip planes.

Fixes spec@glsl-1.30@execution@clipping@vs-clip-distance-enables in zink.

cc @kusma

@alyssa and @enunes also since panfrost and lima are the other drivers making use of the original pipe cap. If this doesn't work for you then I can add a separate pipe cap just for zink.

Merge request reports