diff options
author | Ton Roosendaal <ton@blender.org> | 2009-02-05 22:28:28 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2009-02-05 22:28:28 +0300 |
commit | e1b92bc166ac27e29dfdbec315a7b6233d8724d2 (patch) | |
tree | 2ed3ef7d6d3ac107ff4bd578ae0f2544570087b2 /source/blender/blenkernel | |
parent | 0a3697ccf7f16bd328a8894c62995de0ff12adb0 (diff) |
2.5
Safe method to move render results to the displayed image.
It now allocates a single image for display, and on each
refresh callback from render, it copies the refreshed
section over to this image, in 32 bits. While rendering
that image then only shows progress updates, as usual.
This also now works for scenes in composte and results
for composite.
This should solve reported crashes for MBlur or SSS.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/image.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index ee631a89083..f6d604bdec7 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -1797,14 +1797,30 @@ static ImBuf *image_get_ibuf_multilayer(Image *ima, ImageUser *iuser) /* showing RGBA result itself (from compo/sequence) or like exr, using layers etc */ +/* always returns a single ibuf, also during render progress */ static ImBuf *image_get_render_result(Image *ima, ImageUser *iuser) { + Render *re; RenderResult *rr= NULL; - if(iuser->scene) - rr= RE_GetResult(RE_GetRender(iuser->scene->id.name)); + if(iuser->scene) { + re= RE_GetRender(iuser->scene->id.name); + rr= RE_GetResult(re); + } + if(rr==NULL) return NULL; - if(rr) { + if(RE_RenderInProgress(re)) { + ImBuf *ibuf= image_get_ibuf(ima, IMA_NO_INDEX, 0); + + /* make ibuf if needed, and initialize it */ + /* this only gets called when mutex locked */ + if(ibuf==NULL) { + ibuf= IMB_allocImBuf(rr->rectx, rr->recty, 32, IB_rect, 0); + image_assign_ibuf(ima, ibuf, IMA_NO_INDEX, 0); + } + return ibuf; + } + else { RenderResult rres; float *rectf; unsigned int *rect; |