diff options
Diffstat (limited to 'intern/cycles/kernel/geom')
-rw-r--r-- | intern/cycles/kernel/geom/geom_object.h | 11 | ||||
-rw-r--r-- | intern/cycles/kernel/geom/geom_triangle.h | 4 |
2 files changed, 13 insertions, 2 deletions
diff --git a/intern/cycles/kernel/geom/geom_object.h b/intern/cycles/kernel/geom/geom_object.h index 883c5dc100d..4f72c5b7b93 100644 --- a/intern/cycles/kernel/geom/geom_object.h +++ b/intern/cycles/kernel/geom/geom_object.h @@ -564,6 +564,15 @@ ccl_device_inline void bvh_instance_motion_pop_factor(KernelGlobals *kg, */ #ifdef __KERNEL_OPENCL__ +ccl_device_inline void object_position_transform_addrspace(KernelGlobals *kg, + const ShaderData *sd, + ccl_addr_space float3 *P) +{ + float3 private_P = *P; + object_position_transform(kg, sd, &private_P); + *P = private_P; +} + ccl_device_inline void object_dir_transform_addrspace(KernelGlobals *kg, const ShaderData *sd, ccl_addr_space float3 *D) @@ -584,9 +593,11 @@ ccl_device_inline void object_normal_transform_addrspace(KernelGlobals *kg, #endif #ifndef __KERNEL_OPENCL__ +# define object_position_transform_auto object_position_transform # define object_dir_transform_auto object_dir_transform # define object_normal_transform_auto object_normal_transform #else +# define object_position_transform_auto object_position_transform_addrspace # define object_dir_transform_auto object_dir_transform_addrspace # define object_normal_transform_auto object_normal_transform_addrspace #endif diff --git a/intern/cycles/kernel/geom/geom_triangle.h b/intern/cycles/kernel/geom/geom_triangle.h index d3289d6572c..8bd01e1008d 100644 --- a/intern/cycles/kernel/geom/geom_triangle.h +++ b/intern/cycles/kernel/geom/geom_triangle.h @@ -52,8 +52,8 @@ ccl_device_inline void triangle_point_normal(KernelGlobals *kg, int object, int float t = 1.0f - u - v; *P = (u*v0 + v*v1 + t*v2); - /* get object flags, instance-aware */ - int object_flag = kernel_tex_fetch(__object_flag, object >= 0 ? object : ~object); + /* get object flags */ + int object_flag = kernel_tex_fetch(__object_flag, object); /* compute normal */ if(object_flag & SD_NEGATIVE_SCALE_APPLIED) |