Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2015-11-12 17:17:25 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2015-11-12 17:19:30 +0300
commit19cdceaee415ddba7e3a197e1e2487ae09d766a8 (patch)
tree0dacb915378517010044b22035bdef02a5f5581c /source/blender/imbuf/intern/allocimbuf.c
parent46f452e96baaf9424582003e87736840ccbbffca (diff)
Fix T46748: OpenEXR output different when frame saved with F3 vs. in an animation
The issue was caused by the image save operator ignoring Z-Buf if the input buffer due to the way how IMB_dupImBuf() worked. There's no reason to to ignore z-buf on imbuf duplication, it only asks for issues in the future.
Diffstat (limited to 'source/blender/imbuf/intern/allocimbuf.c')
-rw-r--r--source/blender/imbuf/intern/allocimbuf.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/source/blender/imbuf/intern/allocimbuf.c b/source/blender/imbuf/intern/allocimbuf.c
index 19b68b17e70..a9a21b4fea7 100644
--- a/source/blender/imbuf/intern/allocimbuf.c
+++ b/source/blender/imbuf/intern/allocimbuf.c
@@ -502,6 +502,8 @@ ImBuf *IMB_dupImBuf(ImBuf *ibuf1)
if (ibuf1->rect) flags |= IB_rect;
if (ibuf1->rect_float) flags |= IB_rectfloat;
+ if (ibuf1->zbuf) flags |= IB_zbuf;
+ if (ibuf1->zbuf_float) flags |= IB_zbuffloat;
x = ibuf1->x;
y = ibuf1->y;
@@ -516,6 +518,12 @@ ImBuf *IMB_dupImBuf(ImBuf *ibuf1)
if (flags & IB_rectfloat)
memcpy(ibuf2->rect_float, ibuf1->rect_float, ((size_t)ibuf1->channels) * x * y * sizeof(float));
+ if (flags & IB_zbuf)
+ memcpy(ibuf2->zbuf, ibuf1->zbuf, ((size_t)x) * y * sizeof(int));
+
+ if (flags & IB_rectfloat)
+ memcpy(ibuf2->zbuf_float, ibuf1->zbuf_float, ((size_t)x) * y * sizeof(float));
+
if (ibuf1->encodedbuffer) {
ibuf2->encodedbuffersize = ibuf1->encodedbuffersize;
if (imb_addencodedbufferImBuf(ibuf2) == false) {
@@ -533,8 +541,8 @@ ImBuf *IMB_dupImBuf(ImBuf *ibuf1)
tbuf.rect = ibuf2->rect;
tbuf.rect_float = ibuf2->rect_float;
tbuf.encodedbuffer = ibuf2->encodedbuffer;
- tbuf.zbuf = NULL;
- tbuf.zbuf_float = NULL;
+ tbuf.zbuf = ibuf2->zbuf;
+ tbuf.zbuf_float = ibuf2->zbuf_float;
for (a = 0; a < IMB_MIPMAP_LEVELS; a++)
tbuf.mipmap[a] = NULL;
tbuf.dds_data.data = NULL;