diff options
author | Andre Susano Pinto <andresusanopinto@gmail.com> | 2009-08-26 00:26:50 +0400 |
---|---|---|
committer | Andre Susano Pinto <andresusanopinto@gmail.com> | 2009-08-26 00:26:50 +0400 |
commit | aec7f2f2c47d02b08383a4f30c0dd0067830b8c8 (patch) | |
tree | dedd13739ee273c5cab9225dc0537e5931045b9b /source/blender/render/intern/raytrace | |
parent | 950b770c1ea0c05a907abc93ad7174a02432843f (diff) |
*Changed RayObject_ calls to RE_rayobject to keep consistency on calls
*Moved part of counters code to a separated file (rayobject_raycounter.c)
Diffstat (limited to 'source/blender/render/intern/raytrace')
5 files changed, 34 insertions, 34 deletions
diff --git a/source/blender/render/intern/raytrace/bvh.h b/source/blender/render/intern/raytrace/bvh.h index 8538d9201e0..55bed6f0662 100644 --- a/source/blender/render/intern/raytrace/bvh.h +++ b/source/blender/render/intern/raytrace/bvh.h @@ -59,7 +59,7 @@ template<class Tree> static void bvh_add(Tree *obj, RayObject *ob) template<class Node> inline bool is_leaf(Node *node) { - return !RayObject_isAligned(node); + return !RE_rayobject_isAligned(node); } template<class Tree> static void bvh_done(Tree *obj); diff --git a/source/blender/render/intern/raytrace/rayobject_bih.cpp b/source/blender/render/intern/raytrace/rayobject_bih.cpp index 102a347b470..efbf70616b7 100644 --- a/source/blender/render/intern/raytrace/rayobject_bih.cpp +++ b/source/blender/render/intern/raytrace/rayobject_bih.cpp @@ -78,7 +78,7 @@ struct BIHTree RayObject *RE_rayobject_bih_create(int size) { BIHTree *obj= (BIHTree*)MEM_callocN(sizeof(BIHTree), "BIHTree"); - assert( RayObject_isAligned(obj) ); /* RayObject API assumes real data to be 4-byte aligned */ + assert( RE_rayobject_isAligned(obj) ); /* RayObject API assumes real data to be 4-byte aligned */ obj->rayobj.api = &bih_api; obj->root = NULL; @@ -86,7 +86,7 @@ RayObject *RE_rayobject_bih_create(int size) obj->node_alloc = obj->node_next = NULL; obj->builder = rtbuild_create( size ); - return RayObject_unalignRayAPI((RayObject*) obj); + return RE_rayobject_unalignRayAPI((RayObject*) obj); } static void bih_free(BIHTree *obj) @@ -128,7 +128,7 @@ static int dfs_raycast(const BIHNode *const node, Isect *isec, float tmin, float if(t1 <= t2) { - if(RayObject_isAligned(node->child[i])) + if(RE_rayobject_isAligned(node->child[i])) { if(node->child[i] == 0) break; @@ -151,7 +151,7 @@ static int dfs_raycast(const BIHNode *const node, Isect *isec, float tmin, float static int bih_intersect(BIHTree *obj, Isect *isec) { - if(RayObject_isAligned(obj->root)) + if(RE_rayobject_isAligned(obj->root)) return dfs_raycast(obj->root, isec, 0, isec->labda); else return RE_rayobject_intersect( (RayObject*)obj->root, isec); @@ -169,7 +169,7 @@ static void bih_add(BIHTree *obj, RayObject *ob) static BIHNode *bih_new_node(BIHTree *tree, int nid) { BIHNode *node = tree->node_alloc + nid - 1; - assert(RayObject_isAligned(node)); + assert(RE_rayobject_isAligned(node)); if(node+1 > tree->node_next) tree->node_next = node+1; @@ -187,7 +187,7 @@ static BIHNode *bih_rearrange(BIHTree *tree, RTBuilder *builder, int nid, float if(rtbuild_size(builder) == 1) { RayObject *child = rtbuild_get_primitive( builder, 0 ); - assert(!RayObject_isAligned(child)); + assert(!RE_rayobject_isAligned(child)); INIT_MINMAX(bb, bb+3); RE_rayobject_merge_bb( (RayObject*)child, bb, bb+3); diff --git a/source/blender/render/intern/raytrace/rayobject_bvh.cpp b/source/blender/render/intern/raytrace/rayobject_bvh.cpp index 48c1ac07cd4..bf54f889ebf 100644 --- a/source/blender/render/intern/raytrace/rayobject_bvh.cpp +++ b/source/blender/render/intern/raytrace/rayobject_bvh.cpp @@ -117,7 +117,7 @@ static BVHNode *bvh_rearrange(BVHTree *tree, RTBuilder *builder, int nid, float { RayObject *child = rtbuild_get_primitive( builder, 0 ); - if(RayObject_isRayFace(child)) + if(RE_rayobject_isRayFace(child)) { int i; BVHNode *parent = bvh_new_node(tree, nid); @@ -138,7 +138,7 @@ static BVHNode *bvh_rearrange(BVHTree *tree, RTBuilder *builder, int nid, float } else { - assert(!RayObject_isAligned(child)); + assert(!RE_rayobject_isAligned(child)); //Its a sub-raytrace structure, assume it has it own raycast //methods and adding a Bounding Box arround is unnecessary @@ -200,7 +200,7 @@ void bvh_done<BVHTree>(BVHTree *obj) template<> int bvh_intersect<BVHTree>(BVHTree *obj, Isect* isec) { - if(RayObject_isAligned(obj->root)) + if(RE_rayobject_isAligned(obj->root)) return bvh_node_stack_raycast<BVHNode,64,true>(obj->root, isec); else return RE_rayobject_intersect( (RayObject*) obj->root, isec ); @@ -222,7 +222,7 @@ static RayObjectAPI bvh_api = RayObject *RE_rayobject_bvh_create(int size) { BVHTree *obj= (BVHTree*)MEM_callocN(sizeof(BVHTree), "BVHTree"); - assert( RayObject_isAligned(obj) ); /* RayObject API assumes real data to be 4-byte aligned */ + assert( RE_rayobject_isAligned(obj) ); /* RayObject API assumes real data to be 4-byte aligned */ obj->rayobj.api = &bvh_api; obj->root = NULL; @@ -230,5 +230,5 @@ RayObject *RE_rayobject_bvh_create(int size) obj->node_arena = NULL; obj->builder = rtbuild_create( size ); - return RayObject_unalignRayAPI((RayObject*) obj); + return RE_rayobject_unalignRayAPI((RayObject*) obj); } diff --git a/source/blender/render/intern/raytrace/rayobject_vbvh.cpp b/source/blender/render/intern/raytrace/rayobject_vbvh.cpp index b703e57fdd8..6ec8fab15e4 100644 --- a/source/blender/render/intern/raytrace/rayobject_vbvh.cpp +++ b/source/blender/render/intern/raytrace/rayobject_vbvh.cpp @@ -181,7 +181,7 @@ static VBVHNode *bvh_new_node(VBVHTree *tree) #ifdef DYNAMIC_ALLOC_BB node->bb = (float*)BLI_memarena_alloc(tree->node_arena, 6*sizeof(float)); #endif - assert(RayObject_isAligned(node)); + assert(RE_rayobject_isAligned(node)); return node; } @@ -319,7 +319,7 @@ int intersect(VBVHTree *obj, Isect* isec) for(int i=0; i<lcts->size; i++) { VBVHNode *node = (VBVHNode*)lcts->stack[i]; - if(RayObject_isAligned(node)) + if(RE_rayobject_isAligned(node)) hit |= bvh_node_stack_raycast<VBVHNode,StackSize,true>(node, isec); else hit |= RE_rayobject_intersect( (RayObject*)node, isec ); @@ -333,7 +333,7 @@ int intersect(VBVHTree *obj, Isect* isec) else */ { - if(RayObject_isAligned(obj->root)) + if(RE_rayobject_isAligned(obj->root)) return bvh_node_stack_raycast<SVBVHNode,StackSize,false>( obj->root, isec); else return RE_rayobject_intersect( (RayObject*) obj->root, isec ); @@ -346,7 +346,7 @@ void bvh_dfs_make_hint(Node *node, LCTSHint *hint, int reserve_space, HintObject template<class Node,class HintObject> void bvh_dfs_make_hint_push_siblings(Node *node, LCTSHint *hint, int reserve_space, HintObject *hintObject) { - if(!RayObject_isAligned(node)) + if(!RE_rayobject_isAligned(node)) hint->stack[hint->size++] = (RayObject*)node; else { @@ -459,7 +459,7 @@ static RayObjectAPI* get_api(int maxstacksize) RayObject *RE_rayobject_vbvh_create(int size) { VBVHTree *obj= (VBVHTree*)MEM_callocN(sizeof(VBVHTree), "VBVHTree"); - assert( RayObject_isAligned(obj) ); /* RayObject API assumes real data to be 4-byte aligned */ + assert( RE_rayobject_isAligned(obj) ); /* RayObject API assumes real data to be 4-byte aligned */ obj->rayobj.api = get_api<VBVHTree>(DFS_STACK_SIZE); obj->root = NULL; @@ -467,7 +467,7 @@ RayObject *RE_rayobject_vbvh_create(int size) obj->node_arena = NULL; obj->builder = rtbuild_create( size ); - return RayObject_unalignRayAPI((RayObject*) obj); + return RE_rayobject_unalignRayAPI((RayObject*) obj); } @@ -482,7 +482,7 @@ void bvh_dfs_make_hint(VBVHNode *node, LCTSHint *hint, int reserve_space, HintOb RayObject *RE_rayobject_svbvh_create(int size) { SVBVHTree *obj= (SVBVHTree*)MEM_callocN(sizeof(SVBVHTree), "SVBVHTree"); - assert( RayObject_isAligned(obj) ); // RayObject API assumes real data to be 4-byte aligned + assert( RE_rayobject_isAligned(obj) ); // RayObject API assumes real data to be 4-byte aligned obj->rayobj.api = get_api<SVBVHTree>(DFS_STACK_SIZE); obj->root = NULL; @@ -490,6 +490,6 @@ RayObject *RE_rayobject_svbvh_create(int size) obj->node_arena = NULL; obj->builder = rtbuild_create( size ); - return RayObject_unalignRayAPI((RayObject*) obj); + return RE_rayobject_unalignRayAPI((RayObject*) obj); } */
\ No newline at end of file diff --git a/source/blender/render/intern/raytrace/reorganize.h b/source/blender/render/intern/raytrace/reorganize.h index b77a51bbf65..2494f102003 100644 --- a/source/blender/render/intern/raytrace/reorganize.h +++ b/source/blender/render/intern/raytrace/reorganize.h @@ -47,7 +47,7 @@ void reorganize_find_fittest_parent(Node *tree, Node *node, std::pair<float,Node q.pop(); if(parent == node) continue; - if(node_fits_inside(node, parent) && RayObject_isAligned(parent->child) ) + if(node_fits_inside(node, parent) && RE_rayobject_isAligned(parent->child) ) { float pcost = bb_area(parent->bb, parent->bb+3); cost = std::min( cost, std::make_pair(pcost,parent) ); @@ -69,11 +69,11 @@ void reorganize(Node *root) Node * node = q.front(); q.pop(); - if( RayObject_isAligned(node->child) ) + if( RE_rayobject_isAligned(node->child) ) { for(Node **prev = &node->child; *prev; ) { - assert( RayObject_isAligned(*prev) ); + assert( RE_rayobject_isAligned(*prev) ); q.push(*prev); std::pair<float,Node*> best(FLT_MAX, root); @@ -112,7 +112,7 @@ void reorganize(Node *root) template<class Node> void remove_useless(Node *node, Node **new_node) { - if( RayObject_isAligned(node->child) ) + if( RE_rayobject_isAligned(node->child) ) { for(Node **prev = &node->child; *prev; ) @@ -130,7 +130,7 @@ void remove_useless(Node *node, Node **new_node) } if(node->child) { - if(RayObject_isAligned(node->child) && node->child->sibling == 0) + if(RE_rayobject_isAligned(node->child) && node->child->sibling == 0) *new_node = node->child; } else if(node->child == 0) @@ -148,7 +148,7 @@ void pushup(Node *parent) float p_area = bb_area(parent->bb, parent->bb+3); Node **prev = &parent->child; - for(Node *child = parent->child; RayObject_isAligned(child) && child; ) + for(Node *child = parent->child; RE_rayobject_isAligned(child) && child; ) { float c_area = bb_area(child->bb, child->bb+3) ; int nchilds = count_childs(child); @@ -173,7 +173,7 @@ void pushup(Node *parent) } } - for(Node *child = parent->child; RayObject_isAligned(child) && child; child = child->sibling) + for(Node *child = parent->child; RE_rayobject_isAligned(child) && child; child = child->sibling) pushup(child); } @@ -188,10 +188,10 @@ void pushup_simd(Node *parent) int n = count_childs(parent); Node **prev = &parent->child; - for(Node *child = parent->child; RayObject_isAligned(child) && child; ) + for(Node *child = parent->child; RE_rayobject_isAligned(child) && child; ) { int cn = count_childs(child); - if(cn-1 <= (SSize - (n%SSize) ) % SSize && RayObject_isAligned(child->child) ) + if(cn-1 <= (SSize - (n%SSize) ) % SSize && RE_rayobject_isAligned(child->child) ) { n += (cn - 1); append_sibling(child, child->child); @@ -206,7 +206,7 @@ void pushup_simd(Node *parent) } } - for(Node *child = parent->child; RayObject_isAligned(child) && child; child = child->sibling) + for(Node *child = parent->child; RE_rayobject_isAligned(child) && child; child = child->sibling) pushup_simd<Node,SSize>(child); } @@ -221,15 +221,15 @@ void pushdown(Node *parent) Node **s_child = &parent->child; Node * child = parent->child; - while(child && RayObject_isAligned(child)) + while(child && RE_rayobject_isAligned(child)) { Node *next = child->sibling; Node **next_s_child = &child->sibling; //assert(bb_fits_inside(parent->bb, parent->bb+3, child->bb, child->bb+3)); - for(Node *i = parent->child; RayObject_isAligned(i) && i; i = i->sibling) - if(child != i && bb_fits_inside(i->bb, i->bb+3, child->bb, child->bb+3) && RayObject_isAligned(i->child)) + for(Node *i = parent->child; RE_rayobject_isAligned(i) && i; i = i->sibling) + if(child != i && bb_fits_inside(i->bb, i->bb+3, child->bb, child->bb+3) && RE_rayobject_isAligned(i->child)) { // todo optimize (should the one with the smallest area?) // float ia = bb_area(i->bb, i->bb+3) @@ -246,7 +246,7 @@ void pushdown(Node *parent) s_child = next_s_child; } - for(Node *i = parent->child; RayObject_isAligned(i) && i; i = i->sibling) + for(Node *i = parent->child; RE_rayobject_isAligned(i) && i; i = i->sibling) pushdown( i ); } |