[Bf-blender-cvs] [9c2e385509b] blender-v3.1-release: Fix Cycles hang in classroom scene with upcomping AMD driver version 22.10

Brecht Van Lommel noreply at git.blender.org
Thu Mar 3 13:44:00 CET 2022


Commit: 9c2e385509becf22924293a81470f25a88300b62
Author: Brecht Van Lommel
Date:   Thu Mar 3 13:38:05 2022 +0100
Branches: blender-v3.1-release
https://developer.blender.org/rB9c2e385509becf22924293a81470f25a88300b62

Fix Cycles hang in classroom scene with upcomping AMD driver version 22.10

This is a workaround until there is a fix in the HIP compiler or driver.

Differential Revision: https://developer.blender.org/D14232

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

M	intern/cycles/kernel/light/light.h

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

diff --git a/intern/cycles/kernel/light/light.h b/intern/cycles/kernel/light/light.h
index d05fe47cc2c..40642bdb413 100644
--- a/intern/cycles/kernel/light/light.h
+++ b/intern/cycles/kernel/light/light.h
@@ -394,11 +394,19 @@ ccl_device bool light_sample_from_distant_ray(KernelGlobals kg,
   float costheta = dot(-lightD, ray_D);
   float cosangle = klight->distant.cosangle;
 
+  /* Workaround to prevent a hang in the classroom scene with AMD HIP drivers 22.10,
+   * Remove when a compiler fix is available. */
+#ifdef __HIP__
+  ls->shader = klight->shader_id;
+#endif
+
   if (costheta < cosangle)
     return false;
 
   ls->type = type;
+#ifndef __HIP__
   ls->shader = klight->shader_id;
+#endif
   ls->object = PRIM_NONE;
   ls->prim = PRIM_NONE;
   ls->lamp = lamp;
@@ -947,4 +955,4 @@ ccl_device_inline bool light_distribution_sample_new_position(KernelGlobals kg,
   }
 }
 
-CCL_NAMESPACE_END
\ No newline at end of file
+CCL_NAMESPACE_END



More information about the Bf-blender-cvs mailing list