diff options
author | Antonioya <blendergit@gmail.com> | 2019-01-11 18:58:18 +0300 |
---|---|---|
committer | Antonioya <blendergit@gmail.com> | 2019-01-11 18:58:42 +0300 |
commit | 6c056f9ae2d7898fe577d71a20daf4984838a577 (patch) | |
tree | 94c8f77f6417bc64f566f7d5276de41aa58c3064 /source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c | |
parent | 1c91b6ee29845c323ffd3f477b56f3a68f4e76be (diff) |
GP: Reduce memory reallocation in multiedit mode
There was a problem counting the number of points for edit points and lines. Now the total size is used allocating the VBO size and not the stroke size.
Diffstat (limited to 'source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c')
-rw-r--r-- | source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c index d5927ebca9a..beb9f3ee847 100644 --- a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c +++ b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c @@ -540,7 +540,7 @@ void DRW_gpencil_get_edit_geom(struct GpencilBatchCacheElem *be, bGPDstroke *gps be->thickness_id = GPU_vertformat_attr_add(&be->format, "size", GPU_COMP_F32, 1, GPU_FETCH_FLOAT); be->vbo = GPU_vertbuf_create_with_format(&be->format); - GPU_vertbuf_data_alloc(be->vbo, gps->totpoints); + GPU_vertbuf_data_alloc(be->vbo, be->tot_vertex); be->vbo_len = 0; } gpencil_vbo_ensure_size(be, gps->totpoints); @@ -619,7 +619,7 @@ void DRW_gpencil_get_edlin_geom(struct GpencilBatchCacheElem *be, bGPDstroke *gp be->color_id = GPU_vertformat_attr_add(&be->format, "color", GPU_COMP_F32, 4, GPU_FETCH_FLOAT); be->vbo = GPU_vertbuf_create_with_format(&be->format); - GPU_vertbuf_data_alloc(be->vbo, gps->totpoints); + GPU_vertbuf_data_alloc(be->vbo, be->tot_vertex); be->vbo_len = 0; } gpencil_vbo_ensure_size(be, gps->totpoints); |