From: Marek Olšák Date: Sun, 1 Mar 2015 10:18:42 +0000 (+0100) Subject: draw: fix division-by-zero for empty geometry shaders X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=27a34f62baa991eadd040302748c48b31ec21a0c;p=mesa.git draw: fix division-by-zero for empty geometry shaders Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89372 Reviewed-by: Dave Airlie --- 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)); }