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>2014-12-25 00:49:27 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2014-12-25 00:50:49 +0300
commitdeb06c457d59a3acaa4d81bdbb460d8c74e05c37 (patch)
tree18408719f270785c12e4a7fbe02f0f9bbe559287 /intern/cycles
parent0feba652f787aa87a1eccd2911a6c713d2c8aeaf (diff)
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.
Diffstat (limited to 'intern/cycles')
-rw-r--r--intern/cycles/bvh/bvh.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/intern/cycles/bvh/bvh.cpp b/intern/cycles/bvh/bvh.cpp
index e7141c9ec64..eafb611b015 100644
--- a/intern/cycles/bvh/bvh.cpp
+++ b/intern/cycles/bvh/bvh.cpp
@@ -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;
}