We're writing a custom camera for Arnold, and running into a simple texture access issue.
Trying to call;
AtRGBA lensmapSample = AiTextureHandleAccess(sg, data->texturehandle, *(data->textureparams));
....results in a segfault if used on multiple cores (works fine on a single core).
Unlike shader_evaluate(), sg isn't defined for camera_create_ray, so we're having to declare & init it with;
AtShaderGlobals* sg = AiShaderGlobals();
... and then pass that along to AiTextureHandleAccess, but my guess is that it's not getting initialized per thread or something like that because any number of threads beyond 1 causes a crash (with 1 thread, it works as expected).
Anyone know how this is supposed to be invoked? Is there an alternate texture access method that should be used at the camera_create_ray step?
Oh, two of the more common errors that appear in the segfault are:
/home/thiago/oiio-arnold/src/libtexture/imagecache.cpp:1449: failed assertion 'memsize() == 0 && size > OIIO_SIMD_MAX_SIZE_BYTES'
and
* signal caught: SIGSEGV -- Invalid memory reference (address not mapped to object)
My guess is that the first error is likely just another version of the second.
It's a problem with the sg returned by AiShaderGlobals. Fix in next update.