Cycles: avoid some CUDA performance on scenes without deformation motion blur.

This commit is contained in:
Brecht Van Lommel 2014-04-26 14:25:20 +02:00
parent 1e3904677c
commit 11310b554a
Notes: blender-bot 2023-02-14 10:44:59 +01:00
Referenced by issue #39873, Blender 2.7x OSL crash
4 changed files with 9 additions and 0 deletions

View File

@ -221,10 +221,12 @@ ccl_device bool BVH_FUNCTION_NAME
hit = triangle_intersect(kg, isect_array, P, dir, PATH_RAY_SHADOW, object, primAddr);
break;
}
#if FEATURE(BVH_MOTION)
case PRIMITIVE_MOTION_TRIANGLE: {
hit = motion_triangle_intersect(kg, isect_array, P, dir, ray->time, PATH_RAY_SHADOW, object, primAddr);
break;
}
#endif
#if FEATURE(BVH_HAIR)
case PRIMITIVE_CURVE:
case PRIMITIVE_MOTION_CURVE: {

View File

@ -218,10 +218,12 @@ ccl_device uint BVH_FUNCTION_NAME(KernelGlobals *kg, const Ray *ray, Intersectio
triangle_intersect_subsurface(kg, isect_array, P, dir, object, primAddr, isect_t, &num_hits, lcg_state, max_hits);
break;
}
#if FEATURE(BVH_MOTION)
case PRIMITIVE_MOTION_TRIANGLE: {
motion_triangle_intersect_subsurface(kg, isect_array, P, dir, ray->time, object, primAddr, isect_t, &num_hits, lcg_state, max_hits);
break;
}
#endif
default: {
break;
}

View File

@ -256,10 +256,12 @@ ccl_device bool BVH_FUNCTION_NAME
hit = triangle_intersect(kg, isect, P, dir, visibility, object, primAddr);
break;
}
#if FEATURE(BVH_MOTION)
case PRIMITIVE_MOTION_TRIANGLE: {
hit = motion_triangle_intersect(kg, isect, P, dir, ray->time, visibility, object, primAddr);
break;
}
#endif
#if FEATURE(BVH_HAIR)
case PRIMITIVE_CURVE:
case PRIMITIVE_MOTION_CURVE: {

View File

@ -321,6 +321,9 @@ void ObjectManager::device_update_transforms(Device *device, DeviceScene *dscene
}
#endif
if(mesh->use_motion_blur)
have_motion = true;
/* dupli object coords and motion info */
int totalsteps = mesh->motion_steps;
int numsteps = (totalsteps - 1)/2;