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.
This commit is contained in:
Sergey Sharybin 2014-12-03 20:34:03 +05:00
parent 894dbda575
commit 4cb0e25678
1 changed files with 1 additions and 1 deletions

View File

@ -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_)