blender/source/gameengine/GamePlayer/ghost
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
..
CMakeLists.txt remove $Id: tags after discussion on the mailign list: http://markmail.org/message/fp7ozcywxum3ar7n 2011-10-23 17:52:20 +00:00
GPG_Application.cpp style cleanup 2012-09-16 04:58:18 +00:00
GPG_Application.h Fix for [#32361] "Blenderplayer quad-buffer maximum 100Hz Fps" reported by HG1. 2012-08-18 23:46:37 +00:00
GPG_Canvas.cpp Committing patch "[#27676] Change window size/resolution in realtime" by me. 2012-01-22 20:25:25 +00:00
GPG_Canvas.h code cleanup: check for msvc directly when using warning pragma's. 2012-10-15 02:15:07 +00:00
GPG_ghost.cpp Image thread safe improvements 2012-11-15 15:59:58 +00:00
GPG_KeyboardDevice.cpp style cleanup: bge, switch statements mostly. 2012-10-21 07:58:38 +00:00
GPG_KeyboardDevice.h code cleanup: check for msvc directly when using warning pragma's. 2012-10-15 02:15:07 +00:00
GPG_System.cpp code cleanup: float formatting was confusing in some cases - eg: (0.,0.,0.) 2012-04-11 08:15:13 +00:00
GPG_System.h code cleanup: make header defines more consistent, JOYSENSOR header guard had a typo too. 2012-10-09 13:36:42 +00:00
SConscript buildsystem cleanup: remove duplicate source & includes for scons, 2012-11-14 01:41:24 +00:00