diff options
Diffstat (limited to 'source/blender/render/intern/raytrace/rayobject_svbvh.cpp')
-rw-r--r-- | source/blender/render/intern/raytrace/rayobject_svbvh.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/render/intern/raytrace/rayobject_svbvh.cpp b/source/blender/render/intern/raytrace/rayobject_svbvh.cpp index 2caaabe7359..fcd692fac02 100644 --- a/source/blender/render/intern/raytrace/rayobject_svbvh.cpp +++ b/source/blender/render/intern/raytrace/rayobject_svbvh.cpp @@ -67,7 +67,7 @@ template<> void bvh_done<SVBVHTree>(SVBVHTree *obj) { rtbuild_done(obj->builder, &obj->rayobj.control); - + //TODO find a away to exactly calculate the needed memory MemArena *arena1 = BLI_memarena_new(BLI_MEMARENA_STD_BUFSIZE, "svbvh arena"); BLI_memarena_use_malloc(arena1); @@ -85,7 +85,7 @@ void bvh_done<SVBVHTree>(SVBVHTree *obj) BLI_memarena_free(arena2); return; } - + reorganize(root); remove_useless(root, &root); bvh_refit(root); @@ -114,10 +114,10 @@ void bvh_done<SVBVHTree>(SVBVHTree *obj) else obj->root = NULL; } - + //Free data BLI_memarena_free(arena1); - + obj->node_arena = arena2; obj->cost = 1.0; @@ -152,7 +152,7 @@ static void bvh_hint_bb(Tree *tree, LCTSHint *hint, float *UNUSED(min), float *U template<class Tree, int STACK_SIZE> static RayObjectAPI make_api() { - static RayObjectAPI api = + static RayObjectAPI api = { (RE_rayobject_raycast_callback) ((int (*)(Tree *, Isect *)) & intersect<STACK_SIZE>), (RE_rayobject_add_callback) ((void (*)(Tree *, RayObject *)) & bvh_add<Tree>), @@ -162,7 +162,7 @@ static RayObjectAPI make_api() (RE_rayobject_cost_callback) ((float (*)(Tree *)) & bvh_cost<Tree>), (RE_rayobject_hint_bb_callback) ((void (*)(Tree *, LCTSHint *, float *, float *)) & bvh_hint_bb<Tree>) }; - + return api; } @@ -170,7 +170,7 @@ template<class Tree> static RayObjectAPI *bvh_get_api(int maxstacksize) { static RayObjectAPI bvh_api256 = make_api<Tree, 1024>(); - + if (maxstacksize <= 1024) return &bvh_api256; assert(maxstacksize <= 256); return NULL; |