diff options
Diffstat (limited to 'source/blender/draw/intern/draw_cache_impl_gpencil.c')
-rw-r--r-- | source/blender/draw/intern/draw_cache_impl_gpencil.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/source/blender/draw/intern/draw_cache_impl_gpencil.c b/source/blender/draw/intern/draw_cache_impl_gpencil.c index d6b0c939114..220c7041c7f 100644 --- a/source/blender/draw/intern/draw_cache_impl_gpencil.c +++ b/source/blender/draw/intern/draw_cache_impl_gpencil.c @@ -395,8 +395,8 @@ static void gpencil_batches_ensure(Object *ob, GpencilBatchCache *cache, int cfr /* Add extra space at the end of the buffer because of quad load. */ GPU_vertbuf_data_alloc(cache->vbo, iter.vert_len + 2); GPU_vertbuf_data_alloc(cache->vbo_col, iter.vert_len + 2); - iter.verts = (gpStrokeVert *)cache->vbo->data; - iter.cols = (gpColorVert *)cache->vbo_col->data; + iter.verts = (gpStrokeVert *)GPU_vertbuf_get_data(cache->vbo); + iter.cols = (gpColorVert *)GPU_vertbuf_get_data(cache->vbo_col); /* Create IBO. */ GPU_indexbuf_init(&iter.ibo, GPU_PRIM_TRIS, iter.tri_len, iter.vert_len); @@ -471,7 +471,8 @@ GPUBatch *DRW_cache_gpencil_face_wireframe_get(Object *ob) .ibo = {0}, }; - GPU_indexbuf_init_ex(&iter.ibo, GPU_PRIM_LINE_STRIP, vbo->vertex_len, vbo->vertex_len); + uint vert_len = GPU_vertbuf_get_vertex_len(vbo); + GPU_indexbuf_init_ex(&iter.ibo, GPU_PRIM_LINE_STRIP, vert_len, vert_len); /* IMPORTANT: Keep in sync with gpencil_edit_batches_ensure() */ bool do_onion = true; @@ -558,8 +559,8 @@ static void gpencil_sbuffer_stroke_ensure(bGPdata *gpd, bool do_stroke, bool do_ /* Add extra space at the end (and start) of the buffer because of quad load and cyclic. */ GPU_vertbuf_data_alloc(vbo, 1 + vert_len + 1 + 2); GPU_vertbuf_data_alloc(vbo_col, 1 + vert_len + 1 + 2); - gpStrokeVert *verts = (gpStrokeVert *)vbo->data; - gpColorVert *cols = (gpColorVert *)vbo_col->data; + gpStrokeVert *verts = (gpStrokeVert *)GPU_vertbuf_get_data(vbo); + gpColorVert *cols = (gpColorVert *)GPU_vertbuf_get_data(vbo_col); /* Fill buffers with data. */ gpencil_buffer_add_stroke(verts, cols, gps); @@ -711,7 +712,7 @@ static void gpencil_edit_batches_ensure(Object *ob, GpencilBatchCache *cache, in /* Vertex counting has already been done for cache->vbo. */ BLI_assert(cache->vbo); - int vert_len = cache->vbo->vertex_len; + int vert_len = GPU_vertbuf_get_vertex_len(cache->vbo); gpEditIterData iter; iter.vgindex = ob->actdef - 1; @@ -724,7 +725,7 @@ static void gpencil_edit_batches_ensure(Object *ob, GpencilBatchCache *cache, in cache->edit_vbo = GPU_vertbuf_create_with_format(format); /* Add extra space at the end of the buffer because of quad load. */ GPU_vertbuf_data_alloc(cache->edit_vbo, vert_len); - iter.verts = (gpEditVert *)cache->edit_vbo->data; + iter.verts = (gpEditVert *)GPU_vertbuf_get_data(cache->edit_vbo); /* Fill buffers with data. */ BKE_gpencil_visible_stroke_iter( |