From 6e96f1cca8425f614e240ab3cfdbdff64c1f0d76 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Thu, 16 Oct 2025 17:59:00 +0200 Subject: [PATCH] Fix: Cycles HIP shadow transparency bugs after recent changes Just tweaking code to sidestep the apparently compiler bug. This introduces a performance regression, which we'll fix in another PR. Ref #147989 Pull Request: https://projects.blender.org/blender/blender/pulls/148155 --- .../cycles/kernel/integrator/shade_volume.h | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/intern/cycles/kernel/integrator/shade_volume.h b/intern/cycles/kernel/integrator/shade_volume.h index af3093befcc..e3e533876aa 100644 --- a/intern/cycles/kernel/integrator/shade_volume.h +++ b/intern/cycles/kernel/integrator/shade_volume.h @@ -298,14 +298,21 @@ ccl_device void volume_voxel_get(KernelGlobals kg, ccl_private OctreeTracing &oc /* If there exists a Light Path Node, it could affect the density evaluation at runtime. * Randomly sample a few points on the ray to estimate the extrema. */ template -ccl_device_noinline Extrema volume_estimate_extrema(KernelGlobals kg, - const ccl_private Ray *ccl_restrict ray, - ccl_private ShaderData *ccl_restrict sd, - const IntegratorGenericState state, - const ccl_private RNGState *rng_state, - const uint32_t path_flag, - const Interval t, - const VolumeStack entry) +/* Work around apparent HIP compiler bug. */ +# ifdef __KERNEL_HIP__ +ccl_device +# else +ccl_device_noinline +# endif + Extrema + volume_estimate_extrema(KernelGlobals kg, + const ccl_private Ray *ccl_restrict ray, + ccl_private ShaderData *ccl_restrict sd, + const IntegratorGenericState state, + const ccl_private RNGState *rng_state, + const uint32_t path_flag, + const Interval t, + const VolumeStack entry) { const bool homogeneous = volume_is_homogeneous(kg, entry); const int samples = homogeneous ? 1 : 4;