summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/draw/draw_pt_emit.c
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2009-02-17 12:39:05 +0000
committerKeith Whitwell <keith@tungstengraphics.com>2009-02-17 12:39:05 +0000
commit1c4f67b980b6bec5788336a9cdd18c4fcec5e492 (patch)
tree16e29b40ca08cc144835cdfccbd90e44109aaf8e /src/gallium/auxiliary/draw/draw_pt_emit.c
parent7ca78a07b37e4cce0e258f711c6f8bbe1d98a633 (diff)
draw: second argument to unmap is max, not count
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_pt_emit.c')
-rw-r--r--src/gallium/auxiliary/draw/draw_pt_emit.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gallium/auxiliary/draw/draw_pt_emit.c b/src/gallium/auxiliary/draw/draw_pt_emit.c
index 8a6e01809e..064e16c295 100644
--- a/src/gallium/auxiliary/draw/draw_pt_emit.c
+++ b/src/gallium/auxiliary/draw/draw_pt_emit.c
@@ -165,6 +165,9 @@ void draw_pt_emit( struct pt_emit *emit,
*/
draw_do_flush( draw, DRAW_FLUSH_BACKEND );
+ if (vertex_count == 0)
+ return;
+
if (vertex_count >= UNDEFINED_VERTEX_ID) {
assert(0);
return;
@@ -205,7 +208,7 @@ void draw_pt_emit( struct pt_emit *emit,
render->unmap_vertices( render,
0,
- vertex_count );
+ vertex_count - 1 );
render->draw(render,
elts,
@@ -272,7 +275,7 @@ void draw_pt_emit_linear(struct pt_emit *emit,
}
}
- render->unmap_vertices( render, 0, count );
+ render->unmap_vertices( render, 0, count - 1 );
render->draw_arrays(render, 0, count);