diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-12-12 08:29:17 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-12-12 08:30:50 +0400 |
commit | ec4ed2e3df507245aceb7341b4fdf2f5ed935067 (patch) | |
tree | c1252921e8e9284a8dc09785e23f6d55ec7583da /source/blender/render/intern/raytrace | |
parent | 41e70cfb394fdf03c598388eeefc6553030a3754 (diff) |
Code Cleanup: replace global debug checks in raycast with DEBUG ifdef
Diffstat (limited to 'source/blender/render/intern/raytrace')
-rw-r--r-- | source/blender/render/intern/raytrace/reorganize.h | 13 | ||||
-rw-r--r-- | source/blender/render/intern/raytrace/svbvh.h | 23 |
2 files changed, 22 insertions, 14 deletions
diff --git a/source/blender/render/intern/raytrace/reorganize.h b/source/blender/render/intern/raytrace/reorganize.h index fd54433edd0..5cb48f7e145 100644 --- a/source/blender/render/intern/raytrace/reorganize.h +++ b/source/blender/render/intern/raytrace/reorganize.h @@ -38,8 +38,6 @@ #include <queue> #include <vector> -#include "BKE_global.h" - #ifdef _WIN32 # ifdef INFINITY # undef INFINITY @@ -482,12 +480,19 @@ struct VBVH_optimalPackSIMD { Node *transform(Node *node) { if (RE_rayobject_isAligned(node->child)) { +#ifdef DEBUG static int num = 0; bool first = false; if (num == 0) { num++; first = true; } - +#endif + calc_costs(node); - if ((G.debug & G_DEBUG) && first) printf("expected cost = %f (%d)\n", node->cut_cost[0], node->best_cutsize); + +#ifdef DEBUG + if (first) { + printf("expected cost = %f (%d)\n", node->cut_cost[0], node->best_cutsize); + } +#endif node->optimize(); } return node; diff --git a/source/blender/render/intern/raytrace/svbvh.h b/source/blender/render/intern/raytrace/svbvh.h index 6ec75ebb527..d6c1f22ac12 100644 --- a/source/blender/render/intern/raytrace/svbvh.h +++ b/source/blender/render/intern/raytrace/svbvh.h @@ -36,7 +36,6 @@ #include "bvh.h" #include "BLI_memarena.h" -#include "BKE_global.h" #include <stdio.h> #include <algorithm> @@ -165,16 +164,18 @@ inline void bvh_node_merge_bb<SVBVHNode>(SVBVHNode *node, float min[3], float ma for (i = 0; i + 4 <= node->nchilds; i += 4) { float *res = node->child_bb + 6 * i; for (int j = 0; j < 3; j++) { - min[j] = min_ff(res[4 * j + 0], - min_ff(res[4 * j + 1], - min_ff(res[4 * j + 2], - min_ff(res[4 * j + 3], min[j])))); + min[j] = min_ff(min[j], + min_ffff(res[4 * j + 0], + res[4 * j + 1], + res[4 * j + 2], + res[4 * j + 3])); } for (int j = 0; j < 3; j++) { - max[j] = max_ff(res[4 * (j + 3) + 0], - max_ff(res[4 * (j + 3) + 1], - max_ff(res[4 * (j + 3) + 2], - max_ff(res[4 * (j + 3) + 3], max[j])))); + max[j] = max_ff(max[j], + max_ffff(res[4 * j + 0], + res[4 * j + 1], + res[4 * j + 2], + res[4 * j + 3])); } } @@ -213,13 +214,15 @@ struct Reorganize_SVBVH { ~Reorganize_SVBVH() { - if (G.debug & G_DEBUG) { +#ifdef DEBUG + { printf("%f childs per node\n", childs_per_node / nodes); printf("%d childs BB are useless\n", useless_bb); for (int i = 0; i < 16; i++) { printf("%i childs per node: %d/%d = %f\n", i, nodes_with_childs[i], nodes, nodes_with_childs[i] / float(nodes)); } } +#endif } SVBVHNode *create_node(int nchilds) |