Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormano-wii <germano.costa@ig.com.br>2019-03-01 18:36:34 +0300
committermano-wii <germano.costa@ig.com.br>2019-03-01 18:40:20 +0300
commitfa5950d87820655ef357a3a0ec301ff4816a00e5 (patch)
tree4a9b9e8c888912789232c2ae8134b9cf16fa48fc /source/blender/draw/intern/draw_cache_impl_metaball.c
parent5eee1b4d1bfe23515350809511e8e8fcc1c64500 (diff)
Fix crash with wireframe on highpoly curves on some AMD gpus.
Differential Revision: https://developer.blender.org/D4433
Diffstat (limited to 'source/blender/draw/intern/draw_cache_impl_metaball.c')
-rw-r--r--source/blender/draw/intern/draw_cache_impl_metaball.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/source/blender/draw/intern/draw_cache_impl_metaball.c b/source/blender/draw/intern/draw_cache_impl_metaball.c
index 0d2c06e4c02..811f01aa83a 100644
--- a/source/blender/draw/intern/draw_cache_impl_metaball.c
+++ b/source/blender/draw/intern/draw_cache_impl_metaball.c
@@ -139,7 +139,7 @@ static GPUVertBuf *mball_batch_cache_get_pos_and_normals(Object *ob, MetaBallBat
if (cache->pos_nor_in_order == NULL) {
ListBase *lb = &ob->runtime.curve_cache->disp;
cache->pos_nor_in_order = MEM_callocN(sizeof(GPUVertBuf), __func__);
- DRW_displist_vertbuf_create_pos_and_nor_and_wiredata(lb, cache->pos_nor_in_order);
+ DRW_displist_vertbuf_create_pos_and_nor(lb, cache->pos_nor_in_order);
}
return cache->pos_nor_in_order;
}
@@ -202,16 +202,19 @@ GPUBatch *DRW_metaball_batch_cache_get_wireframes_face(Object *ob)
if (cache->face_wire.batch == NULL) {
ListBase *lb = &ob->runtime.curve_cache->disp;
- GPUVertBuf *vbo_pos_nor = MEM_callocN(sizeof(GPUVertBuf), __func__);
- DRW_displist_vertbuf_create_pos_and_nor_and_wiredata(lb, vbo_pos_nor);
+ GPUVertBuf *vbo_wiredata = MEM_callocN(sizeof(GPUVertBuf), __func__);
+ DRW_displist_vertbuf_create_wiredata(lb, vbo_wiredata);
GPUIndexBuf *ibo = MEM_callocN(sizeof(GPUIndexBuf), __func__);
DRW_displist_indexbuf_create_lines_in_order(lb, ibo);
- cache->face_wire.batch = GPU_batch_create_ex(GPU_PRIM_LINES,
- vbo_pos_nor,
- ibo,
- GPU_BATCH_OWNS_VBO | GPU_BATCH_OWNS_INDEX);
+ cache->face_wire.batch = GPU_batch_create_ex(
+ GPU_PRIM_LINES,
+ mball_batch_cache_get_pos_and_normals(ob, cache),
+ ibo,
+ GPU_BATCH_OWNS_INDEX);
+
+ GPU_batch_vertbuf_add_ex(cache->face_wire.batch, vbo_wiredata, true);
}
return cache->face_wire.batch;