diff --git a/intern/cycles/kernel/kernels/opencl/kernel.cl b/intern/cycles/kernel/kernels/opencl/kernel.cl index 77cb3125d46..5f35def6f7f 100644 --- a/intern/cycles/kernel/kernels/opencl/kernel.cl +++ b/intern/cycles/kernel/kernels/opencl/kernel.cl @@ -23,7 +23,7 @@ #include "../../kernel_film.h" -#ifdef __COMPILE_ONLY_MEGAKERNEL__ +#if defined(__COMPILE_ONLY_MEGAKERNEL__) || !defined(__NO_BAKING__) #include "../../kernel_path.h" #include "../../kernel_path_branched.h" #else /* __COMPILE_ONLY_MEGAKERNEL__ */ @@ -38,7 +38,7 @@ #include "../../kernel_accumulate.h" #include "../../kernel_camera.h" #include "../../kernel_shader.h" -#endif /* __COMPILE_ONLY_MEGAKERNEL__ */ +#endif /* defined(__COMPILE_ONLY_MEGAKERNEL__) || !defined(__NO_BAKING__) */ #include "../../kernel_bake.h" diff --git a/intern/cycles/kernel/svm/svm_voxel.h b/intern/cycles/kernel/svm/svm_voxel.h index af03ce3fe12..a086d321399 100644 --- a/intern/cycles/kernel/svm/svm_voxel.h +++ b/intern/cycles/kernel/svm/svm_voxel.h @@ -27,6 +27,7 @@ ccl_device void svm_node_tex_voxel(KernelGlobals *kg, { uint co_offset, density_out_offset, color_out_offset, space; decode_node_uchar4(node.z, &co_offset, &density_out_offset, &color_out_offset, &space); +#ifdef __VOLUME__ int id = node.y; float3 co = stack_load_float3(stack, co_offset); if(space == NODE_TEX_VOXEL_SPACE_OBJECT) { @@ -41,10 +42,13 @@ ccl_device void svm_node_tex_voxel(KernelGlobals *kg, tfm.w = read_node_float(kg, offset); co = transform_point(&tfm, co); } -#if defined(__KERNEL_GPU__) +# if defined(__KERNEL_GPU__) float4 r = volume_image_texture_3d(id, co.x, co.y, co.z); -#else +# else float4 r = kernel_tex_image_interp_3d(id, co.x, co.y, co.z); +# endif +#else + float4 r = make_float4(0.0f, 0.0f, 0.0f, 0.0f); #endif if (stack_valid(density_out_offset)) stack_store_float(stack, density_out_offset, r.w);