diff options
Diffstat (limited to 'intern/cycles/kernel/bvh')
-rw-r--r-- | intern/cycles/kernel/bvh/bvh.h | 13 | ||||
-rw-r--r-- | intern/cycles/kernel/bvh/bvh_nodes.h | 310 | ||||
-rw-r--r-- | intern/cycles/kernel/bvh/bvh_shadow_all.h | 10 | ||||
-rw-r--r-- | intern/cycles/kernel/bvh/bvh_traversal.h | 124 | ||||
-rw-r--r-- | intern/cycles/kernel/bvh/bvh_types.h | 1 | ||||
-rw-r--r-- | intern/cycles/kernel/bvh/obvh_nodes.h | 181 | ||||
-rw-r--r-- | intern/cycles/kernel/bvh/obvh_shadow_all.h | 10 | ||||
-rw-r--r-- | intern/cycles/kernel/bvh/obvh_traversal.h | 73 | ||||
-rw-r--r-- | intern/cycles/kernel/bvh/qbvh_nodes.h | 187 | ||||
-rw-r--r-- | intern/cycles/kernel/bvh/qbvh_shadow_all.h | 10 | ||||
-rw-r--r-- | intern/cycles/kernel/bvh/qbvh_traversal.h | 73 |
11 files changed, 30 insertions, 962 deletions
diff --git a/intern/cycles/kernel/bvh/bvh.h b/intern/cycles/kernel/bvh/bvh.h index 13e72ed299f..7503bad37b0 100644 --- a/intern/cycles/kernel/bvh/bvh.h +++ b/intern/cycles/kernel/bvh/bvh.h @@ -57,7 +57,7 @@ CCL_NAMESPACE_BEGIN #if defined(__HAIR__) # define BVH_FUNCTION_NAME bvh_intersect_hair -# define BVH_FUNCTION_FEATURES BVH_INSTANCING | BVH_HAIR | BVH_HAIR_MINIMUM_WIDTH +# define BVH_FUNCTION_FEATURES BVH_INSTANCING | BVH_HAIR # include "kernel/bvh/bvh_traversal.h" #endif @@ -69,7 +69,7 @@ CCL_NAMESPACE_BEGIN #if defined(__HAIR__) && defined(__OBJECT_MOTION__) # define BVH_FUNCTION_NAME bvh_intersect_hair_motion -# define BVH_FUNCTION_FEATURES BVH_INSTANCING | BVH_HAIR | BVH_HAIR_MINIMUM_WIDTH | BVH_MOTION +# define BVH_FUNCTION_FEATURES BVH_INSTANCING | BVH_HAIR | BVH_MOTION # include "kernel/bvh/bvh_traversal.h" #endif @@ -181,10 +181,7 @@ ccl_device_inline bool scene_intersect_valid(const Ray *ray) ccl_device_intersect bool scene_intersect(KernelGlobals *kg, const Ray ray, const uint visibility, - Intersection *isect, - uint *lcg_state, - float difl, - float extmax) + Intersection *isect) { PROFILING_INIT(kg, PROFILING_INTERSECT); @@ -211,7 +208,7 @@ ccl_device_intersect bool scene_intersect(KernelGlobals *kg, if (kernel_data.bvh.have_motion) { # ifdef __HAIR__ if (kernel_data.bvh.have_curves) - return bvh_intersect_hair_motion(kg, &ray, isect, visibility, lcg_state, difl, extmax); + return bvh_intersect_hair_motion(kg, &ray, isect, visibility); # endif /* __HAIR__ */ return bvh_intersect_motion(kg, &ray, isect, visibility); @@ -220,7 +217,7 @@ ccl_device_intersect bool scene_intersect(KernelGlobals *kg, #ifdef __HAIR__ if (kernel_data.bvh.have_curves) - return bvh_intersect_hair(kg, &ray, isect, visibility, lcg_state, difl, extmax); + return bvh_intersect_hair(kg, &ray, isect, visibility); #endif /* __HAIR__ */ #ifdef __KERNEL_CPU__ diff --git a/intern/cycles/kernel/bvh/bvh_nodes.h b/intern/cycles/kernel/bvh/bvh_nodes.h index 042630121c8..a33bc73e25b 100644 --- a/intern/cycles/kernel/bvh/bvh_nodes.h +++ b/intern/cycles/kernel/bvh/bvh_nodes.h @@ -75,67 +75,6 @@ ccl_device_forceinline int bvh_aligned_node_intersect(KernelGlobals *kg, # endif } -ccl_device_forceinline int bvh_aligned_node_intersect_robust(KernelGlobals *kg, - const float3 P, - const float3 idir, - const float t, - const float difl, - const float extmax, - const int node_addr, - const uint visibility, - float dist[2]) -{ - - /* fetch node data */ - float4 cnodes = kernel_tex_fetch(__bvh_nodes, node_addr + 0); - float4 node0 = kernel_tex_fetch(__bvh_nodes, node_addr + 1); - float4 node1 = kernel_tex_fetch(__bvh_nodes, node_addr + 2); - float4 node2 = kernel_tex_fetch(__bvh_nodes, node_addr + 3); - - /* intersect ray against child nodes */ - float c0lox = (node0.x - P.x) * idir.x; - float c0hix = (node0.z - P.x) * idir.x; - float c0loy = (node1.x - P.y) * idir.y; - float c0hiy = (node1.z - P.y) * idir.y; - float c0loz = (node2.x - P.z) * idir.z; - float c0hiz = (node2.z - P.z) * idir.z; - float c0min = max4(0.0f, min(c0lox, c0hix), min(c0loy, c0hiy), min(c0loz, c0hiz)); - float c0max = min4(t, max(c0lox, c0hix), max(c0loy, c0hiy), max(c0loz, c0hiz)); - - float c1lox = (node0.y - P.x) * idir.x; - float c1hix = (node0.w - P.x) * idir.x; - float c1loy = (node1.y - P.y) * idir.y; - float c1hiy = (node1.w - P.y) * idir.y; - float c1loz = (node2.y - P.z) * idir.z; - float c1hiz = (node2.w - P.z) * idir.z; - float c1min = max4(0.0f, min(c1lox, c1hix), min(c1loy, c1hiy), min(c1loz, c1hiz)); - float c1max = min4(t, max(c1lox, c1hix), max(c1loy, c1hiy), max(c1loz, c1hiz)); - - if (difl != 0.0f) { - float hdiff = 1.0f + difl; - float ldiff = 1.0f - difl; - if (__float_as_int(cnodes.z) & PATH_RAY_CURVE) { - c0min = max(ldiff * c0min, c0min - extmax); - c0max = min(hdiff * c0max, c0max + extmax); - } - if (__float_as_int(cnodes.w) & PATH_RAY_CURVE) { - c1min = max(ldiff * c1min, c1min - extmax); - c1max = min(hdiff * c1max, c1max + extmax); - } - } - - dist[0] = c0min; - dist[1] = c1min; - -# ifdef __VISIBILITY_FLAG__ - /* this visibility test gives a 5% performance hit, how to solve? */ - return (((c0max >= c0min) && (__float_as_uint(cnodes.x) & visibility)) ? 1 : 0) | - (((c1max >= c1min) && (__float_as_uint(cnodes.y) & visibility)) ? 2 : 0); -# else - return ((c0max >= c0min) ? 1 : 0) | ((c1max >= c1min) ? 2 : 0); -# endif -} - ccl_device_forceinline bool bvh_unaligned_node_intersect_child(KernelGlobals *kg, const float3 P, const float3 dir, @@ -162,41 +101,6 @@ ccl_device_forceinline bool bvh_unaligned_node_intersect_child(KernelGlobals *kg return tnear <= tfar; } -ccl_device_forceinline bool bvh_unaligned_node_intersect_child_robust(KernelGlobals *kg, - const float3 P, - const float3 dir, - const float t, - const float difl, - int node_addr, - int child, - float dist[2]) -{ - Transform space = bvh_unaligned_node_fetch_space(kg, node_addr, child); - float3 aligned_dir = transform_direction(&space, dir); - float3 aligned_P = transform_point(&space, P); - float3 nrdir = -bvh_inverse_direction(aligned_dir); - float3 tLowerXYZ = aligned_P * nrdir; - float3 tUpperXYZ = tLowerXYZ - nrdir; - const float near_x = min(tLowerXYZ.x, tUpperXYZ.x); - const float near_y = min(tLowerXYZ.y, tUpperXYZ.y); - const float near_z = min(tLowerXYZ.z, tUpperXYZ.z); - const float far_x = max(tLowerXYZ.x, tUpperXYZ.x); - const float far_y = max(tLowerXYZ.y, tUpperXYZ.y); - const float far_z = max(tLowerXYZ.z, tUpperXYZ.z); - const float tnear = max4(0.0f, near_x, near_y, near_z); - const float tfar = min4(t, far_x, far_y, far_z); - *dist = tnear; - if (difl != 0.0f) { - /* TODO(sergey): Same as for QBVH, needs a proper use. */ - const float round_down = 1.0f - difl; - const float round_up = 1.0f + difl; - return round_down * tnear <= round_up * tfar; - } - else { - return tnear <= tfar; - } -} - ccl_device_forceinline int bvh_unaligned_node_intersect(KernelGlobals *kg, const float3 P, const float3 dir, @@ -227,38 +131,6 @@ ccl_device_forceinline int bvh_unaligned_node_intersect(KernelGlobals *kg, return mask; } -ccl_device_forceinline int bvh_unaligned_node_intersect_robust(KernelGlobals *kg, - const float3 P, - const float3 dir, - const float3 idir, - const float t, - const float difl, - const float extmax, - const int node_addr, - const uint visibility, - float dist[2]) -{ - int mask = 0; - float4 cnodes = kernel_tex_fetch(__bvh_nodes, node_addr + 0); - if (bvh_unaligned_node_intersect_child_robust(kg, P, dir, t, difl, node_addr, 0, &dist[0])) { -# ifdef __VISIBILITY_FLAG__ - if ((__float_as_uint(cnodes.x) & visibility)) -# endif - { - mask |= 1; - } - } - if (bvh_unaligned_node_intersect_child_robust(kg, P, dir, t, difl, node_addr, 1, &dist[1])) { -# ifdef __VISIBILITY_FLAG__ - if ((__float_as_uint(cnodes.y) & visibility)) -# endif - { - mask |= 2; - } - } - return mask; -} - ccl_device_forceinline int bvh_node_intersect(KernelGlobals *kg, const float3 P, const float3 dir, @@ -277,27 +149,6 @@ ccl_device_forceinline int bvh_node_intersect(KernelGlobals *kg, } } -ccl_device_forceinline int bvh_node_intersect_robust(KernelGlobals *kg, - const float3 P, - const float3 dir, - const float3 idir, - const float t, - const float difl, - const float extmax, - const int node_addr, - const uint visibility, - float dist[2]) -{ - float4 node = kernel_tex_fetch(__bvh_nodes, node_addr); - if (__float_as_uint(node.x) & PATH_RAY_NODE_UNALIGNED) { - return bvh_unaligned_node_intersect_robust( - kg, P, dir, idir, t, difl, extmax, node_addr, visibility, dist); - } - else { - return bvh_aligned_node_intersect_robust( - kg, P, idir, t, difl, extmax, node_addr, visibility, dist); - } -} #else /* !defined(__KERNEL_SSE2__) */ int ccl_device_forceinline bvh_aligned_node_intersect(KernelGlobals *kg, @@ -343,69 +194,6 @@ int ccl_device_forceinline bvh_aligned_node_intersect(KernelGlobals *kg, # endif } -ccl_device_forceinline int bvh_aligned_node_intersect_robust(KernelGlobals *kg, - const float3 &P, - const float3 &dir, - const ssef &tsplat, - const ssef Psplat[3], - const ssef idirsplat[3], - const shuffle_swap_t shufflexyz[3], - const float difl, - const float extmax, - const int nodeAddr, - const uint visibility, - float dist[2]) -{ - /* Intersect two child bounding boxes, SSE3 version adapted from Embree */ - const ssef pn = cast(ssei(0, 0, 0x80000000, 0x80000000)); - - /* fetch node data */ - const ssef *bvh_nodes = (ssef *)kg->__bvh_nodes.data + nodeAddr; - - /* intersect ray against child nodes */ - const ssef tminmaxx = (shuffle_swap(bvh_nodes[1], shufflexyz[0]) - Psplat[0]) * idirsplat[0]; - const ssef tminmaxy = (shuffle_swap(bvh_nodes[2], shufflexyz[1]) - Psplat[1]) * idirsplat[1]; - const ssef tminmaxz = (shuffle_swap(bvh_nodes[3], shufflexyz[2]) - Psplat[2]) * idirsplat[2]; - - /* calculate { c0min, c1min, -c0max, -c1max} */ - ssef minmax = max(max(tminmaxx, tminmaxy), max(tminmaxz, tsplat)); - const ssef tminmax = minmax ^ pn; - - if (difl != 0.0f) { - float4 cnodes = kernel_tex_fetch(__bvh_nodes, nodeAddr + 0); - float4 *tminmaxview = (float4 *)&tminmax; - float &c0min = tminmaxview->x, &c1min = tminmaxview->y; - float &c0max = tminmaxview->z, &c1max = tminmaxview->w; - float hdiff = 1.0f + difl; - float ldiff = 1.0f - difl; - if (__float_as_int(cnodes.x) & PATH_RAY_CURVE) { - c0min = max(ldiff * c0min, c0min - extmax); - c0max = min(hdiff * c0max, c0max + extmax); - } - if (__float_as_int(cnodes.y) & PATH_RAY_CURVE) { - c1min = max(ldiff * c1min, c1min - extmax); - c1max = min(hdiff * c1max, c1max + extmax); - } - } - - const sseb lrhit = tminmax <= shuffle<2, 3, 0, 1>(tminmax); - - dist[0] = tminmax[0]; - dist[1] = tminmax[1]; - - int mask = movemask(lrhit); - -# ifdef __VISIBILITY_FLAG__ - /* this visibility test gives a 5% performance hit, how to solve? */ - float4 cnodes = kernel_tex_fetch(__bvh_nodes, nodeAddr + 0); - int cmask = (((mask & 1) && (__float_as_uint(cnodes.x) & visibility)) ? 1 : 0) | - (((mask & 2) && (__float_as_uint(cnodes.y) & visibility)) ? 2 : 0); - return cmask; -# else - return mask & 3; -# endif -} - ccl_device_forceinline int bvh_unaligned_node_intersect(KernelGlobals *kg, const float3 P, const float3 dir, @@ -458,68 +246,6 @@ ccl_device_forceinline int bvh_unaligned_node_intersect(KernelGlobals *kg, # endif } -ccl_device_forceinline int bvh_unaligned_node_intersect_robust(KernelGlobals *kg, - const float3 P, - const float3 dir, - const ssef &isect_near, - const ssef &isect_far, - const float difl, - const int node_addr, - const uint visibility, - float dist[2]) -{ - Transform space0 = bvh_unaligned_node_fetch_space(kg, node_addr, 0); - Transform space1 = bvh_unaligned_node_fetch_space(kg, node_addr, 1); - - float3 aligned_dir0 = transform_direction(&space0, dir), - aligned_dir1 = transform_direction(&space1, dir); - float3 aligned_P0 = transform_point(&space0, P), aligned_P1 = transform_point(&space1, P); - float3 nrdir0 = -bvh_inverse_direction(aligned_dir0), - nrdir1 = -bvh_inverse_direction(aligned_dir1); - - ssef lower_x = ssef(aligned_P0.x * nrdir0.x, aligned_P1.x * nrdir1.x, 0.0f, 0.0f), - lower_y = ssef(aligned_P0.y * nrdir0.y, aligned_P1.y * nrdir1.y, 0.0f, 0.0f), - lower_z = ssef(aligned_P0.z * nrdir0.z, aligned_P1.z * nrdir1.z, 0.0f, 0.0f); - - ssef upper_x = lower_x - ssef(nrdir0.x, nrdir1.x, 0.0f, 0.0f), - upper_y = lower_y - ssef(nrdir0.y, nrdir1.y, 0.0f, 0.0f), - upper_z = lower_z - ssef(nrdir0.z, nrdir1.z, 0.0f, 0.0f); - - ssef tnear_x = min(lower_x, upper_x); - ssef tnear_y = min(lower_y, upper_y); - ssef tnear_z = min(lower_z, upper_z); - ssef tfar_x = max(lower_x, upper_x); - ssef tfar_y = max(lower_y, upper_y); - ssef tfar_z = max(lower_z, upper_z); - - const ssef tnear = max4(isect_near, tnear_x, tnear_y, tnear_z); - const ssef tfar = min4(isect_far, tfar_x, tfar_y, tfar_z); - sseb vmask; - if (difl != 0.0f) { - const float round_down = 1.0f - difl; - const float round_up = 1.0f + difl; - vmask = round_down * tnear <= round_up * tfar; - } - else { - vmask = tnear <= tfar; - } - - dist[0] = tnear.f[0]; - dist[1] = tnear.f[1]; - - int mask = (int)movemask(vmask); - -# ifdef __VISIBILITY_FLAG__ - /* this visibility test gives a 5% performance hit, how to solve? */ - float4 cnodes = kernel_tex_fetch(__bvh_nodes, node_addr + 0); - int cmask = (((mask & 1) && (__float_as_uint(cnodes.x) & visibility)) ? 1 : 0) | - (((mask & 2) && (__float_as_uint(cnodes.y) & visibility)) ? 2 : 0); - return cmask; -# else - return mask & 3; -# endif -} - ccl_device_forceinline int bvh_node_intersect(KernelGlobals *kg, const float3 &P, const float3 &dir, @@ -543,40 +269,4 @@ ccl_device_forceinline int bvh_node_intersect(KernelGlobals *kg, kg, P, dir, tsplat, Psplat, idirsplat, shufflexyz, node_addr, visibility, dist); } } - -ccl_device_forceinline int bvh_node_intersect_robust(KernelGlobals *kg, - const float3 &P, - const float3 &dir, - const ssef &isect_near, - const ssef &isect_far, - const ssef &tsplat, - const ssef Psplat[3], - const ssef idirsplat[3], - const shuffle_swap_t shufflexyz[3], - const float difl, - const float extmax, - const int node_addr, - const uint visibility, - float dist[2]) -{ - float4 node = kernel_tex_fetch(__bvh_nodes, node_addr); - if (__float_as_uint(node.x) & PATH_RAY_NODE_UNALIGNED) { - return bvh_unaligned_node_intersect_robust( - kg, P, dir, isect_near, isect_far, difl, node_addr, visibility, dist); - } - else { - return bvh_aligned_node_intersect_robust(kg, - P, - dir, - tsplat, - Psplat, - idirsplat, - shufflexyz, - difl, - extmax, - node_addr, - visibility, - dist); - } -} #endif /* !defined(__KERNEL_SSE2__) */ diff --git a/intern/cycles/kernel/bvh/bvh_shadow_all.h b/intern/cycles/kernel/bvh/bvh_shadow_all.h index b362779549c..268bb149970 100644 --- a/intern/cycles/kernel/bvh/bvh_shadow_all.h +++ b/intern/cycles/kernel/bvh/bvh_shadow_all.h @@ -219,10 +219,7 @@ ccl_device_inline object, prim_addr, ray->time, - curve_type, - NULL, - 0, - 0); + curve_type); } else { hit = curve_intersect(kg, @@ -233,10 +230,7 @@ ccl_device_inline object, prim_addr, ray->time, - curve_type, - NULL, - 0, - 0); + curve_type); } break; } diff --git a/intern/cycles/kernel/bvh/bvh_traversal.h b/intern/cycles/kernel/bvh/bvh_traversal.h index 34a06d003bb..18afc6ae4eb 100644 --- a/intern/cycles/kernel/bvh/bvh_traversal.h +++ b/intern/cycles/kernel/bvh/bvh_traversal.h @@ -26,10 +26,8 @@ #if BVH_FEATURE(BVH_HAIR) # define NODE_INTERSECT bvh_node_intersect -# define NODE_INTERSECT_ROBUST bvh_node_intersect_robust #else # define NODE_INTERSECT bvh_aligned_node_intersect -# define NODE_INTERSECT_ROBUST bvh_aligned_node_intersect_robust #endif /* This is a template BVH traversal function, where various features can be @@ -38,21 +36,13 @@ * * BVH_INSTANCING: object instancing * BVH_HAIR: hair curve rendering - * BVH_HAIR_MINIMUM_WIDTH: hair curve rendering with minimum width * BVH_MOTION: motion blur rendering */ ccl_device_noinline bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg, const Ray *ray, Intersection *isect, - const uint visibility -#if BVH_FEATURE(BVH_HAIR_MINIMUM_WIDTH) - , - uint *lcg_state, - float difl, - float extmax -#endif -) + const uint visibility) { /* todo: * - test if pushing distance on the stack helps (for non shadow rays) @@ -117,23 +107,6 @@ ccl_device_noinline bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg, float4 cnodes = kernel_tex_fetch(__bvh_nodes, node_addr + 0); #if !defined(__KERNEL_SSE2__) -# if BVH_FEATURE(BVH_HAIR_MINIMUM_WIDTH) - if (difl != 0.0f) { - traverse_mask = NODE_INTERSECT_ROBUST(kg, - P, -# if BVH_FEATURE(BVH_HAIR) - dir, -# endif - idir, - isect->t, - difl, - extmax, - node_addr, - visibility, - dist); - } - else -# endif { traverse_mask = NODE_INTERSECT(kg, P, @@ -147,27 +120,6 @@ ccl_device_noinline bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg, dist); } #else // __KERNEL_SSE2__ -# if BVH_FEATURE(BVH_HAIR_MINIMUM_WIDTH) - if (difl != 0.0f) { - traverse_mask = NODE_INTERSECT_ROBUST(kg, - P, - dir, -# if BVH_FEATURE(BVH_HAIR) - tnear, - tfar, -# endif - tsplat, - Psplat, - idirsplat, - shufflexyz, - difl, - extmax, - node_addr, - visibility, - dist); - } - else -# endif { traverse_mask = NODE_INTERSECT(kg, P, @@ -287,32 +239,12 @@ ccl_device_noinline bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg, kernel_assert((curve_type & PRIMITIVE_ALL) == (type & PRIMITIVE_ALL)); bool hit; if (kernel_data.curve.curveflags & CURVE_KN_INTERPOLATE) { - hit = cardinal_curve_intersect(kg, - isect, - P, - dir, - visibility, - object, - prim_addr, - ray->time, - curve_type, - lcg_state, - difl, - extmax); + hit = cardinal_curve_intersect( + kg, isect, P, dir, visibility, object, prim_addr, ray->time, curve_type); } else { - hit = curve_intersect(kg, - isect, - P, - dir, - visibility, - object, - prim_addr, - ray->time, - curve_type, - lcg_state, - difl, - extmax); + hit = curve_intersect( + kg, isect, P, dir, visibility, object, prim_addr, ray->time, curve_type); } if (hit) { /* shadow ray early termination */ @@ -408,56 +340,19 @@ ccl_device_noinline bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg, ccl_device_inline bool BVH_FUNCTION_NAME(KernelGlobals *kg, const Ray *ray, Intersection *isect, - const uint visibility -#if BVH_FEATURE(BVH_HAIR_MINIMUM_WIDTH) - , - uint *lcg_state, - float difl, - float extmax -#endif -) + const uint visibility) { switch (kernel_data.bvh.bvh_layout) { #ifdef __KERNEL_AVX2__ case BVH_LAYOUT_BVH8: - return BVH_FUNCTION_FULL_NAME(OBVH)(kg, - ray, - isect, - visibility -# if BVH_FEATURE(BVH_HAIR_MINIMUM_WIDTH) - , - lcg_state, - difl, - extmax -# endif - ); + return BVH_FUNCTION_FULL_NAME(OBVH)(kg, ray, isect, visibility); #endif #ifdef __QBVH__ case BVH_LAYOUT_BVH4: - return BVH_FUNCTION_FULL_NAME(QBVH)(kg, - ray, - isect, - visibility -# if BVH_FEATURE(BVH_HAIR_MINIMUM_WIDTH) - , - lcg_state, - difl, - extmax -# endif - ); + return BVH_FUNCTION_FULL_NAME(QBVH)(kg, ray, isect, visibility); #endif /* __QBVH__ */ case BVH_LAYOUT_BVH2: - return BVH_FUNCTION_FULL_NAME(BVH)(kg, - ray, - isect, - visibility -#if BVH_FEATURE(BVH_HAIR_MINIMUM_WIDTH) - , - lcg_state, - difl, - extmax -#endif - ); + return BVH_FUNCTION_FULL_NAME(BVH)(kg, ray, isect, visibility); } kernel_assert(!"Should not happen"); return false; @@ -466,4 +361,3 @@ ccl_device_inline bool BVH_FUNCTION_NAME(KernelGlobals *kg, #undef BVH_FUNCTION_NAME #undef BVH_FUNCTION_FEATURES #undef NODE_INTERSECT -#undef NODE_INTERSECT_ROBUST diff --git a/intern/cycles/kernel/bvh/bvh_types.h b/intern/cycles/kernel/bvh/bvh_types.h index 16f3b03f842..84dc0dbaef5 100644 --- a/intern/cycles/kernel/bvh/bvh_types.h +++ b/intern/cycles/kernel/bvh/bvh_types.h @@ -38,7 +38,6 @@ CCL_NAMESPACE_BEGIN #define BVH_INSTANCING 1 #define BVH_MOTION 2 #define BVH_HAIR 4 -#define BVH_HAIR_MINIMUM_WIDTH 8 #define BVH_NAME_JOIN(x, y) x##_##y #define BVH_NAME_EVAL(x, y) BVH_NAME_JOIN(x, y) diff --git a/intern/cycles/kernel/bvh/obvh_nodes.h b/intern/cycles/kernel/bvh/obvh_nodes.h index 6831562cade..e5c935b75ed 100644 --- a/intern/cycles/kernel/bvh/obvh_nodes.h +++ b/intern/cycles/kernel/bvh/obvh_nodes.h @@ -276,53 +276,6 @@ ccl_device_inline int obvh_aligned_node_intersect(KernelGlobals *ccl_restrict kg #endif } -ccl_device_inline int obvh_aligned_node_intersect_robust(KernelGlobals *ccl_restrict kg, - const avxf &isect_near, - const avxf &isect_far, -#ifdef __KERNEL_AVX2__ - const avx3f &P_idir, -#else - const avx3f &P, -#endif - const avx3f &idir, - const int near_x, - const int near_y, - const int near_z, - const int far_x, - const int far_y, - const int far_z, - const int node_addr, - const float difl, - avxf *ccl_restrict dist) -{ - const int offset = node_addr + 2; -#ifdef __KERNEL_AVX2__ - const avxf tnear_x = msub( - kernel_tex_fetch_avxf(__bvh_nodes, offset + near_x * 2), idir.x, P_idir.x); - const avxf tfar_x = msub( - kernel_tex_fetch_avxf(__bvh_nodes, offset + far_x * 2), idir.x, P_idir.x); - const avxf tnear_y = msub( - kernel_tex_fetch_avxf(__bvh_nodes, offset + near_y * 2), idir.y, P_idir.y); - const avxf tfar_y = msub( - kernel_tex_fetch_avxf(__bvh_nodes, offset + far_y * 2), idir.y, P_idir.y); - const avxf tnear_z = msub( - kernel_tex_fetch_avxf(__bvh_nodes, offset + near_z * 2), idir.z, P_idir.z); - const avxf tfar_z = msub( - kernel_tex_fetch_avxf(__bvh_nodes, offset + far_z * 2), idir.z, P_idir.z); - - const float round_down = 1.0f - difl; - const float round_up = 1.0f + difl; - const avxf tnear = max4(tnear_x, tnear_y, tnear_z, isect_near); - const avxf tfar = min4(tfar_x, tfar_y, tfar_z, isect_far); - const avxb vmask = round_down * tnear <= round_up * tfar; - int mask = (int)movemask(vmask); - *dist = tnear; - return mask; -#else - return 0; -#endif -} - /* Unaligned nodes intersection */ ccl_device_inline int obvh_unaligned_node_intersect(KernelGlobals *ccl_restrict kg, @@ -391,77 +344,6 @@ ccl_device_inline int obvh_unaligned_node_intersect(KernelGlobals *ccl_restrict return movemask(vmask); } -ccl_device_inline int obvh_unaligned_node_intersect_robust(KernelGlobals *ccl_restrict kg, - const avxf &isect_near, - const avxf &isect_far, -#ifdef __KERNEL_AVX2__ - const avx3f &P_idir, -#endif - const avx3f &P, - const avx3f &dir, - const avx3f &idir, - const int near_x, - const int near_y, - const int near_z, - const int far_x, - const int far_y, - const int far_z, - const int node_addr, - const float difl, - avxf *ccl_restrict dist) -{ - const int offset = node_addr; - const avxf tfm_x_x = kernel_tex_fetch_avxf(__bvh_nodes, offset + 2); - const avxf tfm_x_y = kernel_tex_fetch_avxf(__bvh_nodes, offset + 4); - const avxf tfm_x_z = kernel_tex_fetch_avxf(__bvh_nodes, offset + 6); - - const avxf tfm_y_x = kernel_tex_fetch_avxf(__bvh_nodes, offset + 8); - const avxf tfm_y_y = kernel_tex_fetch_avxf(__bvh_nodes, offset + 10); - const avxf tfm_y_z = kernel_tex_fetch_avxf(__bvh_nodes, offset + 12); - - const avxf tfm_z_x = kernel_tex_fetch_avxf(__bvh_nodes, offset + 14); - const avxf tfm_z_y = kernel_tex_fetch_avxf(__bvh_nodes, offset + 16); - const avxf tfm_z_z = kernel_tex_fetch_avxf(__bvh_nodes, offset + 18); - - const avxf tfm_t_x = kernel_tex_fetch_avxf(__bvh_nodes, offset + 20); - const avxf tfm_t_y = kernel_tex_fetch_avxf(__bvh_nodes, offset + 22); - const avxf tfm_t_z = kernel_tex_fetch_avxf(__bvh_nodes, offset + 24); - - const avxf aligned_dir_x = dir.x * tfm_x_x + dir.y * tfm_x_y + dir.z * tfm_x_z, - aligned_dir_y = dir.x * tfm_y_x + dir.y * tfm_y_y + dir.z * tfm_y_z, - aligned_dir_z = dir.x * tfm_z_x + dir.y * tfm_z_y + dir.z * tfm_z_z; - - const avxf aligned_P_x = P.x * tfm_x_x + P.y * tfm_x_y + P.z * tfm_x_z + tfm_t_x, - aligned_P_y = P.x * tfm_y_x + P.y * tfm_y_y + P.z * tfm_y_z + tfm_t_y, - aligned_P_z = P.x * tfm_z_x + P.y * tfm_z_y + P.z * tfm_z_z + tfm_t_z; - - const avxf neg_one(-1.0f); - const avxf nrdir_x = neg_one / aligned_dir_x, nrdir_y = neg_one / aligned_dir_y, - nrdir_z = neg_one / aligned_dir_z; - - const avxf tlower_x = aligned_P_x * nrdir_x, tlower_y = aligned_P_y * nrdir_y, - tlower_z = aligned_P_z * nrdir_z; - - const avxf tupper_x = tlower_x - nrdir_x, tupper_y = tlower_y - nrdir_y, - tupper_z = tlower_z - nrdir_z; - - const float round_down = 1.0f - difl; - const float round_up = 1.0f + difl; - - const avxf tnear_x = min(tlower_x, tupper_x); - const avxf tnear_y = min(tlower_y, tupper_y); - const avxf tnear_z = min(tlower_z, tupper_z); - const avxf tfar_x = max(tlower_x, tupper_x); - const avxf tfar_y = max(tlower_y, tupper_y); - const avxf tfar_z = max(tlower_z, tupper_z); - - const avxf tnear = max4(isect_near, tnear_x, tnear_y, tnear_z); - const avxf tfar = min4(isect_far, tfar_x, tfar_y, tfar_z); - const avxb vmask = round_down * tnear <= round_up * tfar; - *dist = tnear; - return movemask(vmask); -} - /* Intersectors wrappers. * * They'll check node type and call appropriate intersection code. @@ -526,66 +408,3 @@ ccl_device_inline int obvh_node_intersect(KernelGlobals *ccl_restrict kg, dist); } } - -ccl_device_inline int obvh_node_intersect_robust(KernelGlobals *ccl_restrict kg, - const avxf &isect_near, - const avxf &isect_far, -#ifdef __KERNEL_AVX2__ - const avx3f &P_idir, -#endif - const avx3f &P, - const avx3f &dir, - const avx3f &idir, - const int near_x, - const int near_y, - const int near_z, - const int far_x, - const int far_y, - const int far_z, - const int node_addr, - const float difl, - avxf *ccl_restrict dist) -{ - const int offset = node_addr; - const float4 node = kernel_tex_fetch(__bvh_nodes, offset); - if (__float_as_uint(node.x) & PATH_RAY_NODE_UNALIGNED) { - return obvh_unaligned_node_intersect_robust(kg, - isect_near, - isect_far, -#ifdef __KERNEL_AVX2__ - P_idir, -#endif - P, - dir, - idir, - near_x, - near_y, - near_z, - far_x, - far_y, - far_z, - node_addr, - difl, - dist); - } - else { - return obvh_aligned_node_intersect_robust(kg, - isect_near, - isect_far, -#ifdef __KERNEL_AVX2__ - P_idir, -#else - P, -#endif - idir, - near_x, - near_y, - near_z, - far_x, - far_y, - far_z, - node_addr, - difl, - dist); - } -} diff --git a/intern/cycles/kernel/bvh/obvh_shadow_all.h b/intern/cycles/kernel/bvh/obvh_shadow_all.h index 98efb003788..4bae519578a 100644 --- a/intern/cycles/kernel/bvh/obvh_shadow_all.h +++ b/intern/cycles/kernel/bvh/obvh_shadow_all.h @@ -503,10 +503,7 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(OBVH)(KernelGlobals *kg, object, prim_addr, ray->time, - curve_type, - NULL, - 0, - 0); + curve_type); } else { hit = curve_intersect(kg, @@ -517,10 +514,7 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(OBVH)(KernelGlobals *kg, object, prim_addr, ray->time, - curve_type, - NULL, - 0, - 0); + curve_type); } break; } diff --git a/intern/cycles/kernel/bvh/obvh_traversal.h b/intern/cycles/kernel/bvh/obvh_traversal.h index 86b1de48aaa..b24e9977ffd 100644 --- a/intern/cycles/kernel/bvh/obvh_traversal.h +++ b/intern/cycles/kernel/bvh/obvh_traversal.h @@ -20,29 +20,19 @@ * * BVH_INSTANCING: object instancing * BVH_HAIR: hair curve rendering - * BVH_HAIR_MINIMUM_WIDTH: hair curve rendering with minimum width * BVH_MOTION: motion blur rendering */ #if BVH_FEATURE(BVH_HAIR) # define NODE_INTERSECT obvh_node_intersect -# define NODE_INTERSECT_ROBUST obvh_node_intersect_robust #else # define NODE_INTERSECT obvh_aligned_node_intersect -# define NODE_INTERSECT_ROBUST obvh_aligned_node_intersect_robust #endif ccl_device bool BVH_FUNCTION_FULL_NAME(OBVH)(KernelGlobals *kg, const Ray *ray, Intersection *isect, - const uint visibility -#if BVH_FEATURE(BVH_HAIR_MINIMUM_WIDTH) - , - uint *lcg_state, - float difl, - float extmax -#endif -) + const uint visibility) { /* Traversal stack in CUDA thread-local memory. */ OBVHStackItem traversal_stack[BVH_OSTACK_SIZE]; @@ -117,38 +107,6 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(OBVH)(KernelGlobals *kg, BVH_DEBUG_NEXT_NODE(); -#if BVH_FEATURE(BVH_HAIR_MINIMUM_WIDTH) - if (difl != 0.0f) { - /* NOTE: We extend all the child BB instead of fetching - * and checking visibility flags for each of the, - * - * Need to test if doing opposite would be any faster. - */ - child_mask = NODE_INTERSECT_ROBUST(kg, - tnear, - tfar, -# ifdef __KERNEL_AVX2__ - P_idir4, -# endif -# if BVH_FEATURE(BVH_HAIR) || !defined(__KERNEL_AVX2__) - org4, -# endif -# if BVH_FEATURE(BVH_HAIR) - dir4, -# endif - idir4, - near_x, - near_y, - near_z, - far_x, - far_y, - far_z, - node_addr, - difl, - &dist); - } - else -#endif /* BVH_HAIR_MINIMUM_WIDTH */ { child_mask = NODE_INTERSECT(kg, tnear, @@ -501,32 +459,12 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(OBVH)(KernelGlobals *kg, kernel_assert((curve_type & PRIMITIVE_ALL) == (type & PRIMITIVE_ALL)); bool hit; if (kernel_data.curve.curveflags & CURVE_KN_INTERPOLATE) { - hit = cardinal_curve_intersect(kg, - isect, - P, - dir, - visibility, - object, - prim_addr, - ray->time, - curve_type, - lcg_state, - difl, - extmax); + hit = cardinal_curve_intersect( + kg, isect, P, dir, visibility, object, prim_addr, ray->time, curve_type); } else { - hit = curve_intersect(kg, - isect, - P, - dir, - visibility, - object, - prim_addr, - ray->time, - curve_type, - lcg_state, - difl, - extmax); + hit = curve_intersect( + kg, isect, P, dir, visibility, object, prim_addr, ray->time, curve_type); } if (hit) { tfar = avxf(isect->t); @@ -617,4 +555,3 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(OBVH)(KernelGlobals *kg, } #undef NODE_INTERSECT -#undef NODE_INTERSECT_ROBUST diff --git a/intern/cycles/kernel/bvh/qbvh_nodes.h b/intern/cycles/kernel/bvh/qbvh_nodes.h index 7c1d8c8c72e..bf2389eebad 100644 --- a/intern/cycles/kernel/bvh/qbvh_nodes.h +++ b/intern/cycles/kernel/bvh/qbvh_nodes.h @@ -181,51 +181,6 @@ static int qbvh_aligned_node_intersect(KernelGlobals *ccl_restrict kg, return mask; } -ccl_device_inline int qbvh_aligned_node_intersect_robust(KernelGlobals *ccl_restrict kg, - const ssef &isect_near, - const ssef &isect_far, -#ifdef __KERNEL_AVX2__ - const sse3f &P_idir, -#else - const sse3f &P, -#endif - const sse3f &idir, - const int near_x, - const int near_y, - const int near_z, - const int far_x, - const int far_y, - const int far_z, - const int node_addr, - const float difl, - ssef *ccl_restrict dist) -{ - const int offset = node_addr + 1; -#ifdef __KERNEL_AVX2__ - const ssef tnear_x = msub(kernel_tex_fetch_ssef(__bvh_nodes, offset + near_x), idir.x, P_idir.x); - const ssef tnear_y = msub(kernel_tex_fetch_ssef(__bvh_nodes, offset + near_y), idir.y, P_idir.y); - const ssef tnear_z = msub(kernel_tex_fetch_ssef(__bvh_nodes, offset + near_z), idir.z, P_idir.z); - const ssef tfar_x = msub(kernel_tex_fetch_ssef(__bvh_nodes, offset + far_x), idir.x, P_idir.x); - const ssef tfar_y = msub(kernel_tex_fetch_ssef(__bvh_nodes, offset + far_y), idir.y, P_idir.y); - const ssef tfar_z = msub(kernel_tex_fetch_ssef(__bvh_nodes, offset + far_z), idir.z, P_idir.z); -#else - const ssef tnear_x = (kernel_tex_fetch_ssef(__bvh_nodes, offset + near_x) - P.x) * idir.x; - const ssef tnear_y = (kernel_tex_fetch_ssef(__bvh_nodes, offset + near_y) - P.y) * idir.y; - const ssef tnear_z = (kernel_tex_fetch_ssef(__bvh_nodes, offset + near_z) - P.z) * idir.z; - const ssef tfar_x = (kernel_tex_fetch_ssef(__bvh_nodes, offset + far_x) - P.x) * idir.x; - const ssef tfar_y = (kernel_tex_fetch_ssef(__bvh_nodes, offset + far_y) - P.y) * idir.y; - const ssef tfar_z = (kernel_tex_fetch_ssef(__bvh_nodes, offset + far_z) - P.z) * idir.z; -#endif - - const float round_down = 1.0f - difl; - const float round_up = 1.0f + difl; - const ssef tnear = max4(isect_near, tnear_x, tnear_y, tnear_z); - const ssef tfar = min4(isect_far, tfar_x, tfar_y, tfar_z); - const sseb vmask = round_down * tnear <= round_up * tfar; - *dist = tnear; - return (int)movemask(vmask); -} - /* Unaligned nodes intersection */ ccl_device_inline int qbvh_unaligned_node_intersect(KernelGlobals *ccl_restrict kg, @@ -308,85 +263,6 @@ ccl_device_inline int qbvh_unaligned_node_intersect(KernelGlobals *ccl_restrict #endif } -ccl_device_inline int qbvh_unaligned_node_intersect_robust(KernelGlobals *ccl_restrict kg, - const ssef &isect_near, - const ssef &isect_far, -#ifdef __KERNEL_AVX2__ - const sse3f &P_idir, -#endif - const sse3f &P, - const sse3f &dir, - const sse3f &idir, - const int near_x, - const int near_y, - const int near_z, - const int far_x, - const int far_y, - const int far_z, - const int node_addr, - const float difl, - ssef *ccl_restrict dist) -{ - const int offset = node_addr; - const ssef tfm_x_x = kernel_tex_fetch_ssef(__bvh_nodes, offset + 1); - const ssef tfm_x_y = kernel_tex_fetch_ssef(__bvh_nodes, offset + 2); - const ssef tfm_x_z = kernel_tex_fetch_ssef(__bvh_nodes, offset + 3); - - const ssef tfm_y_x = kernel_tex_fetch_ssef(__bvh_nodes, offset + 4); - const ssef tfm_y_y = kernel_tex_fetch_ssef(__bvh_nodes, offset + 5); - const ssef tfm_y_z = kernel_tex_fetch_ssef(__bvh_nodes, offset + 6); - - const ssef tfm_z_x = kernel_tex_fetch_ssef(__bvh_nodes, offset + 7); - const ssef tfm_z_y = kernel_tex_fetch_ssef(__bvh_nodes, offset + 8); - const ssef tfm_z_z = kernel_tex_fetch_ssef(__bvh_nodes, offset + 9); - - const ssef tfm_t_x = kernel_tex_fetch_ssef(__bvh_nodes, offset + 10); - const ssef tfm_t_y = kernel_tex_fetch_ssef(__bvh_nodes, offset + 11); - const ssef tfm_t_z = kernel_tex_fetch_ssef(__bvh_nodes, offset + 12); - - const ssef aligned_dir_x = dir.x * tfm_x_x + dir.y * tfm_x_y + dir.z * tfm_x_z, - aligned_dir_y = dir.x * tfm_y_x + dir.y * tfm_y_y + dir.z * tfm_y_z, - aligned_dir_z = dir.x * tfm_z_x + dir.y * tfm_z_y + dir.z * tfm_z_z; - - const ssef aligned_P_x = P.x * tfm_x_x + P.y * tfm_x_y + P.z * tfm_x_z + tfm_t_x, - aligned_P_y = P.x * tfm_y_x + P.y * tfm_y_y + P.z * tfm_y_z + tfm_t_y, - aligned_P_z = P.x * tfm_z_x + P.y * tfm_z_y + P.z * tfm_z_z + tfm_t_z; - - const ssef neg_one(-1.0f, -1.0f, -1.0f, -1.0f); - const ssef nrdir_x = neg_one / aligned_dir_x, nrdir_y = neg_one / aligned_dir_y, - nrdir_z = neg_one / aligned_dir_z; - - const ssef tlower_x = aligned_P_x * nrdir_x, tlower_y = aligned_P_y * nrdir_y, - tlower_z = aligned_P_z * nrdir_z; - - const ssef tupper_x = tlower_x - nrdir_x, tupper_y = tlower_y - nrdir_y, - tupper_z = tlower_z - nrdir_z; - - const float round_down = 1.0f - difl; - const float round_up = 1.0f + difl; - -#ifdef __KERNEL_SSE41__ - const ssef tnear_x = mini(tlower_x, tupper_x); - const ssef tnear_y = mini(tlower_y, tupper_y); - const ssef tnear_z = mini(tlower_z, tupper_z); - const ssef tfar_x = maxi(tlower_x, tupper_x); - const ssef tfar_y = maxi(tlower_y, tupper_y); - const ssef tfar_z = maxi(tlower_z, tupper_z); -#else - const ssef tnear_x = min(tlower_x, tupper_x); - const ssef tnear_y = min(tlower_y, tupper_y); - const ssef tnear_z = min(tlower_z, tupper_z); - const ssef tfar_x = max(tlower_x, tupper_x); - const ssef tfar_y = max(tlower_y, tupper_y); - const ssef tfar_z = max(tlower_z, tupper_z); -#endif - const ssef tnear = max4(isect_near, tnear_x, tnear_y, tnear_z); - const ssef tfar = min4(isect_far, tfar_x, tfar_y, tfar_z); - const sseb vmask = round_down * tnear <= round_up * tfar; - *dist = tnear; - return movemask(vmask); -} - /* Intersectors wrappers. * * They'll check node type and call appropriate intersection code. @@ -451,66 +327,3 @@ ccl_device_inline int qbvh_node_intersect(KernelGlobals *ccl_restrict kg, dist); } } - -ccl_device_inline int qbvh_node_intersect_robust(KernelGlobals *ccl_restrict kg, - const ssef &isect_near, - const ssef &isect_far, -#ifdef __KERNEL_AVX2__ - const sse3f &P_idir, -#endif - const sse3f &P, - const sse3f &dir, - const sse3f &idir, - const int near_x, - const int near_y, - const int near_z, - const int far_x, - const int far_y, - const int far_z, - const int node_addr, - const float difl, - ssef *ccl_restrict dist) -{ - const int offset = node_addr; - const float4 node = kernel_tex_fetch(__bvh_nodes, offset); - if (__float_as_uint(node.x) & PATH_RAY_NODE_UNALIGNED) { - return qbvh_unaligned_node_intersect_robust(kg, - isect_near, - isect_far, -#ifdef __KERNEL_AVX2__ - P_idir, -#endif - P, - dir, - idir, - near_x, - near_y, - near_z, - far_x, - far_y, - far_z, - node_addr, - difl, - dist); - } - else { - return qbvh_aligned_node_intersect_robust(kg, - isect_near, - isect_far, -#ifdef __KERNEL_AVX2__ - P_idir, -#else - P, -#endif - idir, - near_x, - near_y, - near_z, - far_x, - far_y, - far_z, - node_addr, - difl, - dist); - } -} diff --git a/intern/cycles/kernel/bvh/qbvh_shadow_all.h b/intern/cycles/kernel/bvh/qbvh_shadow_all.h index 49e607bfbd0..3845afd8969 100644 --- a/intern/cycles/kernel/bvh/qbvh_shadow_all.h +++ b/intern/cycles/kernel/bvh/qbvh_shadow_all.h @@ -293,10 +293,7 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg, object, prim_addr, ray->time, - curve_type, - NULL, - 0, - 0); + curve_type); } else { hit = curve_intersect(kg, @@ -307,10 +304,7 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg, object, prim_addr, ray->time, - curve_type, - NULL, - 0, - 0); + curve_type); } break; } diff --git a/intern/cycles/kernel/bvh/qbvh_traversal.h b/intern/cycles/kernel/bvh/qbvh_traversal.h index 9ee0f7b5933..f43e84bf368 100644 --- a/intern/cycles/kernel/bvh/qbvh_traversal.h +++ b/intern/cycles/kernel/bvh/qbvh_traversal.h @@ -20,29 +20,19 @@ * * BVH_INSTANCING: object instancing * BVH_HAIR: hair curve rendering - * BVH_HAIR_MINIMUM_WIDTH: hair curve rendering with minimum width * BVH_MOTION: motion blur rendering */ #if BVH_FEATURE(BVH_HAIR) # define NODE_INTERSECT qbvh_node_intersect -# define NODE_INTERSECT_ROBUST qbvh_node_intersect_robust #else # define NODE_INTERSECT qbvh_aligned_node_intersect -# define NODE_INTERSECT_ROBUST qbvh_aligned_node_intersect_robust #endif ccl_device bool BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg, const Ray *ray, Intersection *isect, - const uint visibility -#if BVH_FEATURE(BVH_HAIR_MINIMUM_WIDTH) - , - uint *lcg_state, - float difl, - float extmax -#endif -) + const uint visibility) { /* TODO(sergey): * - Test if pushing distance on the stack helps (for non shadow rays). @@ -126,38 +116,6 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg, BVH_DEBUG_NEXT_NODE(); -#if BVH_FEATURE(BVH_HAIR_MINIMUM_WIDTH) - if (difl != 0.0f) { - /* NOTE: We extend all the child BB instead of fetching - * and checking visibility flags for each of the, - * - * Need to test if doing opposite would be any faster. - */ - child_mask = NODE_INTERSECT_ROBUST(kg, - tnear, - tfar, -# ifdef __KERNEL_AVX2__ - P_idir4, -# endif -# if BVH_FEATURE(BVH_HAIR) || !defined(__KERNEL_AVX2__) - org4, -# endif -# if BVH_FEATURE(BVH_HAIR) - dir4, -# endif - idir4, - near_x, - near_y, - near_z, - far_x, - far_y, - far_z, - node_addr, - difl, - &dist); - } - else -#endif /* BVH_HAIR_MINIMUM_WIDTH */ { child_mask = NODE_INTERSECT(kg, tnear, @@ -364,32 +322,12 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg, kernel_assert((curve_type & PRIMITIVE_ALL) == (type & PRIMITIVE_ALL)); bool hit; if (kernel_data.curve.curveflags & CURVE_KN_INTERPOLATE) { - hit = cardinal_curve_intersect(kg, - isect, - P, - dir, - visibility, - object, - prim_addr, - ray->time, - curve_type, - lcg_state, - difl, - extmax); + hit = cardinal_curve_intersect( + kg, isect, P, dir, visibility, object, prim_addr, ray->time, curve_type); } else { - hit = curve_intersect(kg, - isect, - P, - dir, - visibility, - object, - prim_addr, - ray->time, - curve_type, - lcg_state, - difl, - extmax); + hit = curve_intersect( + kg, isect, P, dir, visibility, object, prim_addr, ray->time, curve_type); } if (hit) { tfar = ssef(isect->t); @@ -480,4 +418,3 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg, } #undef NODE_INTERSECT -#undef NODE_INTERSECT_ROBUST |