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.
This commit is contained in:
Sergey Sharybin 2016-01-07 13:15:30 +05:00
parent 3d313c9e5c
commit 772a3dab21
4 changed files with 15 additions and 15 deletions

@ -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 {

@ -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 */

@ -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);

@ -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();