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.
This commit is contained in:
2017-12-18 23:17:55 -02:00
parent 57f2cc918b
commit 24ca903f6d
3 changed files with 27 additions and 38 deletions

View File

@@ -1043,7 +1043,7 @@ Gwn_Batch **DRW_curve_batch_cache_get_surface_shaded(
for (int i = 0; i < gpumat_array_len; ++i) {
cache->surface.shaded_triangles[i] = GWN_batch_create_ex(
GWN_PRIM_TRIS, cache->surface.verts, el[i], el[i] ? GWN_BATCH_OWNS_INDEX : 0);
GWN_PRIM_TRIS, cache->surface.verts, el[i], GWN_BATCH_OWNS_INDEX);
/* TODO: Add vertbuff for UV */
}