Cycles: Fix crash with Environment Texture and OSL
authorLukas Stockner <lukas.stockner@freenet.de>
Wed, 22 Jun 2016 14:10:10 +0000 (16:10 +0200)
committerLukas Stockner <lukas.stockner@freenet.de>
Wed, 22 Jun 2016 14:12:40 +0000 (16:12 +0200)
In the OSL node compilation code for the Environment Texture, is_linear was used as a socket.
However, there was no socket for it, which caused Blender to crash.
Adding a socket doesn't really make sense since it's an internal value and not a parameter
of the node, so it now just uses the variable directly.

intern/cycles/render/nodes.cpp

index 1a9adb0819425cf4c89d6448020b02dfdbb64443..5e53b66f7104a3186ab2ec81570d71da666a3c55 100644 (file)
@@ -581,7 +581,7 @@ void EnvironmentTextureNode::compile(OSLCompiler& compiler)
                compiler.parameter("color_space", "sRGB");
 
        compiler.parameter(this, "interpolation");
-       compiler.parameter(this, "is_float");
+       compiler.parameter("is_float", is_float);
        compiler.parameter("use_alpha", !alpha_out->links.empty());
        compiler.add(this, "node_environment_texture");
 }