blender/source/gameengine/Ketsji
Sergey Sharybin 5c6f6301b0 Image thread safe improvements
This commit makes BKE_image_acquire_ibuf referencing result, which means once
some area requested for image buffer, it'll be guaranteed this buffer wouldn't
be freed by image signal.

To de-reference buffer BKE_image_release_ibuf should now always be used.

To make referencing working correct we can not rely on result of
image_get_ibuf_threadsafe called outside from thread lock. This is so because
we need to guarantee getting image buffer from list of loaded buffers and it's
referencing happens atomic. Without lock here it is possible that between call
of image_get_ibuf_threadsafe and referencing the buffer IMA_SIGNAL_FREE would
be called. Image signal handling too is blocking now to prevent such a
situation.

Threads are locking by spinlock, which are faster than mutexes. There were some
slowdown reports in the past about render slowdown when using OSX on Xeon CPU.
It shouldn't happen with spin locks, but more tests on different hardware would
be really welcome. So far can not see speed regressions on own computers.

This commit also removes BKE_image_get_ibuf, because it was not so intuitive
when get_ibuf and acquire_ibuf should be used.

Thanks to Ton and Brecht for discussion/review :)
2012-11-15 15:59:58 +00:00
..
KXNetwork code cleanup: make header defines more consistent, JOYSENSOR header guard had a typo too. 2012-10-09 13:36:42 +00:00
BL_Action.cpp style cleanup: bge, switch statements mostly. 2012-10-21 07:58:38 +00:00
BL_Action.h code cleanup: make header defines more consistent, JOYSENSOR header guard had a typo too. 2012-10-09 13:36:42 +00:00
BL_ActionManager.cpp remove $Id: tags after discussion on the mailign list: http://markmail.org/message/fp7ozcywxum3ar7n 2011-10-23 17:52:20 +00:00
BL_ActionManager.h code cleanup: make header defines more consistent, JOYSENSOR header guard had a typo too. 2012-10-09 13:36:42 +00:00
BL_BlenderShader.cpp remove CD_POLYINDEX customdata layer: 2012-10-30 19:20:17 +00:00
BL_BlenderShader.h code cleanup: make header defines more consistent, JOYSENSOR header guard had a typo too. 2012-10-09 13:36:42 +00:00
BL_Material.cpp bge mesh conversion speedup, avoid calling ConvertMaterial() on every face. 2012-11-11 01:54:30 +00:00
BL_Material.h bge mesh conversion speedup, avoid calling ConvertMaterial() on every face. 2012-11-11 01:54:30 +00:00
BL_Shader.cpp - property sensor was converting floating point values to text then back to float - for floating point properties. 2012-11-10 22:32:15 +00:00
BL_Shader.h - property sensor was converting floating point values to text then back to float - for floating point properties. 2012-11-10 22:32:15 +00:00
BL_Texture.cpp Image thread safe improvements 2012-11-15 15:59:58 +00:00
BL_Texture.h code cleanup: make header defines more consistent, JOYSENSOR header guard had a typo too. 2012-10-09 13:36:42 +00:00
CMakeLists.txt Compile fixes for recent boost changes 2012-11-05 15:23:09 +00:00
KX_ArmatureSensor.cpp style cleanup 2012-09-16 04:58:18 +00:00
KX_ArmatureSensor.h code cleanup: make header defines more consistent, JOYSENSOR header guard had a typo too. 2012-10-09 13:36:42 +00:00
KX_BlenderMaterial.cpp bge mesh conversion speedup, avoid calling ConvertMaterial() on every face. 2012-11-11 01:54:30 +00:00
KX_BlenderMaterial.h bge mesh conversion speedup, avoid calling ConvertMaterial() on every face. 2012-11-11 01:54:30 +00:00
KX_BulletPhysicsController.cpp style cleanup 2012-09-16 04:58:18 +00:00
KX_BulletPhysicsController.h code cleanup: make header defines more consistent, JOYSENSOR header guard had a typo too. 2012-10-09 13:36:42 +00:00
KX_Camera.cpp style cleanup 2012-10-29 02:11:40 +00:00
KX_Camera.h style cleanup 2012-10-29 02:11:40 +00:00
KX_CameraActuator.cpp style cleanup 2012-10-27 10:42:28 +00:00
KX_CameraActuator.h code cleanup: make header defines more consistent, JOYSENSOR header guard had a typo too. 2012-10-09 13:36:42 +00:00
KX_CameraIpoSGController.cpp remove $Id: tags after discussion on the mailign list: http://markmail.org/message/fp7ozcywxum3ar7n 2011-10-23 17:52:20 +00:00
KX_CameraIpoSGController.h code cleanup: make header defines more consistent, JOYSENSOR header guard had a typo too. 2012-10-09 13:36:42 +00:00
KX_CharacterWrapper.cpp BGE: This patch adds a character wrapper (similar to the already implemented vehicle wrapper) to control character physics options. Currently supported options are: 2012-11-04 20:56:02 +00:00
KX_CharacterWrapper.h code cleanup: some warnings and formatting for PyMethodDef's in the BGE. 2012-11-10 05:42:50 +00:00
KX_ClientObjectInfo.h code cleanup: make header defines more consistent, JOYSENSOR header guard had a typo too. 2012-10-09 13:36:42 +00:00
KX_ConstraintActuator.cpp style cleanup 2012-09-16 04:58:18 +00:00
KX_ConstraintActuator.h code cleanup: make header defines more consistent, JOYSENSOR header guard had a typo too. 2012-10-09 13:36:42 +00:00
KX_ConstraintWrapper.cpp style cleanup 2012-10-22 08:15:51 +00:00
KX_ConstraintWrapper.h code cleanup: make header defines more consistent, JOYSENSOR header guard had a typo too. 2012-10-09 13:36:42 +00:00
KX_ConvertPhysicsObject.h code cleanup: make header defines more consistent, JOYSENSOR header guard had a typo too. 2012-10-09 13:36:42 +00:00
KX_ConvertPhysicsObjects.cpp remove CD_POLYINDEX customdata layer: 2012-10-30 19:20:17 +00:00
KX_Dome.cpp style cleanup: bge, switch statements mostly. 2012-10-21 07:58:38 +00:00
KX_Dome.h BGE: Setting up the RAS_ICanvas interface as the primary way to alter the OpenGL 2012-10-08 03:28:11 +00:00
KX_EmptyObject.cpp remove $Id: tags after discussion on the mailign list: http://markmail.org/message/fp7ozcywxum3ar7n 2011-10-23 17:52:20 +00:00
KX_EmptyObject.h code cleanup: make header defines more consistent, JOYSENSOR header guard had a typo too. 2012-10-09 13:36:42 +00:00
KX_FontObject.cpp style cleanup 2012-10-22 08:15:51 +00:00
KX_FontObject.h code cleanup: make header defines more consistent, JOYSENSOR header guard had a typo too. 2012-10-09 13:36:42 +00:00
KX_GameActuator.cpp remove $Id: tags after discussion on the mailign list: http://markmail.org/message/fp7ozcywxum3ar7n 2011-10-23 17:52:20 +00:00
KX_GameActuator.h quiet double promotion warnings for the game engine. 2012-07-18 23:03:27 +00:00
KX_GameObject.cpp BGE: Renaming KX_GameObject.group_parent and group_children to groupObject and groupMembers to be a bit more descriptive and match the rest of the BGE Py API. KX_MeshProxy.transform_uv has also been renamed to transformUV. It would be nice to switch to PEP8 names for the BGE Python API, but for now, consistency is better. 2012-11-13 04:38:34 +00:00
KX_GameObject.h BGE: Renaming KX_GameObject.group_parent and group_children to groupObject and groupMembers to be a bit more descriptive and match the rest of the BGE Py API. KX_MeshProxy.transform_uv has also been renamed to transformUV. It would be nice to switch to PEP8 names for the BGE Python API, but for now, consistency is better. 2012-11-13 04:38:34 +00:00
KX_IInterpolator.h style cleanup 2012-09-16 04:58:18 +00:00
KX_IPhysicsController.cpp BGE patch #28476: Character object physics type 2012-05-28 21:36:29 +00:00
KX_IPhysicsController.h code cleanup: make header defines more consistent, JOYSENSOR header guard had a typo too. 2012-10-09 13:36:42 +00:00
KX_IPO_SGController.cpp style cleanup: tabs & whitespace 2012-11-03 15:35:03 +00:00
KX_IPO_SGController.h code cleanup: make header defines more consistent, JOYSENSOR header guard had a typo too. 2012-10-09 13:36:42 +00:00
KX_IpoActuator.cpp style cleanup 2012-10-22 08:15:51 +00:00
KX_IpoActuator.h code cleanup: make header defines more consistent, JOYSENSOR header guard had a typo too. 2012-10-09 13:36:42 +00:00
KX_IPOTransform.h style cleanup 2012-10-29 02:11:40 +00:00
KX_IScalarInterpolator.h style cleanup 2012-09-16 04:58:18 +00:00
KX_ISceneConverter.h code cleanup: make header defines more consistent, JOYSENSOR header guard had a typo too. 2012-10-09 13:36:42 +00:00
KX_ISystem.h optionally use guarded alloc for tiles compositor, also replace allocation functions with a macro. 2012-06-25 09:14:37 +00:00
KX_KetsjiEngine.cpp BGE: Committing patch #32291 "Updated profiling layout for BGE" from Angus Hollands (agoose77). This patch adds a headers for the profiling information and for the debug properties so they are no longer jumbled together. It also modifies how debug properties are displayed; changes "swap" to "Frametime"; and changes the display from seconds to ms, which is much more useful. 2012-10-30 22:45:08 +00:00
KX_KetsjiEngine.h code cleanup: make header defines more consistent, JOYSENSOR header guard had a typo too. 2012-10-09 13:36:42 +00:00
KX_Light.cpp style cleanup 2012-10-22 08:15:51 +00:00
KX_Light.h code cleanup: make header defines more consistent, JOYSENSOR header guard had a typo too. 2012-10-09 13:36:42 +00:00
KX_LightIpoSGController.cpp remove $Id: tags after discussion on the mailign list: http://markmail.org/message/fp7ozcywxum3ar7n 2011-10-23 17:52:20 +00:00
KX_LightIpoSGController.h code cleanup: make header defines more consistent, JOYSENSOR header guard had a typo too. 2012-10-09 13:36:42 +00:00
KX_MaterialIpoController.cpp doxygen: gameengine/Ketsji tagged. 2011-02-25 13:35:59 +00:00
KX_MaterialIpoController.h code cleanup: make header defines more consistent, JOYSENSOR header guard had a typo too. 2012-10-09 13:36:42 +00:00
KX_MeshProxy.cpp BGE: Renaming KX_GameObject.group_parent and group_children to groupObject and groupMembers to be a bit more descriptive and match the rest of the BGE Py API. KX_MeshProxy.transform_uv has also been renamed to transformUV. It would be nice to switch to PEP8 names for the BGE Python API, but for now, consistency is better. 2012-11-13 04:38:34 +00:00
KX_MeshProxy.h add 2 new utility functions to the BGE mesh py api. 2012-11-10 09:45:43 +00:00
KX_MotionState.cpp remove $Id: tags after discussion on the mailign list: http://markmail.org/message/fp7ozcywxum3ar7n 2011-10-23 17:52:20 +00:00
KX_MotionState.h code cleanup: make header defines more consistent, JOYSENSOR header guard had a typo too. 2012-10-09 13:36:42 +00:00
KX_MouseFocusSensor.cpp style cleanup 2012-10-22 08:15:51 +00:00
KX_MouseFocusSensor.h style cleanup 2012-10-29 02:11:40 +00:00
KX_NavMeshObject.cpp style cleanup 2012-10-22 08:15:51 +00:00
KX_NavMeshObject.h code cleanup: make header defines more consistent, JOYSENSOR header guard had a typo too. 2012-10-09 13:36:42 +00:00
KX_NearSensor.cpp remove $Id: tags after discussion on the mailign list: http://markmail.org/message/fp7ozcywxum3ar7n 2011-10-23 17:52:20 +00:00
KX_NearSensor.h code cleanup: make header defines more consistent, JOYSENSOR header guard had a typo too. 2012-10-09 13:36:42 +00:00
KX_ObColorIpoSGController.cpp remove $Id: tags after discussion on the mailign list: http://markmail.org/message/fp7ozcywxum3ar7n 2011-10-23 17:52:20 +00:00
KX_ObColorIpoSGController.h code cleanup: make header defines more consistent, JOYSENSOR header guard had a typo too. 2012-10-09 13:36:42 +00:00
KX_ObjectActuator.cpp Fix for [#33090] "Segfault/Crash with Empty and Motion Actuator, Keyboard Sensor" reported by Martin Felke (scorpion81). 2012-11-05 15:13:54 +00:00
KX_ObjectActuator.h code cleanup: make header defines more consistent, JOYSENSOR header guard had a typo too. 2012-10-09 13:36:42 +00:00
KX_ObstacleSimulation.cpp style cleanup 2012-09-16 04:58:18 +00:00
KX_ObstacleSimulation.h style cleanup 2012-09-16 04:58:18 +00:00
KX_OrientationInterpolator.cpp style cleanup, use { on newline after function definition. 2012-02-25 16:49:59 +00:00
KX_OrientationInterpolator.h optionally use guarded alloc for tiles compositor, also replace allocation functions with a macro. 2012-06-25 09:14:37 +00:00
KX_ParentActuator.cpp style cleanup 2012-09-16 04:58:18 +00:00
KX_ParentActuator.h code cleanup: make header defines more consistent, JOYSENSOR header guard had a typo too. 2012-10-09 13:36:42 +00:00
KX_PhysicsEngineEnums.h code cleanup: make header defines more consistent, JOYSENSOR header guard had a typo too. 2012-10-09 13:36:42 +00:00
KX_PhysicsObjectWrapper.cpp style cleanup 2012-09-16 04:58:18 +00:00
KX_PhysicsObjectWrapper.h code cleanup: make header defines more consistent, JOYSENSOR header guard had a typo too. 2012-10-09 13:36:42 +00:00
KX_PhysicsPropertiesobsolete.h code cleanup: make header defines more consistent, JOYSENSOR header guard had a typo too. 2012-10-09 13:36:42 +00:00
KX_PolygonMaterial.cpp game engine material conversion: don't use the material to convert vertex colors, then extract back out (pre face). 2012-11-11 00:39:08 +00:00
KX_PolygonMaterial.h game engine material conversion: don't use the material to convert vertex colors, then extract back out (pre face). 2012-11-11 00:39:08 +00:00
KX_PolyProxy.cpp style cleanup 2012-10-22 08:15:51 +00:00
KX_PolyProxy.h code cleanup: make header defines more consistent, JOYSENSOR header guard had a typo too. 2012-10-09 13:36:42 +00:00
KX_PositionInterpolator.cpp style cleanup, use { on newline after function definition. 2012-02-25 16:49:59 +00:00
KX_PositionInterpolator.h optionally use guarded alloc for tiles compositor, also replace allocation functions with a macro. 2012-06-25 09:14:37 +00:00
KX_PyConstraintBinding.cpp BGE: This patch adds a character wrapper (similar to the already implemented vehicle wrapper) to control character physics options. Currently supported options are: 2012-11-04 20:56:02 +00:00
KX_PyConstraintBinding.h code cleanup: make header defines more consistent, JOYSENSOR header guard had a typo too. 2012-10-09 13:36:42 +00:00
KX_PyMath.cpp style cleanup 2012-10-22 08:15:51 +00:00
KX_PyMath.h code cleanup: make header defines more consistent, JOYSENSOR header guard had a typo too. 2012-10-09 13:36:42 +00:00
KX_PythonInit.cpp style cleanup: tabs & whitespace 2012-11-03 15:35:03 +00:00
KX_PythonInit.h code cleanup: make header defines more consistent, JOYSENSOR header guard had a typo too. 2012-10-09 13:36:42 +00:00
KX_PythonInitTypes.cpp BGE: This patch adds a character wrapper (similar to the already implemented vehicle wrapper) to control character physics options. Currently supported options are: 2012-11-04 20:56:02 +00:00
KX_PythonInitTypes.h style cleanup 2012-09-16 04:58:18 +00:00
KX_PythonMain.cpp code cleanup: remove $Id's that crept back in, also osl style edits 2012-10-23 11:47:23 +00:00
KX_PythonMain.h code cleanup: remove $Id's that crept back in, also osl style edits 2012-10-23 11:47:23 +00:00
KX_PythonSeq.cpp style cleanup: bge, switch statements mostly. 2012-10-21 07:58:38 +00:00
KX_PythonSeq.h code cleanup: make header defines more consistent, JOYSENSOR header guard had a typo too. 2012-10-09 13:36:42 +00:00
KX_RadarSensor.cpp style cleanup 2012-10-22 08:15:51 +00:00
KX_RadarSensor.h code cleanup: make header defines more consistent, JOYSENSOR header guard had a typo too. 2012-10-09 13:36:42 +00:00
KX_RayCast.cpp style cleanup: bge, switch statements mostly. 2012-10-21 07:58:38 +00:00
KX_RayCast.h optionally use guarded alloc for tiles compositor, also replace allocation functions with a macro. 2012-06-25 09:14:37 +00:00
KX_RayEventManager.cpp remove $Id: tags after discussion on the mailign list: http://markmail.org/message/fp7ozcywxum3ar7n 2011-10-23 17:52:20 +00:00
KX_RayEventManager.h code cleanup: make header defines more consistent, JOYSENSOR header guard had a typo too. 2012-10-09 13:36:42 +00:00
KX_RaySensor.cpp style cleanup 2012-09-16 04:58:18 +00:00
KX_RaySensor.h code cleanup: make header defines more consistent, JOYSENSOR header guard had a typo too. 2012-10-09 13:36:42 +00:00
KX_SCA_AddObjectActuator.cpp code cleanup: some warnings and formatting for PyMethodDef's in the BGE. 2012-11-10 05:42:50 +00:00
KX_SCA_AddObjectActuator.h style cleanup: trailing tabs & expand some non prefix tabs into spaces. 2012-10-21 05:46:41 +00:00
KX_SCA_DynamicActuator.cpp style cleanup 2012-09-16 04:58:18 +00:00
KX_SCA_DynamicActuator.h quiet double promotion warnings for the game engine. 2012-07-18 23:03:27 +00:00
KX_SCA_EndObjectActuator.cpp code cleanup: some warnings and formatting for PyMethodDef's in the BGE. 2012-11-10 05:42:50 +00:00
KX_SCA_EndObjectActuator.h style cleanup: also correct some doxy comments 2012-08-18 13:07:48 +00:00
KX_SCA_ReplaceMeshActuator.cpp style cleanup 2012-09-16 04:58:18 +00:00
KX_SCA_ReplaceMeshActuator.h code cleanup: make header defines more consistent, JOYSENSOR header guard had a typo too. 2012-10-09 13:36:42 +00:00
KX_ScalarInterpolator.cpp style cleanup, use { on newline after function definition. 2012-02-25 16:49:59 +00:00
KX_ScalarInterpolator.h optionally use guarded alloc for tiles compositor, also replace allocation functions with a macro. 2012-06-25 09:14:37 +00:00
KX_ScalingInterpolator.cpp style cleanup, use { on newline after function definition. 2012-02-25 16:49:59 +00:00
KX_ScalingInterpolator.h optionally use guarded alloc for tiles compositor, also replace allocation functions with a macro. 2012-06-25 09:14:37 +00:00
KX_Scene.cpp BGE: Committing patch [#32697] "New BGE gravity API" by HG1. 2012-11-10 03:11:18 +00:00
KX_Scene.h BGE: Committing patch [#32697] "New BGE gravity API" by HG1. 2012-11-10 03:11:18 +00:00
KX_SceneActuator.cpp style cleanup 2012-09-16 04:58:18 +00:00
KX_SceneActuator.h code cleanup: make header defines more consistent, JOYSENSOR header guard had a typo too. 2012-10-09 13:36:42 +00:00
KX_SG_BoneParentNodeRelationship.cpp style cleanup 2012-09-16 04:58:18 +00:00
KX_SG_BoneParentNodeRelationship.h style cleanup 2012-09-16 04:58:18 +00:00
KX_SG_NodeRelationships.cpp style cleanup 2012-09-16 04:58:18 +00:00
KX_SG_NodeRelationships.h style cleanup 2012-09-16 04:58:18 +00:00
KX_SoundActuator.cpp Audaspace: 2012-11-05 14:24:35 +00:00
KX_SoundActuator.h Audaspace: 2012-11-05 14:24:35 +00:00
KX_StateActuator.cpp remove $Id: tags after discussion on the mailign list: http://markmail.org/message/fp7ozcywxum3ar7n 2011-10-23 17:52:20 +00:00
KX_StateActuator.h use __ prefix on header guards to avoid mixing up defines with api functions / classes. 2012-02-23 10:41:31 +00:00
KX_SteeringActuator.cpp style cleanup 2012-09-16 04:58:18 +00:00
KX_SteeringActuator.h code cleanup: make header defines more consistent, JOYSENSOR header guard had a typo too. 2012-10-09 13:36:42 +00:00
KX_TimeCategoryLogger.cpp code cleanup: float formatting was confusing in some cases - eg: (0.,0.,0.) 2012-04-11 08:15:13 +00:00
KX_TimeCategoryLogger.h code cleanup: check for msvc directly when using warning pragma's. 2012-10-15 02:15:07 +00:00
KX_TimeLogger.cpp code cleanup: float formatting was confusing in some cases - eg: (0.,0.,0.) 2012-04-11 08:15:13 +00:00
KX_TimeLogger.h code cleanup: check for msvc directly when using warning pragma's. 2012-10-15 02:15:07 +00:00
KX_TouchEventManager.cpp style cleanup: follow style guide for/with/if spacing 2012-03-24 07:52:14 +00:00
KX_TouchEventManager.h code cleanup: make header defines more consistent, JOYSENSOR header guard had a typo too. 2012-10-09 13:36:42 +00:00
KX_TouchSensor.cpp style cleanup 2012-10-22 08:15:51 +00:00
KX_TouchSensor.h code cleanup: make header defines more consistent, JOYSENSOR header guard had a typo too. 2012-10-09 13:36:42 +00:00
KX_TrackToActuator.cpp style cleanup 2012-09-16 04:58:18 +00:00
KX_TrackToActuator.h code cleanup: make header defines more consistent, JOYSENSOR header guard had a typo too. 2012-10-09 13:36:42 +00:00
KX_VehicleWrapper.cpp style cleanup 2012-09-16 04:58:18 +00:00
KX_VehicleWrapper.h code cleanup: make header defines more consistent, JOYSENSOR header guard had a typo too. 2012-10-09 13:36:42 +00:00
KX_VertexProxy.cpp add argument so recent bge function mesh.transform_uv() so you can optionally transform between UV1 / UV2 2012-11-10 10:26:39 +00:00
KX_VertexProxy.h add argument so recent bge function mesh.transform_uv() so you can optionally transform between UV1 / UV2 2012-11-10 10:26:39 +00:00
KX_VisibilityActuator.cpp remove $Id: tags after discussion on the mailign list: http://markmail.org/message/fp7ozcywxum3ar7n 2011-10-23 17:52:20 +00:00
KX_VisibilityActuator.h use __ prefix on header guards to avoid mixing up defines with api functions / classes. 2012-02-23 10:41:31 +00:00
KX_WorldInfo.cpp remove $Id: tags after discussion on the mailign list: http://markmail.org/message/fp7ozcywxum3ar7n 2011-10-23 17:52:20 +00:00
KX_WorldInfo.h code cleanup: make header defines more consistent, JOYSENSOR header guard had a typo too. 2012-10-09 13:36:42 +00:00
KX_WorldIpoController.cpp remove $Id: tags after discussion on the mailign list: http://markmail.org/message/fp7ozcywxum3ar7n 2011-10-23 17:52:20 +00:00
KX_WorldIpoController.h code cleanup: make header defines more consistent, JOYSENSOR header guard had a typo too. 2012-10-09 13:36:42 +00:00
SConscript Compile fixes for recent boost changes 2012-11-05 15:23:09 +00:00