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.
This commit is contained in:
Brecht Van Lommel
2012-12-01 19:15:05 +00:00
parent 807fd448a5
commit 7c0a0bae79
19 changed files with 276 additions and 282 deletions

View File

@@ -18,14 +18,6 @@
/* Constant Globals */
#ifdef __KERNEL_CPU__
#ifdef __OSL__
#include "osl_globals.h"
#endif
#endif
CCL_NAMESPACE_BEGIN
/* On the CPU, we pass along the struct KernelGlobals to nearly everywhere in
@@ -35,6 +27,12 @@ CCL_NAMESPACE_BEGIN
#ifdef __KERNEL_CPU__
#ifdef __OSL__
struct OSLGlobals;
struct OSLThreadData;
struct OSLShadingSystem;
#endif
#define MAX_BYTE_IMAGES 512
#define MAX_FLOAT_IMAGES 5
@@ -51,7 +49,9 @@ typedef struct KernelGlobals {
#ifdef __OSL__
/* On the CPU, we also have the OSL globals here. Most data structures are shared
* with SVM, the difference is in the shaders and object/mesh attributes. */
OSLGlobals osl;
OSLGlobals *osl;
OSLShadingSystem *osl_ss;
OSLThreadData *osl_tdata;
#endif
} KernelGlobals;