[Bf-blender-cvs] [c2ad5e805a4] blender2.8: Fix triangles indexbuf of Curve Displists was being discarded incorrectly

Germano noreply at git.blender.org
Sun Dec 17 01:22:37 CET 2017


Commit: c2ad5e805a4a26e6cc0f7959212f6d8b1285779d
Author: Germano
Date:   Sat Dec 16 22:22:21 2017 -0200
Branches: blender2.8
https://developer.blender.org/rBc2ad5e805a4a26e6cc0f7959212f6d8b1285779d

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

===================================================================

M	source/blender/draw/intern/draw_cache_impl_curve.c

===================================================================

diff --git a/source/blender/draw/intern/draw_cache_impl_curve.c b/source/blender/draw/intern/draw_cache_impl_curve.c
index 5a2ee2b0695..6d98195495f 100644
--- a/source/blender/draw/intern/draw_cache_impl_curve.c
+++ b/source/blender/draw/intern/draw_cache_impl_curve.c
@@ -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]);



More information about the Bf-blender-cvs mailing list