Fix #36526: SSS + hair crash after recent changes.
This commit is contained in:
@@ -794,7 +794,7 @@ __device_inline void bvh_triangle_intersect_subsurface(KernelGlobals *kg, Inters
|
|||||||
|
|
||||||
#if defined(__SUBSURFACE__) && defined(__HAIR__)
|
#if defined(__SUBSURFACE__) && defined(__HAIR__)
|
||||||
#define BVH_FUNCTION_NAME bvh_intersect_subsurface_hair
|
#define BVH_FUNCTION_NAME bvh_intersect_subsurface_hair
|
||||||
#define BVH_FUNCTION_FEATURES BVH_INSTANCING|BVH_HAIR|BVH_HAIR_MINIMUM_WIDTH
|
#define BVH_FUNCTION_FEATURES BVH_INSTANCING|BVH_HAIR
|
||||||
#include "kernel_bvh_subsurface.h"
|
#include "kernel_bvh_subsurface.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -806,7 +806,7 @@ __device_inline void bvh_triangle_intersect_subsurface(KernelGlobals *kg, Inters
|
|||||||
|
|
||||||
#if defined(__SUBSURFACE__) && defined(__HAIR__) && defined(__OBJECT_MOTION__)
|
#if defined(__SUBSURFACE__) && defined(__HAIR__) && defined(__OBJECT_MOTION__)
|
||||||
#define BVH_FUNCTION_NAME bvh_intersect_subsurface_hair_motion
|
#define BVH_FUNCTION_NAME bvh_intersect_subsurface_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_subsurface.h"
|
#include "kernel_bvh_subsurface.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -207,7 +207,13 @@ __device uint BVH_FUNCTION_NAME(KernelGlobals *kg, const Ray *ray, Intersection
|
|||||||
--stackPtr;
|
--stackPtr;
|
||||||
|
|
||||||
/* primitive intersection */
|
/* primitive intersection */
|
||||||
while(primAddr < primAddr2) {
|
for(; primAddr < primAddr2; primAddr++) {
|
||||||
|
#if FEATURE(BVH_HAIR)
|
||||||
|
uint segment = kernel_tex_fetch(__prim_segment, primAddr);
|
||||||
|
if(segment != ~0)
|
||||||
|
continue;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* only primitives from the same object */
|
/* only primitives from the same object */
|
||||||
uint tri_object = (object == ~0)? kernel_tex_fetch(__prim_object, primAddr): object;
|
uint tri_object = (object == ~0)? kernel_tex_fetch(__prim_object, primAddr): object;
|
||||||
|
|
||||||
@@ -216,8 +222,6 @@ __device uint BVH_FUNCTION_NAME(KernelGlobals *kg, const Ray *ray, Intersection
|
|||||||
/* intersect ray against primitive */
|
/* intersect ray against primitive */
|
||||||
bvh_triangle_intersect_subsurface(kg, isect_array, P, idir, object, primAddr, tmax, &num_hits, lcg_state, max_hits);
|
bvh_triangle_intersect_subsurface(kg, isect_array, P, idir, object, primAddr, tmax, &num_hits, lcg_state, max_hits);
|
||||||
}
|
}
|
||||||
|
|
||||||
primAddr++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#if FEATURE(BVH_INSTANCING)
|
#if FEATURE(BVH_INSTANCING)
|
||||||
|
Reference in New Issue
Block a user