diff options
author | Thomas Dinges <blender@dingto.org> | 2014-10-03 19:23:45 +0400 |
---|---|---|
committer | Thomas Dinges <blender@dingto.org> | 2014-10-03 19:23:45 +0400 |
commit | dc1ca0c94f16cebfc4c3ac0305af6ccdecb9bf4b (patch) | |
tree | dc948238b4692301c45e04a7c4658e1884f71f13 /intern/cycles/kernel/geom/geom_bvh.h | |
parent | 5e10392e9f677934ad4223ab5862b73a787561a9 (diff) |
Cycles: Fix OpenCL compile after new Volume BVH introduction and add some comments.
Diffstat (limited to 'intern/cycles/kernel/geom/geom_bvh.h')
-rw-r--r-- | intern/cycles/kernel/geom/geom_bvh.h | 100 |
1 files changed, 55 insertions, 45 deletions
diff --git a/intern/cycles/kernel/geom/geom_bvh.h b/intern/cycles/kernel/geom/geom_bvh.h index 59e811fa97e..807b23d15e5 100644 --- a/intern/cycles/kernel/geom/geom_bvh.h +++ b/intern/cycles/kernel/geom/geom_bvh.h @@ -35,6 +35,8 @@ CCL_NAMESPACE_BEGIN #define BVH_HAIR 4 #define BVH_HAIR_MINIMUM_WIDTH 8 +/* Regular BVH traversal */ + #define BVH_FUNCTION_NAME bvh_intersect #define BVH_FUNCTION_FEATURES 0 #include "geom_bvh_traversal.h" @@ -63,6 +65,8 @@ CCL_NAMESPACE_BEGIN #include "geom_bvh_traversal.h" #endif +/* Subsurface scattering BVH traversal */ + #if defined(__SUBSURFACE__) #define BVH_FUNCTION_NAME bvh_intersect_subsurface #define BVH_FUNCTION_FEATURES 0 @@ -93,6 +97,8 @@ CCL_NAMESPACE_BEGIN #include "geom_bvh_subsurface.h" #endif +/* Record all BVH intersection for shadows */ + #if defined(__SHADOW_RECORD_ALL__) #define BVH_FUNCTION_NAME bvh_intersect_shadow_all #define BVH_FUNCTION_FEATURES 0 @@ -123,6 +129,8 @@ CCL_NAMESPACE_BEGIN #include "geom_bvh_shadow.h" #endif +/* Camera inside Volume BVH intersection */ + #if defined(__VOLUME__) #define BVH_FUNCTION_NAME bvh_intersect_volume #define BVH_FUNCTION_FEATURES 0 @@ -287,6 +295,53 @@ uint scene_intersect_shadow_all(KernelGlobals *kg, const Ray *ray, Intersection } #endif +/* to work around titan bug when using arrays instead of textures */ +#ifdef __VOLUME__ +#if !defined(__KERNEL_CUDA__) || defined(__KERNEL_CUDA_TEX_STORAGE__) +ccl_device_inline +#else +ccl_device_noinline +#endif +bool scene_intersect_volume(KernelGlobals *kg, + const Ray *ray, + Intersection *isect) +{ +#ifdef __OBJECT_MOTION__ + if(kernel_data.bvh.have_motion) { +#ifdef __HAIR__ + if(kernel_data.bvh.have_curves) + return bvh_intersect_volume_hair_motion(kg, ray, isect); +#endif /* __HAIR__ */ + + return bvh_intersect_volume_motion(kg, ray, isect); + } +#endif /* __OBJECT_MOTION__ */ + +#ifdef __HAIR__ + if(kernel_data.bvh.have_curves) + return bvh_intersect_volume_hair(kg, ray, isect); +#endif /* __HAIR__ */ + +#ifdef __KERNEL_CPU__ + +#ifdef __INSTANCING__ + if(kernel_data.bvh.have_instancing) + return bvh_intersect_volume_instancing(kg, ray, isect); +#endif /* __INSTANCING__ */ + + return bvh_intersect_volume(kg, ray, isect); +#else /* __KERNEL_CPU__ */ + +#ifdef __INSTANCING__ + return bvh_intersect_volume_instancing(kg, ray, isect); +#else + return bvh_intersect_volume(kg, ray, isect); +#endif /* __INSTANCING__ */ + +#endif /* __KERNEL_CPU__ */ +} +#endif + /* Ray offset to avoid self intersection. * @@ -341,50 +396,5 @@ ccl_device_inline float3 ray_offset(float3 P, float3 Ng) #endif } -/* to work around titan bug when using arrays instead of textures */ -#if !defined(__KERNEL_CUDA__) || defined(__KERNEL_CUDA_TEX_STORAGE__) -ccl_device_inline -#else -ccl_device_noinline -#endif -bool scene_intersect_volume(KernelGlobals *kg, - const Ray *ray, - Intersection *isect) -{ -#ifdef __OBJECT_MOTION__ - if(kernel_data.bvh.have_motion) { -#ifdef __HAIR__ - if(kernel_data.bvh.have_curves) - return bvh_intersect_volume_hair_motion(kg, ray, isect); -#endif /* __HAIR__ */ - - return bvh_intersect_volume_motion(kg, ray, isect); - } -#endif /* __OBJECT_MOTION__ */ - -#ifdef __HAIR__ - if(kernel_data.bvh.have_curves) - return bvh_intersect_volume_hair(kg, ray, isect); -#endif /* __HAIR__ */ - -#ifdef __KERNEL_CPU__ - -#ifdef __INSTANCING__ - if(kernel_data.bvh.have_instancing) - return bvh_intersect_volume_instancing(kg, ray, isect); -#endif /* __INSTANCING__ */ - - return bvh_intersect_volume(kg, ray, isect); -#else /* __KERNEL_CPU__ */ - -#ifdef __INSTANCING__ - return bvh_intersect_volume_instancing(kg, ray, isect); -#else - return bvh_intersect_volume(kg, ray, isect); -#endif /* __INSTANCING__ */ - -#endif /* __KERNEL_CPU__ */ -} - CCL_NAMESPACE_END |