draw: enable user plane clipping when clipdistance is used
authorZack Rusin <zackr@vmware.com>
Thu, 6 Jun 2013 03:17:10 +0000 (23:17 -0400)
committerZack Rusin <zackr@vmware.com>
Tue, 11 Jun 2013 02:04:27 +0000 (22:04 -0400)
commit2b2e7bb13361fa93c49c4872cc5070a66a7b1746
tree562d262275793efb583ae5965924d51ec90508e5
parentc1a50f5ed7beb2f6aecfbacdc3339c8cb0107257
draw: enable user plane clipping when clipdistance is used

Draw depended on clip_plane_enable being set in the rasterizer
to use clipdistance registers for clipping. That's really
unfriendly because it requires that rasterizer state to have
variants for every shader out there. Instead of depending on
the rasterizer lets extract the info from the available state:
if a shader writes clipdistance then we need to use it and we
need to clip using a number of planes equal to the number
of writen clipdistance components. This way clipdistances
just work.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
src/gallium/auxiliary/draw/draw_cliptest_tmp.h
src/gallium/auxiliary/draw/draw_llvm.c