[Bf-blender-cvs] [cb0934477e6] greasepencil-object: Change default VBO size for FILL
Antonioya
noreply at git.blender.org
Sun Nov 18 20:36:48 CET 2018
Commit: cb0934477e6d3ce23c295745318ca4746360919f
Author: Antonioya
Date: Sun Nov 18 20:36:34 2018 +0100
Branches: greasepencil-object
https://developer.blender.org/rBcb0934477e6d3ce23c295745318ca4746360919f
Change default VBO size for FILL
===================================================================
M source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
M source/blender/draw/engines/gpencil/gpencil_engine.h
===================================================================
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 3a1f1d74bc4..ccff826a536 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
@@ -226,7 +226,7 @@ void DRW_gpencil_get_fill_geom(struct GpencilBatchCacheElem *be, Object *ob, bGP
be->uvdata_id = GPU_vertformat_attr_add(&be->format, "texCoord", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
be->vbo = GPU_vertbuf_create_with_format(&be->format);
- GPU_vertbuf_data_alloc(be->vbo, totvertex);
+ GPU_vertbuf_data_alloc(be->vbo, GPENCIL_VBO_BLOCK_SIZE * 64);
be->vbo_len = 0;
}
else {
diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.h b/source/blender/draw/engines/gpencil/gpencil_engine.h
index bd5593f5b76..894badd5e95 100644
--- a/source/blender/draw/engines/gpencil/gpencil_engine.h
+++ b/source/blender/draw/engines/gpencil/gpencil_engine.h
@@ -41,7 +41,11 @@ struct RenderLayer;
#define GPENCIL_CACHE_BLOCK_SIZE 8
#define GPENCIL_MAX_SHGROUPS 65536
#define GPENCIL_GROUPS_BLOCK_SIZE 1024
-#define GPENCIL_VBO_BLOCK_SIZE 256
+
+/* the default size has a big impact in the speed, but use more GPU memory
+ * Maybe this could be a parameter
+ */
+#define GPENCIL_VBO_BLOCK_SIZE 2048
#define GPENCIL_COLOR_SOLID 0
#define GPENCIL_COLOR_TEXTURE 1
More information about the Bf-blender-cvs
mailing list