7#include <OSL/oslexec.h>
13OSLThreadData::OSLThreadData(OSLGlobals *osl_globals,
const int thread_index)
14 : globals(osl_globals), thread_index(thread_index)
17 if (globals ==
nullptr || !(globals->use_shading || globals->use_camera)) {
23 memset((
void *)&shader_globals, 0,
sizeof(shader_globals));
24 shader_globals.tracedata = &tracedata;
27 osl_thread_info = ss->create_thread_info();
28 context = ss->get_context(osl_thread_info);
31 oiio_thread_info = globals->ts->get_perthread_info();
35OSLThreadData::~OSLThreadData()
38 ss->release_context(context);
40 if (osl_thread_info) {
41 ss->destroy_thread_info(osl_thread_info);
45OSLThreadData::OSLThreadData(OSLThreadData &&other) noexcept
46 : globals(other.globals),
48 thread_index(other.thread_index),
49 shader_globals(other.shader_globals),
50 tracedata(other.tracedata),
51 osl_thread_info(other.osl_thread_info),
53 oiio_thread_info(other.oiio_thread_info)
55 shader_globals.tracedata = &tracedata;
57 memset((
void *)&other.shader_globals, 0,
sizeof(other.shader_globals));
58 memset((
void *)&other.tracedata, 0,
sizeof(other.tracedata));
59 other.thread_index = -1;
60 other.context =
nullptr;
61 other.osl_thread_info =
nullptr;
62 other.oiio_thread_info =
nullptr;
#define CCL_NAMESPACE_END
int context(const bContext *C, const char *member, bContextDataResult *result)