use static functions for raycast functions.
This commit is contained in:
@@ -359,7 +359,7 @@ static int bvh_node_raycast(Node *node, Isect *isec)
|
||||
#endif
|
||||
|
||||
template<class Node, class HintObject>
|
||||
void bvh_dfs_make_hint(Node *node, LCTSHint *hint, int reserve_space, HintObject *hintObject)
|
||||
static void bvh_dfs_make_hint(Node *node, LCTSHint *hint, int reserve_space, HintObject *hintObject)
|
||||
{
|
||||
assert(hint->size + reserve_space + 1 <= RE_RAY_LCTS_MAX_SIZE);
|
||||
|
||||
|
@@ -94,7 +94,7 @@ void bvh_done<QBVHTree>(QBVHTree *obj)
|
||||
}
|
||||
|
||||
template<int StackSize>
|
||||
int intersect(QBVHTree *obj, Isect *isec)
|
||||
static int intersect(QBVHTree *obj, Isect *isec)
|
||||
{
|
||||
//TODO renable hint support
|
||||
if (RE_rayobject_isAligned(obj->root)) {
|
||||
@@ -108,7 +108,7 @@ int intersect(QBVHTree *obj, Isect *isec)
|
||||
}
|
||||
|
||||
template<class Tree>
|
||||
void bvh_hint_bb(Tree *tree, LCTSHint *hint, float *UNUSED(min), float *UNUSED(max))
|
||||
static void bvh_hint_bb(Tree *tree, LCTSHint *hint, float *UNUSED(min), float *UNUSED(max))
|
||||
{
|
||||
//TODO renable hint support
|
||||
{
|
||||
@@ -118,7 +118,7 @@ void bvh_hint_bb(Tree *tree, LCTSHint *hint, float *UNUSED(min), float *UNUSED(m
|
||||
}
|
||||
/* the cast to pointer function is needed to workarround gcc bug: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11407 */
|
||||
template<class Tree, int STACK_SIZE>
|
||||
RayObjectAPI make_api()
|
||||
static RayObjectAPI make_api()
|
||||
{
|
||||
static RayObjectAPI api =
|
||||
{
|
||||
|
@@ -126,7 +126,7 @@ void bvh_done<SVBVHTree>(SVBVHTree *obj)
|
||||
}
|
||||
|
||||
template<int StackSize>
|
||||
int intersect(SVBVHTree *obj, Isect *isec)
|
||||
static int intersect(SVBVHTree *obj, Isect *isec)
|
||||
{
|
||||
//TODO renable hint support
|
||||
if (RE_rayobject_isAligned(obj->root)) {
|
||||
@@ -140,7 +140,7 @@ int intersect(SVBVHTree *obj, Isect *isec)
|
||||
}
|
||||
|
||||
template<class Tree>
|
||||
void bvh_hint_bb(Tree *tree, LCTSHint *hint, float *UNUSED(min), float *UNUSED(max))
|
||||
static void bvh_hint_bb(Tree *tree, LCTSHint *hint, float *UNUSED(min), float *UNUSED(max))
|
||||
{
|
||||
//TODO renable hint support
|
||||
{
|
||||
@@ -150,7 +150,7 @@ void bvh_hint_bb(Tree *tree, LCTSHint *hint, float *UNUSED(min), float *UNUSED(m
|
||||
}
|
||||
/* the cast to pointer function is needed to workarround gcc bug: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11407 */
|
||||
template<class Tree, int STACK_SIZE>
|
||||
RayObjectAPI make_api()
|
||||
static RayObjectAPI make_api()
|
||||
{
|
||||
static RayObjectAPI api =
|
||||
{
|
||||
@@ -167,7 +167,7 @@ RayObjectAPI make_api()
|
||||
}
|
||||
|
||||
template<class Tree>
|
||||
RayObjectAPI *bvh_get_api(int maxstacksize)
|
||||
static RayObjectAPI *bvh_get_api(int maxstacksize)
|
||||
{
|
||||
static RayObjectAPI bvh_api256 = make_api<Tree, 1024>();
|
||||
|
||||
|
@@ -129,7 +129,7 @@ void bvh_done<VBVHTree>(VBVHTree *obj)
|
||||
}
|
||||
|
||||
template<int StackSize>
|
||||
int intersect(VBVHTree *obj, Isect *isec)
|
||||
static int intersect(VBVHTree *obj, Isect *isec)
|
||||
{
|
||||
//TODO renable hint support
|
||||
if (RE_rayobject_isAligned(obj->root)) {
|
||||
@@ -143,7 +143,7 @@ int intersect(VBVHTree *obj, Isect *isec)
|
||||
}
|
||||
|
||||
template<class Tree>
|
||||
void bvh_hint_bb(Tree *tree, LCTSHint *hint, float *UNUSED(min), float *UNUSED(max))
|
||||
static void bvh_hint_bb(Tree *tree, LCTSHint *hint, float *UNUSED(min), float *UNUSED(max))
|
||||
{
|
||||
//TODO renable hint support
|
||||
{
|
||||
@@ -174,7 +174,7 @@ static void bfree(VBVHTree *tree)
|
||||
|
||||
/* the cast to pointer function is needed to workarround gcc bug: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11407 */
|
||||
template<class Tree, int STACK_SIZE>
|
||||
RayObjectAPI make_api()
|
||||
static RayObjectAPI make_api()
|
||||
{
|
||||
static RayObjectAPI api =
|
||||
{
|
||||
|
@@ -55,13 +55,13 @@ extern int tot_pushdown;
|
||||
#endif
|
||||
|
||||
template<class Node>
|
||||
bool node_fits_inside(Node *a, Node *b)
|
||||
static bool node_fits_inside(Node *a, Node *b)
|
||||
{
|
||||
return bb_fits_inside(b->bb, b->bb + 3, a->bb, a->bb + 3);
|
||||
}
|
||||
|
||||
template<class Node>
|
||||
void reorganize_find_fittest_parent(Node *tree, Node *node, std::pair<float, Node *> &cost)
|
||||
static void reorganize_find_fittest_parent(Node *tree, Node *node, std::pair<float, Node *> &cost)
|
||||
{
|
||||
std::queue<Node *> q;
|
||||
q.push(tree);
|
||||
@@ -81,7 +81,7 @@ void reorganize_find_fittest_parent(Node *tree, Node *node, std::pair<float, Nod
|
||||
}
|
||||
|
||||
template<class Node>
|
||||
void reorganize(Node *root)
|
||||
static void reorganize(Node *root)
|
||||
{
|
||||
std::queue<Node *> q;
|
||||
|
||||
@@ -124,7 +124,7 @@ void reorganize(Node *root)
|
||||
* prunes nodes with only one child (except if that child is a primitive)
|
||||
*/
|
||||
template<class Node>
|
||||
void remove_useless(Node *node, Node **new_node)
|
||||
static void remove_useless(Node *node, Node **new_node)
|
||||
{
|
||||
if (RE_rayobject_isAligned(node->child) ) {
|
||||
|
||||
@@ -153,7 +153,7 @@ void remove_useless(Node *node, Node **new_node)
|
||||
* it uses surface area heuristic for determining whether a node should be colapsed
|
||||
*/
|
||||
template<class Node>
|
||||
void pushup(Node *parent)
|
||||
static void pushup(Node *parent)
|
||||
{
|
||||
if (is_leaf(parent)) return;
|
||||
|
||||
@@ -189,7 +189,7 @@ void pushup(Node *parent)
|
||||
* try to optimize number of childs to be a multiple of SSize
|
||||
*/
|
||||
template<class Node, int SSize>
|
||||
void pushup_simd(Node *parent)
|
||||
static void pushup_simd(Node *parent)
|
||||
{
|
||||
if (is_leaf(parent)) return;
|
||||
|
||||
@@ -221,7 +221,7 @@ void pushup_simd(Node *parent)
|
||||
* makes sure no child fits inside any of its sibling
|
||||
*/
|
||||
template<class Node>
|
||||
void pushdown(Node *parent)
|
||||
static void pushdown(Node *parent)
|
||||
{
|
||||
Node **s_child = &parent->child;
|
||||
Node *child = parent->child;
|
||||
@@ -260,7 +260,7 @@ void pushdown(Node *parent)
|
||||
* readjust nodes BB (useful if nodes childs where modified)
|
||||
*/
|
||||
template<class Node>
|
||||
float bvh_refit(Node *node)
|
||||
static float bvh_refit(Node *node)
|
||||
{
|
||||
if (is_leaf(node)) return 0;
|
||||
if (is_leaf(node->child)) return 0;
|
||||
|
@@ -79,7 +79,7 @@ inline static void bvh_node_push_childs(Node *node, Isect *UNUSED(isec), Node **
|
||||
|
||||
|
||||
template<class Node>
|
||||
int count_childs(Node *parent)
|
||||
static int count_childs(Node *parent)
|
||||
{
|
||||
int n = 0;
|
||||
for (Node *i = parent->child; i; i = i->sibling) {
|
||||
@@ -93,7 +93,7 @@ int count_childs(Node *parent)
|
||||
|
||||
|
||||
template<class Node>
|
||||
void append_sibling(Node *node, Node *sibling)
|
||||
static void append_sibling(Node *node, Node *sibling)
|
||||
{
|
||||
while (node->sibling)
|
||||
node = node->sibling;
|
||||
|
Reference in New Issue
Block a user