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:
authorCampbell Barton <ideasman42@gmail.com>2012-12-12 10:53:39 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-12-12 10:53:39 +0400
commit44b634bcb1363fa600e0f9300dcaa76402b47738 (patch)
treec5fe9bfe9fb8496f67c6fad4447ed225decdf20d /source/blender/editors/mesh/mesh_navmesh.c
parent3759c10e5c832672920daf80b0f1018604cfb4b4 (diff)
make EDBM_index_arrays's stay in memory, blender was allocating an array and filling it for verts/edges/faces on every redraw.
this may introduce bugs which I didn't catch, but they are very easy to identify in a debug build which has asserts to ensure the arrays are valid before use. in my own test drawing ~98,304 quads - this gave an overall ~16% drawing speedup.
Diffstat (limited to 'source/blender/editors/mesh/mesh_navmesh.c')
-rw-r--r--source/blender/editors/mesh/mesh_navmesh.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/source/blender/editors/mesh/mesh_navmesh.c b/source/blender/editors/mesh/mesh_navmesh.c
index bae2c6cde9d..21564d2d348 100644
--- a/source/blender/editors/mesh/mesh_navmesh.c
+++ b/source/blender/editors/mesh/mesh_navmesh.c
@@ -375,7 +375,7 @@ static Object *createRepresentation(bContext *C, struct recast_polyMesh *pmesh,
BM_vert_create(em->bm, co, NULL, 0);
}
- EDBM_index_arrays_init(em, BM_VERT);
+ EDBM_index_arrays_ensure(em, BM_VERT);
/* create faces */
for (j = 0; j < trinum; j++) {
@@ -399,8 +399,6 @@ static Object *createRepresentation(bContext *C, struct recast_polyMesh *pmesh,
polygonIdx = (int *)CustomData_bmesh_get(&em->bm->pdata, newFace->head.data, CD_RECAST);
*polygonIdx = i + 1; /* add 1 to avoid zero idx */
}
-
- EDBM_index_arrays_free(em);
}
recast_destroyPolyMesh(pmesh);