[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [56485] trunk/blender/intern/cycles/kernel : Possible fix for #35198: uninitialized memory access with background multiple
Brecht Van Lommel
brechtvanlommel at pandora.be
Fri May 3 07:24:05 CEST 2013
Revision: 56485
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=56485
Author: blendix
Date: 2013-05-03 05:24:05 +0000 (Fri, 03 May 2013)
Log Message:
-----------
Possible fix for #35198: uninitialized memory access with background multiple
importance sampling + OSL.
Modified Paths:
--------------
trunk/blender/intern/cycles/kernel/kernel_emission.h
trunk/blender/intern/cycles/kernel/kernel_path.h
Modified: trunk/blender/intern/cycles/kernel/kernel_emission.h
===================================================================
--- trunk/blender/intern/cycles/kernel/kernel_emission.h 2013-05-03 05:24:01 UTC (rev 56484)
+++ trunk/blender/intern/cycles/kernel/kernel_emission.h 2013-05-03 05:24:05 UTC (rev 56485)
@@ -21,7 +21,7 @@
/* 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 @@
#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 @@
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 @@
/* 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,
Modified: trunk/blender/intern/cycles/kernel/kernel_path.h
===================================================================
--- trunk/blender/intern/cycles/kernel/kernel_path.h 2013-05-03 05:24:01 UTC (rev 56484)
+++ trunk/blender/intern/cycles/kernel/kernel_path.h 2013-05-03 05:24:05 UTC (rev 56485)
@@ -280,6 +280,8 @@
light_ray.D = ray.D;
light_ray.t = ray_t;
light_ray.time = ray.time;
+ light_ray.dD = ray.dD;
+ light_ray.dP = ray.dP;
/* intersect with lamp */
float light_t = path_rng(kg, rng, sample, rng_offset + PRNG_LIGHT);
@@ -536,6 +538,8 @@
light_ray.D = ray.D;
light_ray.t = ray_t;
light_ray.time = ray.time;
+ light_ray.dD = ray.dD;
+ light_ray.dP = ray.dP;
/* intersect with lamp */
float light_t = path_rng(kg, rng, sample, rng_offset + PRNG_LIGHT);
More information about the Bf-blender-cvs
mailing list