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
path: root/intern
diff options
context:
space:
mode:
authorGarry R. Osgood <grosgood>2020-06-02 06:55:59 +0300
committerBrecht Van Lommel <brecht@blender.org>2020-06-02 07:25:08 +0300
commit389d5504120fb1a331a13118979a896b7e31ee0f (patch)
treee3f2381fe3bcc1d16ac1374fe7078a1cbc442da9 /intern
parent31cf87a29e0015ab163a1c69d117e003c09838b3 (diff)
Fix T77106: Cycles crash baking with AO shader node
Differential Revision: https://developer.blender.org/D7890
Diffstat (limited to 'intern')
-rw-r--r--intern/cycles/kernel/bvh/bvh.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/intern/cycles/kernel/bvh/bvh.h b/intern/cycles/kernel/bvh/bvh.h
index b3992c03a9a..9b9df883b62 100644
--- a/intern/cycles/kernel/bvh/bvh.h
+++ b/intern/cycles/kernel/bvh/bvh.h
@@ -300,7 +300,9 @@ ccl_device_intersect bool scene_intersect_local(KernelGlobals *kg,
// Is set to zero on miss or if ray is aborted, so can be used as return value
uint p5 = max_hits;
- local_isect->num_hits = 0; // Initialize hit count to zero
+ if (local_isect) {
+ local_isect->num_hits = 0; // Initialize hit count to zero
+ }
optixTrace(scene_intersect_valid(ray) ? kernel_data.bvh.scene : 0,
ray->P,
ray->D,
@@ -323,7 +325,9 @@ ccl_device_intersect bool scene_intersect_local(KernelGlobals *kg,
return p5;
# else /* __KERNEL_OPTIX__ */
if (!scene_intersect_valid(ray)) {
- local_isect->num_hits = 0;
+ if (local_isect) {
+ local_isect->num_hits = 0;
+ }
return false;
}