*Added memset's to make sure counters start on zero

*Disabled ray counter (can be enabled on render/extern/include/RE_raytrace.h by commenting out the define)
*marked bvh_node_merge() as static inline (hopping it now compiles on gcc and mingw)
This commit is contained in:
Andre Susano Pinto
2009-10-06 10:52:14 +00:00
parent 08deeee455
commit ba3ec58d01
4 changed files with 10 additions and 3 deletions

View File

@@ -35,7 +35,7 @@
extern "C" {
#endif
#define RE_RAYCOUNTER /* enable counters per ray, usefull for measuring raytrace structures performance */
// #define RE_RAYCOUNTER /* enable counters per ray, usefull for measuring raytrace structures performance */
#define RE_RAY_LCTS_MAX_SIZE 256
#define RT_USE_LAST_HIT /* last shadow hit is reused before raycasting on whole tree */

View File

@@ -112,7 +112,7 @@ template<class Node> static inline int bvh_node_hit_test(Node *node, Isect *isec
template<class Node>
static void bvh_node_merge_bb(Node *node, float *min, float *max)
static inline void bvh_node_merge_bb(Node *node, float *min, float *max)
{
if(is_leaf(node))
{

View File

@@ -76,7 +76,7 @@ inline void bvh_node_push_childs<SVBVHNode>(SVBVHNode *node, Isect *isec, SVBVHN
}
template<>
static void bvh_node_merge_bb<SVBVHNode>(SVBVHNode *node, float *min, float *max)
void bvh_node_merge_bb<SVBVHNode>(SVBVHNode *node, float *min, float *max)
{
if(is_leaf(node))
{

View File

@@ -181,6 +181,7 @@ void freeraytree(Render *re)
#ifdef RE_RAYCOUNTER
{
RayCounter sum;
memset( &sum, 0, sizeof(sum) );
int i;
for(i=0; i<BLENDER_MAX_THREADS; i++)
RE_RC_MERGE(&sum, re_rc_counter+i);
@@ -444,8 +445,14 @@ void makeraytree(Render *re)
re->i.infostr= "Raytree finished";
re->stats_draw(re->sdh, &re->i);
}
#ifdef RE_RAYCOUNTER
memset( re_rc_counter, 0, sizeof(re_rc_counter) );
#endif
}
void shade_ray(Isect *is, ShadeInput *shi, ShadeResult *shr)
{
ObjectInstanceRen *obi= (ObjectInstanceRen*)is->hit.ob;