2
* $Id: rayobject_raycounter.c 26841 2010-02-12 13:34:04Z campbellbarton $
4
* ***** BEGIN GPL LICENSE BLOCK *****
6
* This program is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU General Public License
8
* as published by the Free Software Foundation; either version 2
9
* of the License, or (at your option) any later version.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software Foundation,
18
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20
* The Original Code is Copyright (C) 2009 Blender Foundation.
21
* All rights reserved.
23
* The Original Code is: all of this file.
25
* Contributor(s): André Pinto.
27
* ***** END GPL LICENSE BLOCK *****
29
#include "rayobject.h"
30
#include "raycounter.h"
34
void RE_RC_INFO(RayCounter *info)
36
printf("----------- Raycast counter --------\n");
37
printf("Rays total: %llu\n", info->raycast.test );
38
printf("Rays hit: %llu\n", info->raycast.hit );
40
printf("BB tests: %llu\n", info->bb.test );
41
printf("BB hits: %llu\n", info->bb.hit );
43
printf("SIMD BB tests: %llu\n", info->simd_bb.test );
44
printf("SIMD BB hits: %llu\n", info->simd_bb.hit );
46
printf("Primitives tests: %llu\n", info->faces.test );
47
printf("Primitives hits: %llu\n", info->faces.hit );
48
printf("------------------------------------\n");
49
printf("Shadow last-hit tests per ray: %f\n", info->rayshadow_last_hit.test / ((float)info->raycast.test) );
50
printf("Shadow last-hit hits per ray: %f\n", info->rayshadow_last_hit.hit / ((float)info->raycast.test) );
52
printf("Hint tests per ray: %f\n", info->raytrace_hint.test / ((float)info->raycast.test) );
53
printf("Hint hits per ray: %f\n", info->raytrace_hint.hit / ((float)info->raycast.test) );
55
printf("BB tests per ray: %f\n", info->bb.test / ((float)info->raycast.test) );
56
printf("BB hits per ray: %f\n", info->bb.hit / ((float)info->raycast.test) );
58
printf("SIMD tests per ray: %f\n", info->simd_bb.test / ((float)info->raycast.test) );
59
printf("SIMD hits per ray: %f\n", info->simd_bb.hit / ((float)info->raycast.test) );
61
printf("Primitives tests per ray: %f\n", info->faces.test / ((float)info->raycast.test) );
62
printf("Primitives hits per ray: %f\n", info->faces.hit / ((float)info->raycast.test) );
63
printf("------------------------------------\n");
66
void RE_RC_MERGE(RayCounter *dest, RayCounter *tmp)
68
dest->faces.test += tmp->faces.test;
69
dest->faces.hit += tmp->faces.hit;
71
dest->bb.test += tmp->bb.test;
72
dest->bb.hit += tmp->bb.hit;
74
dest->simd_bb.test += tmp->simd_bb.test;
75
dest->simd_bb.hit += tmp->simd_bb.hit;
77
dest->raycast.test += tmp->raycast.test;
78
dest->raycast.hit += tmp->raycast.hit;
80
dest->rayshadow_last_hit.test += tmp->rayshadow_last_hit.test;
81
dest->rayshadow_last_hit.hit += tmp->rayshadow_last_hit.hit;
83
dest->raytrace_hint.test += tmp->raytrace_hint.test;
84
dest->raytrace_hint.hit += tmp->raytrace_hint.hit;