diff options
author | Marek Olšák <[email protected]> | 2015-03-01 11:18:42 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2015-03-02 12:46:36 +0100 |
commit | 27a34f62baa991eadd040302748c48b31ec21a0c (patch) | |
tree | 9e85b491fdce44e8430167f68c8701497bb3386c | |
parent | b51ff50a767cc78d678ed3d2c25995f5c4194fea (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.c | 7 |
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)); } |