Fix T57963: Cycles crash using AO for displacement.
[blender.git] / intern / cycles / kernel / svm / svm_bevel.h
index 79d0fb6ddbecc59b191e1210a2b0d55cd58014af..96d132acd73c4a156906735f7253b6fb6a134a1f 100644 (file)
@@ -34,6 +34,11 @@ ccl_device_noinline float3 svm_bevel(
                return sd->N;
        }
 
+       /* Can't raytrace from shaders like displacement, before BVH exists. */
+       if (kernel_data.bvh.bvh_layout == BVH_LAYOUT_NONE) {
+               return sd->N;
+       }
+
        /* Don't bevel for blurry indirect rays. */
        if(state->min_ray_pdf < 8.0f) {
                return sd->N;