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
This commit is contained in:
Brecht Van Lommel
2025-10-16 17:59:00 +02:00
committed by Brecht Van Lommel
parent c71a7b59f7
commit 6e96f1cca8

View File

@@ -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<const bool shadow, typename IntegratorGenericState>
ccl_device_noinline Extrema<float> 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<float> t,
const VolumeStack entry)
/* Work around apparent HIP compiler bug. */
# ifdef __KERNEL_HIP__
ccl_device
# else
ccl_device_noinline
# endif
Extrema<float>
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<float> t,
const VolumeStack entry)
{
const bool homogeneous = volume_is_homogeneous(kg, entry);
const int samples = homogeneous ? 1 : 4;