Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2013-05-03 09:24:05 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2013-05-03 09:24:05 +0400
commita5d6820b6d96b2f379e3f5e118b80cfc486b425d (patch)
treea6f2f01e833deedf9118d192373ddad5c5a6e434 /intern/cycles/kernel/kernel_emission.h
parent7753d1c49c225ce9c77dc2fa425eb5cf455b9bdc (diff)
Possible fix for #35198: uninitialized memory access with background multiple
importance sampling + OSL.
Diffstat (limited to 'intern/cycles/kernel/kernel_emission.h')
-rw-r--r--intern/cycles/kernel/kernel_emission.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/intern/cycles/kernel/kernel_emission.h b/intern/cycles/kernel/kernel_emission.h
index 7d7494657e2..0553ac7a4ee 100644
--- a/intern/cycles/kernel/kernel_emission.h
+++ b/intern/cycles/kernel/kernel_emission.h
@@ -21,7 +21,7 @@ CCL_NAMESPACE_BEGIN
/* Direction Emission */
__device_noinline float3 direct_emissive_eval(KernelGlobals *kg, float rando,
- LightSample *ls, float u, float v, float3 I, float t, float time)
+ LightSample *ls, float u, float v, float3 I, differential3 dI, float t, float time)
{
/* setup shading at emitter */
ShaderData sd;
@@ -38,6 +38,7 @@ __device_noinline float3 direct_emissive_eval(KernelGlobals *kg, float rando,
#endif
ray.dP.dx = make_float3(0.0f, 0.0f, 0.0f);
ray.dP.dy = make_float3(0.0f, 0.0f, 0.0f);
+ ray.dD = dI;
#ifdef __CAMERA_MOTION__
ray.time = time;
#endif
@@ -93,8 +94,13 @@ __device_noinline bool direct_emission(KernelGlobals *kg, ShaderData *sd, int li
if(ls.pdf == 0.0f)
return false;
+ /* todo: implement */
+ differential3 dD;
+ dD.dx = make_float3(0.0f, 0.0f, 0.0f);
+ dD.dy = make_float3(0.0f, 0.0f, 0.0f);
+
/* evaluate closure */
- float3 light_eval = direct_emissive_eval(kg, rando, &ls, randu, randv, -ls.D, ls.t, sd->time);
+ float3 light_eval = direct_emissive_eval(kg, rando, &ls, randu, randv, -ls.D, dD, ls.t, sd->time);
if(is_zero(light_eval))
return false;
@@ -183,7 +189,7 @@ __device_noinline bool indirect_lamp_emission(KernelGlobals *kg, Ray *ray, int p
/* todo: missing texture coordinates */
float u = 0.0f;
float v = 0.0f;
- float3 L = direct_emissive_eval(kg, 0.0f, &ls, u, v, -ray->D, ls.t, ray->time);
+ float3 L = direct_emissive_eval(kg, 0.0f, &ls, u, v, -ray->D, ray->dD, ls.t, ray->time);
if(!(path_flag & PATH_RAY_MIS_SKIP)) {
/* multiple importance sampling, get regular light pdf,