~siretart/ubuntu/utopic/blender/libav10

« back to all changes in this revision

Viewing changes to source/blender/render/intern/raytrace/rayobject_raycounter.cpp

  • Committer: Package Import Robot
  • Author(s): Matteo F. Vescovi
  • Date: 2012-07-23 08:54:18 UTC
  • mfrom: (14.2.16 sid)
  • mto: (14.2.19 sid)
  • mto: This revision was merged to the branch mainline in revision 42.
  • Revision ID: package-import@ubuntu.com-20120723085418-9foz30v6afaf5ffs
Tags: 2.63a-2
* debian/: Cycles support added (Closes: #658075)
  For now, this top feature has been enabled only
  on [any-amd64 any-i386] architectures because
  of OpenImageIO failing on all others
* debian/: scripts installation path changed
  from /usr/lib to /usr/share:
  + debian/patches/: patchset re-worked for path changing
  + debian/control: "Breaks" field added on yafaray-exporter

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * ***** BEGIN GPL LICENSE BLOCK *****
 
3
 *
 
4
 * This program is free software; you can redistribute it and/or
 
5
 * modify it under the terms of the GNU General Public License
 
6
 * as published by the Free Software Foundation; either version 2
 
7
 * of the License, or (at your option) any later version. 
 
8
 *
 
9
 * This program is distributed in the hope that it will be useful,
 
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
 * GNU General Public License for more details.
 
13
 *
 
14
 * You should have received a copy of the GNU General Public License
 
15
 * along with this program; if not, write to the Free Software Foundation,
 
16
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 
17
 *
 
18
 * The Original Code is Copyright (C) 2009 Blender Foundation.
 
19
 * All rights reserved.
 
20
 *
 
21
 * The Original Code is: all of this file.
 
22
 *
 
23
 * Contributor(s): André Pinto.
 
24
 *
 
25
 * ***** END GPL LICENSE BLOCK *****
 
26
 */
 
27
 
 
28
/** \file blender/render/intern/raytrace/rayobject_raycounter.cpp
 
29
 *  \ingroup render
 
30
 */
 
31
 
 
32
 
 
33
#include "rayobject.h"
 
34
#include "raycounter.h"
 
35
 
 
36
#ifdef RE_RAYCOUNTER
 
37
 
 
38
void RE_RC_INFO(RayCounter *info)
 
39
{
 
40
        printf("----------- Raycast counter --------\n");
 
41
        printf("Rays total: %llu\n", info->raycast.test );
 
42
        printf("Rays hit: %llu\n",   info->raycast.hit  );
 
43
        printf("\n");
 
44
        printf("BB tests: %llu\n", info->bb.test );
 
45
        printf("BB hits: %llu\n", info->bb.hit );
 
46
        printf("\n");   
 
47
        printf("SIMD BB tests: %llu\n", info->simd_bb.test );
 
48
        printf("SIMD BB hits: %llu\n", info->simd_bb.hit );
 
49
        printf("\n");   
 
50
        printf("Primitives tests: %llu\n", info->faces.test );
 
51
        printf("Primitives hits: %llu\n", info->faces.hit );
 
52
        printf("------------------------------------\n");
 
53
        printf("Shadow last-hit tests per ray: %f\n", info->rayshadow_last_hit.test / ((float)info->raycast.test) );
 
54
        printf("Shadow last-hit hits per ray: %f\n",  info->rayshadow_last_hit.hit  / ((float)info->raycast.test) );
 
55
        printf("\n");
 
56
        printf("Hint tests per ray: %f\n", info->raytrace_hint.test / ((float)info->raycast.test) );
 
57
        printf("Hint hits per ray: %f\n",  info->raytrace_hint.hit  / ((float)info->raycast.test) );
 
58
        printf("\n");
 
59
        printf("BB tests per ray: %f\n", info->bb.test / ((float)info->raycast.test) );
 
60
        printf("BB hits per ray: %f\n", info->bb.hit / ((float)info->raycast.test) );
 
61
        printf("\n");
 
62
        printf("SIMD tests per ray: %f\n", info->simd_bb.test / ((float)info->raycast.test) );
 
63
        printf("SIMD hits per ray: %f\n", info->simd_bb.hit / ((float)info->raycast.test) );
 
64
        printf("\n");
 
65
        printf("Primitives tests per ray: %f\n", info->faces.test / ((float)info->raycast.test) );
 
66
        printf("Primitives hits per ray: %f\n", info->faces.hit / ((float)info->raycast.test) );
 
67
        printf("------------------------------------\n");
 
68
}
 
69
 
 
70
void RE_RC_MERGE(RayCounter *dest, RayCounter *tmp)
 
71
{
 
72
        dest->faces.test += tmp->faces.test;
 
73
        dest->faces.hit  += tmp->faces.hit;
 
74
 
 
75
        dest->bb.test += tmp->bb.test;
 
76
        dest->bb.hit  += tmp->bb.hit;
 
77
 
 
78
        dest->simd_bb.test += tmp->simd_bb.test;
 
79
        dest->simd_bb.hit  += tmp->simd_bb.hit;
 
80
 
 
81
        dest->raycast.test += tmp->raycast.test;
 
82
        dest->raycast.hit  += tmp->raycast.hit;
 
83
        
 
84
        dest->rayshadow_last_hit.test += tmp->rayshadow_last_hit.test;
 
85
        dest->rayshadow_last_hit.hit  += tmp->rayshadow_last_hit.hit;
 
86
 
 
87
        dest->raytrace_hint.test += tmp->raytrace_hint.test;
 
88
        dest->raytrace_hint.hit  += tmp->raytrace_hint.hit;
 
89
}
 
90
 
 
91
#endif