[Bf-blender-cvs] [20ec6bc] master: Fix Cycles kernel build without render passes support.
Brecht Van Lommel
noreply at git.blender.org
Mon Jul 18 22:54:53 CEST 2016
Commit: 20ec6bc166e31449cce48a5a658f26caf96f71fa
Author: Brecht Van Lommel
Date: Sun Jul 17 18:09:58 2016 +0200
Branches: master
https://developer.blender.org/rB20ec6bc166e31449cce48a5a658f26caf96f71fa
Fix Cycles kernel build without render passes support.
===================================================================
M intern/cycles/kernel/kernel_accumulate.h
M intern/cycles/kernel/kernel_types.h
M intern/cycles/kernel/kernels/cpu/kernel_cpu_impl.h
===================================================================
diff --git a/intern/cycles/kernel/kernel_accumulate.h b/intern/cycles/kernel/kernel_accumulate.h
index 5f5a360..0e13b22 100644
--- a/intern/cycles/kernel/kernel_accumulate.h
+++ b/intern/cycles/kernel/kernel_accumulate.h
@@ -50,7 +50,7 @@ ccl_device_inline void bsdf_eval_init(BsdfEval *eval, ClosureType type, float3 v
else
eval->diffuse = value;
#else
- *eval = value;
+ eval->diffuse = value;
#endif
}
@@ -80,7 +80,7 @@ void bsdf_eval_accum(BsdfEval *eval, ClosureType type, float3 value)
else
eval->diffuse += value;
#else
- *eval += value;
+ eval->diffuse += value;
#endif
}
@@ -98,7 +98,7 @@ ccl_device_inline bool bsdf_eval_is_zero(BsdfEval *eval)
else
return is_zero(eval->diffuse);
#else
- return is_zero(*eval);
+ return is_zero(eval->diffuse);
#endif
}
@@ -117,7 +117,7 @@ ccl_device_inline void bsdf_eval_mul(BsdfEval *eval, float3 value)
else
eval->diffuse *= value;
#else
- *eval *= value;
+ eval->diffuse *= value;
#endif
}
@@ -172,7 +172,7 @@ ccl_device_inline void path_radiance_init(PathRadiance *L, int use_light_pass)
else
L->emission = make_float3(0.0f, 0.0f, 0.0f);
#else
- *L = make_float3(0.0f, 0.0f, 0.0f);
+ L->emission = make_float3(0.0f, 0.0f, 0.0f);
#endif
}
@@ -207,7 +207,7 @@ ccl_device_inline void path_radiance_bsdf_bounce(PathRadiance *L, ccl_addr_space
else
*throughput *= bsdf_eval->diffuse*inverse_pdf;
#else
- *throughput *= *bsdf_eval*inverse_pdf;
+ *throughput *= bsdf_eval->diffuse*inverse_pdf;
#endif
}
@@ -225,7 +225,7 @@ ccl_device_inline void path_radiance_accum_emission(PathRadiance *L, float3 thro
else
L->emission += throughput*value;
#else
- *L += throughput*value;
+ L->emission += throughput*value;
#endif
}
@@ -246,7 +246,7 @@ ccl_device_inline void path_radiance_accum_ao(PathRadiance *L, float3 throughput
else
L->emission += throughput*bsdf*ao;
#else
- *L += throughput*bsdf*ao;
+ L->emission += throughput*bsdf*ao;
#endif
}
@@ -277,7 +277,7 @@ ccl_device_inline void path_radiance_accum_light(PathRadiance *L, float3 through
else
L->emission += throughput*bsdf_eval->diffuse*shadow;
#else
- *L += throughput*(*bsdf_eval)*shadow;
+ L->emission += throughput*bsdf_eval->diffuse*shadow;
#endif
}
@@ -295,7 +295,7 @@ ccl_device_inline void path_radiance_accum_background(PathRadiance *L, float3 th
else
L->emission += throughput*value;
#else
- *L += throughput*value;
+ L->emission += throughput*value;
#endif
}
@@ -441,7 +441,7 @@ ccl_device_inline float3 path_radiance_clamp_and_sum(KernelGlobals *kg, PathRadi
else
L_sum = L->emission;
#else
- L_sum = *L;
+ L_sum = L->emission;
#endif
/* Reject invalid value */
@@ -477,7 +477,7 @@ ccl_device_inline void path_radiance_accum_sample(PathRadiance *L, PathRadiance
L->shadow += L_sample->shadow*fac;
L->mist += L_sample->mist*fac;
#else
- *L += *L_sample * fac;
+ L->emission += L_sample->emission * fac;
#endif
}
diff --git a/intern/cycles/kernel/kernel_types.h b/intern/cycles/kernel/kernel_types.h
index 5de58ba..a9be2ae 100644
--- a/intern/cycles/kernel/kernel_types.h
+++ b/intern/cycles/kernel/kernel_types.h
@@ -387,12 +387,13 @@ typedef enum BakePassFilterCombos {
BAKE_FILTER_SUBSURFACE_INDIRECT = (BAKE_FILTER_INDIRECT | BAKE_FILTER_SUBSURFACE),
} BakePassFilterCombos;
-#ifdef __PASSES__
-
typedef ccl_addr_space struct PathRadiance {
+#ifdef __PASSES__
int use_light_pass;
+#endif
float3 emission;
+#ifdef __PASSES__
float3 background;
float3 ao;
@@ -426,25 +427,23 @@ typedef ccl_addr_space struct PathRadiance {
float4 shadow;
float mist;
+#endif
} PathRadiance;
typedef struct BsdfEval {
+#ifdef __PASSES__
int use_light_pass;
+#endif
float3 diffuse;
+#ifdef __PASSES__
float3 glossy;
float3 transmission;
float3 transparent;
float3 subsurface;
float3 scatter;
-} BsdfEval;
-
-#else
-
-typedef ccl_addr_space float3 PathRadiance;
-typedef float3 BsdfEval;
-
#endif
+} BsdfEval;
/* Shader Flag */
diff --git a/intern/cycles/kernel/kernels/cpu/kernel_cpu_impl.h b/intern/cycles/kernel/kernels/cpu/kernel_cpu_impl.h
index 962196c..ec82d4b 100644
--- a/intern/cycles/kernel/kernels/cpu/kernel_cpu_impl.h
+++ b/intern/cycles/kernel/kernels/cpu/kernel_cpu_impl.h
@@ -109,6 +109,7 @@ void KERNEL_FUNCTION_FULL_NAME(shader)(KernelGlobals *kg,
{
if(type >= SHADER_EVAL_BAKE) {
kernel_assert(output_luma == NULL);
+#ifdef __BAKING__
kernel_bake_evaluate(kg,
input,
output,
@@ -117,6 +118,7 @@ void KERNEL_FUNCTION_FULL_NAME(shader)(KernelGlobals *kg,
i,
offset,
sample);
+#endif
}
else {
kernel_shader_evaluate(kg,
More information about the Bf-blender-cvs
mailing list