Cycles: Update some types used form OSL
authorSergey Sharybin <sergey.vfx@gmail.com>
Thu, 7 Jan 2016 08:15:30 +0000 (13:15 +0500)
committerSergey Sharybin <sergey.vfx@gmail.com>
Thu, 7 Jan 2016 08:15:30 +0000 (13:15 +0500)
Some types were deprecated back in 2013, better to be prepared earlier for those
types being removed from upstream.

intern/cycles/kernel/osl/osl_globals.h
intern/cycles/render/osl.cpp
intern/cycles/render/osl.h
intern/cycles/render/shader.h

index e349ac6..916542e 100644 (file)
@@ -51,10 +51,10 @@ struct OSLGlobals {
        OSLRenderServices *services;
 
        /* shader states */
-       vector<OSL::ShadingAttribStateRef> surface_state;
-       vector<OSL::ShadingAttribStateRef> volume_state;
-       vector<OSL::ShadingAttribStateRef> displacement_state;
-       OSL::ShadingAttribStateRef background_state;
+       vector<OSL::ShaderGroupRef> surface_state;
+       vector<OSL::ShaderGroupRef> volume_state;
+       vector<OSL::ShaderGroupRef> displacement_state;
+       OSL::ShaderGroupRef background_state;
 
        /* attributes */
        struct Attribute {
index e5842c7..a75716e 100644 (file)
@@ -765,13 +765,13 @@ void OSLCompiler::generate_nodes(const ShaderNodeSet& nodes)
        } while(!nodes_done);
 }
 
-OSL::ShadingAttribStateRef OSLCompiler::compile_type(Shader *shader, ShaderGraph *graph, ShaderType type)
+OSL::ShaderGroupRef OSLCompiler::compile_type(Shader *shader, ShaderGraph *graph, ShaderType type)
 {
        OSL::ShadingSystem *ss = (OSL::ShadingSystem*)shadingsys;
 
        current_type = type;
 
-       OSL::ShadingAttribStateRef group = ss->ShaderGroupBegin(shader->name.c_str());
+       OSL::ShaderGroupRef group = ss->ShaderGroupBegin(shader->name.c_str());
 
        ShaderNode *output = graph->output();
        ShaderNodeSet dependencies;
@@ -850,8 +850,8 @@ void OSLCompiler::compile(Scene *scene, OSLGlobals *og, Shader *shader)
                        shader->has_surface = true;
                }
                else {
-                       shader->osl_surface_ref = OSL::ShadingAttribStateRef();
-                       shader->osl_surface_bump_ref = OSL::ShadingAttribStateRef();
+                       shader->osl_surface_ref = OSL::ShaderGroupRef();
+                       shader->osl_surface_bump_ref = OSL::ShaderGroupRef();
                }
 
                /* generate volume shader */
@@ -860,7 +860,7 @@ void OSLCompiler::compile(Scene *scene, OSLGlobals *og, Shader *shader)
                        shader->has_volume = true;
                }
                else
-                       shader->osl_volume_ref = OSL::ShadingAttribStateRef();
+                       shader->osl_volume_ref = OSL::ShaderGroupRef();
 
                /* generate displacement shader */
                if(shader->used && graph && output->input("Displacement")->link) {
@@ -868,7 +868,7 @@ void OSLCompiler::compile(Scene *scene, OSLGlobals *og, Shader *shader)
                        shader->has_displacement = true;
                }
                else
-                       shader->osl_displacement_ref = OSL::ShadingAttribStateRef();
+                       shader->osl_displacement_ref = OSL::ShaderGroupRef();
        }
 
        /* push state to array for lookup */
index 3ff37c5..ac985a8 100644 (file)
@@ -145,7 +145,7 @@ public:
 private:
 #ifdef WITH_OSL
        string id(ShaderNode *node);
-       OSL::ShadingAttribStateRef compile_type(Shader *shader, ShaderGraph *graph, ShaderType type);
+       OSL::ShaderGroupRef compile_type(Shader *shader, ShaderGraph *graph, ShaderType type);
        bool node_skip_input(ShaderNode *node, ShaderInput *input);
        string compatible_name(ShaderNode *node, ShaderInput *input);
        string compatible_name(ShaderNode *node, ShaderOutput *output);
index b19b1c6..954e1f5 100644 (file)
@@ -118,10 +118,10 @@ public:
 
 #ifdef WITH_OSL
        /* osl shading state references */
-       OSL::ShadingAttribStateRef osl_surface_ref;
-       OSL::ShadingAttribStateRef osl_surface_bump_ref;
-       OSL::ShadingAttribStateRef osl_volume_ref;
-       OSL::ShadingAttribStateRef osl_displacement_ref;
+       OSL::ShaderGroupRef osl_surface_ref;
+       OSL::ShaderGroupRef osl_surface_bump_ref;
+       OSL::ShaderGroupRef osl_volume_ref;
+       OSL::ShaderGroupRef osl_displacement_ref;
 #endif
 
        Shader();