mirror of
https://github.com/blender/blender
synced 2026-09-29 04:37:17 +03:00
Fix #160673: Cycles debug mode assert baking and black BSDF color
When using a Principled BSDF node with a fully black diffuse color on input, Cycles would raise an assert error in surface_shader_bsdf_sample_closure() when baking a diffuse pass. This fix removes the SD_BSDF flag from the shader in surface_shader_prepare_closures(), if no BSDF closure is left. Pull Request: https://projects.blender.org/blender/blender/pulls/162059
This commit is contained in:
parent
b3d62684bc
commit
27336bc5fa
1 changed files with 7 additions and 1 deletions
|
|
@ -155,7 +155,7 @@ ccl_device_inline void surface_shader_prepare_closures(KernelGlobals kg,
|
|||
if (filter_closures & FILTER_CLOSURE_DIRECT_LIGHT) {
|
||||
sd->runtime_flag &= ~SR_BSDF_HAS_EVAL;
|
||||
}
|
||||
|
||||
bool has_bsdf_closure = false;
|
||||
for (int i = 0; i < sd->num_closure; i++) {
|
||||
ccl_private ShaderClosure *sc = &sd->closure[i];
|
||||
|
||||
|
|
@ -178,6 +178,12 @@ ccl_device_inline void surface_shader_prepare_closures(KernelGlobals kg,
|
|||
sc->sample_weight = 0.0f;
|
||||
sd->runtime_flag |= SR_HOLDOUT;
|
||||
}
|
||||
else if (CLOSURE_IS_BSDF(sc->type)) {
|
||||
has_bsdf_closure = true;
|
||||
}
|
||||
}
|
||||
if (!has_bsdf_closure) {
|
||||
sd->flag &= ~SD_BSDF;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue