Blender Git Commit Log
Git Commits -> Revision 5c6f630
Revision 5c6f630 by Sergey Sharybin (master) November 15, 2012, 15:59 (GMT) |
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 :) |
Commit Details:
Full Hash: 5c6f6301b02a68c6569e14a70b3968a69fa099e7
SVN Revision: 52235
Parent Commit: 613cf7a
Lines Changed: +604, -292
52 Modified Paths:
/intern/cycles/kernel/kernel_shader.h (+1, -1) (Diff)
/source/blender/blenkernel/BKE_image.h (+6, -4) (Diff)
/source/blender/blenkernel/intern/blender.c (+2, -0) (Diff)
/source/blender/blenkernel/intern/brush.c (+0, -2) (Diff)
/source/blender/blenkernel/intern/image.c (+147, -116) (Diff)
/source/blender/blenlib/BLI_threads.h (+17, -0) (Diff)
/source/blender/blenlib/intern/threads.c (+36, -0) (Diff)
/source/blender/blenloader/intern/readfile.c (+1, -1) (Diff)
/source/blender/collada/ImageExporter.cpp (+3, -1) (Diff)
/source/blender/compositor/nodes/COM_ImageNode.cpp (+2, -1) (Diff)
/source/blender/compositor/operations/COM_ImageOperation.cpp (+4, -1) (Diff)
/source/blender/compositor/operations/COM_ViewerBaseOperation.cpp (+3, -7) (Diff)
/source/blender/editors/include/ED_image.h (+1, -1) (Diff)
/source/blender/editors/object/object_bake.c (+30, -16) (Diff)
/source/blender/editors/object/object_edit.c (+3, -1) (Diff)
/source/blender/editors/render/render_internal.c (+1, -1) (Diff)
/source/blender/editors/render/render_opengl.c (+2, -2) (Diff)
/source/blender/editors/render/render_preview.c (+3, -1) (Diff)
/source/blender/editors/sculpt_paint/paint_image.c (+52, -20) (Diff)
/source/blender/editors/space_image/image_buttons.c (+2, -3) (Diff)
/source/blender/editors/space_image/image_draw.c (+8, -3) (Diff)
/source/blender/editors/space_image/image_edit.c (+10, -6) (Diff)
/source/blender/editors/space_image/image_ops.c (+33, -22) (Diff)
/source/blender/editors/space_image/space_image.c (+1, -1) (Diff)
/source/blender/editors/space_info/info_ops.c (+6, -2) (Diff)
/source/blender/editors/space_node/drawnode.c (+4, -2) (Diff)
/source/blender/editors/space_node/node_view.c (+4, -4) (Diff)
/source/blender/editors/space_view3d/drawmesh.c (+1, -1) (Diff)
/source/blender/editors/space_view3d/drawobject.c (+3, -1) (Diff)
/source/blender/editors/space_view3d/view3d_draw.c (+2, -1) (Diff)
/source/blender/gpu/intern/gpu_draw.c (+11, -3) (Diff)
/source/blender/gpu/intern/gpu_material.c (+2, -1) (Diff)
/source/blender/makesrna/intern/rna_image.c (+16, -11) (Diff)
/source/blender/makesrna/intern/rna_image_api.c (+14, -5) (Diff)
/source/blender/makesrna/intern/rna_space.c (+2, -2) (Diff)
/source/blender/nodes/composite/nodes/node_composite_image.c (+17, -5) (Diff)
/source/blender/nodes/composite/nodes/node_composite_splitViewer.c (+1, -1) (Diff)
/source/blender/nodes/composite/nodes/node_composite_viewer.c (+1, -1) (Diff)
/source/blender/nodes/shader/nodes/node_shader_texture.c (+2, -1) (Diff)
/source/blender/nodes/shader/nodes/node_shader_tex_environment.c (+2, -1) (Diff)
/source/blender/nodes/shader/nodes/node_shader_tex_image.c (+2, -1) (Diff)
/source/blender/nodes/texture/nodes/node_texture_image.c (+3, -1) (Diff)
/source/blender/render/intern/source/envmap.c (+2, -1) (Diff)
/source/blender/render/intern/source/imagetexture.c (+68, -13) (Diff)
/source/blender/render/intern/source/pipeline.c (+1, -0) (Diff)
/source/blender/render/intern/source/rendercore.c (+21, -7) (Diff)
/source/blender/render/intern/source/render_texture.c (+22, -8) (Diff)
/source/blender/render/intern/source/voxeldata.c (+7, -4) (Diff)
/source/blender/windowmanager/intern/wm_playanim.c (+2, -0) (Diff)
/source/creator/creator.c (+1, -0) (Diff)
/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp (+3, -0) (Diff)
/source/gameengine/Ketsji/BL_Texture.cpp (+16, -4) (Diff)
/source/blender/blenkernel/BKE_image.h (+6, -4) (Diff)
/source/blender/blenkernel/intern/blender.c (+2, -0) (Diff)
/source/blender/blenkernel/intern/brush.c (+0, -2) (Diff)
/source/blender/blenkernel/intern/image.c (+147, -116) (Diff)
/source/blender/blenlib/BLI_threads.h (+17, -0) (Diff)
/source/blender/blenlib/intern/threads.c (+36, -0) (Diff)
/source/blender/blenloader/intern/readfile.c (+1, -1) (Diff)
/source/blender/collada/ImageExporter.cpp (+3, -1) (Diff)
/source/blender/compositor/nodes/COM_ImageNode.cpp (+2, -1) (Diff)
/source/blender/compositor/operations/COM_ImageOperation.cpp (+4, -1) (Diff)
/source/blender/compositor/operations/COM_ViewerBaseOperation.cpp (+3, -7) (Diff)
/source/blender/editors/include/ED_image.h (+1, -1) (Diff)
/source/blender/editors/object/object_bake.c (+30, -16) (Diff)
/source/blender/editors/object/object_edit.c (+3, -1) (Diff)
/source/blender/editors/render/render_internal.c (+1, -1) (Diff)
/source/blender/editors/render/render_opengl.c (+2, -2) (Diff)
/source/blender/editors/render/render_preview.c (+3, -1) (Diff)
/source/blender/editors/sculpt_paint/paint_image.c (+52, -20) (Diff)
/source/blender/editors/space_image/image_buttons.c (+2, -3) (Diff)
/source/blender/editors/space_image/image_draw.c (+8, -3) (Diff)
/source/blender/editors/space_image/image_edit.c (+10, -6) (Diff)
/source/blender/editors/space_image/image_ops.c (+33, -22) (Diff)
/source/blender/editors/space_image/space_image.c (+1, -1) (Diff)
/source/blender/editors/space_info/info_ops.c (+6, -2) (Diff)
/source/blender/editors/space_node/drawnode.c (+4, -2) (Diff)
/source/blender/editors/space_node/node_view.c (+4, -4) (Diff)
/source/blender/editors/space_view3d/drawmesh.c (+1, -1) (Diff)
/source/blender/editors/space_view3d/drawobject.c (+3, -1) (Diff)
/source/blender/editors/space_view3d/view3d_draw.c (+2, -1) (Diff)
/source/blender/gpu/intern/gpu_draw.c (+11, -3) (Diff)
/source/blender/gpu/intern/gpu_material.c (+2, -1) (Diff)
/source/blender/makesrna/intern/rna_image.c (+16, -11) (Diff)
/source/blender/makesrna/intern/rna_image_api.c (+14, -5) (Diff)
/source/blender/makesrna/intern/rna_space.c (+2, -2) (Diff)
/source/blender/nodes/composite/nodes/node_composite_image.c (+17, -5) (Diff)
/source/blender/nodes/composite/nodes/node_composite_splitViewer.c (+1, -1) (Diff)
/source/blender/nodes/composite/nodes/node_composite_viewer.c (+1, -1) (Diff)
/source/blender/nodes/shader/nodes/node_shader_texture.c (+2, -1) (Diff)
/source/blender/nodes/shader/nodes/node_shader_tex_environment.c (+2, -1) (Diff)
/source/blender/nodes/shader/nodes/node_shader_tex_image.c (+2, -1) (Diff)
/source/blender/nodes/texture/nodes/node_texture_image.c (+3, -1) (Diff)
/source/blender/render/intern/source/envmap.c (+2, -1) (Diff)
/source/blender/render/intern/source/imagetexture.c (+68, -13) (Diff)
/source/blender/render/intern/source/pipeline.c (+1, -0) (Diff)
/source/blender/render/intern/source/rendercore.c (+21, -7) (Diff)
/source/blender/render/intern/source/render_texture.c (+22, -8) (Diff)
/source/blender/render/intern/source/voxeldata.c (+7, -4) (Diff)
/source/blender/windowmanager/intern/wm_playanim.c (+2, -0) (Diff)
/source/creator/creator.c (+1, -0) (Diff)
/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp (+3, -0) (Diff)
/source/gameengine/Ketsji/BL_Texture.cpp (+16, -4) (Diff)