diff options
author | Ton Roosendaal <ton@blender.org> | 2011-03-25 20:11:32 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2011-03-25 20:11:32 +0300 |
commit | 11920f7880062c1efb68a4e141162b7ec060ca29 (patch) | |
tree | 18cb137f954fcbdab56da53c4c3fcbee041f7692 /source/blender/render | |
parent | fb2fd884637f912a56302d331f4514ddd7b18374 (diff) |
Bugfix #26195
When rendering, during processing scene data, drawing in 3d window
is now locked. Can get extended to more areas in UI easily.
At least this solves all crashes with conflicting memory access in
render && 3d drawing. Deleting objects via operators or delete
modifiers isn't locked yet.
Also fixed: crash on quitting a renderwindow when it was rendering.
Diffstat (limited to 'source/blender/render')
-rw-r--r-- | source/blender/render/extern/include/RE_pipeline.h | 1 | ||||
-rw-r--r-- | source/blender/render/intern/include/render_types.h | 2 | ||||
-rw-r--r-- | source/blender/render/intern/source/pipeline.c | 22 |
3 files changed, 21 insertions, 4 deletions
diff --git a/source/blender/render/extern/include/RE_pipeline.h b/source/blender/render/extern/include/RE_pipeline.h index b64538cb452..4cc3207a05e 100644 --- a/source/blender/render/extern/include/RE_pipeline.h +++ b/source/blender/render/extern/include/RE_pipeline.h @@ -239,6 +239,7 @@ void RE_display_clear_cb(struct Render *re, void *handle, void (*f)(void *handle void RE_display_draw_cb (struct Render *re, void *handle, void (*f)(void *handle, RenderResult *rr, volatile struct rcti *rect)); void RE_stats_draw_cb (struct Render *re, void *handle, void (*f)(void *handle, RenderStats *rs)); void RE_progress_cb (struct Render *re, void *handle, void (*f)(void *handle, float)); +void RE_draw_lock_cb (struct Render *re, void *handle, void (*f)(void *handle, int)); void RE_test_break_cb (struct Render *re, void *handle, int (*f)(void *handle)); void RE_error_cb (struct Render *re, void *handle, void (*f)(void *handle, const char *str)); diff --git a/source/blender/render/intern/include/render_types.h b/source/blender/render/intern/include/render_types.h index 7a1d7190b83..672b5080fbf 100644 --- a/source/blender/render/intern/include/render_types.h +++ b/source/blender/render/intern/include/render_types.h @@ -246,6 +246,8 @@ struct Render void (*progress)(void *handle, float i); void *prh; + void (*draw_lock)(void *handle, int i); + void *dlh; int (*test_break)(void *handle); void *tbh; diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index 9511392116f..68ed956781d 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -46,18 +46,18 @@ #include "MEM_guardedalloc.h" -#include "BKE_utildefines.h" +#include "BKE_animsys.h" /* <------ should this be here?, needed for sequencer update */ #include "BKE_global.h" #include "BKE_image.h" #include "BKE_main.h" #include "BKE_node.h" #include "BKE_object.h" +#include "BKE_pointcache.h" #include "BKE_report.h" #include "BKE_scene.h" -#include "BKE_writeavi.h" /* <------ should be replaced once with generic movie module */ #include "BKE_sequencer.h" -#include "BKE_pointcache.h" -#include "BKE_animsys.h" /* <------ should this be here?, needed for sequencer update */ +#include "BKE_utildefines.h" +#include "BKE_writeavi.h" /* <------ should be replaced once with generic movie module */ #include "BLI_math.h" #include "BLI_blenlib.h" @@ -1404,6 +1404,12 @@ void RE_progress_cb(Render *re, void *handle, void (*f)(void *handle, float)) re->prh= handle; } +void RE_draw_lock_cb(Render *re, void *handle, void (*f)(void *handle, int i)) +{ + re->draw_lock= f; + re->tbh= handle; +} + void RE_test_break_cb(Render *re, void *handle, int (*f)(void *handle)) { re->test_break= f; @@ -1790,12 +1796,20 @@ static void do_render_3d(Render *re) // re->cfra= cfra; /* <- unused! */ re->scene->r.subframe = re->mblur_offs + re->field_offs; + /* lock drawing in UI during data phase */ + if(re->draw_lock) + re->draw_lock(re->dlh, 1); + /* make render verts/faces/halos/lamps */ if(render_scene_needs_vector(re)) RE_Database_FromScene_Vectors(re, re->main, re->scene, re->lay); else RE_Database_FromScene(re, re->main, re->scene, re->lay, 1); + /* clear UI drawing locks */ + if(re->draw_lock) + re->draw_lock(re->dlh, 0); + threaded_tile_processor(re); /* do left-over 3d post effects (flares) */ |