|
Blender
V2.59
|
00001 /* 00002 * $Id: raycounter.h 35233 2011-02-27 19:31:27Z jesterking $ 00003 * 00004 * ***** BEGIN GPL LICENSE BLOCK ***** 00005 * 00006 * This program is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU General Public License 00008 * as published by the Free Software Foundation; either version 2 00009 * of the License, or (at your option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with this program; if not, write to the Free Software Foundation, 00018 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00019 * 00020 * The Original Code is Copyright (C) 2009 Blender Foundation. 00021 * All rights reserved. 00022 * 00023 * The Original Code is: all of this file. 00024 * 00025 * Contributor(s): André Pinto. 00026 * 00027 * ***** END GPL LICENSE BLOCK ***** 00028 */ 00029 00035 #ifndef RE_RAYCOUNTER_H 00036 #define RE_RAYCOUNTER_H 00037 00038 //#define RE_RAYCOUNTER /* enable counters per ray, usefull for measuring raytrace structures performance */ 00039 00040 #ifdef __cplusplus 00041 extern "C" { 00042 #endif 00043 00044 #ifdef RE_RAYCOUNTER 00045 00046 /* ray counter functions */ 00047 00048 typedef struct RayCounter { 00049 struct { 00050 unsigned long long test, hit; 00051 } faces, bb, simd_bb, raycast, raytrace_hint, rayshadow_last_hit; 00052 } RayCounter; 00053 00054 #define RE_RC_INIT(isec, shi) (isec).raycounter = &((shi).shading.raycounter) 00055 void RE_RC_INFO (RayCounter *rc); 00056 void RE_RC_MERGE(RayCounter *rc, RayCounter *tmp); 00057 #define RE_RC_COUNT(var) (var)++ 00058 00059 extern RayCounter re_rc_counter[]; 00060 00061 #else 00062 00063 /* ray counter stubs */ 00064 00065 #define RE_RC_INIT(isec,shi) 00066 #define RE_RC_INFO(rc) 00067 #define RE_RC_MERGE(dest,src) 00068 #define RE_RC_COUNT(var) 00069 00070 #endif 00071 00072 #ifdef __cplusplus 00073 } 00074 #endif 00075 00076 #endif