Cycles: Correction for node tail copy on packing BVH

This is harmless for now because tail of the node is zero in there, but better
to fix it early so in the case of extending BVH nodes this code doesn't give
issues.
This commit is contained in:
Sergey Sharybin 2014-12-25 02:49:27 +05:00
parent 0feba652f7
commit deb06c457d

@ -479,11 +479,12 @@ void BVH::pack_instances(size_t nodes_size)
pack_nodes[pack_nodes_offset + nsize_bbox] = data;
if(use_qbvh) {
memcpy(&pack_nodes[pack_nodes_offset + nsize_bbox+1],
&bvh_nodes[i + nsize_bbox+1],
sizeof(int4) * (nsize - (nsize_bbox+1)));
}
/* Usually this is gonna to copy nothing, but we'd better to
* beprepared for possible node size extension.
*/
memcpy(&pack_nodes[pack_nodes_offset + nsize_bbox+1],
&bvh_nodes[i + nsize_bbox+1],
sizeof(int4) * (nsize - (nsize_bbox+1)));
pack_nodes_offset += nsize;
}