From 24ca903f6d8f1e87c464b4a50c44c495cda11fec Mon Sep 17 00:00:00 2001 From: Germano Date: Mon, 18 Dec 2017 23:17:55 -0200 Subject: Draw Manager: draw_cache_imp_displist, always return IndexBuf even when there is no index This prevents possible errors with materials and a crash with low resolution metaball. Also a small cleanup was done in the code. --- source/blender/draw/intern/draw_cache_impl_metaball.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source/blender/draw/intern/draw_cache_impl_metaball.c') diff --git a/source/blender/draw/intern/draw_cache_impl_metaball.c b/source/blender/draw/intern/draw_cache_impl_metaball.c index 9a9bbbd2c0c..f01e7b929f8 100644 --- a/source/blender/draw/intern/draw_cache_impl_metaball.c +++ b/source/blender/draw/intern/draw_cache_impl_metaball.c @@ -133,10 +133,9 @@ Gwn_Batch *DRW_metaball_batch_cache_get_triangles_with_normals(Object *ob) if (cache->batch == NULL) { ListBase *lb = &ob->curve_cache->disp; - Gwn_VertBuf *verts = DRW_displist_vertbuf_calc_pos_with_normals(lb); cache->batch = GWN_batch_create_ex( GWN_PRIM_TRIS, - verts, + DRW_displist_vertbuf_calc_pos_with_normals(lb), DRW_displist_indexbuf_calc_triangles_in_order(lb), GWN_BATCH_OWNS_VBO | GWN_BATCH_OWNS_INDEX); } -- cgit v1.2.3