diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2018-06-26 12:41:59 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2018-06-26 12:43:17 +0300 |
commit | c795505a2c751e1396029c8797af79e1b5b98447 (patch) | |
tree | 5de7f58cd4358b2fdd36ea73ae686fd07b136961 /source/blender/gpu/intern | |
parent | dad4703ec577adccd252151fc893a24e023ec587 (diff) |
Cleanup: dyntopo sculpt draw update: use same BM_face_as_array_vert_tri for indexbuf generation.
It's cleaner, and actually assert that BMFace is a triangle. Same code
as when generating vertexbuf for flat shading!
Diffstat (limited to 'source/blender/gpu/intern')
-rw-r--r-- | source/blender/gpu/intern/gpu_buffers.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/source/blender/gpu/intern/gpu_buffers.c b/source/blender/gpu/intern/gpu_buffers.c index 462785a5dcb..688386810ea 100644 --- a/source/blender/gpu/intern/gpu_buffers.c +++ b/source/blender/gpu/intern/gpu_buffers.c @@ -908,13 +908,11 @@ void GPU_pbvh_bmesh_buffers_update( BMFace *f = BLI_gsetIterator_getKey(&gs_iter); if (!BM_elem_flag_test(f, BM_ELEM_HIDDEN)) { - BMLoop *l_iter; - BMLoop *l_first; + BMVert *v[3]; - l_iter = l_first = BM_FACE_FIRST_LOOP(f); - do { - GWN_indexbuf_add_generic_vert(&elb, BM_elem_index_get(l_iter->v)); - } while ((l_iter = l_iter->next) != l_first); + BM_face_as_array_vert_tri(f, v); + GWN_indexbuf_add_tri_verts( + &elb, BM_elem_index_get(v[0]), BM_elem_index_get(v[1]), BM_elem_index_get(v[2])); } } |