Commit: b3e3ca7464074ca76cd8761f9a94724ff6730349
Author: Sergey Sharybin
Date:   Tue Aug 5 15:53:00 2014 +0600
Branches: master
https://developer.blender.org/rBb3e3ca7464074ca76cd8761f9a94724ff6730349

Fix T41318: OSL broken on Linux kubuntu 14.04

Now for real, hopefully.

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

M       intern/cycles/render/osl.cpp

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

diff --git a/intern/cycles/render/osl.cpp b/intern/cycles/render/osl.cpp
index c95c626..f57e164 100644
--- a/intern/cycles/render/osl.cpp
+++ b/intern/cycles/render/osl.cpp
@@ -248,12 +248,13 @@ void OSLShaderManager::shading_system_free()
 
 bool OSLShaderManager::osl_compile(const string& inputfile, const string& 
outputfile)
 {
-#if OSL_LIBRARY_VERSION_CODE >= 10500
-       vector<string_view> options;
-#else
-       vector<string> options;
+#if OSL_LIBRARY_VERSION_CODE < 10500
+       typedef string string_view;
 #endif
+
+       vector<string_view> options;
        string stdosl_path;
+       string shader_path = path_get("shader");
 
        /* specify output file name */
        options.push_back("-o");
@@ -261,17 +262,13 @@ bool OSLShaderManager::osl_compile(const string& 
inputfile, const string& output
 
        /* specify standard include path */
        options.push_back("-I");
-       options.push_back(path_get("shader"));
+       options.push_back(shader_path);
 
        stdosl_path = path_get("shader/stdosl.h");
 
        /* compile */
        OSL::OSLCompiler *compiler = OSL::OSLCompiler::create();
-#if OSL_LIBRARY_VERSION_CODE >= 10500
        bool ok = compiler->compile(string_view(inputfile), options, 
string_view(stdosl_path));
-#else
-       bool ok = compiler->compile(inputfile, options, stdosl_path);
-#endif
        delete compiler;
 
        return ok;

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to