summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/draw/draw_vs.c
diff options
context:
space:
mode:
authorZack Rusin <zackr@vmware.com>2013-06-06 09:07:33 -0400
committerZack Rusin <zackr@vmware.com>2013-06-10 22:04:28 -0400
commitbabe35a067d1610d9032cc28eec8e16b18685621 (patch)
tree9c84b9f48f59e563e3bf5162ee5bb24998129320 /src/gallium/auxiliary/draw/draw_vs.c
parent3d08eada3450aa8801aed194afea99c816dd71f0 (diff)
downloadexternal_mesa3d-babe35a067d1610d9032cc28eec8e16b18685621.zip
external_mesa3d-babe35a067d1610d9032cc28eec8e16b18685621.tar.gz
external_mesa3d-babe35a067d1610d9032cc28eec8e16b18685621.tar.bz2
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 <zackr@vmware.com> Reviewed-by: Jose Fonseca <jfonseca@vmware.com> Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_vs.c')
-rw-r--r--src/gallium/auxiliary/draw/draw_vs.c3
1 files changed, 3 insertions, 0 deletions
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)