From babe35a067d1610d9032cc28eec8e16b18685621 Mon Sep 17 00:00:00 2001 From: Zack Rusin Date: Thu, 6 Jun 2013 09:07:33 -0400 Subject: draw: implement distance culling Works similarly to clip distance. If the cull distance is negative for all vertices against a specific plane then the primitive is culled. Signed-off-by: Zack Rusin Reviewed-by: Jose Fonseca Reviewed-by: Brian Paul Reviewed-by: Roland Scheidegger --- src/gallium/auxiliary/draw/draw_vs.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/gallium/auxiliary/draw/draw_vs.c') diff --git a/src/gallium/auxiliary/draw/draw_vs.c b/src/gallium/auxiliary/draw/draw_vs.c index 95f678a..a0bebcc 100644 --- a/src/gallium/auxiliary/draw/draw_vs.c +++ b/src/gallium/auxiliary/draw/draw_vs.c @@ -90,6 +90,9 @@ draw_create_vertex_shader(struct draw_context *draw, vs->clipdistance_output[0] = i; else vs->clipdistance_output[1] = i; + } else if (vs->info.output_semantic_name[i] == TGSI_SEMANTIC_CULLDIST) { + debug_assert(vs->info.output_semantic_index[i] < Elements(vs->culldistance_output)); + vs->culldistance_output[vs->info.output_semantic_index[i]] = i; } } if (!found_clipvertex) -- cgit v1.1