From 0709743c0c4aafffcc4dfb74d563317c26d7733d Mon Sep 17 00:00:00 2001 From: Alaska Date: Fri, 4 Oct 2024 12:39:03 +0200 Subject: [PATCH] Fix: Cycles: Rendering of the Principled BSDF when using adaptive kernel compilation Fixes a issue where the Principled BSDF would render incorrectly if `__SUBSURFACE__` is off. Which is common when using adaptive kernel compilation (a unsupported Cycles feature). Pull Request: https://projects.blender.org/blender/blender/pulls/128003 --- intern/cycles/kernel/svm/closure.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/intern/cycles/kernel/svm/closure.h b/intern/cycles/kernel/svm/closure.h index a8c135ac54e..5d0bef8f701 100644 --- a/intern/cycles/kernel/svm/closure.h +++ b/intern/cycles/kernel/svm/closure.h @@ -151,9 +151,7 @@ ccl_device const float3 clamped_base_color = min(base_color, one_float3()); // get the subsurface scattering data -#ifdef __SUBSURFACE__ uint4 data_subsurf = read_node(kg, &offset); -#endif uint4 data_alpha_emission_thin = read_node(kg, &offset); svm_unpack_node_uchar4(data_alpha_emission_thin.x, @@ -419,6 +417,7 @@ ccl_device } #else subsurface_weight = 0.0f; + (void)data_subsurf; #endif ccl_private OrenNayarBsdf *bsdf = (ccl_private OrenNayarBsdf *)bsdf_alloc(