diff options
author | Mitchell Stokes <mogurijin@gmail.com> | 2014-04-07 03:30:59 +0400 |
---|---|---|
committer | Mitchell Stokes <mogurijin@gmail.com> | 2014-04-07 03:30:59 +0400 |
commit | fe05f97841c0ee3e2a6e15f2252ad160fefc3509 (patch) | |
tree | 2a672e5d82448f43471ddb529a95fa547d5c311e /source/gameengine/Ketsji/KX_KetsjiEngine.cpp | |
parent | be8b4b8b0c4d4fdeed6ebf88d8a3bd480e4c48ce (diff) |
BGE: Multi-threading animation updates and skinning.
This required BL_ArmatureObject to have tighter control over armatures and poses.
Also, (Blender) armature objects are now copied instead of shared between
BL_ArmatureObjects to avoid race conditions. Also, due to the armature copy,
shape key drivers need a bit of extra fiddling to get the correct armature copy.
Initially OpenMP was used for threading, but then BLI_task was used due to being
less compiler dependent.
This commit also places time spent on skinning updates in the Animation
profiler category (was previously under the Rasterizer category).
Diffstat (limited to 'source/gameengine/Ketsji/KX_KetsjiEngine.cpp')
-rw-r--r-- | source/gameengine/Ketsji/KX_KetsjiEngine.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp index 231590cde83..96a3845a439 100644 --- a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp +++ b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp @@ -37,6 +37,8 @@ #include <iostream> #include <stdio.h> +#include "BLI_task.h" + #include "KX_KetsjiEngine.h" #include "ListValue.h" @@ -185,6 +187,7 @@ KX_KetsjiEngine::KX_KetsjiEngine(KX_ISystem* system) m_pyprofiledict = PyDict_New(); #endif + m_taskscheduler = BLI_task_scheduler_create(TASK_SCHEDULER_AUTO_THREADS); } @@ -201,6 +204,9 @@ KX_KetsjiEngine::~KX_KetsjiEngine() #ifdef WITH_PYTHON Py_CLEAR(m_pyprofiledict); #endif + + if (m_taskscheduler) + BLI_task_scheduler_free(m_taskscheduler); } |