[Bf-blender-cvs] [5223214] master: Optimization for mesh deform: use BLI_INLINE specifiers

Sergey Sharybin noreply at git.blender.org
Mon Oct 20 13:04:52 CEST 2014


Commit: 52232141994327c55ec631b702ec3def327f1489
Author: Sergey Sharybin
Date:   Mon Oct 20 16:40:41 2014 +0600
Branches: master
https://developer.blender.org/rB52232141994327c55ec631b702ec3def327f1489

Optimization for mesh deform: use BLI_INLINE specifiers

This helps compiler to do detect stuff which might be inlined,
gives around 30% speedup on my laptop with test files from ZanQdo.

===================================================================

M	source/blender/editors/armature/meshlaplacian.c

===================================================================

diff --git a/source/blender/editors/armature/meshlaplacian.c b/source/blender/editors/armature/meshlaplacian.c
index 49650fc..b7d14e0 100644
--- a/source/blender/editors/armature/meshlaplacian.c
+++ b/source/blender/editors/armature/meshlaplacian.c
@@ -1303,7 +1303,7 @@ static int meshdeform_inside_cage(MeshDeformBind *mdb, float *co)
 
 /* solving */
 
-static int meshdeform_index(MeshDeformBind *mdb, int x, int y, int z, int n)
+BLI_INLINE int meshdeform_index(MeshDeformBind *mdb, int x, int y, int z, int n)
 {
 	int size = mdb->size;
 	
@@ -1321,7 +1321,7 @@ static int meshdeform_index(MeshDeformBind *mdb, int x, int y, int z, int n)
 	return x + y * size + z * size * size;
 }
 
-static void meshdeform_cell_center(MeshDeformBind *mdb, int x, int y, int z, int n, float *center)
+BLI_INLINE void meshdeform_cell_center(MeshDeformBind *mdb, int x, int y, int z, int n, float *center)
 {
 	x += MESHDEFORM_OFFSET[n][0];
 	y += MESHDEFORM_OFFSET[n][1];




More information about the Bf-blender-cvs mailing list