summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO2
-rw-r--r--PKGBUILD6
-rw-r--r--osl19x.patch399
3 files changed, 405 insertions, 2 deletions
diff --git a/.SRCINFO b/.SRCINFO
index afcfa88b256..263e34c9b37 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -55,6 +55,7 @@ pkgbase = blender-fracture_modifier-git
source = openvdb8.patch
source = openexr3.patch
source = opencolorio1.patch
+ source = osl19x.patch
sha256sums = SKIP
sha256sums = SKIP
sha256sums = SKIP
@@ -77,5 +78,6 @@ pkgbase = blender-fracture_modifier-git
sha256sums = edfd784f8497417660c0b9fdc97893fd0d77764d0bc10f4cb92a9082f41bae75
sha256sums = 8e28b28679c67ce589558468d5d912321b345dbbe46c80b359a1a38417ba2ed2
sha256sums = b998efa375b868e3beeba54fe070fa73256663f23a86668a04f34ceb626c65ac
+ sha256sums = 1f5f9cfc3e19c5a2e358a8de1c690e1d94dc24b63eecd76fa156f69e6cdd2edd
pkgname = blender-fracture_modifier-git
diff --git a/PKGBUILD b/PKGBUILD
index 2d888f4b3ae..19d7c6163c6 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -55,6 +55,7 @@ source=("git://git.blender.org/blender.git${_fragment}"
openvdb8.patch # ::https://git.blender.org/gitweb/gitweb.cgi/blender.git/patch/37889011070ff2ec52159690f652238d2b325185
openexr3.patch
opencolorio1.patch
+ osl19x.patch
)
sha256sums=('SKIP'
'SKIP'
@@ -77,7 +78,8 @@ sha256sums=('SKIP'
'c4079c4c142516d9cd476f5a3cafddf4068f0950c3c11ea4da9cf999c5ccc1f9'
'edfd784f8497417660c0b9fdc97893fd0d77764d0bc10f4cb92a9082f41bae75'
'8e28b28679c67ce589558468d5d912321b345dbbe46c80b359a1a38417ba2ed2'
- 'b998efa375b868e3beeba54fe070fa73256663f23a86668a04f34ceb626c65ac')
+ 'b998efa375b868e3beeba54fe070fa73256663f23a86668a04f34ceb626c65ac'
+ '1f5f9cfc3e19c5a2e358a8de1c690e1d94dc24b63eecd76fa156f69e6cdd2edd')
pkgver() {
blender_version=$(grep -Po "BLENDER_VERSION\s+\K[0-9]{3}" "$srcdir"/blender/source/blender/blenkernel/BKE_blender_version.h)
@@ -98,7 +100,7 @@ prepare() {
if [[ -v _suffix ]]; then
git apply -v <(sed "s/@@_suffix@@/${_suffix}/g" "${srcdir}/addon_path.patch")
fi
- git -C "$srcdir/blender" apply -v "${srcdir}"/{gcc{8,9},ffmpeg,openvdb{,7,8},collada1668,oiio-2.0,Cleanup-use-PyImport_GetModuleDict,open{exr3,colorio1}}.patch
+ git -C "$srcdir/blender" apply -v "${srcdir}"/{gcc{8,9},ffmpeg,openvdb{,7,8},collada1668,oiio-2.0,Cleanup-use-PyImport_GetModuleDict,open{exr3,colorio1},osl19x}.patch
git -C "$srcdir/blender" apply -v "${srcdir}"/python3.{8,9,9_2}.patch
}
diff --git a/osl19x.patch b/osl19x.patch
new file mode 100644
index 00000000000..63697938b19
--- /dev/null
+++ b/osl19x.patch
@@ -0,0 +1,399 @@
+From 56aa72bc1922652dba8539f5a305a175619d68aa Mon Sep 17 00:00:00 2001
+From: Brecht Van Lommel <brechtvanlommel@gmail.com>
+Date: Fri, 26 Oct 2018 19:26:06 +0200
+Subject: [PATCH 1/4] Fix T57393: Cycles OSL bevel and AO not working after OSL
+ upgrade.
+
+---
+ intern/cycles/kernel/osl/osl_services.cpp | 28 +++++++++++++++++++++--
+ intern/cycles/kernel/osl/osl_services.h | 7 +++++-
+ 2 files changed, 32 insertions(+), 3 deletions(-)
+
+diff --git a/intern/cycles/kernel/osl/osl_services.cpp b/intern/cycles/kernel/osl/osl_services.cpp
+index 1535496c73d..f54d18d5e38 100644
+--- a/intern/cycles/kernel/osl/osl_services.cpp
++++ b/intern/cycles/kernel/osl/osl_services.cpp
+@@ -900,6 +900,23 @@ bool OSLRenderServices::has_userdata(ustring name, TypeDesc type, OSL::ShaderGlo
+ return false; /* never called by OSL */
+ }
+
++TextureSystem::TextureHandle *OSLRenderServices::get_texture_handle(ustring filename)
++{
++ if (filename.length() && filename[0] == '@') {
++ /* Dummy, we don't use texture handles for builtin textures but need
++ * to tell the OSL runtime optimizer that this is a valid texture. */
++ return NULL;
++ }
++ else {
++ return texturesys()->get_texture_handle(filename);
++ }
++}
++
++bool OSLRenderServices::good(TextureSystem::TextureHandle *texture_handle)
++{
++ return texturesys()->good(texture_handle);
++}
++
+ bool OSLRenderServices::texture(ustring filename,
+ TextureHandle *texture_handle,
+ TexturePerthread *texture_thread_info,
+@@ -910,7 +927,8 @@ bool OSLRenderServices::texture(ustring filename,
+ int nchannels,
+ float *result,
+ float *dresultds,
+- float *dresultdt)
++ float *dresultdt,
++ ustring *errormessage)
+ {
+ OSL::TextureSystem *ts = osl_ts;
+ ShaderData *sd = (ShaderData *)(sg->renderstate);
+@@ -1131,7 +1149,13 @@ bool OSLRenderServices::get_texture_info(OSL::ShaderGlobals *sg, ustring filenam
+ TypeDesc datatype, void *data)
+ {
+ OSL::TextureSystem *ts = osl_ts;
+- return ts->get_texture_info(filename, subimage, dataname, datatype, data);
++ if (filename.length() && filename[0] == '@') {
++ /* Special builtin textures. */
++ return false;
++ }
++ else {
++ return ts->get_texture_info(filename, subimage, dataname, datatype, data);
++ }
+ }
+
+ int OSLRenderServices::pointcloud_search(OSL::ShaderGlobals *sg, ustring filename, const OSL::Vec3 &center,
+diff --git a/intern/cycles/kernel/osl/osl_services.h b/intern/cycles/kernel/osl/osl_services.h
+index ec34ca77115..8b47342c9d3 100644
+--- a/intern/cycles/kernel/osl/osl_services.h
++++ b/intern/cycles/kernel/osl/osl_services.h
+@@ -93,6 +93,10 @@ public:
+ bool getmessage(OSL::ShaderGlobals *sg, ustring source, ustring name,
+ TypeDesc type, void *val, bool derivatives);
+
++ TextureSystem::TextureHandle *get_texture_handle(ustring filename);
++
++ bool good(TextureSystem::TextureHandle *texture_handle);
++
+ bool texture(ustring filename,
+ TextureSystem::TextureHandle *texture_handle,
+ TexturePerthread *texture_thread_info,
+@@ -103,7 +107,8 @@ public:
+ int nchannels,
+ float *result,
+ float *dresultds,
+- float *dresultdt);
++ float *dresultdt,
++ ustring *errormessage);
+
+ bool texture3d(ustring filename,
+ TextureHandle *texture_handle,
+--
+2.32.0
+
+
+From 4f6171e877777306f9394e239c1e6edea72af93d Mon Sep 17 00:00:00 2001
+From: Sergey Sharybin <sergey.vfx@gmail.com>
+Date: Fri, 9 Nov 2018 12:08:51 +0100
+Subject: [PATCH 2/4] Cycles: Cleanup, space after (void)
+
+It was used in like 95% of places.
+---
+ intern/cycles/kernel/osl/osl_services.cpp | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/intern/cycles/kernel/osl/osl_services.cpp b/intern/cycles/kernel/osl/osl_services.cpp
+index f54d18d5e38..a1aa6c6b978 100644
+--- a/intern/cycles/kernel/osl/osl_services.cpp
++++ b/intern/cycles/kernel/osl/osl_services.cpp
+@@ -1028,7 +1028,7 @@ bool OSLRenderServices::texture(ustring filename,
+ * other nasty stuff happening.
+ */
+ string err = ts->geterror();
+- (void)err;
++ (void) err;
+ }
+
+ return status;
+@@ -1107,7 +1107,7 @@ bool OSLRenderServices::texture3d(ustring filename,
+ * other nasty stuff happening.
+ */
+ string err = ts->geterror();
+- (void)err;
++ (void) err;
+ }
+
+ return status;
+--
+2.32.0
+
+
+From cbcfbd8bb23f5ef6636dc94668ee6cfa5b3f11cb Mon Sep 17 00:00:00 2001
+From: Sergey Sharybin <sergey.vfx@gmail.com>
+Date: Thu, 15 Nov 2018 17:16:40 +0100
+Subject: [PATCH 3/4] Cycles: Cleanup, code style
+
+---
+ intern/cycles/kernel/osl/osl_services.cpp | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/intern/cycles/kernel/osl/osl_services.cpp b/intern/cycles/kernel/osl/osl_services.cpp
+index a1aa6c6b978..c35f240837f 100644
+--- a/intern/cycles/kernel/osl/osl_services.cpp
++++ b/intern/cycles/kernel/osl/osl_services.cpp
+@@ -902,7 +902,7 @@ bool OSLRenderServices::has_userdata(ustring name, TypeDesc type, OSL::ShaderGlo
+
+ TextureSystem::TextureHandle *OSLRenderServices::get_texture_handle(ustring filename)
+ {
+- if (filename.length() && filename[0] == '@') {
++ if(filename.length() && filename[0] == '@') {
+ /* Dummy, we don't use texture handles for builtin textures but need
+ * to tell the OSL runtime optimizer that this is a valid texture. */
+ return NULL;
+@@ -1149,7 +1149,7 @@ bool OSLRenderServices::get_texture_info(OSL::ShaderGlobals *sg, ustring filenam
+ TypeDesc datatype, void *data)
+ {
+ OSL::TextureSystem *ts = osl_ts;
+- if (filename.length() && filename[0] == '@') {
++ if(filename.length() && filename[0] == '@') {
+ /* Special builtin textures. */
+ return false;
+ }
+--
+2.32.0
+
+
+From ba0ff934b30a9f89a2827fcfb60e5f2eca5f7f72 Mon Sep 17 00:00:00 2001
+From: Brecht Van Lommel <brechtvanlommel@gmail.com>
+Date: Wed, 2 Jan 2019 19:55:26 +0100
+Subject: [PATCH 4/4] Fix T60061: Cycles OSL point density not working.
+
+Add override keywords so we can detect when the function definitions change.
+---
+ intern/cycles/kernel/osl/osl_services.cpp | 50 +++++++++------
+ intern/cycles/kernel/osl/osl_services.h | 77 ++++++++++++++---------
+ 2 files changed, 78 insertions(+), 49 deletions(-)
+
+diff --git a/intern/cycles/kernel/osl/osl_services.cpp b/intern/cycles/kernel/osl/osl_services.cpp
+index c35f240837f..51938d330d5 100644
+--- a/intern/cycles/kernel/osl/osl_services.cpp
++++ b/intern/cycles/kernel/osl/osl_services.cpp
+@@ -895,11 +895,6 @@ bool OSLRenderServices::get_userdata(bool derivatives, ustring name, TypeDesc ty
+ return false; /* disabled by lockgeom */
+ }
+
+-bool OSLRenderServices::has_userdata(ustring name, TypeDesc type, OSL::ShaderGlobals *sg)
+-{
+- return false; /* never called by OSL */
+-}
+-
+ TextureSystem::TextureHandle *OSLRenderServices::get_texture_handle(ustring filename)
+ {
+ if(filename.length() && filename[0] == '@') {
+@@ -1047,7 +1042,8 @@ bool OSLRenderServices::texture3d(ustring filename,
+ float *result,
+ float *dresultds,
+ float *dresultdt,
+- float *dresultdr)
++ float *dresultdr,
++ ustring *errormessage)
+ {
+ OSL::TextureSystem *ts = osl_ts;
+ ShaderData *sd = (ShaderData *)(sg->renderstate);
+@@ -1113,22 +1109,36 @@ bool OSLRenderServices::texture3d(ustring filename,
+ return status;
+ }
+
+-bool OSLRenderServices::environment(ustring filename, TextureOpt &options,
+- OSL::ShaderGlobals *sg, const OSL::Vec3 &R,
+- const OSL::Vec3 &dRdx, const OSL::Vec3 &dRdy,
+- int nchannels, float *result)
++bool OSLRenderServices::environment(ustring filename,
++ TextureHandle *th,
++ TexturePerthread *thread_info,
++ TextureOpt &options,
++ OSL::ShaderGlobals *sg,
++ const OSL::Vec3 &R,
++ const OSL::Vec3 &dRdx,
++ const OSL::Vec3 &dRdy,
++ int nchannels,
++ float *result,
++ float *dresultds,
++ float *dresultdt,
++ ustring *errormessage)
+ {
+ OSL::TextureSystem *ts = osl_ts;
+- ShaderData *sd = (ShaderData *)(sg->renderstate);
+- KernelGlobals *kg = sd->osl_globals;
+- OSLThreadData *tdata = kg->osl_tdata;
+- OIIO::TextureSystem::Perthread *thread_info = tdata->oiio_thread_info;
+
+- OIIO::TextureSystem::TextureHandle *th = ts->get_texture_handle(filename, thread_info);
++ if (thread_info == NULL) {
++ ShaderData *sd = (ShaderData *)(sg->renderstate);
++ KernelGlobals *kg = sd->osl_globals;
++ OSLThreadData *tdata = kg->osl_tdata;
++ thread_info = tdata->oiio_thread_info;
++ }
++
++ if (th == NULL) {
++ th = ts->get_texture_handle(filename, thread_info);
++ }
+
+ bool status = ts->environment(th, thread_info,
+ options, R, dRdx, dRdy,
+- nchannels, result);
++ nchannels, result, dresultds, dresultdt);
+
+ if(!status) {
+ if(nchannels == 3 || nchannels == 4) {
+@@ -1144,9 +1154,13 @@ bool OSLRenderServices::environment(ustring filename, TextureOpt &options,
+ return status;
+ }
+
+-bool OSLRenderServices::get_texture_info(OSL::ShaderGlobals *sg, ustring filename, int subimage,
++bool OSLRenderServices::get_texture_info(OSL::ShaderGlobals *sg,
++ ustring filename,
++ TextureHandle *th,
++ int subimage,
+ ustring dataname,
+- TypeDesc datatype, void *data)
++ TypeDesc datatype,
++ void *data)
+ {
+ OSL::TextureSystem *ts = osl_ts;
+ if(filename.length() && filename[0] == '@') {
+diff --git a/intern/cycles/kernel/osl/osl_services.h b/intern/cycles/kernel/osl/osl_services.h
+index 8b47342c9d3..9e58a1c5c45 100644
+--- a/intern/cycles/kernel/osl/osl_services.h
++++ b/intern/cycles/kernel/osl/osl_services.h
+@@ -45,57 +45,57 @@ class OSLRenderServices : public OSL::RendererServices
+ public:
+ OSLRenderServices();
+ ~OSLRenderServices();
+-
++
+ void thread_init(KernelGlobals *kernel_globals, OSL::TextureSystem *ts);
+
+- bool get_matrix(OSL::ShaderGlobals *sg, OSL::Matrix44 &result, OSL::TransformationPtr xform, float time);
+- bool get_inverse_matrix(OSL::ShaderGlobals *sg, OSL::Matrix44 &result, OSL::TransformationPtr xform, float time);
+-
+- bool get_matrix(OSL::ShaderGlobals *sg, OSL::Matrix44 &result, ustring from, float time);
+- bool get_inverse_matrix(OSL::ShaderGlobals *sg, OSL::Matrix44 &result, ustring to, float time);
+-
+- bool get_matrix(OSL::ShaderGlobals *sg, OSL::Matrix44 &result, OSL::TransformationPtr xform);
+- bool get_inverse_matrix(OSL::ShaderGlobals *sg, OSL::Matrix44 &result, OSL::TransformationPtr xform);
+-
+- bool get_matrix(OSL::ShaderGlobals *sg, OSL::Matrix44 &result, ustring from);
+- bool get_inverse_matrix(OSL::ShaderGlobals *sg, OSL::Matrix44 &result, ustring from);
++ bool get_matrix(OSL::ShaderGlobals *sg, OSL::Matrix44 &result, OSL::TransformationPtr xform, float time) override;
++ bool get_inverse_matrix(OSL::ShaderGlobals *sg, OSL::Matrix44 &result, OSL::TransformationPtr xform, float time) override;
++
++ bool get_matrix(OSL::ShaderGlobals *sg, OSL::Matrix44 &result, ustring from, float time) override;
++ bool get_inverse_matrix(OSL::ShaderGlobals *sg, OSL::Matrix44 &result, ustring to, float time) override;
++
++ bool get_matrix(OSL::ShaderGlobals *sg, OSL::Matrix44 &result, OSL::TransformationPtr xform) override;
++ bool get_inverse_matrix(OSL::ShaderGlobals *sg, OSL::Matrix44 &result, OSL::TransformationPtr xform) override;
++
++ bool get_matrix(OSL::ShaderGlobals *sg, OSL::Matrix44 &result, ustring from) override;
++ bool get_inverse_matrix(OSL::ShaderGlobals *sg, OSL::Matrix44 &result, ustring from) override;
+
+ bool get_array_attribute(OSL::ShaderGlobals *sg, bool derivatives,
+ ustring object, TypeDesc type, ustring name,
+- int index, void *val);
++ int index, void *val) override;
+ bool get_attribute(OSL::ShaderGlobals *sg, bool derivatives, ustring object,
+- TypeDesc type, ustring name, void *val);
++ TypeDesc type, ustring name, void *val) override;
+ bool get_attribute(ShaderData *sd, bool derivatives, ustring object_name,
+ TypeDesc type, ustring name, void *val);
+
+ bool get_userdata(bool derivatives, ustring name, TypeDesc type,
+- OSL::ShaderGlobals *sg, void *val);
++ OSL::ShaderGlobals *sg, void *val) override;
+ bool has_userdata(ustring name, TypeDesc type, OSL::ShaderGlobals *sg);
+
+ int pointcloud_search(OSL::ShaderGlobals *sg, ustring filename, const OSL::Vec3 &center,
+ float radius, int max_points, bool sort, size_t *out_indices,
+- float *out_distances, int derivs_offset);
++ float *out_distances, int derivs_offset) override;
+
+ int pointcloud_get(OSL::ShaderGlobals *sg, ustring filename, size_t *indices, int count,
+- ustring attr_name, TypeDesc attr_type, void *out_data);
++ ustring attr_name, TypeDesc attr_type, void *out_data) override;
+
+ bool pointcloud_write(OSL::ShaderGlobals *sg,
+ ustring filename, const OSL::Vec3 &pos,
+ int nattribs, const ustring *names,
+ const TypeDesc *types,
+- const void **data);
++ const void **data) override;
+
+ bool trace(TraceOpt &options, OSL::ShaderGlobals *sg,
+ const OSL::Vec3 &P, const OSL::Vec3 &dPdx,
+ const OSL::Vec3 &dPdy, const OSL::Vec3 &R,
+- const OSL::Vec3 &dRdx, const OSL::Vec3 &dRdy);
++ const OSL::Vec3 &dRdx, const OSL::Vec3 &dRdy) override;
+
+ bool getmessage(OSL::ShaderGlobals *sg, ustring source, ustring name,
+- TypeDesc type, void *val, bool derivatives);
++ TypeDesc type, void *val, bool derivatives) override;
+
+ TextureSystem::TextureHandle *get_texture_handle(ustring filename);
+
+- bool good(TextureSystem::TextureHandle *texture_handle);
++ bool good(TextureSystem::TextureHandle *texture_handle) override;
+
+ bool texture(ustring filename,
+ TextureSystem::TextureHandle *texture_handle,
+@@ -108,7 +108,7 @@ public:
+ float *result,
+ float *dresultds,
+ float *dresultdt,
+- ustring *errormessage);
++ ustring *errormessage) override;
+
+ bool texture3d(ustring filename,
+ TextureHandle *texture_handle,
+@@ -123,15 +123,30 @@ public:
+ float *result,
+ float *dresultds,
+ float *dresultdt,
+- float *dresultdr);
+-
+- bool environment(ustring filename, TextureOpt &options,
+- OSL::ShaderGlobals *sg, const OSL::Vec3 &R,
+- const OSL::Vec3 &dRdx, const OSL::Vec3 &dRdy,
+- int nchannels, float *result);
+-
+- bool get_texture_info(OSL::ShaderGlobals *sg, ustring filename, int subimage,
+- ustring dataname, TypeDesc datatype, void *data);
++ float *dresultdr,
++ ustring *errormessage) override;
++
++ bool environment(ustring filename,
++ TextureHandle *texture_handle,
++ TexturePerthread *texture_thread_info,
++ TextureOpt &options,
++ OSL::ShaderGlobals *sg,
++ const OSL::Vec3 &R,
++ const OSL::Vec3 &dRdx,
++ const OSL::Vec3 &dRdy,
++ int nchannels,
++ float *result,
++ float *dresultds,
++ float *dresultdt,
++ ustring *errormessage) override;
++
++ bool get_texture_info(OSL::ShaderGlobals *sg,
++ ustring filename,
++ TextureHandle *texture_handle,
++ int subimage,
++ ustring dataname,
++ TypeDesc datatype,
++ void *data);
+
+ static bool get_background_attribute(KernelGlobals *kg, ShaderData *sd, ustring name,
+ TypeDesc type, bool derivatives, void *val);
+--
+2.32.0
+