summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2015-03-01 11:18:42 +0100
committerMarek Olšák <[email protected]>2015-03-02 12:46:36 +0100
commit27a34f62baa991eadd040302748c48b31ec21a0c (patch)
tree9e85b491fdce44e8430167f68c8701497bb3386c
parentb51ff50a767cc78d678ed3d2c25995f5c4194fea (diff)
draw: fix division-by-zero for empty geometry shaders
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89372 Reviewed-by: Dave Airlie <[email protected]>
-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 b215c5f4db4..d1eafd84032 100644
--- a/src/gallium/auxiliary/draw/draw_pt_emit.c
+++ b/src/gallium/auxiliary/draw/draw_pt_emit.c
@@ -113,8 +113,11 @@ draw_pt_emit_prepare(struct pt_emit *emit,
emit->translate = translate_cache_find(emit->cache, &hw_key);
}
- *max_vertices = (draw->render->max_vertex_buffer_bytes /
- (vinfo->size * 4));
+ if (!vinfo->size)
+ *max_vertices = 0;
+ else
+ *max_vertices = (draw->render->max_vertex_buffer_bytes /
+ (vinfo->size * 4));
}