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-03 15:46:18 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2015-09-03 16:16:30 +0300
commita4bcd9bc9676edf9706dd6169c4c7f8eabf312b4 (patch)
tree9b23606fa22326edbb5c71d1c4a67fe1ac1ce24b /intern/cycles
parent0bc4bc2e616bc860634bb3b4a637c3400dc5c68f (diff)
Cycles: Fix missing packed images with newer versions of OSL
This isn't really complete fix, complete fix would require calculating derivatives via OIIO API, but supporting this will either end up with some code duplication or will require some non really safe changes at this release cycle.
Diffstat (limited to 'intern/cycles')
-rw-r--r--intern/cycles/kernel/osl/osl_services.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/intern/cycles/kernel/osl/osl_services.h b/intern/cycles/kernel/osl/osl_services.h
index 190234a7706..cb6f2311ad8 100644
--- a/intern/cycles/kernel/osl/osl_services.h
+++ b/intern/cycles/kernel/osl/osl_services.h
@@ -104,6 +104,53 @@ public:
const OSL::Vec3 &dPdx, const OSL::Vec3 &dPdy,
const OSL::Vec3 &dPdz, int nchannels, float *result);
+#if OSL_LIBRARY_VERSION_CODE >= 10700
+ bool texture(ustring filename,
+ TextureHandle * /*texture_handle*/,
+ TexturePerthread * /*texture_thread_info*/,
+ TextureOpt &options,
+ OSL::ShaderGlobals *sg,
+ float s, float t,
+ float dsdx, float dtdx, float dsdy, float dtdy,
+ int nchannels,
+ float *result,
+ float * /*dresultds*/,
+ float * /*dresultdt*/)
+ {
+ return texture(filename,
+ options,
+ sg,
+ s, t,
+ dsdx, dtdx, dsdy, dtdy,
+ nchannels,
+ result);
+ }
+
+ bool texture3d(ustring filename,
+ TextureHandle * /*texture_handle*/,
+ TexturePerthread * /*texture_thread_info*/,
+ TextureOpt &options,
+ OSL::ShaderGlobals *sg,
+ const OSL::Vec3 &P,
+ const OSL::Vec3 &dPdx,
+ const OSL::Vec3 &dPdy,
+ const OSL::Vec3 &dPdz,
+ int nchannels,
+ float *result,
+ float * /*dresultds*/,
+ float * /*dresultdt*/,
+ float * /*dresultdr*/)
+ {
+ return texture3d(filename,
+ options,
+ sg,
+ P,
+ dPdx, dPdy, dPdz,
+ nchannels,
+ result);
+ }
+#endif
+
bool environment(ustring filename, TextureOpt &options,
OSL::ShaderGlobals *sg, const OSL::Vec3 &R,
const OSL::Vec3 &dRdx, const OSL::Vec3 &dRdy,