From 772a3dab21459637da69132aaac6b7b31173161f Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Thu, 7 Jan 2016 13:15:30 +0500 Subject: [PATCH] Cycles: Update some types used form OSL 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 | 8 ++++---- intern/cycles/render/osl.cpp | 12 ++++++------ intern/cycles/render/osl.h | 2 +- intern/cycles/render/shader.h | 8 ++++---- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/intern/cycles/kernel/osl/osl_globals.h b/intern/cycles/kernel/osl/osl_globals.h index e349ac676b0..916542ec628 100644 --- a/intern/cycles/kernel/osl/osl_globals.h +++ b/intern/cycles/kernel/osl/osl_globals.h @@ -51,10 +51,10 @@ struct OSLGlobals { OSLRenderServices *services; /* shader states */ - vector surface_state; - vector volume_state; - vector displacement_state; - OSL::ShadingAttribStateRef background_state; + vector surface_state; + vector volume_state; + vector displacement_state; + OSL::ShaderGroupRef background_state; /* attributes */ struct Attribute { diff --git a/intern/cycles/render/osl.cpp b/intern/cycles/render/osl.cpp index e5842c796db..a75716e9f68 100644 --- a/intern/cycles/render/osl.cpp +++ b/intern/cycles/render/osl.cpp @@ -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 */ diff --git a/intern/cycles/render/osl.h b/intern/cycles/render/osl.h index 3ff37c56e50..ac985a84eef 100644 --- a/intern/cycles/render/osl.h +++ b/intern/cycles/render/osl.h @@ -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); diff --git a/intern/cycles/render/shader.h b/intern/cycles/render/shader.h index b19b1c619a2..954e1f56fff 100644 --- a/intern/cycles/render/shader.h +++ b/intern/cycles/render/shader.h @@ -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();