Blender Git Commit Log
Git Commits -> Revision b466286
Revision b466286 by Brecht Van Lommel (master) September 30, 2009, 18:18 (GMT) |
Render & Compositing Thread Fixes * Rendering twice or more could crash layer/pass buttons. * Compositing would crash while drawing the image. * Rendering animations could also crash drawing the image. * Compositing could crash * Starting to rendering while preview render / compo was still running could crash. * Exiting while rendering an animation would not abort the renderer properly, making Blender seemingly freeze. * Fixes theoretically possible issue with setting malloc lock with nested threads. * Drawing previews inside nodes could crash when those nodes were being rendered at the same time. There's more crashes, manipulating the scene data or undo can still crash, this commit only focuses on making sure the image buffer and render result access is thread safe. Implementation: * Rather than assuming the render result does not get freed during render, which seems to be quite difficult to do given that e.g. the compositor is allowed to change the size of the buffer or output different passes, the render result is now protected with a read/write mutex. * The read/write mutex allows multiple readers (and pixel writers) at the same time, but only allows one writer to manipulate the data structure. * Added BKE_image_acquire_ibuf/BKE_image_release_ibuf to access images being rendered, cases where this is not needed (most code) can still use BKE_image_get_ibuf. * The job manager now allows only one rendering job at the same time, rather than the G.rendering check which was not reliable. |
Commit Details:
Full Hash: b466286c3e0e64860299a4737b9cb13c8fc15618
SVN Revision: 23570
Parent Commit: 727745b
Lines Changed: +594, -213
29 Modified Paths:
/intern/guardedalloc/intern/mallocn.c (+21, -3) (Diff)
/source/blender/blenkernel/BKE_image.h (+7, -1) (Diff)
/source/blender/blenkernel/intern/image.c (+49, -12) (Diff)
/source/blender/blenkernel/intern/node.c (+1, -0) (Diff)
/source/blender/blenkernel/intern/sequence.c (+3, -1) (Diff)
/source/blender/blenlib/BLI_threads.h (+41, -12) (Diff)
/source/blender/blenlib/intern/threads.c (+76, -18) (Diff)
/source/blender/editors/include/ED_image.h (+4, -1) (Diff)
/source/blender/editors/render/render_preview.c (+8, -15) (Diff)
/source/blender/editors/screen/screendump.c (+1, -1) (Diff)
/source/blender/editors/screen/screen_ops.c (+14, -7) (Diff)
/source/blender/editors/space_file/writeimage.c (+11, -3) (Diff)
/source/blender/editors/space_image/image_buttons.c (+18, -12) (Diff)
/source/blender/editors/space_image/image_draw.c (+8, -4) (Diff)
/source/blender/editors/space_image/image_ops.c (+51, -29) (Diff)
/source/blender/editors/space_image/space_image.c (+46, -25) (Diff)
/source/blender/editors/space_node/node_draw.c (+10, -2) (Diff)
/source/blender/editors/space_node/node_edit.c (+6, -3) (Diff)
/source/blender/makesrna/intern/rna_image.c (+17, -6) (Diff)
/source/blender/makesrna/intern/rna_space.c (+12, -2) (Diff)
/source/blender/nodes/intern/CMP_nodes/CMP_composite.c (+6, -1) (Diff)
/source/blender/nodes/intern/CMP_nodes/CMP_image.c (+7, -3) (Diff)
/source/blender/nodes/intern/CMP_util.c (+6, -3) (Diff)
/source/blender/render/extern/include/RE_pipeline.h (+5, -2) (Diff)
/source/blender/render/intern/include/render_types.h (+4, -0) (Diff)
/source/blender/render/intern/source/pipeline.c (+135, -33) (Diff)
/source/blender/render/intern/source/sss.c (+4, -0) (Diff)
/source/blender/windowmanager/intern/wm_jobs.c (+20, -13) (Diff)
/source/blender/windowmanager/WM_api.h (+3, -1) (Diff)
/source/blender/blenkernel/BKE_image.h (+7, -1) (Diff)
/source/blender/blenkernel/intern/image.c (+49, -12) (Diff)
/source/blender/blenkernel/intern/node.c (+1, -0) (Diff)
/source/blender/blenkernel/intern/sequence.c (+3, -1) (Diff)
/source/blender/blenlib/BLI_threads.h (+41, -12) (Diff)
/source/blender/blenlib/intern/threads.c (+76, -18) (Diff)
/source/blender/editors/include/ED_image.h (+4, -1) (Diff)
/source/blender/editors/render/render_preview.c (+8, -15) (Diff)
/source/blender/editors/screen/screendump.c (+1, -1) (Diff)
/source/blender/editors/screen/screen_ops.c (+14, -7) (Diff)
/source/blender/editors/space_file/writeimage.c (+11, -3) (Diff)
/source/blender/editors/space_image/image_buttons.c (+18, -12) (Diff)
/source/blender/editors/space_image/image_draw.c (+8, -4) (Diff)
/source/blender/editors/space_image/image_ops.c (+51, -29) (Diff)
/source/blender/editors/space_image/space_image.c (+46, -25) (Diff)
/source/blender/editors/space_node/node_draw.c (+10, -2) (Diff)
/source/blender/editors/space_node/node_edit.c (+6, -3) (Diff)
/source/blender/makesrna/intern/rna_image.c (+17, -6) (Diff)
/source/blender/makesrna/intern/rna_space.c (+12, -2) (Diff)
/source/blender/nodes/intern/CMP_nodes/CMP_composite.c (+6, -1) (Diff)
/source/blender/nodes/intern/CMP_nodes/CMP_image.c (+7, -3) (Diff)
/source/blender/nodes/intern/CMP_util.c (+6, -3) (Diff)
/source/blender/render/extern/include/RE_pipeline.h (+5, -2) (Diff)
/source/blender/render/intern/include/render_types.h (+4, -0) (Diff)
/source/blender/render/intern/source/pipeline.c (+135, -33) (Diff)
/source/blender/render/intern/source/sss.c (+4, -0) (Diff)
/source/blender/windowmanager/intern/wm_jobs.c (+20, -13) (Diff)
/source/blender/windowmanager/WM_api.h (+3, -1) (Diff)