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:
-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;