Cycles: Fix crash when building with no shading systems

This commit is contained in:
Sergey Sharybin 2018-03-06 12:00:51 +01:00
parent ec904ed327
commit 76122bc8f0
Notes: blender-bot 2023-06-26 11:58:59 +02:00
Referenced by issue #56130, Daily builds are missing Shadows checkbox in Cycles
Referenced by issue #54257, group objects and their counts become mismatched in particle system "use count" list
1 changed files with 4 additions and 2 deletions

View 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
}