From a4f1a52a5c11379981fc2009985fa7183957565f Mon Sep 17 00:00:00 2001 From: Alaska Date: Tue, 26 Mar 2024 08:20:09 +0100 Subject: [PATCH] Fix #119903: Cycles compilation on device that don't use the light tree During the some of the shading for volumetrics, Cycles would try to write to a variable that does not exist if the device has the light tree disabled. At the moment this only impacts AMD GPUs with the Metal backend. Pull Request: https://projects.blender.org/blender/blender/pulls/119906 --- intern/cycles/kernel/integrator/shade_volume.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/intern/cycles/kernel/integrator/shade_volume.h b/intern/cycles/kernel/integrator/shade_volume.h index ad94e46ebbb..8fbbab1720c 100644 --- a/intern/cycles/kernel/integrator/shade_volume.h +++ b/intern/cycles/kernel/integrator/shade_volume.h @@ -944,7 +944,9 @@ ccl_device_forceinline bool integrate_volume_phase_scatter( INTEGRATOR_STATE_WRITE(state, ray, P) = sd->P; INTEGRATOR_STATE_WRITE(state, ray, D) = normalize(phase_wo); INTEGRATOR_STATE_WRITE(state, ray, tmin) = 0.0f; +#ifdef __LIGHT_TREE__ INTEGRATOR_STATE_WRITE(state, ray, previous_dt) = ray->tmax - ray->tmin; +#endif INTEGRATOR_STATE_WRITE(state, ray, tmax) = FLT_MAX; # ifdef __RAY_DIFFERENTIALS__ INTEGRATOR_STATE_WRITE(state, ray, dP) = differential_make_compact(sd->dP);