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();
29 context = ss->get_context(osl_thread_info,
30 reinterpret_cast<OSL::TextureSystem::Perthread *
>(1));
34OSLThreadData::~OSLThreadData()
37 ss->release_context(context);
39 if (osl_thread_info) {
40 ss->destroy_thread_info(osl_thread_info);
44OSLThreadData::OSLThreadData(OSLThreadData &&other) noexcept
45 : globals(other.globals),
47 thread_index(other.thread_index),
48 shader_globals(other.shader_globals),
49 tracedata(other.tracedata),
50 osl_thread_info(other.osl_thread_info),
53 shader_globals.tracedata = &tracedata;
55 memset((
void *)&other.shader_globals, 0,
sizeof(other.shader_globals));
56 memset((
void *)&other.tracedata, 0,
sizeof(other.tracedata));
57 other.thread_index = -1;
58 other.context =
nullptr;
59 other.osl_thread_info =
nullptr;
#define CCL_NAMESPACE_END
int context(const bContext *C, const char *member, bContextDataResult *result)