[Bf-blender-cvs] [77b2ceaa1f0] cycles_path_guiding: BSDF: init all eval and samples with zeros

Sebastian Herholz noreply at git.blender.org
Thu Jan 26 20:15:06 CET 2023


Commit: 77b2ceaa1f0cc9d46fc64c46641ae785a7c576de
Author: Sebastian Herholz
Date:   Thu Jan 26 20:14:08 2023 +0100
Branches: cycles_path_guiding
https://developer.blender.org/rB77b2ceaa1f0cc9d46fc64c46641ae785a7c576de

BSDF: init all eval and samples with zeros

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

M	intern/cycles/kernel/closure/bsdf.h

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

diff --git a/intern/cycles/kernel/closure/bsdf.h b/intern/cycles/kernel/closure/bsdf.h
index b0d01c427de..42865991134 100644
--- a/intern/cycles/kernel/closure/bsdf.h
+++ b/intern/cycles/kernel/closure/bsdf.h
@@ -120,7 +120,9 @@ ccl_device_inline int bsdf_sample(KernelGlobals kg,
 {
   /* For curves use the smooth normal, particularly for ribbons the geometric
    * normal gives too much darkening otherwise. */
-  int label;
+  *eval = zero_spectrum();
+  *pdf = 0.f;
+  int label = LABEL_NONE;
   const float3 Ng = (sd->type & PRIMITIVE_CURVE) ? sc->N : sd->Ng;
 
   switch (sc->type) {
@@ -526,6 +528,7 @@ ccl_device_inline
               ccl_private float *pdf)
 {
   Spectrum eval = zero_spectrum();
+  *pdf = 0.f;
 
   switch (sc->type) {
     case CLOSURE_BSDF_DIFFUSE_ID:



More information about the Bf-blender-cvs mailing list