diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2017-11-02 16:29:42 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2017-11-02 16:31:05 +0300 |
commit | ff97dcebf301f78ffb56ea464209c3847b75e5f6 (patch) | |
tree | 38ed624d6cdd7de7c394d77e85f6efcefaf642b3 /source | |
parent | 6355d98267963984160b7cae212d0353b6846a7d (diff) |
Fix T53182: cancelling save buffers + denoising render clears image.
Diffstat (limited to 'source')
4 files changed, 7 insertions, 6 deletions
diff --git a/source/blender/render/intern/include/render_types.h b/source/blender/render/intern/include/render_types.h index f9942bef61f..45206f21ae4 100644 --- a/source/blender/render/intern/include/render_types.h +++ b/source/blender/render/intern/include/render_types.h @@ -118,7 +118,8 @@ typedef struct RenderPart { enum { PART_STATUS_NONE = 0, PART_STATUS_IN_PROGRESS = 1, - PART_STATUS_READY = 2 + PART_STATUS_RENDERED = 2, + PART_STATUS_MERGED = 3 }; /* controls state of render, everything that's read-only during render stage */ diff --git a/source/blender/render/intern/source/external_engine.c b/source/blender/render/intern/source/external_engine.c index 3358d7a855b..b1cd23d0827 100644 --- a/source/blender/render/intern/source/external_engine.c +++ b/source/blender/render/intern/source/external_engine.c @@ -273,7 +273,7 @@ void RE_engine_end_result(RenderEngine *engine, RenderResult *result, int cancel RenderPart *pa = get_part_from_result(re, result); if (pa) { - pa->status = PART_STATUS_READY; + pa->status = (merge_results)? PART_STATUS_MERGED: PART_STATUS_RENDERED; } else if (re->result->do_exr_tile) { /* if written result does not match any tile and we are using save @@ -284,7 +284,7 @@ void RE_engine_end_result(RenderEngine *engine, RenderResult *result, int cancel if (!cancel || merge_results) { if (re->result->do_exr_tile) { - if (!cancel) { + if (!cancel && merge_results) { render_result_exr_file_merge(re->result, result, re->viewname); } } diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index a0ebe241569..ce2fd3a1a48 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -1133,7 +1133,7 @@ static void *do_part_thread(void *pa_v) BLI_rw_mutex_unlock(&R.resultmutex); } - pa->status = PART_STATUS_READY; + pa->status = PART_STATUS_MERGED; return NULL; } @@ -1239,7 +1239,7 @@ static int sort_and_queue_parts(Render *re, int minx, ThreadQueue *workqueue) /* find center of rendered parts, image center counts for 1 too */ for (pa = re->parts.first; pa; pa = pa->next) { - if (pa->status == PART_STATUS_READY) { + if (pa->status >= PART_STATUS_RENDERED) { centx += BLI_rcti_cent_x(&pa->disprect); centy += BLI_rcti_cent_y(&pa->disprect); tot++; diff --git a/source/blender/render/intern/source/render_result.c b/source/blender/render/intern/source/render_result.c index df51cd3c2e6..aa0c7357302 100644 --- a/source/blender/render/intern/source/render_result.c +++ b/source/blender/render/intern/source/render_result.c @@ -1063,7 +1063,7 @@ void render_result_save_empty_result_tiles(Render *re) IMB_exr_clear_channels(rl->exrhandle); for (pa = re->parts.first; pa; pa = pa->next) { - if (pa->status != PART_STATUS_READY) { + if (pa->status != PART_STATUS_MERGED) { int party = pa->disprect.ymin - re->disprect.ymin + pa->crop; int partx = pa->disprect.xmin - re->disprect.xmin + pa->crop; IMB_exrtile_write_channels(rl->exrhandle, partx, party, 0, re->viewname); |