[Bf-blender-cvs] [2dc4c07] blender-v2.75-release: Fix T41870: Cycles OSL - Changing rotation value in anisotropic shader crashes Blender

Sergey Sharybin noreply at git.blender.org
Thu Jun 18 17:38:07 CEST 2015


Commit: 2dc4c07d3a20ef30796e2a20737215cc93383a30
Author: Sergey Sharybin
Date:   Sun Jun 14 13:13:03 2015 +0200
Branches: blender-v2.75-release
https://developer.blender.org/rB2dc4c07d3a20ef30796e2a20737215cc93383a30

Fix T41870: Cycles OSL - Changing rotation value in anisotropic shader crashes Blender

Older OSX has major issues with sincos() function, it's likely a big in OSL
or LLVM. For until we've updated to new versions of this libraries we'll use
a workaround to prevent possible crashes on all the platforms.

Shouldn't be that bad because it's mainly used for anisotropic shader where
angle is usually constant.

This fix is safe for inclusion into final Blender 2.75 release.

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

M	intern/cycles/kernel/shaders/stdosl.h

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

diff --git a/intern/cycles/kernel/shaders/stdosl.h b/intern/cycles/kernel/shaders/stdosl.h
index 6babe98..697a175 100644
--- a/intern/cycles/kernel/shaders/stdosl.h
+++ b/intern/cycles/kernel/shaders/stdosl.h
@@ -249,7 +249,21 @@ point rotate (point p, float angle, point a, point b)
 {
     vector axis = normalize (b - a);
     float cosang, sinang;
+    /* Older OSX has major issues with sincos() function,
+     * it's likely a big in OSL or LLVM. For until we've
+     * updated to new versions of this libraries we'll
+     * use a workaround to prevent possible crashes on all
+     * the platforms.
+     *
+     * Shouldn't be that bad because it's mainly used for
+     * anisotropic shader where angle is usually constant.
+     */
+#if 0
     sincos (angle, sinang, cosang);
+#else
+    sinang = sin (angle);
+    cosang = cos (angle);
+#endif
     float cosang1 = 1.0 - cosang;
     float x = axis[0], y = axis[1], z = axis[2];
     matrix M = matrix (x * x + (1.0 - x * x) * cosang,




More information about the Bf-blender-cvs mailing list