diff options
Diffstat (limited to 'intern/cycles/kernel/geom/geom_bvh.h')
-rw-r--r-- | intern/cycles/kernel/geom/geom_bvh.h | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/intern/cycles/kernel/geom/geom_bvh.h b/intern/cycles/kernel/geom/geom_bvh.h index 12ebc646c14..dd7c25d581d 100644 --- a/intern/cycles/kernel/geom/geom_bvh.h +++ b/intern/cycles/kernel/geom/geom_bvh.h @@ -93,6 +93,36 @@ CCL_NAMESPACE_BEGIN #include "geom_bvh_subsurface.h" #endif +#if defined(__SHADOW_RECORD_ALL__) +#define BVH_FUNCTION_NAME bvh_intersect_shadow_all +#define BVH_FUNCTION_FEATURES 0 +#include "geom_bvh_shadow.h" +#endif + +#if defined(__SUBSURFACE__) && defined(__INSTANCING__) +#define BVH_FUNCTION_NAME bvh_intersect_shadow_all_instancing +#define BVH_FUNCTION_FEATURES BVH_INSTANCING +#include "geom_bvh_shadow.h" +#endif + +#if defined(__SUBSURFACE__) && defined(__HAIR__) +#define BVH_FUNCTION_NAME bvh_intersect_shadow_all_hair +#define BVH_FUNCTION_FEATURES BVH_INSTANCING|BVH_HAIR +#include "geom_bvh_shadow.h" +#endif + +#if defined(__SUBSURFACE__) && defined(__OBJECT_MOTION__) +#define BVH_FUNCTION_NAME bvh_intersect_shadow_all_motion +#define BVH_FUNCTION_FEATURES BVH_INSTANCING|BVH_MOTION +#include "geom_bvh_shadow.h" +#endif + +#if defined(__SUBSURFACE__) && defined(__HAIR__) && defined(__OBJECT_MOTION__) +#define BVH_FUNCTION_NAME bvh_intersect_shadow_all_hair_motion +#define BVH_FUNCTION_FEATURES BVH_INSTANCING|BVH_HAIR|BVH_MOTION +#include "geom_bvh_shadow.h" +#endif + /* to work around titan bug when using arrays instead of textures */ #if !defined(__KERNEL_CUDA__) || defined(__KERNEL_CUDA_TEX_STORAGE__) ccl_device_inline @@ -185,6 +215,52 @@ uint scene_intersect_subsurface(KernelGlobals *kg, const Ray *ray, Intersection } #endif +/* to work around titan bug when using arrays instead of textures */ +#ifdef __SHADOW_RECORD_ALL__ +#if !defined(__KERNEL_CUDA__) || defined(__KERNEL_CUDA_TEX_STORAGE__) +ccl_device_inline +#else +ccl_device_noinline +#endif +uint scene_intersect_shadow_all(KernelGlobals *kg, const Ray *ray, Intersection *isect, uint max_hits, uint *num_hits) +{ +#ifdef __OBJECT_MOTION__ + if(kernel_data.bvh.have_motion) { +#ifdef __HAIR__ + if(kernel_data.bvh.have_curves) + return bvh_intersect_shadow_all_hair_motion(kg, ray, isect, max_hits, num_hits); +#endif /* __HAIR__ */ + + return bvh_intersect_shadow_all_motion(kg, ray, isect, max_hits, num_hits); + } +#endif /* __OBJECT_MOTION__ */ + +#ifdef __HAIR__ + if(kernel_data.bvh.have_curves) + return bvh_intersect_shadow_all_hair(kg, ray, isect, max_hits, num_hits); +#endif /* __HAIR__ */ + +#ifdef __KERNEL_CPU__ + +#ifdef __INSTANCING__ + if(kernel_data.bvh.have_instancing) + return bvh_intersect_shadow_all_instancing(kg, ray, isect, max_hits, num_hits); +#endif /* __INSTANCING__ */ + + return bvh_intersect_shadow_all(kg, ray, isect, max_hits, num_hits); +#else /* __KERNEL_CPU__ */ + +#ifdef __INSTANCING__ + return bvh_intersect_shadow_all_instancing(kg, ray, isect, max_hits, num_hits); +#else + return bvh_intersect_shadow_all(kg, ray, isect, max_hits, num_hits); +#endif /* __INSTANCING__ */ + +#endif /* __KERNEL_CPU__ */ +} +#endif + + /* Ray offset to avoid self intersection. * * This function should be used to compute a modified ray start position for |