From fc35b758ade7062b194076c7dd3b848792c1a4ea Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Wed, 17 Jun 2015 17:48:15 +0200 Subject: Fix T44682: Save Buffers canceled renders show nothing in Image Editor The issue was caused by render pipeline freeing render parts prior to finishing exr file writing which resulted in unfinished parts not being written into the file by save_empty_result_tiles(). As a temporary solution we do explicitly write unfinished parts as empty tiles to the exr file prior to freeing parts. Not ideal solution, but should work for the release. --- source/blender/render/intern/include/render_result.h | 1 + source/blender/render/intern/source/external_engine.c | 1 + source/blender/render/intern/source/pipeline.c | 8 +++++++- source/blender/render/intern/source/render_result.c | 4 +--- 4 files changed, 10 insertions(+), 4 deletions(-) (limited to 'source/blender/render') diff --git a/source/blender/render/intern/include/render_result.h b/source/blender/render/intern/include/render_result.h index f031be9e9c9..90ad0fa30d7 100644 --- a/source/blender/render/intern/include/render_result.h +++ b/source/blender/render/intern/include/render_result.h @@ -79,6 +79,7 @@ void render_result_single_layer_end(struct Render *re); /* EXR Tile File Render */ +void render_result_save_empty_result_tiles(struct Render *re); void render_result_exr_file_begin(struct Render *re); void render_result_exr_file_end(struct Render *re); diff --git a/source/blender/render/intern/source/external_engine.c b/source/blender/render/intern/source/external_engine.c index e44dacaaad3..63d1b609621 100644 --- a/source/blender/render/intern/source/external_engine.c +++ b/source/blender/render/intern/source/external_engine.c @@ -707,6 +707,7 @@ int RE_engine_render(Render *re, int do_all) if (re->result->do_exr_tile) { BLI_rw_mutex_lock(&re->resultmutex, THREAD_LOCK_WRITE); + render_result_save_empty_result_tiles(re); render_result_exr_file_end(re); BLI_rw_mutex_unlock(&re->resultmutex); } diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index f2851e23c32..29822b96221 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -1400,7 +1400,13 @@ static void threaded_tile_processor(Render *re) BLI_thread_queue_free(donequeue); BLI_thread_queue_free(workqueue); - + + if (re->result->do_exr_tile) { + BLI_rw_mutex_lock(&re->resultmutex, THREAD_LOCK_WRITE); + render_result_save_empty_result_tiles(re); + BLI_rw_mutex_unlock(&re->resultmutex); + } + /* unset threadsafety */ g_break = 0; BLI_rw_mutex_lock(&re->partsmutex, THREAD_LOCK_WRITE); diff --git a/source/blender/render/intern/source/render_result.c b/source/blender/render/intern/source/render_result.c index 05a46927b63..ddd9859ce54 100644 --- a/source/blender/render/intern/source/render_result.c +++ b/source/blender/render/intern/source/render_result.c @@ -1244,7 +1244,7 @@ static void save_render_result_tile(RenderResult *rr, RenderResult *rrpart, cons BLI_unlock_thread(LOCK_IMAGE); } -static void save_empty_result_tiles(Render *re) +void render_result_save_empty_result_tiles(Render *re) { RenderPart *pa; RenderResult *rr; @@ -1287,8 +1287,6 @@ void render_result_exr_file_end(Render *re) RenderResult *rr; RenderLayer *rl; - save_empty_result_tiles(re); - for (rr = re->result; rr; rr = rr->next) { for (rl = rr->layers.first; rl; rl = rl->next) { IMB_exr_close(rl->exrhandle); -- cgit v1.2.3