From 7d85b6431fc331d9869f945bf7c9f3353b7b8c95 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 28 Apr 2020 13:46:36 +0200 Subject: Fix T76044: update Cycles to build with OSL 1.11 master --- intern/cycles/kernel/osl/osl_services.cpp | 18 ++++++++++++++++++ intern/cycles/kernel/osl/osl_services.h | 17 +++++++++++++++++ 2 files changed, 35 insertions(+) (limited to 'intern') diff --git a/intern/cycles/kernel/osl/osl_services.cpp b/intern/cycles/kernel/osl/osl_services.cpp index 2857de533f3..5292b5f8055 100644 --- a/intern/cycles/kernel/osl/osl_services.cpp +++ b/intern/cycles/kernel/osl/osl_services.cpp @@ -1011,7 +1011,13 @@ bool OSLRenderServices::get_userdata( return false; /* disabled by lockgeom */ } +#if OSL_LIBRARY_VERSION_CODE >= 11100 +TextureSystem::TextureHandle *OSLRenderServices::get_texture_handle(ustring filename, + OSL::ShadingContext *) +#else + TextureSystem::TextureHandle *OSLRenderServices::get_texture_handle(ustring filename) +#endif { OSLTextureHandleMap::iterator it = textures.find(filename); @@ -1365,6 +1371,17 @@ bool OSLRenderServices::environment(ustring filename, return status; } +#if OSL_LIBRARY_VERSION_CODE >= 11100 +bool OSLRenderServices::get_texture_info(ustring filename, + TextureHandle *texture_handle, + TexturePerthread *, + OSL::ShadingContext *, + int subimage, + ustring dataname, + TypeDesc datatype, + void *data, + ustring *) +#else bool OSLRenderServices::get_texture_info(OSL::ShaderGlobals *sg, ustring filename, TextureHandle *texture_handle, @@ -1372,6 +1389,7 @@ bool OSLRenderServices::get_texture_info(OSL::ShaderGlobals *sg, ustring dataname, TypeDesc datatype, void *data) +#endif { OSLTextureHandle *handle = (OSLTextureHandle *)texture_handle; diff --git a/intern/cycles/kernel/osl/osl_services.h b/intern/cycles/kernel/osl/osl_services.h index d32dace23bf..894d6e471ba 100644 --- a/intern/cycles/kernel/osl/osl_services.h +++ b/intern/cycles/kernel/osl/osl_services.h @@ -173,7 +173,12 @@ class OSLRenderServices : public OSL::RendererServices { void *val, bool derivatives) override; +#if OSL_LIBRARY_VERSION_CODE >= 11100 + TextureSystem::TextureHandle *get_texture_handle(ustring filename, + OSL::ShadingContext *context) override; +#else TextureSystem::TextureHandle *get_texture_handle(ustring filename) override; +#endif bool good(TextureSystem::TextureHandle *texture_handle) override; @@ -224,6 +229,17 @@ class OSLRenderServices : public OSL::RendererServices { float *dresultdt, ustring *errormessage) override; +#if OSL_LIBRARY_VERSION_CODE >= 11100 + bool get_texture_info(ustring filename, + TextureHandle *texture_handle, + TexturePerthread *texture_thread_info, + OSL::ShadingContext *shading_context, + int subimage, + ustring dataname, + TypeDesc datatype, + void *data, + ustring *errormessage) override; +#else bool get_texture_info(OSL::ShaderGlobals *sg, ustring filename, TextureHandle *texture_handle, @@ -231,6 +247,7 @@ class OSLRenderServices : public OSL::RendererServices { ustring dataname, TypeDesc datatype, void *data) override; +#endif static bool get_background_attribute( KernelGlobals *kg, ShaderData *sd, ustring name, TypeDesc type, bool derivatives, void *val); -- cgit v1.2.3