[Bf-blender-cvs] [4a0a2e1ba55] soc-2022-many-lights-sampling: Fix: explicitly use floats for constant values

Jeffrey Liu noreply at git.blender.org
Wed Jul 13 07:31:33 CEST 2022


Commit: 4a0a2e1ba55a4d05189eb77c7ec190991260c4ee
Author: Jeffrey Liu
Date:   Wed Jul 13 01:31:59 2022 -0400
Branches: soc-2022-many-lights-sampling
https://developer.blender.org/rB4a0a2e1ba55a4d05189eb77c7ec190991260c4ee

Fix: explicitly use floats for constant values

===================================================================

M	intern/cycles/kernel/light/light.h

===================================================================

diff --git a/intern/cycles/kernel/light/light.h b/intern/cycles/kernel/light/light.h
index 40454ae6e63..06fc3a15c51 100644
--- a/intern/cycles/kernel/light/light.h
+++ b/intern/cycles/kernel/light/light.h
@@ -670,7 +670,7 @@ ccl_device_forceinline float triangle_light_pdf(KernelGlobals kg,
       if (has_motion) {
         triangle_world_space_vertices(kg, sd->object, sd->prim, sd->time, V);
         const float area_pre = (kernel_data.integrator.use_light_tree) ?
-                                   1.0 :
+                                   1.0f :
                                    triangle_area(V[0], V[1], V[2]);
         pdf *= area_pre / area;
       }
@@ -838,7 +838,7 @@ ccl_device_forceinline void triangle_light_sample(KernelGlobals kg,
       if (has_motion) {
         triangle_world_space_vertices(kg, object, prim, -1.0f, V);
         const float area_pre = (kernel_data.integrator.use_light_tree) ?
-                                   1.0 :
+                                   1.0f :
                                    triangle_area(V[0], V[1], V[2]);
         ls->pdf = ls->pdf * area_pre / area;
       }



More information about the Bf-blender-cvs mailing list