diff --git a/intern/cycles/kernel/closure/bsdf_ray_portal.h b/intern/cycles/kernel/closure/bsdf_ray_portal.h index 39edb6d459d..7f724e054db 100644 --- a/intern/cycles/kernel/closure/bsdf_ray_portal.h +++ b/intern/cycles/kernel/closure/bsdf_ray_portal.h @@ -28,12 +28,12 @@ ccl_device void bsdf_ray_portal_setup(ccl_private ShaderData *sd, } sd->closure_transparent_extinction += weight; - sd->flag |= SD_BSDF | SD_RAY_PORTAL; ccl_private RayPortalClosure *pc = (ccl_private RayPortalClosure *)closure_alloc( sd, sizeof(RayPortalClosure), CLOSURE_BSDF_RAY_PORTAL_ID, weight); if (pc) { + sd->flag |= SD_BSDF | SD_RAY_PORTAL; if (is_zero(direction)) { direction = -sd->wi; }