ok, so we do need this patch in, right? It may be a good idea to remove the -forceload from OSX then, to make Linux and OSX to behave alike.
Cheers, Dalai 2012/10/6 Lukas Toenne <lukas.toe...@googlemail.com>: > Revision: 51117 > > http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=51117 > Author: lukastoenne > Date: 2012-10-06 16:28:02 +0000 (Sat, 06 Oct 2012) > Log Message: > ----------- > 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. > > Modified Paths: > -------------- > trunk/blender/intern/cycles/kernel/osl/background.cpp > trunk/blender/intern/cycles/kernel/osl/bsdf_ashikhmin_velvet.cpp > trunk/blender/intern/cycles/kernel/osl/bsdf_diffuse.cpp > trunk/blender/intern/cycles/kernel/osl/bsdf_microfacet.cpp > trunk/blender/intern/cycles/kernel/osl/bsdf_oren_nayar.cpp > trunk/blender/intern/cycles/kernel/osl/bsdf_phong.cpp > trunk/blender/intern/cycles/kernel/osl/bsdf_reflection.cpp > trunk/blender/intern/cycles/kernel/osl/bsdf_refraction.cpp > trunk/blender/intern/cycles/kernel/osl/bsdf_transparent.cpp > trunk/blender/intern/cycles/kernel/osl/bsdf_ward.cpp > trunk/blender/intern/cycles/kernel/osl/bsdf_westin.cpp > trunk/blender/intern/cycles/kernel/osl/bssrdf.cpp > trunk/blender/intern/cycles/kernel/osl/debug.cpp > trunk/blender/intern/cycles/kernel/osl/emissive.cpp > trunk/blender/intern/cycles/kernel/osl/osl_closures.cpp > trunk/blender/intern/cycles/kernel/osl/osl_closures.h > trunk/blender/intern/cycles/kernel/osl/vol_subsurface.cpp > > Modified: trunk/blender/intern/cycles/kernel/osl/background.cpp > =================================================================== > --- trunk/blender/intern/cycles/kernel/osl/background.cpp 2012-10-06 > 14:35:48 UTC (rev 51116) > +++ trunk/blender/intern/cycles/kernel/osl/background.cpp 2012-10-06 > 16:28:02 UTC (rev 51117) > @@ -85,16 +85,25 @@ > } > }; > > -ClosureParam closure_background_params[] = { > - CLOSURE_STRING_KEYPARAM("label"), > - CLOSURE_FINISH_PARAM(GenericBackgroundClosure) > -}; > > +ClosureParam *closure_background_params() > +{ > + static ClosureParam params[] = { > + CLOSURE_STRING_KEYPARAM("label"), > + CLOSURE_FINISH_PARAM(GenericBackgroundClosure) > + }; > + return params; > +} > + > CLOSURE_PREPARE(closure_background_prepare, GenericBackgroundClosure) > > -ClosureParam closure_holdout_params[] = { > - CLOSURE_FINISH_PARAM(HoldoutClosure) > -}; > +ClosureParam *closure_holdout_params() > +{ > + static ClosureParam params[] = { > + CLOSURE_FINISH_PARAM(HoldoutClosure) > + }; > + return params; > +} > > CLOSURE_PREPARE(closure_holdout_prepare, HoldoutClosure) > > > Modified: trunk/blender/intern/cycles/kernel/osl/bsdf_ashikhmin_velvet.cpp > =================================================================== > --- trunk/blender/intern/cycles/kernel/osl/bsdf_ashikhmin_velvet.cpp > 2012-10-06 14:35:48 UTC (rev 51116) > +++ trunk/blender/intern/cycles/kernel/osl/bsdf_ashikhmin_velvet.cpp > 2012-10-06 16:28:02 UTC (rev 51117) > @@ -173,12 +173,16 @@ > > > > -ClosureParam bsdf_ashikhmin_velvet_params[] = { > - CLOSURE_VECTOR_PARAM(AshikhminVelvetClosure, m_N), > - CLOSURE_FLOAT_PARAM(AshikhminVelvetClosure, m_sigma), > - CLOSURE_STRING_KEYPARAM("label"), > - CLOSURE_FINISH_PARAM(AshikhminVelvetClosure) > -}; > +ClosureParam *bsdf_ashikhmin_velvet_params() > +{ > + static ClosureParam params[] = { > + CLOSURE_VECTOR_PARAM(AshikhminVelvetClosure, m_N), > + CLOSURE_FLOAT_PARAM(AshikhminVelvetClosure, m_sigma), > + CLOSURE_STRING_KEYPARAM("label"), > + CLOSURE_FINISH_PARAM(AshikhminVelvetClosure) > + }; > + return params; > +} > > CLOSURE_PREPARE(bsdf_ashikhmin_velvet_prepare, AshikhminVelvetClosure) > > > Modified: trunk/blender/intern/cycles/kernel/osl/bsdf_diffuse.cpp > =================================================================== > --- trunk/blender/intern/cycles/kernel/osl/bsdf_diffuse.cpp 2012-10-06 > 14:35:48 UTC (rev 51116) > +++ trunk/blender/intern/cycles/kernel/osl/bsdf_diffuse.cpp 2012-10-06 > 16:28:02 UTC (rev 51117) > @@ -168,17 +168,25 @@ > } > }; > > -ClosureParam bsdf_diffuse_params[] = { > - CLOSURE_VECTOR_PARAM(DiffuseClosure, m_N), > - CLOSURE_STRING_KEYPARAM("label"), > - CLOSURE_FINISH_PARAM(DiffuseClosure) > -}; > +ClosureParam *bsdf_diffuse_params() > +{ > + static ClosureParam params[] = { > + CLOSURE_VECTOR_PARAM(DiffuseClosure, m_N), > + CLOSURE_STRING_KEYPARAM("label"), > + CLOSURE_FINISH_PARAM(DiffuseClosure) > + }; > + return params; > +} > > -ClosureParam bsdf_translucent_params[] = { > - CLOSURE_VECTOR_PARAM(TranslucentClosure, m_N), > - CLOSURE_STRING_KEYPARAM("label"), > - CLOSURE_FINISH_PARAM(TranslucentClosure) > -}; > +ClosureParam *bsdf_translucent_params() > +{ > + static ClosureParam params[] = { > + CLOSURE_VECTOR_PARAM(TranslucentClosure, m_N), > + CLOSURE_STRING_KEYPARAM("label"), > + CLOSURE_FINISH_PARAM(TranslucentClosure) > + }; > + return params; > +} > > CLOSURE_PREPARE(bsdf_diffuse_prepare, DiffuseClosure) > CLOSURE_PREPARE(bsdf_translucent_prepare, TranslucentClosure) > > Modified: trunk/blender/intern/cycles/kernel/osl/bsdf_microfacet.cpp > =================================================================== > --- trunk/blender/intern/cycles/kernel/osl/bsdf_microfacet.cpp 2012-10-06 > 14:35:48 UTC (rev 51116) > +++ trunk/blender/intern/cycles/kernel/osl/bsdf_microfacet.cpp 2012-10-06 > 16:28:02 UTC (rev 51117) > @@ -503,35 +503,51 @@ > > > > -ClosureParam bsdf_microfacet_ggx_params[] = { > - CLOSURE_VECTOR_PARAM(MicrofacetGGXClosure<0>, m_N), > - CLOSURE_FLOAT_PARAM(MicrofacetGGXClosure<0>, m_ag), > - CLOSURE_STRING_KEYPARAM("label"), > - CLOSURE_FINISH_PARAM(MicrofacetGGXClosure<0>) > -}; > +ClosureParam *bsdf_microfacet_ggx_params() > +{ > + static ClosureParam params[] = { > + CLOSURE_VECTOR_PARAM(MicrofacetGGXClosure<0>, m_N), > + CLOSURE_FLOAT_PARAM(MicrofacetGGXClosure<0>, m_ag), > + CLOSURE_STRING_KEYPARAM("label"), > + CLOSURE_FINISH_PARAM(MicrofacetGGXClosure<0>) > + }; > + return params; > +} > > -ClosureParam bsdf_microfacet_ggx_refraction_params[] = { > - CLOSURE_VECTOR_PARAM(MicrofacetGGXClosure<1>, m_N), > - CLOSURE_FLOAT_PARAM(MicrofacetGGXClosure<1>, m_ag), > - CLOSURE_FLOAT_PARAM(MicrofacetGGXClosure<1>, m_eta), > - CLOSURE_STRING_KEYPARAM("label"), > - CLOSURE_FINISH_PARAM(MicrofacetGGXClosure<1>) > -}; > +ClosureParam *bsdf_microfacet_ggx_refraction_params() > +{ > + static ClosureParam params[] = { > + CLOSURE_VECTOR_PARAM(MicrofacetGGXClosure<1>, m_N), > + CLOSURE_FLOAT_PARAM(MicrofacetGGXClosure<1>, m_ag), > + CLOSURE_FLOAT_PARAM(MicrofacetGGXClosure<1>, m_eta), > + CLOSURE_STRING_KEYPARAM("label"), > + CLOSURE_FINISH_PARAM(MicrofacetGGXClosure<1>) > + }; > + return params; > +} > > -ClosureParam bsdf_microfacet_beckmann_params[] = { > - CLOSURE_VECTOR_PARAM(MicrofacetBeckmannClosure<0>, m_N), > - CLOSURE_FLOAT_PARAM(MicrofacetBeckmannClosure<0>, m_ab), > - CLOSURE_STRING_KEYPARAM("label"), > - CLOSURE_FINISH_PARAM(MicrofacetBeckmannClosure<0>) > -}; > +ClosureParam *bsdf_microfacet_beckmann_params() > +{ > + static ClosureParam params[] = { > + CLOSURE_VECTOR_PARAM(MicrofacetBeckmannClosure<0>, m_N), > + CLOSURE_FLOAT_PARAM(MicrofacetBeckmannClosure<0>, m_ab), > + CLOSURE_STRING_KEYPARAM("label"), > + CLOSURE_FINISH_PARAM(MicrofacetBeckmannClosure<0>) > + }; > + return params; > +} > > -ClosureParam bsdf_microfacet_beckmann_refraction_params[] = { > - CLOSURE_VECTOR_PARAM(MicrofacetBeckmannClosure<1>, m_N), > - CLOSURE_FLOAT_PARAM(MicrofacetBeckmannClosure<1>, m_ab), > - CLOSURE_FLOAT_PARAM(MicrofacetBeckmannClosure<1>, m_eta), > - CLOSURE_STRING_KEYPARAM("label"), > - CLOSURE_FINISH_PARAM(MicrofacetBeckmannClosure<1>) > -}; > +ClosureParam *bsdf_microfacet_beckmann_refraction_params() > +{ > + static ClosureParam params[] = { > + CLOSURE_VECTOR_PARAM(MicrofacetBeckmannClosure<1>, m_N), > + CLOSURE_FLOAT_PARAM(MicrofacetBeckmannClosure<1>, m_ab), > + CLOSURE_FLOAT_PARAM(MicrofacetBeckmannClosure<1>, m_eta), > + CLOSURE_STRING_KEYPARAM("label"), > + CLOSURE_FINISH_PARAM(MicrofacetBeckmannClosure<1>) > + }; > + return params; > +} > > CLOSURE_PREPARE(bsdf_microfacet_ggx_prepare, > MicrofacetGGXClosure<0>) > CLOSURE_PREPARE(bsdf_microfacet_ggx_refraction_prepare, > MicrofacetGGXClosure<1>) > > Modified: trunk/blender/intern/cycles/kernel/osl/bsdf_oren_nayar.cpp > =================================================================== > --- trunk/blender/intern/cycles/kernel/osl/bsdf_oren_nayar.cpp 2012-10-06 > 14:35:48 UTC (rev 51116) > +++ trunk/blender/intern/cycles/kernel/osl/bsdf_oren_nayar.cpp 2012-10-06 > 16:28:02 UTC (rev 51117) > @@ -125,12 +125,16 @@ > } > }; > > -ClosureParam bsdf_oren_nayar_params[] = { > - CLOSURE_VECTOR_PARAM(OrenNayarClosure, m_N), > - CLOSURE_FLOAT_PARAM(OrenNayarClosure, m_sigma), > - CLOSURE_STRING_KEYPARAM("label"), > - CLOSURE_FINISH_PARAM(OrenNayarClosure) > -}; > +ClosureParam *bsdf_oren_nayar_params() > +{ > + static ClosureParam params[] = { > + CLOSURE_VECTOR_PARAM(OrenNayarClosure, m_N), > + CLOSURE_FLOAT_PARAM(OrenNayarClosure, m_sigma), > + CLOSURE_STRING_KEYPARAM("label"), > + CLOSURE_FINISH_PARAM(OrenNayarClosure) > + }; > + return params; > +} > > CLOSURE_PREPARE(bsdf_oren_nayar_prepare, OrenNayarClosure) > > > Modified: trunk/blender/intern/cycles/kernel/osl/bsdf_phong.cpp > =================================================================== > --- trunk/blender/intern/cycles/kernel/osl/bsdf_phong.cpp 2012-10-06 > 14:35:48 UTC (rev 51116) > +++ trunk/blender/intern/cycles/kernel/osl/bsdf_phong.cpp 2012-10-06 > 16:28:02 UTC (rev 51117) > @@ -258,18 +258,28 @@ > > > > -ClosureParam bsdf_phong_params[] = { > - CLOSURE_VECTOR_PARAM(PhongClosure, m_N), > - CLOSURE_FLOAT_PARAM (PhongClosure, m_exponent), > - CLOSURE_STRING_KEYPARAM("label"), > - CLOSURE_FINISH_PARAM(PhongClosure) }; > +ClosureParam *bsdf_phong_params() > +{ > + static ClosureParam params[] = { > + CLOSURE_VECTOR_PARAM(PhongClosure, m_N), > + CLOSURE_FLOAT_PARAM (PhongClosure, m_exponent), > + CLOSURE_STRING_KEYPARAM("label"), > + CLOSURE_FINISH_PARAM(PhongClosure) > + }; > + return params; > +} > > -ClosureParam bsdf_phong_ramp_params[] = { > - CLOSURE_VECTOR_PARAM (PhongRampClosure, m_N), > - CLOSURE_FLOAT_PARAM (PhongRampClosure, m_exponent), > - CLOSURE_COLOR_ARRAY_PARAM(PhongRampClosure, m_colors, > PhongRampClosure::MAXCOLORS), > - CLOSURE_STRING_KEYPARAM("label"), > - CLOSURE_FINISH_PARAM (PhongRampClosure) }; > +ClosureParam *bsdf_phong_ramp_params() > +{ > + static ClosureParam params[] = { > + CLOSURE_VECTOR_PARAM (PhongRampClosure, m_N), > + CLOSURE_FLOAT_PARAM (PhongRampClosure, m_exponent), > + CLOSURE_COLOR_ARRAY_PARAM(PhongRampClosure, m_colors, > PhongRampClosure::MAXCOLORS), > + CLOSURE_STRING_KEYPARAM("label"), > + CLOSURE_FINISH_PARAM (PhongRampClosure) > + }; > + return params; > +} > > CLOSURE_PREPARE(bsdf_phong_prepare, PhongClosure) > CLOSURE_PREPARE(bsdf_phong_ramp_prepare, PhongRampClosure) > > Modified: trunk/blender/intern/cycles/kernel/osl/bsdf_reflection.cpp > =================================================================== > --- trunk/blender/intern/cycles/kernel/osl/bsdf_reflection.cpp 2012-10-06 > 14:35:48 UTC (rev 51116) > +++ trunk/blender/intern/cycles/kernel/osl/bsdf_reflection.cpp 2012-10-06 > 16:28:02 UTC (rev 51117) > @@ -97,11 +97,15 @@ > } > }; > > -ClosureParam bsdf_reflection_params[] = { > - CLOSURE_VECTOR_PARAM(ReflectionClosure, m_N), > - CLOSURE_STRING_KEYPARAM("label"), > - CLOSURE_FINISH_PARAM(ReflectionClosure) > -}; > +ClosureParam *bsdf_reflection_params() > +{ > + static ClosureParam params[] = { > + CLOSURE_VECTOR_PARAM(ReflectionClosure, m_N), > + CLOSURE_STRING_KEYPARAM("label"), > + CLOSURE_FINISH_PARAM(ReflectionClosure) > + }; > + return params; > +} > > CLOSURE_PREPARE(bsdf_reflection_prepare, ReflectionClosure) > > > Modified: trunk/blender/intern/cycles/kernel/osl/bsdf_refraction.cpp > =================================================================== > --- trunk/blender/intern/cycles/kernel/osl/bsdf_refraction.cpp 2012-10-06 > 14:35:48 UTC (rev 51116) > +++ trunk/blender/intern/cycles/kernel/osl/bsdf_refraction.cpp 2012-10-06 > 16:28:02 UTC (rev 51117) > @@ -108,12 +108,16 @@ > } > }; > > -ClosureParam bsdf_refraction_params[] = { > - CLOSURE_VECTOR_PARAM(RefractionClosure, m_N), > - CLOSURE_FLOAT_PARAM(RefractionClosure, m_eta), > > @@ Diff output truncated at 10240 characters. @@ > _______________________________________________ > Bf-blender-cvs mailing list > bf-blender-...@blender.org > http://lists.blender.org/mailman/listinfo/bf-blender-cvs _______________________________________________ Bf-committers mailing list Bf-committers@blender.org http://lists.blender.org/mailman/listinfo/bf-committers