diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-08-05 15:53:00 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-08-05 15:54:08 +0400 |
commit | a192facd8c5449ffe55b7978fe85a0080703411b (patch) | |
tree | a3d24bedcce5b9534412ad0238cf9f6412ee0b84 /intern | |
parent | 5efa7fa534c343a50e2fc62d76de171cd808bae2 (diff) |
Fix T41276: OSL bug in getmessage ("trace", "geom:name" , output)
Diffstat (limited to 'intern')
-rw-r--r-- | intern/cycles/kernel/osl/osl_services.cpp | 10 | ||||
-rw-r--r-- | intern/cycles/kernel/osl/osl_services.h | 2 |
2 files changed, 10 insertions, 2 deletions
diff --git a/intern/cycles/kernel/osl/osl_services.cpp b/intern/cycles/kernel/osl/osl_services.cpp index d5d995d490b..38cb5061346 100644 --- a/intern/cycles/kernel/osl/osl_services.cpp +++ b/intern/cycles/kernel/osl/osl_services.cpp @@ -479,7 +479,7 @@ static bool set_attribute_int(int i, TypeDesc type, bool derivatives, void *val) static bool set_attribute_string(ustring str, TypeDesc type, bool derivatives, void *val) { - if(type.basetype == TypeDesc::INT && type.aggregate == TypeDesc::SCALAR && type.arraylen == 0) { + if(type.basetype == TypeDesc::STRING && type.aggregate == TypeDesc::SCALAR && type.arraylen == 0) { ustring *sval = (ustring *)val; sval[0] = str; @@ -758,6 +758,12 @@ bool OSLRenderServices::get_attribute(OSL::ShaderGlobals *sg, bool derivatives, return false; ShaderData *sd = (ShaderData *)(sg->renderstate); + return get_attribute(sd, derivatives, object_name, type, name, val); +} + +bool OSLRenderServices::get_attribute(ShaderData *sd, bool derivatives, ustring object_name, + TypeDesc type, ustring name, void *val) +{ KernelGlobals *kg = sd->osl_globals; bool is_curve; int object; @@ -1100,7 +1106,7 @@ bool OSLRenderServices::getmessage(OSL::ShaderGlobals *sg, ustring source, ustri return set_attribute_float(f, type, derivatives, val); } - return get_attribute(sg, derivatives, u_empty, type, name, val); + return get_attribute(sd, derivatives, u_empty, type, name, val); } } } diff --git a/intern/cycles/kernel/osl/osl_services.h b/intern/cycles/kernel/osl/osl_services.h index 024a8396060..6f928a0d103 100644 --- a/intern/cycles/kernel/osl/osl_services.h +++ b/intern/cycles/kernel/osl/osl_services.h @@ -66,6 +66,8 @@ public: int index, void *val); bool get_attribute(OSL::ShaderGlobals *sg, bool derivatives, ustring object, TypeDesc type, ustring name, void *val); + bool get_attribute(ShaderData *sd, bool derivatives, ustring object_name, + TypeDesc type, ustring name, void *val); bool get_userdata(bool derivatives, ustring name, TypeDesc type, OSL::ShaderGlobals *sg, void *val); |