summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/draw/draw_vs.c
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2012-01-06 12:23:00 +0000
committerDave Airlie <[email protected]>2012-01-11 08:20:11 +0000
commit1865f341d8f45b389061fc08d2da90b7aa8a6099 (patch)
treedbe427bbb19465398d3c62f4f0d9b58e30728c3e /src/gallium/auxiliary/draw/draw_vs.c
parentf7e3e46f72fffe4b83cd3f922173ff28e9ab9c7c (diff)
draw: clipdistance support (v2)
Add support for using the clipdistance instead of clip plane. Passes all piglit clipdistance tests. v2: fixup some comments from Brian in review. Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_vs.c')
-rw-r--r--src/gallium/auxiliary/draw/draw_vs.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/draw/draw_vs.c b/src/gallium/auxiliary/draw/draw_vs.c
index 150653c669a..56c4f882cae 100644
--- a/src/gallium/auxiliary/draw/draw_vs.c
+++ b/src/gallium/auxiliary/draw/draw_vs.c
@@ -132,6 +132,11 @@ draw_create_vertex_shader(struct draw_context *draw,
vs->info.output_semantic_index[i] == 0) {
found_clipvertex = TRUE;
vs->clipvertex_output = i;
+ } else if (vs->info.output_semantic_name[i] == TGSI_SEMANTIC_CLIPDIST) {
+ if (vs->info.output_semantic_index[i] == 0)
+ vs->clipdistance_output[0] = i;
+ else
+ vs->clipdistance_output[1] = i;
}
}
if (!found_clipvertex)
@@ -156,6 +161,8 @@ draw_bind_vertex_shader(struct draw_context *draw,
draw->vs.position_output = dvs->position_output;
draw->vs.edgeflag_output = dvs->edgeflag_output;
draw->vs.clipvertex_output = dvs->clipvertex_output;
+ draw->vs.clipdistance_output[0] = dvs->clipdistance_output[0];
+ draw->vs.clipdistance_output[1] = dvs->clipdistance_output[1];
dvs->prepare( dvs, draw );
}
else {