[Bf-blender-cvs] [baf60a179f8] soc-2022-many-lights-sampling: Cleanup: Remove unused parent variable in light tree construction
Alaska
noreply at git.blender.org
Sun Nov 20 17:18:36 CET 2022
Commit: baf60a179f8c0f69d482bc2a73235735fe8c3c26
Author: Alaska
Date: Sun Nov 20 14:52:53 2022 +0100
Branches: soc-2022-many-lights-sampling
https://developer.blender.org/rBbaf60a179f8c0f69d482bc2a73235735fe8c3c26
Cleanup: Remove unused parent variable in light tree construction
In rBa7cd05d15028 the parent variable was removed in favour of a bit trail.
However the parent variable wasn't removed from the code and that's what this
patch does.
Differential Revision: https://developer.blender.org/D16564
===================================================================
M intern/cycles/scene/light_tree.cpp
M intern/cycles/scene/light_tree.h
===================================================================
diff --git a/intern/cycles/scene/light_tree.cpp b/intern/cycles/scene/light_tree.cpp
index 37a2875de50..2973f21ba9a 100644
--- a/intern/cycles/scene/light_tree.cpp
+++ b/intern/cycles/scene/light_tree.cpp
@@ -297,7 +297,7 @@ LightTree::LightTree(const vector<LightTreePrimitive> &prims,
int offset = 0;
nodes_.resize(total_nodes);
- flatten_tree(root, offset, -1);
+ flatten_tree(root, offset);
}
const vector<LightTreePrimitive> &LightTree::get_prims() const
@@ -495,7 +495,7 @@ float LightTree::min_split_saoh(const BoundBox ¢roid_bbox,
return min_cost;
}
-int LightTree::flatten_tree(const LightTreeBuildNode *node, int &offset, int parent)
+int LightTree::flatten_tree(const LightTreeBuildNode *node, int &offset)
{
PackedLightTreeNode *current_node = &nodes_[offset];
current_node->bbox = node->bbox;
@@ -517,8 +517,8 @@ int LightTree::flatten_tree(const LightTreeBuildNode *node, int &offset, int par
current_node->is_leaf_node = false;
/* The first child is located directly to the right of the parent. */
- flatten_tree(node->children[0], offset, current_index);
- current_node->second_child_index = flatten_tree(node->children[1], offset, current_index);
+ flatten_tree(node->children[0], offset);
+ current_node->second_child_index = flatten_tree(node->children[1], offset);
}
return current_index;
diff --git a/intern/cycles/scene/light_tree.h b/intern/cycles/scene/light_tree.h
index 78d482c6849..b1268755644 100644
--- a/intern/cycles/scene/light_tree.h
+++ b/intern/cycles/scene/light_tree.h
@@ -175,7 +175,7 @@ class LightTree {
const OrientationBounds &bcone,
int &min_dim,
int &min_bucket);
- int flatten_tree(const LightTreeBuildNode *node, int &offset, int parent);
+ int flatten_tree(const LightTreeBuildNode *node, int &offset);
};
CCL_NAMESPACE_END
More information about the Bf-blender-cvs
mailing list