diff options
-rw-r--r-- | source/blender/editors/include/ED_render.h | 2 | ||||
-rw-r--r-- | source/blender/editors/include/ED_view3d.h | 2 | ||||
-rw-r--r-- | source/blender/editors/render/render_update.c | 16 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/space_view3d.c | 6 |
4 files changed, 11 insertions, 15 deletions
diff --git a/source/blender/editors/include/ED_render.h b/source/blender/editors/include/ED_render.h index 293621c3d19..1b1d8d723ee 100644 --- a/source/blender/editors/include/ED_render.h +++ b/source/blender/editors/include/ED_render.h @@ -50,7 +50,7 @@ void ED_operatortypes_render(void); void ED_render_id_flush_update(struct Main *bmain, struct ID *id); void ED_render_engine_changed(struct Main *bmain); -void ED_render_engine_area_exit(struct ScrArea *sa); +void ED_render_engine_area_exit(struct Main *bmain, struct ScrArea *sa); void ED_render_scene_update(struct Main *bmain, struct Scene *scene, int updated); void ED_viewport_render_kill_jobs(struct wmWindowManager *wm, struct Main *bmain, bool free_database); diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h index 5fc5738c88f..11f961605af 100644 --- a/source/blender/editors/include/ED_view3d.h +++ b/source/blender/editors/include/ED_view3d.h @@ -61,6 +61,7 @@ struct rcti; struct wmOperator; struct wmOperatorType; struct wmWindow; +struct wmWindowManager; struct GPUFX; struct GPUOffScreen; struct GPUFXSettings; @@ -377,6 +378,7 @@ void ED_view3d_operator_properties_viewmat_get(struct wmOperator *op, int *winx, #endif /* render */ +void ED_view3d_stop_render_preview(struct wmWindowManager *wm, struct ARegion *ar); void ED_view3d_shade_update(struct Main *bmain, struct Scene *scene, struct View3D *v3d, struct ScrArea *sa); #endif /* __ED_VIEW3D_H__ */ diff --git a/source/blender/editors/render/render_update.c b/source/blender/editors/render/render_update.c index be42e2ed518..4980e0bba80 100644 --- a/source/blender/editors/render/render_update.c +++ b/source/blender/editors/render/render_update.c @@ -61,6 +61,7 @@ #include "ED_node.h" #include "ED_render.h" +#include "ED_view3d.h" #include "render_intern.h" // own include @@ -141,26 +142,19 @@ void ED_render_scene_update(Main *bmain, Scene *scene, int updated) recursive_check = false; } -void ED_render_engine_area_exit(ScrArea *sa) +void ED_render_engine_area_exit(Main *bmain, ScrArea *sa) { /* clear all render engines in this area */ ARegion *ar; + wmWindowManager *wm = bmain->wm.first; if (sa->spacetype != SPACE_VIEW3D) return; for (ar = sa->regionbase.first; ar; ar = ar->next) { - RegionView3D *rv3d; - if (ar->regiontype != RGN_TYPE_WINDOW || !(ar->regiondata)) continue; - - rv3d = ar->regiondata; - - if (rv3d->render_engine) { - RE_engine_free(rv3d->render_engine); - rv3d->render_engine = NULL; - } + ED_view3d_stop_render_preview(wm, ar); } } @@ -173,7 +167,7 @@ void ED_render_engine_changed(Main *bmain) for (sc = bmain->screen.first; sc; sc = sc->id.next) for (sa = sc->areabase.first; sa; sa = sa->next) - ED_render_engine_area_exit(sa); + ED_render_engine_area_exit(bmain, sa); RE_FreePersistentData(); diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index 35fb2bce115..ddb3e2f20c5 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -266,7 +266,7 @@ void ED_view3d_check_mats_rv3d(struct RegionView3D *rv3d) } #endif -static void view3d_stop_render_preview(wmWindowManager *wm, ARegion *ar) +void ED_view3d_stop_render_preview(wmWindowManager *wm, ARegion *ar) { RegionView3D *rv3d = ar->regiondata; @@ -297,7 +297,7 @@ void ED_view3d_shade_update(Main *bmain, Scene *scene, View3D *v3d, ScrArea *sa) for (ar = sa->regionbase.first; ar; ar = ar->next) { if (ar->regiondata) - view3d_stop_render_preview(wm, ar); + ED_view3d_stop_render_preview(wm, ar); } } else if (scene->obedit != NULL && scene->obedit->type == OB_MESH) { @@ -563,7 +563,7 @@ static void view3d_main_area_exit(wmWindowManager *wm, ARegion *ar) { RegionView3D *rv3d = ar->regiondata; - view3d_stop_render_preview(wm, ar); + ED_view3d_stop_render_preview(wm, ar); if (rv3d->gpuoffscreen) { GPU_offscreen_free(rv3d->gpuoffscreen); |