From 4cb0e256789231a329780bbdc8706e6aa031e52e Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Wed, 3 Dec 2014 20:34:03 +0500 Subject: Cycles: Use 16 bytes aligned closures in OSL This solves bugs like T42210 which are caused by compiler being smart and using some SSE instructions to operate with closure classes, which was failing because those classes are not allocated by the regular allocator but allocated in memory pool in OSL. With newer versions of OSL it is now possible to force closure classes being aligned to a given boundary and this commit uses this new functionality. Unfortunately, it means we're no longer compatible with older versions of OSL, only latest git version from upstream and our branch at github are supported: https://github.com/Nazg-Gul/OpenShadingLanguage/tree/blender-fixes For OSX and Windows it's not an issue because libraries are already updated there, Linux users would need to run install_deps script. --- intern/cycles/kernel/osl/osl_closures.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'intern/cycles/kernel/osl/osl_closures.cpp') diff --git a/intern/cycles/kernel/osl/osl_closures.cpp b/intern/cycles/kernel/osl/osl_closures.cpp index bae9cb2f377..1d99f1d2682 100644 --- a/intern/cycles/kernel/osl/osl_closures.cpp +++ b/intern/cycles/kernel/osl/osl_closures.cpp @@ -189,7 +189,7 @@ static void register_closure(OSL::ShadingSystem *ss, const char *name, int id, O /* optimization: it's possible to not use a prepare function at all and * only initialize the actual class when accessing the closure component * data, but then we need to map the id to the class somehow */ - ss->register_closure(name, id, params, prepare, NULL); + ss->register_closure(name, id, params, prepare, NULL, 16); } void OSLShader::register_closures(OSLShadingSystem *ss_) -- cgit v1.2.3