Fix Cycles adaptive compile without volumes broken after recent changes.
authorCarlo Andreacchio <carlorules@gmail.com>
Mon, 18 Sep 2017 10:31:17 +0000 (12:31 +0200)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Mon, 18 Sep 2017 10:52:32 +0000 (12:52 +0200)
Differential Revision: https://developer.blender.org/D2847

intern/cycles/kernel/kernel_path.h

index fc157feb28c5d2c43cec9ae608bcafc33267b646..3a242a06a7289404931ee4963e5e715f0b4505f6 100644 (file)
@@ -154,6 +154,7 @@ ccl_device_forceinline void kernel_path_background(
 
 #ifndef __SPLIT_KERNEL__
 
+#ifdef __VOLUME__
 ccl_device_forceinline VolumeIntegrateResult kernel_path_volume(
        KernelGlobals *kg,
        ShaderData *sd,
@@ -165,7 +166,6 @@ ccl_device_forceinline VolumeIntegrateResult kernel_path_volume(
        ShaderData *emission_sd,
        PathRadiance *L)
 {
-#ifdef __VOLUME__
        /* Sanitize volume stack. */
        if(!hit) {
                kernel_volume_clean_stack(kg, state->volume_stack);
@@ -252,10 +252,10 @@ ccl_device_forceinline VolumeIntegrateResult kernel_path_volume(
 #  endif  /* __VOLUME_SCATTER__ */
                }
        }
-#endif  /* __VOLUME__ */
 
        return VOLUME_PATH_ATTENUATED;
 }
+#endif  /* __VOLUME__ */
 
 #endif /* __SPLIT_KERNEL__ */
 
@@ -400,6 +400,7 @@ ccl_device void kernel_path_indirect(KernelGlobals *kg,
                /* Find intersection with lamps and compute emission for MIS. */
                kernel_path_lamp_emission(kg, state, ray, throughput, &isect, emission_sd, L);
 
+#ifdef __VOLUME__
                /* Volume integration. */
                VolumeIntegrateResult result = kernel_path_volume(kg,
                                                                   sd,
@@ -417,6 +418,7 @@ ccl_device void kernel_path_indirect(KernelGlobals *kg,
                else if(result == VOLUME_PATH_MISSED) {
                        break;
                }
+#endif /* __VOLUME__*/
 
                /* Shade background. */
                if(!hit) {
@@ -558,6 +560,7 @@ ccl_device_forceinline void kernel_path_integrate(
                /* Find intersection with lamps and compute emission for MIS. */
                kernel_path_lamp_emission(kg, state, ray, throughput, &isect, emission_sd, L);
 
+#ifdef __VOLUME__
                /* Volume integration. */
                VolumeIntegrateResult result = kernel_path_volume(kg,
                                                                   &sd,
@@ -575,6 +578,7 @@ ccl_device_forceinline void kernel_path_integrate(
                else if(result == VOLUME_PATH_MISSED) {
                        break;
                }
+#endif /* __VOLUME__*/
 
                /* Shade background. */
                if(!hit) {