Fix triangles indexbuf of Curve Displists was being discarded incorrectly

They were discarded when shaded surfaces were requested thus bringing glitches to the outline of the selected Displists Objects
This commit is contained in:
2017-12-16 22:22:21 -02:00
parent 3713de163e
commit c2ad5e805a

View File

@@ -810,8 +810,8 @@ static Gwn_Batch *curve_batch_cache_get_pos_and_normals(CurveRenderData *rdata,
if (cache->surface.triangles_in_order == NULL) {
cache->surface.triangles_in_order = DRW_displist_indexbuf_calc_triangles_in_order(lb);
}
cache->surface.batch = GWN_batch_create_ex(
GWN_PRIM_TRIS, cache->surface.verts, cache->surface.triangles_in_order, 0);
cache->surface.batch = GWN_batch_create(
GWN_PRIM_TRIS, cache->surface.verts, cache->surface.triangles_in_order);
}
return cache->surface.batch;
@@ -1021,7 +1021,6 @@ Gwn_Batch **DRW_curve_batch_cache_get_surface_shaded(
if (cache->surface.mat_len != gpumat_array_len) {
/* TODO: deduplicate code */
GWN_INDEXBUF_DISCARD_SAFE(cache->surface.triangles_in_order);
if (cache->surface.shaded_triangles) {
for (int i = 0; i < cache->surface.mat_len; ++i) {
GWN_BATCH_DISCARD_SAFE(cache->surface.shaded_triangles[i]);