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/bsdf_transparent.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/bsdf_transparent.cpp')
-rw-r--r-- | intern/cycles/kernel/osl/bsdf_transparent.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/intern/cycles/kernel/osl/bsdf_transparent.cpp b/intern/cycles/kernel/osl/bsdf_transparent.cpp index acde92530a2..29cef8e192f 100644 --- a/intern/cycles/kernel/osl/bsdf_transparent.cpp +++ b/intern/cycles/kernel/osl/bsdf_transparent.cpp @@ -87,10 +87,14 @@ public: -ClosureParam bsdf_transparent_params[] = { - CLOSURE_STRING_KEYPARAM("label"), - CLOSURE_FINISH_PARAM(TransparentClosure) -}; +ClosureParam *bsdf_transparent_params() +{ + static ClosureParam params[] = { + CLOSURE_STRING_KEYPARAM("label"), + CLOSURE_FINISH_PARAM(TransparentClosure) + }; + return params; +} CLOSURE_PREPARE(bsdf_transparent_prepare, TransparentClosure) |