diff options
author | Lukas Toenne <lukas.toenne@googlemail.com> | 2012-10-06 20:28:02 +0400 |
---|---|---|
committer | Lukas Toenne <lukas.toenne@googlemail.com> | 2012-10-06 20:28:02 +0400 |
commit | 78978dcd805af2db50478fcba7fdf56d3fbca2ec (patch) | |
tree | c6eb6966b0b8fafbc2ccf098de30b2e15ab14d14 /intern/cycles/kernel/osl/emissive.cpp | |
parent | 2ecb4781a7634b7e95c7426c0f15e98abafee4a5 (diff) |
Fix for a case of 'static initialization fiasco' with OSL closure variables. The parameter lists are using OIIO::TypeDesc static standards, which are also static variables. With static OSL libraries these are not initialized when the closure parameter lists are initialized, so OSL rejects the closure types.
Putting static initialization into functions works just as well, but ensures the OIIO::TypeDesc access is delayed until initialization is complete.
Diffstat (limited to 'intern/cycles/kernel/osl/emissive.cpp')
-rw-r--r-- | intern/cycles/kernel/osl/emissive.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/intern/cycles/kernel/osl/emissive.cpp b/intern/cycles/kernel/osl/emissive.cpp index 0a582c3f558..3ee57cbe6b6 100644 --- a/intern/cycles/kernel/osl/emissive.cpp +++ b/intern/cycles/kernel/osl/emissive.cpp @@ -97,10 +97,14 @@ public: -ClosureParam closure_emission_params[] = { - CLOSURE_STRING_KEYPARAM("label"), - CLOSURE_FINISH_PARAM(GenericEmissiveClosure) -}; +ClosureParam *closure_emission_params() +{ + static ClosureParam params[] = { + CLOSURE_STRING_KEYPARAM("label"), + CLOSURE_FINISH_PARAM(GenericEmissiveClosure) + }; + return params; +} CLOSURE_PREPARE(closure_emission_prepare, GenericEmissiveClosure) |