nir: add lowering stage for user-clip-planes / clipdist
authorRob Clark <robclark@freedesktop.org>
Wed, 9 Sep 2015 18:57:15 +0000 (14:57 -0400)
committerRob Clark <robclark@freedesktop.org>
Thu, 17 Sep 2015 23:57:21 +0000 (19:57 -0400)
commit509e0c4505813ebeaad1c95822156ed2df627487
treee0df1d29f1dc4a329653f34178056437ddfaccbf
parent53671a37238fd34f08d91d5d079d26437f21a473
nir: add lowering stage for user-clip-planes / clipdist

The vertex shader lowering adds calculation for CLIPDIST, if needed
(ie. user-clip-planes), and the frag shader lowering adds conditional
kills based on CLIPDIST value (which should be treated as a normal
interpolated varying by the driver).

Note that this won't quite do the right thing in the face of MSAA plus
user-clip-planes, since all the samples would be killed or not (rather
than potentially only a portion of them).  But it's better than no UCP
support at all for drivers that don't have this in hw.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/glsl/Makefile.sources
src/glsl/nir/nir.h
src/glsl/nir/nir_lower_clip.c [new file with mode: 0644]