Fix T57963: Cycles crash using AO for displacement.
Note this is not supported, there exists no geometry at this point, but it should not crash at least.
This commit is contained in:
@@ -33,6 +33,11 @@ ccl_device_noinline float svm_ao(KernelGlobals *kg,
|
|||||||
return 1.0f;
|
return 1.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Can't raytrace from shaders like displacement, before BVH exists. */
|
||||||
|
if (kernel_data.bvh.bvh_layout == BVH_LAYOUT_NONE) {
|
||||||
|
return 1.0f;
|
||||||
|
}
|
||||||
|
|
||||||
if(flags & NODE_AO_INSIDE) {
|
if(flags & NODE_AO_INSIDE) {
|
||||||
N = -N;
|
N = -N;
|
||||||
}
|
}
|
||||||
|
@@ -34,6 +34,11 @@ ccl_device_noinline float3 svm_bevel(
|
|||||||
return sd->N;
|
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. */
|
/* Don't bevel for blurry indirect rays. */
|
||||||
if(state->min_ray_pdf < 8.0f) {
|
if(state->min_ray_pdf < 8.0f) {
|
||||||
return sd->N;
|
return sd->N;
|
||||||
|
Reference in New Issue
Block a user