diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2015-05-13 07:00:03 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2015-05-13 07:03:19 +0300 |
commit | c78df8f9ee9cff5f2c217035327a4888085b1d35 (patch) | |
tree | 5294d245dd617f4be307527b5e864c0fd8155e94 /source/blender | |
parent | abb80abf8add3e42d1edcce03c60e6e1eacdb14a (diff) |
Duplicate Render->RenderData.views for thread safety (as we do for layers)
This fixes nothing at the moment, but better safe than sorry since there
are still a few strange multiview issues around.
Diffstat (limited to 'source/blender')
4 files changed, 13 insertions, 2 deletions
diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index 87c886929d6..06028870a3f 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -5852,9 +5852,11 @@ void RE_Database_Baking(Render *re, Main *bmain, Scene *scene, unsigned int lay, /* renderdata setup and exceptions */ BLI_freelistN(&re->r.layers); + BLI_freelistN(&re->r.views); re->r = scene->r; BLI_duplicatelist(&re->r.layers, &scene->r.layers); - + BLI_duplicatelist(&re->r.views, &scene->r.views); + RE_init_threadcount(re); re->flag |= R_BAKING; diff --git a/source/blender/render/intern/source/envmap.c b/source/blender/render/intern/source/envmap.c index ed3033d8393..23d021db848 100644 --- a/source/blender/render/intern/source/envmap.c +++ b/source/blender/render/intern/source/envmap.c @@ -141,6 +141,7 @@ static Render *envmap_render_copy(Render *re, EnvMap *env) envre->r = re->r; envre->r.mode &= ~(R_BORDER | R_PANORAMA | R_ORTHO | R_MBLUR); BLI_listbase_clear(&envre->r.layers); + BLI_listbase_clear(&envre->r.views); envre->r.filtertype = 0; envre->r.tilex = envre->r.xsch / 2; envre->r.tiley = envre->r.ysch / 2; diff --git a/source/blender/render/intern/source/external_engine.c b/source/blender/render/intern/source/external_engine.c index 653af7460f9..e44dacaaad3 100644 --- a/source/blender/render/intern/source/external_engine.c +++ b/source/blender/render/intern/source/external_engine.c @@ -454,6 +454,7 @@ void RE_bake_engine_set_engine_parameters(Render *re, Main *bmain, Scene *scene) * but it potentially leaves unfreed memory blocks * not sure how to fix this yet -- dfelinto */ BLI_listbase_clear(&re->r.layers); + BLI_listbase_clear(&re->r.views); } bool RE_bake_has_engine(Render *re) diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index bdf67434725..3d61cd43dba 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -509,7 +509,8 @@ void RE_FreeRender(Render *re) BLI_rw_mutex_end(&re->partsmutex); BLI_freelistN(&re->r.layers); - + BLI_freelistN(&re->r.views); + /* main dbase can already be invalid now, some database-free code checks it */ re->main = NULL; re->scene = NULL; @@ -656,8 +657,10 @@ void RE_InitState(Render *re, Render *source, RenderData *rd, /* copy render data and render layers for thread safety */ BLI_freelistN(&re->r.layers); + BLI_freelistN(&re->r.views); re->r = *rd; BLI_duplicatelist(&re->r.layers, &rd->layers); + BLI_duplicatelist(&re->r.views, &rd->views); if (source) { /* reuse border flags from source renderer */ @@ -866,6 +869,10 @@ void render_update_anim_renderdata(Render *re, RenderData *rd) /* render layers */ BLI_freelistN(&re->r.layers); BLI_duplicatelist(&re->r.layers, &rd->layers); + + /* render views */ + BLI_freelistN(&re->r.views); + BLI_duplicatelist(&re->r.views, &rd->views); } void RE_SetWindow(Render *re, rctf *viewplane, float clipsta, float clipend) |