aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/draw/draw_gs.c
diff options
context:
space:
mode:
authorZack Rusin <[email protected]>2013-06-06 09:07:33 -0400
committerZack Rusin <[email protected]>2013-06-10 22:04:28 -0400
commitbabe35a067d1610d9032cc28eec8e16b18685621 (patch)
tree9c84b9f48f59e563e3bf5162ee5bb24998129320 /src/gallium/auxiliary/draw/draw_gs.c
parent3d08eada3450aa8801aed194afea99c816dd71f0 (diff)
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 <[email protected]> Reviewed-by: Jose Fonseca <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_gs.c')
-rw-r--r--src/gallium/auxiliary/draw/draw_gs.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/draw/draw_gs.c b/src/gallium/auxiliary/draw/draw_gs.c
index 74c6279d648..b762dd6cb57 100644
--- a/src/gallium/auxiliary/draw/draw_gs.c
+++ b/src/gallium/auxiliary/draw/draw_gs.c
@@ -797,6 +797,10 @@ draw_create_geometry_shader(struct draw_context *draw,
else
gs->clipdistance_output[1] = i;
}
+ if (gs->info.output_semantic_name[i] == TGSI_SEMANTIC_CULLDIST) {
+ debug_assert(gs->info.output_semantic_index[i] < Elements(gs->culldistance_output));
+ gs->culldistance_output[gs->info.output_semantic_index[i]] = i;
+ }
}
gs->machine = draw->gs.tgsi.machine;