[Bf-cycles] OSL problems in OSX

Dalai Felinto dfelinto at gmail.com
Tue Sep 4 23:43:36 CEST 2012


Hi there,

I'm helping Jens to get OSL 1.2 to work on OSX as well. OSL is
building and Blender builds as well. However we are now stumbling into
a strange problem.

When rendering with OSL we get the errors:
http://www.pasteall.org/34953
* note, Parameter 1 is the first parameter of the array (index 0)


The error comes from the register_closure() function in the OSL source
code, see below:

//OpenShadingLanguage/src/liboslexec/shadingsys.cpp :~507
void ShadingSystemImpl::register_closure(...) {
    for (int i = 0; params && params[i].type != TypeDesc(); ++i) {
        if (params[i].key == NULL && params[i].type.size() !=
(size_t)params[i].field_size) {
            error ("Parameter %d of '%s' closure is assigned to a
field of incompatible size", i + 1, name);


This function is called from //intern/cycles/kernel/osl/osl_closures.cpp:62
    ss->register_closure(name, id, params, prepare,
generic_closure_setup, generic_closure_compare);

A breakpoint to this line and found out that the value of params[0] is
indeed problematic:
Basically params[0].type.size() is zero, while params[0].field_size is 12:
http://www.pasteall.org/34955


In Linux this is working though. Does anyone has any clues on what is
going wrong here?
If someone has a Linux debug of Blender with OSL could you please:

b osl_closures.cpp:62
r
[in blender, render something ... it will get back to the debugger]
p params[0]
p params[0].type.size()
p params[0].field_size

Thanks,
Dalai


More information about the Bf-cycles mailing list