[Bf-blender-cvs] [5e8b09259bf] cycles-x: Fix T91441: bump node not working for shadow rays

Brecht Van Lommel noreply at git.blender.org
Thu Sep 16 19:59:12 CEST 2021


Commit: 5e8b09259bf20f6b1a35422580adccc99c803a3e
Author: Brecht Van Lommel
Date:   Thu Sep 16 19:39:03 2021 +0200
Branches: cycles-x
https://developer.blender.org/rB5e8b09259bf20f6b1a35422580adccc99c803a3e

Fix T91441: bump node not working for shadow rays

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

M	intern/cycles/kernel/integrator/integrator_state_template.h
M	intern/cycles/kernel/integrator/integrator_state_util.h

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

diff --git a/intern/cycles/kernel/integrator/integrator_state_template.h b/intern/cycles/kernel/integrator/integrator_state_template.h
index be5bb97754a..41dd1bfcdbf 100644
--- a/intern/cycles/kernel/integrator/integrator_state_template.h
+++ b/intern/cycles/kernel/integrator/integrator_state_template.h
@@ -138,7 +138,7 @@ KERNEL_STRUCT_MEMBER(shadow_ray, float3, P, KERNEL_FEATURE_PATH_TRACING)
 KERNEL_STRUCT_MEMBER(shadow_ray, float3, D, KERNEL_FEATURE_PATH_TRACING)
 KERNEL_STRUCT_MEMBER(shadow_ray, float, t, KERNEL_FEATURE_PATH_TRACING)
 KERNEL_STRUCT_MEMBER(shadow_ray, float, time, KERNEL_FEATURE_PATH_TRACING)
-/* TODO: compact differentials. */
+KERNEL_STRUCT_MEMBER(shadow_ray, float, dP, KERNEL_FEATURE_PATH_TRACING)
 KERNEL_STRUCT_END(shadow_ray)
 
 /*********************** Shadow Intersection result **************************/
diff --git a/intern/cycles/kernel/integrator/integrator_state_util.h b/intern/cycles/kernel/integrator/integrator_state_util.h
index bcbc6d422ad..cdf412fe22f 100644
--- a/intern/cycles/kernel/integrator/integrator_state_util.h
+++ b/intern/cycles/kernel/integrator/integrator_state_util.h
@@ -54,6 +54,7 @@ ccl_device_forceinline void integrator_state_write_shadow_ray(INTEGRATOR_STATE_A
   INTEGRATOR_STATE_WRITE(shadow_ray, D) = ray->D;
   INTEGRATOR_STATE_WRITE(shadow_ray, t) = ray->t;
   INTEGRATOR_STATE_WRITE(shadow_ray, time) = ray->time;
+  INTEGRATOR_STATE_WRITE(shadow_ray, dP) = ray->dP;
 }
 
 ccl_device_forceinline void integrator_state_read_shadow_ray(INTEGRATOR_STATE_CONST_ARGS,
@@ -63,7 +64,7 @@ ccl_device_forceinline void integrator_state_read_shadow_ray(INTEGRATOR_STATE_CO
   ray->D = INTEGRATOR_STATE(shadow_ray, D);
   ray->t = INTEGRATOR_STATE(shadow_ray, t);
   ray->time = INTEGRATOR_STATE(shadow_ray, time);
-  ray->dP = differential_zero_compact();
+  ray->dP = INTEGRATOR_STATE(shadow_ray, dP);
   ray->dD = differential_zero_compact();
 }



More information about the Bf-blender-cvs mailing list