Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'intern/cycles/kernel/bvh/bvh_util.h')
-rw-r--r--intern/cycles/kernel/bvh/bvh_util.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/intern/cycles/kernel/bvh/bvh_util.h b/intern/cycles/kernel/bvh/bvh_util.h
index 867ea3af8d1..b1faebce957 100644
--- a/intern/cycles/kernel/bvh/bvh_util.h
+++ b/intern/cycles/kernel/bvh/bvh_util.h
@@ -239,4 +239,14 @@ ccl_device_forceinline int intersection_get_shader(KernelGlobals *ccl_restrict k
return shader & SHADER_MASK;
}
+ccl_device_forceinline int intersection_get_object(KernelGlobals *ccl_restrict kg,
+ const Intersection *ccl_restrict isect)
+{
+ if (isect->object != OBJECT_NONE) {
+ return isect->object;
+ }
+
+ return kernel_tex_fetch(__prim_object, isect->prim);
+}
+
CCL_NAMESPACE_END