Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2015-09-23 10:23:37 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2015-09-23 10:27:02 +0300
commit0ec814c91d82eca135354abc38889e2bfb64dd9a (patch)
treedc67081902d4ab5745d84eb5d8a1f6d545de6e4d /intern/cycles/kernel/osl/osl_closures.h
parent1cae9c4af480e2ab674901c0933be3286f2ae2ca (diff)
Cycles: Support building with latest OSL-1.7dev
So now the following OSL versions are supported (at least for compilation): - 1.5 with closure alignment patch applied - 1.6.8 release - 1.7 development version from latest git
Diffstat (limited to 'intern/cycles/kernel/osl/osl_closures.h')
-rw-r--r--intern/cycles/kernel/osl/osl_closures.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/intern/cycles/kernel/osl/osl_closures.h b/intern/cycles/kernel/osl/osl_closures.h
index ef67ef52fc0..97bd1b1ac92 100644
--- a/intern/cycles/kernel/osl/osl_closures.h
+++ b/intern/cycles/kernel/osl/osl_closures.h
@@ -78,6 +78,11 @@ void name(RendererServices *, int id, void *data) \
#define TO_COLOR3(v) OSL::Color3(v.x, v.y, v.z)
#define TO_FLOAT3(v) make_float3(v[0], v[1], v[2])
+#if OSL_LIBRARY_VERSION_CODE < 10700
+# undef CLOSURE_STRING_KEYPARAM
+# define CLOSURE_STRING_KEYPARAM(st, fld, key) { TypeDesc::TypeString, 0, key, 0 }
+#endif
+
/* Closure */
class CClosurePrimitive {
@@ -97,6 +102,10 @@ public:
virtual void setup() {}
Category category;
+
+#if OSL_LIBRARY_VERSION_CODE >= 10700
+ OSL::ustring label;
+#endif
};
/* BSDF */
@@ -175,7 +184,7 @@ static ClosureParam *bsdf_##lower##_params() \
/* parameters */
#define BSDF_CLOSURE_CLASS_END(Upper, lower) \
- CLOSURE_STRING_KEYPARAM("label"), \
+ CLOSURE_STRING_KEYPARAM(Upper##Closure, label, "label"), \
CLOSURE_FINISH_PARAM(Upper##Closure) \
}; \
return params; \
@@ -223,7 +232,7 @@ static ClosureParam *volume_##lower##_params() \
/* parameters */
#define VOLUME_CLOSURE_CLASS_END(Upper, lower) \
- CLOSURE_STRING_KEYPARAM("label"), \
+ CLOSURE_STRING_KEYPARAM(Upper##Closure, label, "label"), \
CLOSURE_FINISH_PARAM(Upper##Closure) \
}; \
return params; \