From 7c0a0bae79bb8f842a575fe83975c6d34d73c64a Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Sat, 1 Dec 2012 19:15:05 +0000 Subject: Fix #33375: OSL geom:trianglevertices gave wrong coordinates for static BVH. Also some simple OSL optimization, passing thread data pointer directly instead of via thread local storage, and creating ustrings for attribute lookup. --- intern/cycles/kernel/osl/osl_globals.h | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'intern/cycles/kernel/osl/osl_globals.h') diff --git a/intern/cycles/kernel/osl/osl_globals.h b/intern/cycles/kernel/osl/osl_globals.h index ce283023c5c..1a2a210de88 100644 --- a/intern/cycles/kernel/osl/osl_globals.h +++ b/intern/cycles/kernel/osl/osl_globals.h @@ -38,7 +38,14 @@ CCL_NAMESPACE_BEGIN class OSLRenderServices; struct OSLGlobals { - /* use */ + OSLGlobals() + { + ss = NULL; + ts = NULL; + services = NULL; + use = false; + } + bool use; /* shading system */ @@ -66,19 +73,12 @@ struct OSLGlobals { vector attribute_map; ObjectNameMap object_name_map; vector object_names; +}; - /* thread key for thread specific data lookup */ - struct ThreadData { - OSL::ShaderGlobals globals; - OSL::PerThreadInfo *thread_info; - }; - - static tls_ptr(ThreadData, thread_data); - static thread_mutex thread_data_mutex; - static volatile int thread_data_users; - - void thread_data_init(); - void thread_data_free(); +/* thread key for thread specific data lookup */ +struct OSLThreadData { + OSL::ShaderGlobals globals; + OSL::PerThreadInfo *thread_info; }; CCL_NAMESPACE_END -- cgit v1.2.3