From 27a34f62baa991eadd040302748c48b31ec21a0c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Sun, 1 Mar 2015 11:18:42 +0100 Subject: [PATCH] draw: fix division-by-zero for empty geometry shaders Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89372 Reviewed-by: Dave Airlie --- src/gallium/auxiliary/draw/draw_pt_emit.c | 7 +++++-- 1 file 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)); } -- 2.30.2