Cycles: Fix compilation error with minimal feature set
authorSergey Sharybin <sergey.vfx@gmail.com>
Wed, 28 Sep 2016 15:03:42 +0000 (17:03 +0200)
committerSergey Sharybin <sergey.vfx@gmail.com>
Wed, 28 Sep 2016 15:03:59 +0000 (17:03 +0200)
intern/cycles/kernel/closure/bsdf.h
intern/cycles/kernel/kernel_shader.h

index 1e7fbdb54500f54150f0463ffa907995e993d318..2ab92badc93806e328ecdfaba4339c7ca5891d4b 100644 (file)
@@ -374,6 +374,8 @@ ccl_device bool bsdf_merge(ShaderClosure *a, ShaderClosure *b)
                default:
                        return false;
        }
+#else
+       return false;
 #endif
 }
 
index c36d940466973b885b14f6e383af0c8e2a075831..3e098c922dcd6a269a7c3f593bca0f8f6cb61126 100644 (file)
@@ -851,11 +851,11 @@ ccl_device void shader_eval_surface(KernelGlobals *kg, ShaderData *sd, ccl_addr_
 #ifdef __SVM__
                svm_eval_nodes(kg, sd, state, SHADER_TYPE_SURFACE, path_flag);
 #else
-               ccl_fetch_array(sd, closure, 0)->weight = make_float3(0.8f, 0.8f, 0.8f);
-               ccl_fetch_array(sd, closure, 0)->N = ccl_fetch(sd, N);
-               ccl_fetch_array(sd, closure, 0)->data0 = 0.0f;
-               ccl_fetch_array(sd, closure, 0)->data1 = 0.0f;
-               ccl_fetch(sd, flag) |= bsdf_diffuse_setup(ccl_fetch_array(sd, closure, 0));
+               DiffuseBsdf *bsdf = (DiffuseBsdf*)bsdf_alloc(sd,
+                                                            sizeof(DiffuseBsdf),
+                                                            make_float3(0.8f, 0.8f, 0.8f));
+               bsdf->N = ccl_fetch(sd, N);
+               ccl_fetch(sd, flag) |= bsdf_diffuse_setup(bsdf);
 #endif
        }