diff options
Diffstat (limited to 'intern')
-rw-r--r-- | intern/cycles/kernel/kernel_shader.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/intern/cycles/kernel/kernel_shader.h b/intern/cycles/kernel/kernel_shader.h index 8cfd33b808e..b1f66852b7f 100644 --- a/intern/cycles/kernel/kernel_shader.h +++ b/intern/cycles/kernel/kernel_shader.h @@ -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 } |