mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-09-24 04:59:14 -07:00
media-gfx/blender: add 4.0.2-r1, cleanup
hopefully fixed osl build re-added hip flag in 4.0.2-r1 hide test code in release versions Bug: https://bugs.gentoo.org/693200 Closes: https://bugs.gentoo.org/925534 Closes: https://bugs.gentoo.org/927281 Closes: https://bugs.gentoo.org/927715 Closes: https://bugs.gentoo.org/927835 Closes: https://bugs.gentoo.org/927931 Signed-off-by: Paul Zander <negril.nx+gentoo@gmail.com> Closes: https://github.com/gentoo/gentoo/pull/35973 Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
@@ -22,8 +22,8 @@ else
|
||||
KEYWORDS="~amd64 ~arm ~arm64"
|
||||
fi
|
||||
|
||||
SLOT="${PV%.*}"
|
||||
LICENSE="|| ( GPL-3 BL )"
|
||||
SLOT="${PV%.*}"
|
||||
IUSE="+bullet +dds +fluid +openexr +tbb \
|
||||
alembic collada +color-management cuda +cycles \
|
||||
debug doc +embree +ffmpeg +fftw +gmp headless jack jemalloc jpeg2k \
|
||||
@@ -94,7 +94,7 @@ RDEPEND="${PYTHON_DEPS}
|
||||
)
|
||||
opensubdiv? ( >=media-libs/opensubdiv-3.4.0 )
|
||||
openvdb? (
|
||||
>=media-gfx/openvdb-9.0.0:=[nanovdb?]
|
||||
<media-gfx/openvdb-11.0.0:=[nanovdb?]
|
||||
dev-libs/c-blosc:=
|
||||
)
|
||||
optix? ( <dev-libs/optix-7.5.0 )
|
||||
|
||||
@@ -22,8 +22,8 @@ else
|
||||
KEYWORDS="amd64 ~arm ~arm64"
|
||||
fi
|
||||
|
||||
SLOT="${PV%.*}"
|
||||
LICENSE="|| ( GPL-3 BL )"
|
||||
SLOT="${PV%.*}"
|
||||
IUSE="+bullet +dds +fluid +openexr +tbb \
|
||||
alembic collada +color-management cuda +cycles \
|
||||
debug doc +embree +ffmpeg +fftw +gmp headless jack jemalloc jpeg2k \
|
||||
@@ -94,7 +94,7 @@ RDEPEND="${PYTHON_DEPS}
|
||||
)
|
||||
opensubdiv? ( >=media-libs/opensubdiv-3.4.0 )
|
||||
openvdb? (
|
||||
>=media-gfx/openvdb-9.0.0:=[nanovdb?]
|
||||
<media-gfx/openvdb-11.0.0:=[nanovdb?]
|
||||
dev-libs/c-blosc:=
|
||||
)
|
||||
optix? ( <dev-libs/optix-7.5.0 )
|
||||
|
||||
@@ -23,8 +23,8 @@ else
|
||||
KEYWORDS="amd64 ~arm ~arm64"
|
||||
fi
|
||||
|
||||
SLOT="${PV%.*}"
|
||||
LICENSE="|| ( GPL-3 BL )"
|
||||
SLOT="${PV%.*}"
|
||||
IUSE="+bullet +dds +fluid +openexr +tbb
|
||||
alembic collada +color-management cuda +cycles cycles-bin-kernels
|
||||
debug doc +embree +ffmpeg +fftw +gmp jack jemalloc jpeg2k
|
||||
@@ -89,7 +89,7 @@ RDEPEND="${PYTHON_DEPS}
|
||||
openpgl? ( media-libs/openpgl:0/0.5 )
|
||||
opensubdiv? ( >=media-libs/opensubdiv-3.4.0 )
|
||||
openvdb? (
|
||||
>=media-gfx/openvdb-9.0.0:=[nanovdb?]
|
||||
<media-gfx/openvdb-11.0.0:=[nanovdb?]
|
||||
dev-libs/c-blosc:=
|
||||
)
|
||||
optix? ( <dev-libs/optix-7.5.0 )
|
||||
|
||||
@@ -3,41 +3,50 @@
|
||||
|
||||
EAPI=8
|
||||
|
||||
PYTHON_COMPAT=( python3_{10..11} )
|
||||
PYTHON_COMPAT=( python3_{10..12} )
|
||||
# matches media-libs/osl
|
||||
LLVM_COMPAT=( {15..17} )
|
||||
|
||||
inherit check-reqs cmake cuda flag-o-matic pax-utils python-single-r1 toolchain-funcs xdg-utils
|
||||
inherit check-reqs cmake cuda flag-o-matic llvm-r1 pax-utils python-single-r1 toolchain-funcs xdg-utils
|
||||
|
||||
DESCRIPTION="3D Creation/Animation/Publishing System"
|
||||
HOMEPAGE="https://www.blender.org"
|
||||
|
||||
if [[ ${PV} = *9999* ]] ; then
|
||||
# Subversion is needed for downloading unit test files
|
||||
inherit git-r3 subversion
|
||||
EGIT_LFS="yes"
|
||||
inherit git-r3
|
||||
EGIT_REPO_URI="https://projects.blender.org/blender/blender.git"
|
||||
EGIT_SUBMODULES=( '*' '-lib/*' )
|
||||
ADDONS_EGIT_REPO_URI="https://projects.blender.org/blender/blender-addons.git"
|
||||
RESTRICT="!test? ( test )"
|
||||
else
|
||||
SRC_URI="https://download.blender.org/source/${P}.tar.xz"
|
||||
# Update these between major releases.
|
||||
TEST_TARBALL_VERSION="$(ver_cut 1-2).0"
|
||||
# SRC_URI+=" test? ( https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${PN}-${TEST_TARBALL_VERSION}-tests.tar.xz )"
|
||||
SRC_URI="
|
||||
https://download.blender.org/source/${P}.tar.xz
|
||||
"
|
||||
# test? (
|
||||
# https://projects.blender.org/blender/blender-test-data/archive/blender-v$(ver_cut 1-2)-release.tar.gz
|
||||
# )
|
||||
# "
|
||||
KEYWORDS="~amd64 ~arm ~arm64"
|
||||
RESTRICT="test" # the test archive returns LFS references.
|
||||
fi
|
||||
|
||||
SLOT="${PV%.*}"
|
||||
LICENSE="|| ( GPL-3 BL )"
|
||||
SLOT="${PV%.*}"
|
||||
IUSE="+bullet +fluid +openexr +tbb
|
||||
alembic collada +color-management cuda +cycles cycles-bin-kernels
|
||||
debug doc +embree +ffmpeg +fftw +gmp jack jemalloc jpeg2k
|
||||
debug doc +embree +ffmpeg +fftw +gmp gnome hip jack jemalloc jpeg2k
|
||||
man +nanovdb ndof nls openal +oidn +openmp +openpgl +opensubdiv
|
||||
+openvdb optix osl +pdf +potrace +pugixml pulseaudio sdl
|
||||
+sndfile test +tiff valgrind wayland +webp X"
|
||||
RESTRICT="test"
|
||||
|
||||
REQUIRED_USE="${PYTHON_REQUIRED_USE}
|
||||
alembic? ( openexr )
|
||||
cuda? ( cycles )
|
||||
cycles? ( openexr tiff tbb )
|
||||
fluid? ( tbb )
|
||||
gnome? ( wayland )
|
||||
hip? ( cycles )
|
||||
nanovdb? ( openvdb )
|
||||
openvdb? ( tbb openexr )
|
||||
optix? ( cuda )
|
||||
@@ -45,7 +54,7 @@ REQUIRED_USE="${PYTHON_REQUIRED_USE}
|
||||
test? ( color-management )"
|
||||
|
||||
# Library versions for official builds can be found in the blender source directory in:
|
||||
# build_files/build_environment/install_deps.sh
|
||||
# build_files/build_environment/cmake/versions.cmake
|
||||
RDEPEND="${PYTHON_DEPS}
|
||||
app-arch/zstd
|
||||
dev-libs/boost:=[nls?]
|
||||
@@ -70,10 +79,12 @@ RDEPEND="${PYTHON_DEPS}
|
||||
collada? ( >=media-libs/opencollada-1.6.68 )
|
||||
color-management? ( media-libs/opencolorio:= )
|
||||
cuda? ( dev-util/nvidia-cuda-toolkit:= )
|
||||
embree? ( >=media-libs/embree-3.13.0:=[raymask] )
|
||||
embree? ( media-libs/embree:=[raymask] )
|
||||
ffmpeg? ( media-video/ffmpeg:=[x264,mp3,encode,theora,jpeg2k?,vpx,vorbis,opus,xvid] )
|
||||
fftw? ( sci-libs/fftw:3.0= )
|
||||
gmp? ( dev-libs/gmp )
|
||||
gnome? ( gui-libs/libdecor )
|
||||
hip? ( >=dev-util/hip-5.7:= )
|
||||
jack? ( virtual/jack )
|
||||
jemalloc? ( dev-libs/jemalloc:= )
|
||||
jpeg2k? ( media-libs/openjpeg:2= )
|
||||
@@ -83,7 +94,7 @@ RDEPEND="${PYTHON_DEPS}
|
||||
)
|
||||
nls? ( virtual/libiconv )
|
||||
openal? ( media-libs/openal )
|
||||
oidn? ( >=media-libs/oidn-1.4.0 )
|
||||
oidn? ( >=media-libs/oidn-2.1.0 )
|
||||
openexr? (
|
||||
>=dev-libs/imath-3.1.4-r2:=
|
||||
>=media-libs/openexr-3:0=
|
||||
@@ -94,8 +105,14 @@ RDEPEND="${PYTHON_DEPS}
|
||||
>=media-gfx/openvdb-10.0.0:=[nanovdb?]
|
||||
dev-libs/c-blosc:=
|
||||
)
|
||||
optix? ( <dev-libs/optix-7.5.0 )
|
||||
osl? ( <media-libs/osl-1.13:= )
|
||||
optix? ( dev-libs/optix )
|
||||
osl? (
|
||||
>=media-libs/osl-1.13:=
|
||||
$(llvm_gen_dep '
|
||||
>=media-libs/osl-1.13[llvm_slot_${LLVM_SLOT}]
|
||||
media-libs/mesa[llvm_slot_${LLVM_SLOT}]
|
||||
')
|
||||
)
|
||||
pdf? ( media-libs/libharu )
|
||||
potrace? ( media-gfx/potrace )
|
||||
pugixml? ( dev-libs/pugixml )
|
||||
@@ -139,10 +156,17 @@ BDEPEND="
|
||||
wayland? (
|
||||
dev-util/wayland-scanner
|
||||
)
|
||||
X? (
|
||||
x11-base/xorg-proto
|
||||
)
|
||||
"
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}/${PN}-4.0.1-fix-cflags-cleaner.patch" # to be dropped for releases after Dec 8, 2023
|
||||
"${FILESDIR}/${PN}-4.0.1-openvdb-11.patch"
|
||||
"${FILESDIR}/${PN}-4.0.2-FindClang.patch"
|
||||
"${FILESDIR}/${PN}-4.0.2-CUDA_NVCC_FLAGS.patch"
|
||||
"${FILESDIR}/${PN}-4.0.2-r1-osl-1.13.patch"
|
||||
)
|
||||
|
||||
blender_check_requirements() {
|
||||
@@ -170,35 +194,36 @@ pkg_pretend() {
|
||||
}
|
||||
|
||||
pkg_setup() {
|
||||
if use osl; then
|
||||
llvm-r1_pkg_setup
|
||||
fi
|
||||
|
||||
blender_check_requirements
|
||||
python-single-r1_pkg_setup
|
||||
}
|
||||
|
||||
src_unpack() {
|
||||
if [[ ${PV} = *9999* ]] ; then
|
||||
if ! use test; then
|
||||
EGIT_SUBMODULES+=( '-tests/*' )
|
||||
fi
|
||||
git-r3_src_unpack
|
||||
|
||||
git-r3_fetch "${ADDONS_EGIT_REPO_URI}"
|
||||
git-r3_checkout "${ADDONS_EGIT_REPO_URI}" "${S}/scripts/addons"
|
||||
|
||||
if use test; then
|
||||
TESTS_SVN_URL=https://svn.blender.org/svnroot/bf-blender/trunk/lib/tests
|
||||
subversion_fetch ${TESTS_SVN_URL} ../lib/tests
|
||||
fi
|
||||
ASSETS_SVN_URL=https://svn.blender.org/svnroot/bf-blender/trunk/lib/assets
|
||||
subversion_fetch ${ASSETS_SVN_URL} ../lib/assets
|
||||
else
|
||||
default
|
||||
|
||||
if use test; then
|
||||
#The tests are downloaded from: https://svn.blender.org/svnroot/bf-blender/tags/blender-${SLOT}-release/lib/tests
|
||||
mkdir -p lib || die
|
||||
mv "${WORKDIR}/blender-${TEST_TARBALL_VERSION}-tests/tests" lib || die
|
||||
mkdir -p "${S}/tests/data/" || die
|
||||
mv blender-test-data/* "${S}/tests/data/" || die
|
||||
fi
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
src_prepare() {
|
||||
use cuda && cuda_src_prepare
|
||||
|
||||
cmake_src_prepare
|
||||
|
||||
blender_get_version
|
||||
@@ -221,6 +246,8 @@ src_prepare() {
|
||||
-e "s|Icon=blender|Icon=blender-${BV}|" \
|
||||
-i release/freedesktop/blender.desktop || die
|
||||
|
||||
sed -e "s|\${CMAKE_INSTALL_PREFIX}/\${BLENDER_BIN}|${T}/usr/\${BLENDER_BIN}|g" -i source/creator/CMakeLists.txt || die
|
||||
|
||||
mv \
|
||||
release/freedesktop/icons/scalable/apps/blender.svg \
|
||||
"release/freedesktop/icons/scalable/apps/blender-${BV}.svg" || die
|
||||
@@ -232,7 +259,7 @@ src_prepare() {
|
||||
if use test; then
|
||||
# Without this the tests will try to use /usr/bin/blender and /usr/share/blender/ to run the tests.
|
||||
sed -e "s|set(TEST_INSTALL_DIR.*|set(TEST_INSTALL_DIR ${T}/usr)|g" -i tests/CMakeLists.txt || die
|
||||
sed -e "s|string(REPLACE.*|set(TEST_INSTALL_DIR ${T}/usr)|g" -i build_files/cmake/Modules/GTestTesting.cmake || die
|
||||
sed -e "s|string(REPLACE.*|set(TEST_INSTALL_DIR ${T}/usr)|g" -i build_files/cmake/testing.cmake || die
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -257,17 +284,16 @@ src_configure() {
|
||||
-DWITH_ALEMBIC=$(usex alembic)
|
||||
-DWITH_BOOST=yes
|
||||
-DWITH_BULLET=$(usex bullet)
|
||||
-DWITH_CLANG=$(usex osl)
|
||||
-DWITH_CODEC_FFMPEG=$(usex ffmpeg)
|
||||
-DWITH_CODEC_SNDFILE=$(usex sndfile)
|
||||
-DWITH_CYCLES=$(usex cycles)
|
||||
-DWITH_CYCLES_CUDA_BINARIES=$(usex cuda $(usex cycles-bin-kernels))
|
||||
-DWITH_CYCLES_DEVICE_ONEAPI=no
|
||||
-DWITH_CYCLES_DEVICE_CUDA=$(usex cuda)
|
||||
-DWITH_CYCLES_DEVICE_HIP=no
|
||||
-DWITH_CYCLES_DEVICE_HIP=$(usex hip)
|
||||
-DWITH_CYCLES_DEVICE_OPTIX=$(usex optix)
|
||||
-DWITH_CYCLES_EMBREE=$(usex embree)
|
||||
-DWITH_CYCLES_HIP_BINARIES=no
|
||||
-DWITH_CYCLES_HIP_BINARIES=$(usex hip $(usex cycles-bin-kernels))
|
||||
-DWITH_CYCLES_ONEAPI_BINARIES=no
|
||||
-DWITH_CYCLES_OSL=$(usex osl)
|
||||
-DWITH_CYCLES_PATH_GUIDING=$(usex openpgl)
|
||||
@@ -279,7 +305,7 @@ src_configure() {
|
||||
-DWITH_GHOST_WAYLAND_APP_ID="blender-${BV}"
|
||||
-DWITH_GHOST_WAYLAND_DBUS=$(usex wayland)
|
||||
-DWITH_GHOST_WAYLAND_DYNLOAD=no
|
||||
-DWITH_GHOST_WAYLAND_LIBDECOR=no
|
||||
-DWITH_GHOST_WAYLAND_LIBDECOR="$(usex gnome)"
|
||||
-DWITH_GHOST_X11=$(usex X)
|
||||
-DWITH_GMP=$(usex gmp)
|
||||
-DWITH_GTESTS=$(usex test)
|
||||
@@ -292,7 +318,6 @@ src_configure() {
|
||||
-DWITH_INPUT_NDOF=$(usex ndof)
|
||||
-DWITH_INTERNATIONAL=$(usex nls)
|
||||
-DWITH_JACK=$(usex jack)
|
||||
-DWITH_LLVM=$(usex osl)
|
||||
-DWITH_MATERIALX=no
|
||||
-DWITH_MEM_JEMALLOC=$(usex jemalloc)
|
||||
-DWITH_MEM_VALGRIND=$(usex valgrind)
|
||||
@@ -328,6 +353,12 @@ src_configure() {
|
||||
-DWITH_XR_OPENXR=no
|
||||
)
|
||||
|
||||
if use cuda; then
|
||||
mycmakeargs+=(
|
||||
-DCUDA_NVCC_FLAGS="--compiler-bindir;$(cuda_gccdir)"
|
||||
)
|
||||
fi
|
||||
|
||||
if use optix; then
|
||||
mycmakeargs+=(
|
||||
-DCYCLES_RUNTIME_OPTIX_ROOT_DIR="${EPREFIX}"/opt/optix
|
||||
@@ -338,8 +369,8 @@ src_configure() {
|
||||
# This is currently needed on arm64 to get the NEON SIMD wrapper to compile the code successfully
|
||||
use arm64 && append-flags -flax-vector-conversions
|
||||
|
||||
append-cflags $(usex debug '-DDEBUG' '-DNDEBUG')
|
||||
append-cppflags $(usex debug '-DDEBUG' '-DNDEBUG')
|
||||
append-cflags "$(usex debug '-DDEBUG' '-DNDEBUG')"
|
||||
append-cppflags "$(usex debug '-DDEBUG' '-DNDEBUG')"
|
||||
|
||||
if tc-is-gcc ; then
|
||||
# These options only exist when GCC is detected.
|
||||
@@ -352,18 +383,25 @@ src_configure() {
|
||||
use cuda && use cycles-bin-kernels && mycmakeargs+=( -DCUDA_HOST_COMPILER="$(cuda_gccdir)" )
|
||||
fi
|
||||
|
||||
if tc-is-clang || use osl; then
|
||||
mycmakeargs+=(
|
||||
-DWITH_CLANG=yes
|
||||
-DWITH_LLVM=yes
|
||||
)
|
||||
fi
|
||||
|
||||
if use test ; then
|
||||
local CYCLES_TEST_DEVICES=( "CPU" )
|
||||
if use cycles-bin-kernels; then
|
||||
use cuda && CYCLES_TEST_DEVICES+=( "CUDA" )
|
||||
use optix && CYCLES_TEST_DEVICES+=( "OPTIX" )
|
||||
use hip && CYCLES_TEST_DEVICES+=( "HIP" )
|
||||
fi
|
||||
mycmakeargs+=(
|
||||
-DCYCLES_TEST_DEVICES:STRING="$(local IFS=";"; echo "${CYCLES_TEST_DEVICES[*]}")"
|
||||
-DWITH_COMPOSITOR_REALTIME_TESTS=yes
|
||||
-DWITH_GTESTS=yes
|
||||
-DWITH_OPENGL_DRAW_TESTS=yes
|
||||
-DWITH_OPENGL_RENDER_TESTS=yes
|
||||
-DWITH_GPU_DRAW_TESTS=yes
|
||||
-DWITH_GPU_RENDER_TESTS=yes
|
||||
)
|
||||
fi
|
||||
|
||||
@@ -373,7 +411,7 @@ src_configure() {
|
||||
src_test() {
|
||||
# A lot of tests needs to have access to the installed data files.
|
||||
# So install them into the image directory now.
|
||||
DESTDIR="${T}" cmake_build install "$@"
|
||||
DESTDIR="${T}" cmake_build install
|
||||
|
||||
blender_get_version
|
||||
# Define custom blender data/script file paths not be able to find them otherwise during testing.
|
||||
@@ -386,10 +424,20 @@ src_test() {
|
||||
[ -d "$BLENDER_SYSTEM_SCRIPTS" ] || die "The custom script path is invalid, fix the ebuild!"
|
||||
[ -d "$BLENDER_SYSTEM_DATAFILES" ] || die "The custom datafiles path is invalid, fix the ebuild!"
|
||||
|
||||
if use cuda; then
|
||||
cuda_add_sandbox -w
|
||||
addwrite "/dev/dri/renderD128"
|
||||
addwrite "/dev/char/"
|
||||
fi
|
||||
|
||||
if use X; then
|
||||
xdg_environment_reset
|
||||
fi
|
||||
|
||||
cmake_src_test
|
||||
|
||||
# Clean up the image directory for src_install
|
||||
rm -fr "${T}"/usr || die
|
||||
rm -fr "${T}/usr" || die
|
||||
}
|
||||
|
||||
src_install() {
|
||||
@@ -4,8 +4,10 @@
|
||||
EAPI=8
|
||||
|
||||
PYTHON_COMPAT=( python3_{11..12} )
|
||||
# matches media-libs/osl
|
||||
LLVM_COMPAT=( {15..17} )
|
||||
|
||||
inherit check-reqs cmake cuda flag-o-matic pax-utils python-single-r1 toolchain-funcs xdg-utils
|
||||
inherit check-reqs cmake cuda flag-o-matic llvm-r1 pax-utils python-single-r1 toolchain-funcs xdg-utils
|
||||
|
||||
DESCRIPTION="3D Creation/Animation/Publishing System"
|
||||
HOMEPAGE="https://www.blender.org"
|
||||
@@ -14,30 +16,36 @@ if [[ ${PV} = *9999* ]] ; then
|
||||
EGIT_LFS="yes"
|
||||
inherit git-r3
|
||||
EGIT_REPO_URI="https://projects.blender.org/blender/blender.git"
|
||||
EGIT_SUBMODULES=( '*' '-lib/*' )
|
||||
ADDONS_EGIT_REPO_URI="https://projects.blender.org/blender/blender-addons.git"
|
||||
RESTRICT="!test? ( test )"
|
||||
else
|
||||
SRC_URI="https://download.blender.org/source/${P}.tar.xz"
|
||||
# Update these between major releases.
|
||||
TEST_TARBALL_VERSION="$(ver_cut 1-2).0"
|
||||
SRC_URI+=" test? ( https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${PN}-${TEST_TARBALL_VERSION}-tests.tar.xz )"
|
||||
SRC_URI="
|
||||
https://download.blender.org/source/${P}.tar.xz
|
||||
"
|
||||
# test? (
|
||||
# https://projects.blender.org/blender/blender-test-data/archive/blender-v$(ver_cut 1-2)-release.tar.gz
|
||||
# )
|
||||
# "
|
||||
KEYWORDS="~amd64 ~arm ~arm64"
|
||||
RESTRICT="test" # the test archive returns LFS references.
|
||||
fi
|
||||
|
||||
SLOT="${PV%.*}"
|
||||
LICENSE="|| ( GPL-3 BL )"
|
||||
SLOT="${PV%.*}"
|
||||
IUSE="+bullet +fluid +openexr +tbb
|
||||
alembic collada +color-management cuda +cycles cycles-bin-kernels
|
||||
debug doc +embree +ffmpeg +fftw +gmp hip jack jemalloc jpeg2k
|
||||
debug doc +embree +ffmpeg +fftw +gmp gnome hip jack jemalloc jpeg2k
|
||||
man +nanovdb ndof nls openal +oidn +openmp +openpgl +opensubdiv
|
||||
+openvdb optix osl +pdf +potrace +pugixml pulseaudio sdl
|
||||
+sndfile test +tiff valgrind wayland +webp X"
|
||||
RESTRICT="!test? ( test )"
|
||||
|
||||
REQUIRED_USE="${PYTHON_REQUIRED_USE}
|
||||
alembic? ( openexr )
|
||||
cuda? ( cycles )
|
||||
cycles? ( openexr tiff tbb )
|
||||
fluid? ( tbb )
|
||||
gnome? ( wayland )
|
||||
hip? ( cycles )
|
||||
nanovdb? ( openvdb )
|
||||
openvdb? ( tbb openexr )
|
||||
@@ -62,7 +70,7 @@ RDEPEND="${PYTHON_DEPS}
|
||||
media-libs/libjpeg-turbo:=
|
||||
media-libs/libpng:=
|
||||
media-libs/libsamplerate
|
||||
>=media-libs/openimageio-2.4.6.0:=
|
||||
>=media-libs/openimageio-2.5.6.0:=
|
||||
sys-libs/zlib:=
|
||||
virtual/glu
|
||||
virtual/libintl
|
||||
@@ -71,11 +79,12 @@ RDEPEND="${PYTHON_DEPS}
|
||||
collada? ( >=media-libs/opencollada-1.6.68 )
|
||||
color-management? ( media-libs/opencolorio:= )
|
||||
cuda? ( dev-util/nvidia-cuda-toolkit:= )
|
||||
embree? ( >=media-libs/embree-3.13.0:=[raymask] )
|
||||
embree? ( media-libs/embree:=[raymask] )
|
||||
ffmpeg? ( media-video/ffmpeg:=[x264,mp3,encode,theora,jpeg2k?,vpx,vorbis,opus,xvid] )
|
||||
fftw? ( sci-libs/fftw:3.0= )
|
||||
gmp? ( dev-libs/gmp )
|
||||
hip? ( >=dev-util/hip-5.7.1 )
|
||||
gnome? ( gui-libs/libdecor )
|
||||
hip? ( >=dev-util/hip-5.7:= )
|
||||
jack? ( virtual/jack )
|
||||
jemalloc? ( dev-libs/jemalloc:= )
|
||||
jpeg2k? ( media-libs/openjpeg:2= )
|
||||
@@ -87,17 +96,23 @@ RDEPEND="${PYTHON_DEPS}
|
||||
openal? ( media-libs/openal )
|
||||
oidn? ( >=media-libs/oidn-2.1.0 )
|
||||
openexr? (
|
||||
>=dev-libs/imath-3.1.4-r2:=
|
||||
>=media-libs/openexr-3:0=
|
||||
>=dev-libs/imath-3.1.7:=
|
||||
>=media-libs/openexr-3.2.1:0=
|
||||
)
|
||||
openpgl? ( media-libs/openpgl:= )
|
||||
opensubdiv? ( >=media-libs/opensubdiv-3.5.0 )
|
||||
openvdb? (
|
||||
>=media-gfx/openvdb-10.1.0:=[nanovdb?]
|
||||
>=media-gfx/openvdb-11:=[nanovdb?]
|
||||
dev-libs/c-blosc:=
|
||||
)
|
||||
optix? ( <dev-libs/optix-7.5.0 )
|
||||
osl? ( media-libs/osl:= )
|
||||
optix? ( dev-libs/optix )
|
||||
osl? (
|
||||
>=media-libs/osl-1.13:=
|
||||
$(llvm_gen_dep '
|
||||
>=media-libs/osl-1.13[llvm_slot_${LLVM_SLOT}]
|
||||
media-libs/mesa[llvm_slot_${LLVM_SLOT}]
|
||||
')
|
||||
)
|
||||
pdf? ( media-libs/libharu )
|
||||
potrace? ( media-gfx/potrace )
|
||||
pugixml? ( dev-libs/pugixml )
|
||||
@@ -141,10 +156,14 @@ BDEPEND="
|
||||
wayland? (
|
||||
dev-util/wayland-scanner
|
||||
)
|
||||
X? (
|
||||
x11-base/xorg-proto
|
||||
)
|
||||
"
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}/${PN}-4.0.1-openvdb-11.patch"
|
||||
"${FILESDIR}/${PN}-4.0.2-FindClang.patch"
|
||||
"${FILESDIR}/${PN}-4.0.2-CUDA_NVCC_FLAGS.patch"
|
||||
)
|
||||
|
||||
blender_check_requirements() {
|
||||
@@ -172,32 +191,36 @@ pkg_pretend() {
|
||||
}
|
||||
|
||||
pkg_setup() {
|
||||
if use osl; then
|
||||
llvm-r1_pkg_setup
|
||||
fi
|
||||
|
||||
blender_check_requirements
|
||||
python-single-r1_pkg_setup
|
||||
}
|
||||
|
||||
src_unpack() {
|
||||
if [[ ${PV} = *9999* ]] ; then
|
||||
if ! use test; then
|
||||
EGIT_SUBMODULES+=( '-tests/*' )
|
||||
fi
|
||||
git-r3_src_unpack
|
||||
|
||||
git-r3_fetch "${ADDONS_EGIT_REPO_URI}"
|
||||
git-r3_checkout "${ADDONS_EGIT_REPO_URI}" "${S}/scripts/addons"
|
||||
# TODO
|
||||
#if use test; then
|
||||
|
||||
#fi
|
||||
else
|
||||
default
|
||||
|
||||
if use test; then
|
||||
#The tests are downloaded from: https://svn.blender.org/svnroot/bf-blender/tags/blender-${SLOT}-release/lib/tests
|
||||
mkdir -p lib || die
|
||||
mv "${WORKDIR}/blender-${TEST_TARBALL_VERSION}-tests/tests" lib || die
|
||||
mkdir -p "${S}/tests/data/" || die
|
||||
mv blender-test-data/* "${S}/tests/data/" || die
|
||||
fi
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
src_prepare() {
|
||||
use cuda && cuda_src_prepare
|
||||
|
||||
cmake_src_prepare
|
||||
|
||||
blender_get_version
|
||||
@@ -220,6 +243,8 @@ src_prepare() {
|
||||
-e "s|Icon=blender|Icon=blender-${BV}|" \
|
||||
-i release/freedesktop/blender.desktop || die
|
||||
|
||||
sed -e "s|\${CMAKE_INSTALL_PREFIX}/\${BLENDER_BIN}|${T}/usr/\${BLENDER_BIN}|g" -i source/creator/CMakeLists.txt || die
|
||||
|
||||
mv \
|
||||
release/freedesktop/icons/scalable/apps/blender.svg \
|
||||
"release/freedesktop/icons/scalable/apps/blender-${BV}.svg" || die
|
||||
@@ -256,7 +281,6 @@ src_configure() {
|
||||
-DWITH_ALEMBIC=$(usex alembic)
|
||||
-DWITH_BOOST=yes
|
||||
-DWITH_BULLET=$(usex bullet)
|
||||
-DWITH_CLANG=$(usex osl)
|
||||
-DWITH_CODEC_FFMPEG=$(usex ffmpeg)
|
||||
-DWITH_CODEC_SNDFILE=$(usex sndfile)
|
||||
-DWITH_CPU_CHECK=no
|
||||
@@ -278,7 +302,7 @@ src_configure() {
|
||||
-DWITH_GHOST_WAYLAND=$(usex wayland)
|
||||
-DWITH_GHOST_WAYLAND_APP_ID="blender-${BV}"
|
||||
-DWITH_GHOST_WAYLAND_DYNLOAD=no
|
||||
-DWITH_GHOST_WAYLAND_LIBDECOR=no
|
||||
-DWITH_GHOST_WAYLAND_LIBDECOR="$(usex gnome)"
|
||||
-DWITH_GHOST_X11=$(usex X)
|
||||
-DWITH_GMP=$(usex gmp)
|
||||
-DWITH_GTESTS=$(usex test)
|
||||
@@ -291,7 +315,6 @@ src_configure() {
|
||||
-DWITH_INPUT_NDOF=$(usex ndof)
|
||||
-DWITH_INTERNATIONAL=$(usex nls)
|
||||
-DWITH_JACK=$(usex jack)
|
||||
-DWITH_LLVM=$(usex osl)
|
||||
-DWITH_MATERIALX=no
|
||||
-DWITH_MEM_JEMALLOC=$(usex jemalloc)
|
||||
-DWITH_MEM_VALGRIND=$(usex valgrind)
|
||||
@@ -327,6 +350,12 @@ src_configure() {
|
||||
-DWITH_XR_OPENXR=no
|
||||
)
|
||||
|
||||
if use cuda; then
|
||||
mycmakeargs+=(
|
||||
-DCUDA_NVCC_FLAGS="--compiler-bindir;$(cuda_gccdir)"
|
||||
)
|
||||
fi
|
||||
|
||||
if use optix; then
|
||||
mycmakeargs+=(
|
||||
-DCYCLES_RUNTIME_OPTIX_ROOT_DIR="${EPREFIX}"/opt/optix
|
||||
@@ -337,8 +366,8 @@ src_configure() {
|
||||
# This is currently needed on arm64 to get the NEON SIMD wrapper to compile the code successfully
|
||||
use arm64 && append-flags -flax-vector-conversions
|
||||
|
||||
append-cflags $(usex debug '-DDEBUG' '-DNDEBUG')
|
||||
append-cppflags $(usex debug '-DDEBUG' '-DNDEBUG')
|
||||
append-cflags "$(usex debug '-DDEBUG' '-DNDEBUG')"
|
||||
append-cppflags "$(usex debug '-DDEBUG' '-DNDEBUG')"
|
||||
|
||||
if tc-is-gcc ; then
|
||||
# These options only exist when GCC is detected.
|
||||
@@ -351,6 +380,13 @@ src_configure() {
|
||||
use cuda && use cycles-bin-kernels && mycmakeargs+=( -DCUDA_HOST_COMPILER="$(cuda_gccdir)" )
|
||||
fi
|
||||
|
||||
if tc-is-clang || use osl; then
|
||||
mycmakeargs+=(
|
||||
-DWITH_CLANG=yes
|
||||
-DWITH_LLVM=yes
|
||||
)
|
||||
fi
|
||||
|
||||
if use test ; then
|
||||
local CYCLES_TEST_DEVICES=( "CPU" )
|
||||
if use cycles-bin-kernels; then
|
||||
@@ -361,9 +397,8 @@ src_configure() {
|
||||
mycmakeargs+=(
|
||||
-DCYCLES_TEST_DEVICES:STRING="$(local IFS=";"; echo "${CYCLES_TEST_DEVICES[*]}")"
|
||||
-DWITH_COMPOSITOR_REALTIME_TESTS=yes
|
||||
-DWITH_GTESTS=yes
|
||||
-DWITH_OPENGL_DRAW_TESTS=yes
|
||||
-DWITH_OPENGL_RENDER_TESTS=yes
|
||||
-DWITH_GPU_DRAW_TESTS=yes
|
||||
-DWITH_GPU_RENDER_TESTS=yes
|
||||
)
|
||||
fi
|
||||
|
||||
@@ -373,7 +408,7 @@ src_configure() {
|
||||
src_test() {
|
||||
# A lot of tests needs to have access to the installed data files.
|
||||
# So install them into the image directory now.
|
||||
DESTDIR="${T}" cmake_build install "$@"
|
||||
DESTDIR="${T}" cmake_build install
|
||||
|
||||
blender_get_version
|
||||
# Define custom blender data/script file paths not be able to find them otherwise during testing.
|
||||
@@ -386,10 +421,20 @@ src_test() {
|
||||
[ -d "$BLENDER_SYSTEM_SCRIPTS" ] || die "The custom script path is invalid, fix the ebuild!"
|
||||
[ -d "$BLENDER_SYSTEM_DATAFILES" ] || die "The custom datafiles path is invalid, fix the ebuild!"
|
||||
|
||||
if use cuda; then
|
||||
cuda_add_sandbox -w
|
||||
addwrite "/dev/dri/renderD128"
|
||||
addwrite "/dev/char/"
|
||||
fi
|
||||
|
||||
if use X; then
|
||||
xdg_environment_reset
|
||||
fi
|
||||
|
||||
cmake_src_test
|
||||
|
||||
# Clean up the image directory for src_install
|
||||
rm -fr "${T}"/usr || die
|
||||
rm -fr "${T}/usr" || die
|
||||
}
|
||||
|
||||
src_install() {
|
||||
@@ -465,11 +510,11 @@ pkg_postinst() {
|
||||
ewarn ""
|
||||
fi
|
||||
|
||||
if ! use python_single_target_python3_10; then
|
||||
if ! use python_single_target_python3_11; then
|
||||
elog "You are building Blender with a newer python version than"
|
||||
elog "supported by this version upstream."
|
||||
elog "If you experience breakages with e.g. plugins, please switch to"
|
||||
elog "python_single_target_python3_10 instead."
|
||||
elog "python_single_target_python3_11 instead."
|
||||
elog "Bug: https://bugs.gentoo.org/737388"
|
||||
elog
|
||||
fi
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
From: Paul Zander <negril.nx+gentoo@gmail.com>
|
||||
Change lookup for OpenVDB-11
|
||||
--- a/intern/cycles/scene/image_vdb.cpp 2023-11-23 14:42:38.772685628 +0100
|
||||
+++ b/intern/cycles/scene/image_vdb.cpp 2023-11-23 15:19:55.475804922 +0100
|
||||
@@ -11,7 +11,14 @@
|
||||
|
||||
14
media-gfx/blender/files/blender-4.0.2-CUDA_NVCC_FLAGS.patch
Normal file
14
media-gfx/blender/files/blender-4.0.2-CUDA_NVCC_FLAGS.patch
Normal file
@@ -0,0 +1,14 @@
|
||||
From: Paul Zander <negril.nx+gentoo@gmail.com>
|
||||
insert CUDA_NVCC_FLAGS into the custom nvcc call so we can use CUDAHOSTCXX, e.g. a different gcc version for cuda code
|
||||
diff --git a/intern/cycles/kernel/CMakeLists.txt b/intern/cycles/kernel/CMakeLists.txt
|
||||
index 604ccb8..160ee20 100644
|
||||
--- a/intern/cycles/kernel/CMakeLists.txt
|
||||
+++ b/intern/cycles/kernel/CMakeLists.txt
|
||||
@@ -752,6 +752,7 @@ if(WITH_CYCLES_DEVICE_OPTIX AND WITH_CYCLES_CUDA_BINARIES)
|
||||
-I "${CMAKE_CURRENT_SOURCE_DIR}/device/cuda"
|
||||
--use_fast_math
|
||||
-Wno-deprecated-gpu-targets
|
||||
+ ${CUDA_NVCC_FLAGS}
|
||||
-o ${output})
|
||||
|
||||
if(WITH_NANOVDB)
|
||||
14
media-gfx/blender/files/blender-4.0.2-FindClang.patch
Normal file
14
media-gfx/blender/files/blender-4.0.2-FindClang.patch
Normal file
@@ -0,0 +1,14 @@
|
||||
From: Paul Zander <negril.nx+gentoo@gmail.com>
|
||||
look for the merged clang library so we can find clang
|
||||
diff --git a/build_files/cmake/Modules/FindClang.cmake b/build_files/cmake/Modules/FindClang.cmake
|
||||
index 1957c63..5620b84 100644
|
||||
--- a/build_files/cmake/Modules/FindClang.cmake
|
||||
+++ b/build_files/cmake/Modules/FindClang.cmake
|
||||
@@ -85,6 +85,7 @@ set(_CLANG_FIND_COMPONENTS
|
||||
clangAST
|
||||
clangLex
|
||||
clangBasic
|
||||
+ clang-cpp
|
||||
)
|
||||
|
||||
set(_CLANG_LIBRARIES)
|
||||
342
media-gfx/blender/files/blender-4.0.2-r1-osl-1.13.patch
Normal file
342
media-gfx/blender/files/blender-4.0.2-r1-osl-1.13.patch
Normal file
@@ -0,0 +1,342 @@
|
||||
From 798a0b301e640e73ae12e6f8a36a66746893bff1 Mon Sep 17 00:00:00 2001
|
||||
From: Brecht Van Lommel <brecht@blender.org>
|
||||
Date: Sun, 10 Dec 2023 17:08:47 +0100
|
||||
Subject: [PATCH] Cycles: update OSL to work with version 1.13.5
|
||||
|
||||
This keeps compatibility with older stable versions, but not
|
||||
older unreleased versions in the 1.13.x series.
|
||||
|
||||
Ref #113157
|
||||
|
||||
Pull Request: https://projects.blender.org/blender/blender/pulls/116004
|
||||
---
|
||||
intern/cycles/device/cpu/device_impl.cpp | 2 +-
|
||||
.../device/cpu/kernel_thread_globals.cpp | 6 ++-
|
||||
.../cycles/device/cpu/kernel_thread_globals.h | 3 +-
|
||||
intern/cycles/kernel/device/cpu/globals.h | 1 +
|
||||
intern/cycles/kernel/osl/closures.cpp | 52 ++++++++++++++++++-
|
||||
intern/cycles/kernel/osl/globals.cpp | 3 +-
|
||||
intern/cycles/kernel/osl/globals.h | 4 +-
|
||||
intern/cycles/kernel/osl/osl.h | 5 ++
|
||||
intern/cycles/kernel/osl/services.cpp | 27 ++++++++--
|
||||
intern/cycles/kernel/osl/services.h | 21 +++++++-
|
||||
intern/cycles/kernel/osl/types.h | 4 +-
|
||||
11 files changed, 115 insertions(+), 13 deletions(-)
|
||||
|
||||
diff --git a/intern/cycles/device/cpu/device_impl.cpp b/intern/cycles/device/cpu/device_impl.cpp
|
||||
index cbbdb844323..ba838233855 100644
|
||||
--- a/intern/cycles/device/cpu/device_impl.cpp
|
||||
+++ b/intern/cycles/device/cpu/device_impl.cpp
|
||||
@@ -313,7 +313,7 @@ void CPUDevice::get_cpu_kernel_thread_globals(
|
||||
kernel_thread_globals.clear();
|
||||
void *osl_memory = get_cpu_osl_memory();
|
||||
for (int i = 0; i < info.cpu_threads; i++) {
|
||||
- kernel_thread_globals.emplace_back(kernel_globals, osl_memory, profiler);
|
||||
+ kernel_thread_globals.emplace_back(kernel_globals, osl_memory, profiler, i);
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/intern/cycles/device/cpu/kernel_thread_globals.cpp b/intern/cycles/device/cpu/kernel_thread_globals.cpp
|
||||
index 546061a5086..998a63aa334 100644
|
||||
--- a/intern/cycles/device/cpu/kernel_thread_globals.cpp
|
||||
+++ b/intern/cycles/device/cpu/kernel_thread_globals.cpp
|
||||
@@ -12,14 +12,16 @@ CCL_NAMESPACE_BEGIN
|
||||
|
||||
CPUKernelThreadGlobals::CPUKernelThreadGlobals(const KernelGlobalsCPU &kernel_globals,
|
||||
void *osl_globals_memory,
|
||||
- Profiler &cpu_profiler)
|
||||
+ Profiler &cpu_profiler,
|
||||
+ const int thread_index)
|
||||
: KernelGlobalsCPU(kernel_globals), cpu_profiler_(cpu_profiler)
|
||||
{
|
||||
clear_runtime_pointers();
|
||||
|
||||
#ifdef WITH_OSL
|
||||
- OSLGlobals::thread_init(this, static_cast<OSLGlobals *>(osl_globals_memory));
|
||||
+ OSLGlobals::thread_init(this, static_cast<OSLGlobals *>(osl_globals_memory), thread_index);
|
||||
#else
|
||||
+ (void)thread_index;
|
||||
(void)osl_globals_memory;
|
||||
#endif
|
||||
|
||||
diff --git a/intern/cycles/device/cpu/kernel_thread_globals.h b/intern/cycles/device/cpu/kernel_thread_globals.h
|
||||
index dc4b693702a..3dbc35fefa3 100644
|
||||
--- a/intern/cycles/device/cpu/kernel_thread_globals.h
|
||||
+++ b/intern/cycles/device/cpu/kernel_thread_globals.h
|
||||
@@ -23,7 +23,8 @@ class CPUKernelThreadGlobals : public KernelGlobalsCPU {
|
||||
* without OSL support. Will avoid need to those unnamed pointers and casts. */
|
||||
CPUKernelThreadGlobals(const KernelGlobalsCPU &kernel_globals,
|
||||
void *osl_globals_memory,
|
||||
- Profiler &cpu_profiler);
|
||||
+ Profiler &cpu_profiler,
|
||||
+ const int thread_index);
|
||||
|
||||
~CPUKernelThreadGlobals();
|
||||
|
||||
diff --git a/intern/cycles/kernel/device/cpu/globals.h b/intern/cycles/kernel/device/cpu/globals.h
|
||||
index 90a274b2bcf..d0495883e27 100644
|
||||
--- a/intern/cycles/kernel/device/cpu/globals.h
|
||||
+++ b/intern/cycles/kernel/device/cpu/globals.h
|
||||
@@ -49,6 +49,7 @@ typedef struct KernelGlobalsCPU {
|
||||
OSLGlobals *osl = nullptr;
|
||||
OSLShadingSystem *osl_ss = nullptr;
|
||||
OSLThreadData *osl_tdata = nullptr;
|
||||
+ int osl_thread_index = 0;
|
||||
#endif
|
||||
|
||||
#ifdef __PATH_GUIDING__
|
||||
diff --git a/intern/cycles/kernel/osl/closures.cpp b/intern/cycles/kernel/osl/closures.cpp
|
||||
index 808e13f48d6..4a5906873af 100644
|
||||
--- a/intern/cycles/kernel/osl/closures.cpp
|
||||
+++ b/intern/cycles/kernel/osl/closures.cpp
|
||||
@@ -110,7 +110,17 @@ void osl_eval_nodes<SHADER_TYPE_SURFACE>(const KernelGlobalsCPU *kg,
|
||||
if (sd->object == OBJECT_NONE && sd->lamp == LAMP_NONE) {
|
||||
/* background */
|
||||
if (kg->osl->background_state) {
|
||||
+#if OSL_LIBRARY_VERSION_CODE >= 11304
|
||||
+ ss->execute(*octx,
|
||||
+ *(kg->osl->background_state),
|
||||
+ kg->osl_thread_index,
|
||||
+ 0,
|
||||
+ *globals,
|
||||
+ nullptr,
|
||||
+ nullptr);
|
||||
+#else
|
||||
ss->execute(octx, *(kg->osl->background_state), *globals);
|
||||
+#endif
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -150,8 +160,18 @@ void osl_eval_nodes<SHADER_TYPE_SURFACE>(const KernelGlobalsCPU *kg,
|
||||
globals->dPdy = TO_VEC3(tmp_dP.dy);
|
||||
}
|
||||
|
||||
- /* execute bump shader */
|
||||
+/* execute bump shader */
|
||||
+#if OSL_LIBRARY_VERSION_CODE >= 11304
|
||||
+ ss->execute(*octx,
|
||||
+ *(kg->osl->bump_state[shader]),
|
||||
+ kg->osl_thread_index,
|
||||
+ 0,
|
||||
+ *globals,
|
||||
+ nullptr,
|
||||
+ nullptr);
|
||||
+#else
|
||||
ss->execute(octx, *(kg->osl->bump_state[shader]), *globals);
|
||||
+#endif
|
||||
|
||||
/* reset state */
|
||||
sd->P = P;
|
||||
@@ -164,7 +184,17 @@ void osl_eval_nodes<SHADER_TYPE_SURFACE>(const KernelGlobalsCPU *kg,
|
||||
|
||||
/* surface shader */
|
||||
if (kg->osl->surface_state[shader]) {
|
||||
+#if OSL_LIBRARY_VERSION_CODE >= 11304
|
||||
+ ss->execute(*octx,
|
||||
+ *(kg->osl->surface_state[shader]),
|
||||
+ kg->osl_thread_index,
|
||||
+ 0,
|
||||
+ *globals,
|
||||
+ nullptr,
|
||||
+ nullptr);
|
||||
+#else
|
||||
ss->execute(octx, *(kg->osl->surface_state[shader]), *globals);
|
||||
+#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -208,7 +238,17 @@ void osl_eval_nodes<SHADER_TYPE_VOLUME>(const KernelGlobalsCPU *kg,
|
||||
int shader = sd->shader & SHADER_MASK;
|
||||
|
||||
if (kg->osl->volume_state[shader]) {
|
||||
+#if OSL_LIBRARY_VERSION_CODE >= 11304
|
||||
+ ss->execute(*octx,
|
||||
+ *(kg->osl->volume_state[shader]),
|
||||
+ kg->osl_thread_index,
|
||||
+ 0,
|
||||
+ *globals,
|
||||
+ nullptr,
|
||||
+ nullptr);
|
||||
+#else
|
||||
ss->execute(octx, *(kg->osl->volume_state[shader]), *globals);
|
||||
+#endif
|
||||
}
|
||||
|
||||
/* flatten closure tree */
|
||||
@@ -245,7 +285,17 @@ void osl_eval_nodes<SHADER_TYPE_DISPLACEMENT>(const KernelGlobalsCPU *kg,
|
||||
int shader = sd->shader & SHADER_MASK;
|
||||
|
||||
if (kg->osl->displacement_state[shader]) {
|
||||
+#if OSL_LIBRARY_VERSION_CODE >= 11304
|
||||
+ ss->execute(*octx,
|
||||
+ *(kg->osl->displacement_state[shader]),
|
||||
+ kg->osl_thread_index,
|
||||
+ 0,
|
||||
+ *globals,
|
||||
+ nullptr,
|
||||
+ nullptr);
|
||||
+#else
|
||||
ss->execute(octx, *(kg->osl->displacement_state[shader]), *globals);
|
||||
+#endif
|
||||
}
|
||||
|
||||
/* get back position */
|
||||
diff --git a/intern/cycles/kernel/osl/globals.cpp b/intern/cycles/kernel/osl/globals.cpp
|
||||
index c4f055af7f7..573ddb6f362 100644
|
||||
--- a/intern/cycles/kernel/osl/globals.cpp
|
||||
+++ b/intern/cycles/kernel/osl/globals.cpp
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
CCL_NAMESPACE_BEGIN
|
||||
|
||||
-void OSLGlobals::thread_init(KernelGlobalsCPU *kg, OSLGlobals *osl_globals)
|
||||
+void OSLGlobals::thread_init(KernelGlobalsCPU *kg, OSLGlobals *osl_globals, const int thread_index)
|
||||
{
|
||||
/* no osl used? */
|
||||
if (!osl_globals->use) {
|
||||
@@ -37,6 +37,7 @@ void OSLGlobals::thread_init(KernelGlobalsCPU *kg, OSLGlobals *osl_globals)
|
||||
|
||||
kg->osl_ss = (OSLShadingSystem *)ss;
|
||||
kg->osl_tdata = tdata;
|
||||
+ kg->osl_thread_index = thread_index;
|
||||
}
|
||||
|
||||
void OSLGlobals::thread_free(KernelGlobalsCPU *kg)
|
||||
diff --git a/intern/cycles/kernel/osl/globals.h b/intern/cycles/kernel/osl/globals.h
|
||||
index 9656ef08306..cf24c62613b 100644
|
||||
--- a/intern/cycles/kernel/osl/globals.h
|
||||
+++ b/intern/cycles/kernel/osl/globals.h
|
||||
@@ -45,7 +45,9 @@ struct OSLGlobals {
|
||||
}
|
||||
|
||||
/* per thread data */
|
||||
- static void thread_init(struct KernelGlobalsCPU *kg, OSLGlobals *osl_globals);
|
||||
+ static void thread_init(struct KernelGlobalsCPU *kg,
|
||||
+ OSLGlobals *osl_globals,
|
||||
+ const int thread_init);
|
||||
static void thread_free(struct KernelGlobalsCPU *kg);
|
||||
|
||||
bool use;
|
||||
diff --git a/intern/cycles/kernel/osl/osl.h b/intern/cycles/kernel/osl/osl.h
|
||||
index 347b635632a..3238eb5096b 100644
|
||||
--- a/intern/cycles/kernel/osl/osl.h
|
||||
+++ b/intern/cycles/kernel/osl/osl.h
|
||||
@@ -52,6 +52,11 @@ ccl_device_inline void shaderdata_to_shaderglobals(KernelGlobals kg,
|
||||
|
||||
/* shader data to be used in services callbacks */
|
||||
globals->renderstate = sd;
|
||||
+#if OSL_LIBRARY_VERSION_CODE >= 11304
|
||||
+ globals->shadingStateUniform = nullptr;
|
||||
+ globals->thread_index = 0;
|
||||
+ globals->shade_index = 0;
|
||||
+#endif
|
||||
|
||||
/* hacky, we leave it to services to fetch actual object matrix */
|
||||
globals->shader2common = sd;
|
||||
diff --git a/intern/cycles/kernel/osl/services.cpp b/intern/cycles/kernel/osl/services.cpp
|
||||
index 02dc1cd1aec..93595b0a458 100644
|
||||
--- a/intern/cycles/kernel/osl/services.cpp
|
||||
+++ b/intern/cycles/kernel/osl/services.cpp
|
||||
@@ -1165,7 +1165,18 @@ bool OSLRenderServices::get_userdata(
|
||||
return false; /* disabled by lockgeom */
|
||||
}
|
||||
|
||||
-#if OSL_LIBRARY_VERSION_CODE >= 11100
|
||||
+#if OSL_LIBRARY_VERSION_CODE >= 11304
|
||||
+TextureSystem::TextureHandle *OSLRenderServices::get_texture_handle(OSLUStringHash filename,
|
||||
+ OSL::ShadingContext *context,
|
||||
+ const TextureOpt *opt)
|
||||
+{
|
||||
+ return get_texture_handle(to_ustring(filename), context, opt);
|
||||
+}
|
||||
+
|
||||
+TextureSystem::TextureHandle *OSLRenderServices::get_texture_handle(OSL::ustring filename,
|
||||
+ OSL::ShadingContext *,
|
||||
+ const TextureOpt *)
|
||||
+#elif OSL_LIBRARY_VERSION_CODE >= 11100
|
||||
TextureSystem::TextureHandle *OSLRenderServices::get_texture_handle(OSLUStringHash filename,
|
||||
OSL::ShadingContext *)
|
||||
#else
|
||||
@@ -1616,7 +1627,17 @@ bool OSLRenderServices::environment(OSLUStringHash filename,
|
||||
return status;
|
||||
}
|
||||
|
||||
-#if OSL_LIBRARY_VERSION_CODE >= 11100
|
||||
+#if OSL_LIBRARY_VERSION_CODE >= 11304
|
||||
+bool OSLRenderServices::get_texture_info(OSLUStringHash filename,
|
||||
+ TextureHandle *texture_handle,
|
||||
+ TexturePerthread *texture_thread_info,
|
||||
+ OSL::ShaderGlobals *,
|
||||
+ int subimage,
|
||||
+ OSLUStringHash dataname,
|
||||
+ TypeDesc datatype,
|
||||
+ void *data,
|
||||
+ OSLUStringHash *)
|
||||
+#elif OSL_LIBRARY_VERSION_CODE >= 11100
|
||||
bool OSLRenderServices::get_texture_info(OSLUStringHash filename,
|
||||
TextureHandle *texture_handle,
|
||||
TexturePerthread *texture_thread_info,
|
||||
@@ -1627,7 +1648,7 @@ bool OSLRenderServices::get_texture_info(OSLUStringHash filename,
|
||||
void *data,
|
||||
OSLUStringHash *)
|
||||
#else
|
||||
-bool OSLRenderServices::get_texture_info(OSL::ShaderGlobals *sg,
|
||||
+bool OSLRenderServices::get_texture_info(OSL::ShaderGlobals *,
|
||||
OSLUStringHash filename,
|
||||
TextureHandle *texture_handle,
|
||||
int subimage,
|
||||
diff --git a/intern/cycles/kernel/osl/services.h b/intern/cycles/kernel/osl/services.h
|
||||
index b674fa7c7a7..62d8a4c5416 100644
|
||||
--- a/intern/cycles/kernel/osl/services.h
|
||||
+++ b/intern/cycles/kernel/osl/services.h
|
||||
@@ -189,7 +189,14 @@ class OSLRenderServices : public OSL::RendererServices {
|
||||
void *val,
|
||||
bool derivatives) override;
|
||||
|
||||
-#if OSL_LIBRARY_VERSION_CODE >= 11100
|
||||
+#if OSL_LIBRARY_VERSION_CODE >= 11304
|
||||
+ TextureSystem::TextureHandle *get_texture_handle(OSL::ustring filename,
|
||||
+ OSL::ShadingContext *context,
|
||||
+ const TextureOpt *options) override;
|
||||
+ TextureSystem::TextureHandle *get_texture_handle(OSLUStringHash filename,
|
||||
+ OSL::ShadingContext *context,
|
||||
+ const TextureOpt *options) override;
|
||||
+#elif OSL_LIBRARY_VERSION_CODE >= 11100
|
||||
TextureSystem::TextureHandle *get_texture_handle(OSLUStringHash filename,
|
||||
OSL::ShadingContext *context) override;
|
||||
#else
|
||||
@@ -245,7 +252,17 @@ class OSLRenderServices : public OSL::RendererServices {
|
||||
float *dresultdt,
|
||||
OSLUStringHash *errormessage) override;
|
||||
|
||||
-#if OSL_LIBRARY_VERSION_CODE >= 11100
|
||||
+#if OSL_LIBRARY_VERSION_CODE >= 11304
|
||||
+ bool get_texture_info(OSLUStringHash filename,
|
||||
+ TextureHandle *texture_handle,
|
||||
+ TexturePerthread *texture_thread_info,
|
||||
+ OSL::ShaderGlobals *sg,
|
||||
+ int subimage,
|
||||
+ OSLUStringHash dataname,
|
||||
+ TypeDesc datatype,
|
||||
+ void *data,
|
||||
+ OSLUStringHash *errormessage) override;
|
||||
+#elif OSL_LIBRARY_VERSION_CODE >= 11100
|
||||
bool get_texture_info(OSLUStringHash filename,
|
||||
TextureHandle *texture_handle,
|
||||
TexturePerthread *texture_thread_info,
|
||||
diff --git a/intern/cycles/kernel/osl/types.h b/intern/cycles/kernel/osl/types.h
|
||||
index 71c808ff91b..8cb5779961a 100644
|
||||
--- a/intern/cycles/kernel/osl/types.h
|
||||
+++ b/intern/cycles/kernel/osl/types.h
|
||||
@@ -86,8 +86,10 @@ struct ShaderGlobals {
|
||||
ccl_private void *tracedata;
|
||||
ccl_private void *objdata;
|
||||
void *context;
|
||||
-#if OSL_LIBRARY_VERSION_CODE >= 11302
|
||||
+#if OSL_LIBRARY_VERSION_CODE >= 11304
|
||||
void *shadingStateUniform;
|
||||
+ int thread_index;
|
||||
+ int shade_index;
|
||||
#endif
|
||||
void *renderer;
|
||||
ccl_private void *object2common;
|
||||
@@ -17,6 +17,10 @@
|
||||
|
||||
#--- END OF EXAMPLES ---
|
||||
|
||||
# Paul Zander <negril.nx+gentoo@gmail.com> (2024-04-20)
|
||||
# only keyworded for amd64 currently
|
||||
media-gfx/blender -gnome
|
||||
|
||||
# Ionen Wolkens <ionen@gentoo.org> (2024-04-16)
|
||||
# dev-qt/qtlanguageserver:6 is keyworded here
|
||||
dev-qt/qtdeclarative:6 -qmlls
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
# Copyright 1999-2024 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
# Paul Zander <negril.nx+gentoo@gmail.com> (2024-04-20)
|
||||
# only keyworded for amd64 currently
|
||||
media-gfx/blender gnome
|
||||
|
||||
# Ionen Wolkens <ionen@gentoo.org> (2024-04-16)
|
||||
# dev-qt/qtlanguageserver:6 currently has very few keywords
|
||||
dev-qt/qtdeclarative:6 qmlls
|
||||
|
||||
Reference in New Issue
Block a user