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.
This commit is contained in:
parent
46f452e96b
commit
19cdceaee4
Notes:
blender-bot
2023-02-14 08:26:29 +01:00
Referenced by issue #46748, OpenEXR output different when frame saved with F3 vs. in an animation
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue