Cycles: Fix crash when building with no shading systems
authorSergey Sharybin <sergey.vfx@gmail.com>
Tue, 6 Mar 2018 11:00:51 +0000 (12:00 +0100)
committerSergey Sharybin <sergey.vfx@gmail.com>
Tue, 6 Mar 2018 12:04:28 +0000 (13:04 +0100)
intern/cycles/kernel/kernel_shader.h

index 8cfd33b808ece340b5f04f59fb7fbdcf86c40e94..b1f66852b7f1029c6942ac189dd81ed3a91cba62 100644 (file)
@@ -994,8 +994,10 @@ ccl_device void shader_eval_surface(KernelGlobals *kg, ShaderData *sd,
                DiffuseBsdf *bsdf = (DiffuseBsdf*)bsdf_alloc(sd,
                                                             sizeof(DiffuseBsdf),
                                                             make_float3(0.8f, 0.8f, 0.8f));
-               bsdf->N = sd->N;
-               sd->flag |= bsdf_diffuse_setup(bsdf);
+               if (bsdf != NULL) {
+                       bsdf->N = sd->N;
+                       sd->flag |= bsdf_diffuse_setup(bsdf);
+               }
 #endif
        }