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-21 20:35:51 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2014-12-25 00:50:49 +0300
commit144096faad21626b98133da3a837ff5aa5af4e35 (patch)
tree7c544a948d91990d323505d0d86e2cc0ec22b239 /intern/cycles/bvh
parentf27d87d30043c2bb09bee461ce903744e074de8b (diff)
Cycles: Make it more clear offsets in BVH construction
Previously offsets were calculated based on the BVH node size, which is wrong and real PITA in cases when some extra data is to be added into (or removed from) the node. Now use offsets which are not calculated form the node size.
Diffstat (limited to 'intern/cycles/bvh')
-rw-r--r--intern/cycles/bvh/bvh.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/intern/cycles/bvh/bvh.cpp b/intern/cycles/bvh/bvh.cpp
index 1bddff3b1b6..57bc6db1d72 100644
--- a/intern/cycles/bvh/bvh.cpp
+++ b/intern/cycles/bvh/bvh.cpp
@@ -506,7 +506,10 @@ void BVH::pack_instances(size_t nodes_size)
/* merge nodes */
if(bvh->pack.nodes.size()) {
- size_t nsize_bbox = (use_qbvh)? nsize-2: nsize-1;
+ /* For QBVH we're packing ann child bbox into 6 float4,
+ * and for regulat BVH they're packed into 3 float4.
+ */
+ size_t nsize_bbox = (use_qbvh)? 6: 3;
int4 *bvh_nodes = &bvh->pack.nodes[0];
size_t bvh_nodes_size = bvh->pack.nodes.size();
int *bvh_is_leaf = (bvh->pack.is_leaf.size() != 0) ? &bvh->pack.is_leaf[0] : NULL;