media-gfx/blender: add support of dev-libs/hiprt ray tracing library

Signed-off-by: Sv. Lockal <lockalsash@gmail.com>
Part-of: https://github.com/gentoo/gentoo/pull/42717
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Sv. Lockal
2025-06-23 21:59:58 +00:00
committed by Sam James
parent d3e730b5c6
commit 23aacd8804
3 changed files with 45 additions and 4 deletions

View File

@@ -26,7 +26,7 @@ LLVM_OPTIONAL=1
ROCM_SKIP_GLOBALS=1
inherit cuda rocm llvm-r1
inherit eapi9-pipestatus check-reqs flag-o-matic pax-utils python-single-r1 toolchain-funcs virtualx
inherit eapi9-pipestatus check-reqs flag-o-matic multiprocessing pax-utils python-single-r1 toolchain-funcs virtualx
inherit cmake xdg-utils
DESCRIPTION="3D Creation/Animation/Publishing System"
@@ -66,7 +66,7 @@ SLOT="${BLENDER_BRANCH}"
# potentially mirror cpu_flags_x86 + REQUIRED_USE
IUSE="
alembic +bullet collada +color-management cuda +cycles +cycles-bin-kernels
debug doc +embree +ffmpeg +fftw +fluid +gmp gnome hip jack
debug doc +embree +ffmpeg +fftw +fluid +gmp gnome hip hiprt jack
jemalloc jpeg2k man +nanovdb ndof nls +oidn openal +openexr +opengl +openmp +openpgl
+opensubdiv +openvdb optix osl pipewire +pdf +potrace +pugixml pulseaudio
renderdoc sdl +sndfile +tbb test +tiff +truetype valgrind vulkan wayland +webp X
@@ -86,6 +86,7 @@ REQUIRED_USE="${PYTHON_REQUIRED_USE}
fluid? ( tbb )
gnome? ( wayland )
hip? ( cycles )
hiprt? ( hip )
nanovdb? ( openvdb )
openvdb? ( tbb openexr )
optix? ( cuda )
@@ -132,6 +133,9 @@ RDEPEND="${PYTHON_DEPS}
gnome? ( gui-libs/libdecor )
hip? (
>=dev-util/hip-5.7:=
hiprt? (
dev-libs/hiprt:2.5=
)
)
jack? ( virtual/jack )
jemalloc? ( dev-libs/jemalloc:= )
@@ -381,6 +385,11 @@ src_prepare() {
fi
rm -rf extern/gflags || die
# Use slotted libhiprt64
sed \
-e "s|\"libhiprt64.so\"|\"/usr/lib/hiprt/2.5/$(get_libdir)/libhiprt64.so\"|" \
-i extern/hipew/src/hiprtew.cc || die
}
src_configure() {
@@ -519,6 +528,8 @@ src_configure() {
-DWITH_CYCLES_DEVICE_HIP="$(usex hip)"
-DWITH_CYCLES_HIP_BINARIES="$(usex hip "$(usex cycles-bin-kernels)")"
-DWITH_CYCLES_DEVICE_HIPRT="$(usex hip "$(usex hiprt)")"
-DWITH_CYCLES_HYDRA_RENDER_DELEGATE="no" # TODO: package Hydra
# -DWITH_CYCLES_STANDALONE=OFF
@@ -570,6 +581,13 @@ src_configure() {
-DCYCLES_HIP_BINARIES_ARCH="$(get_amdgpu_flags)"
)
if use hiprt; then
mycmakeargs+=(
-DHIPRT_ROOT_DIR="${ESYSROOT}/usr/lib/hiprt/2.5"
-DHIPRT_COMPILER_PARALLEL_JOBS="$(makeopts_jobs)"
)
fi
fi
if use optix; then
@@ -612,6 +630,7 @@ src_configure() {
use cuda && CYCLES_TEST_DEVICES+=( "CUDA" )
use optix && CYCLES_TEST_DEVICES+=( "OPTIX" )
use hip && CYCLES_TEST_DEVICES+=( "HIP" )
use hiprt && CYCLES_TEST_DEVICES+=( "HIP-RT" )
fi
mycmakeargs+=(
-DCMAKE_INSTALL_PREFIX_WITH_CONFIG="${T}/usr"

View File

@@ -26,7 +26,7 @@ LLVM_OPTIONAL=1
ROCM_SKIP_GLOBALS=1
inherit cuda rocm llvm-r1
inherit eapi9-pipestatus check-reqs flag-o-matic pax-utils python-single-r1 toolchain-funcs virtualx
inherit eapi9-pipestatus check-reqs flag-o-matic multiprocessing pax-utils python-single-r1 toolchain-funcs virtualx
inherit cmake xdg-utils
DESCRIPTION="3D Creation/Animation/Publishing System"
@@ -66,7 +66,7 @@ SLOT="${BLENDER_BRANCH}"
# potentially mirror cpu_flags_x86 + REQUIRED_USE
IUSE="
alembic +bullet collada +color-management cuda +cycles +cycles-bin-kernels
debug doc +embree +ffmpeg +fftw +fluid +gmp gnome hip jack
debug doc +embree +ffmpeg +fftw +fluid +gmp gnome hip hiprt jack
+jemalloc jpeg2k man +manifold +nanovdb ndof nls +oidn oneapi openal +openexr +opengl +openpgl
+opensubdiv +openvdb optix osl pipewire +pdf +potrace +pugixml pulseaudio
renderdoc sdl +sndfile +tbb test +tiff +truetype valgrind vulkan wayland +webp X
@@ -86,6 +86,7 @@ REQUIRED_USE="${PYTHON_REQUIRED_USE}
fluid? ( tbb )
gnome? ( wayland )
hip? ( cycles )
hiprt? ( hip )
nanovdb? ( openvdb )
openvdb? ( tbb openexr )
optix? ( cuda )
@@ -132,6 +133,9 @@ RDEPEND="${PYTHON_DEPS}
gnome? ( gui-libs/libdecor )
hip? (
>=dev-util/hip-5.7:=
hiprt? (
dev-libs/hiprt:2.5=
)
)
jack? ( virtual/jack )
jemalloc? ( dev-libs/jemalloc:= )
@@ -393,6 +397,11 @@ src_prepare() {
fi
rm -rf extern/gflags || die
# Use slotted libhiprt64
sed \
-e "s|\"libhiprt64.so\"|\"/usr/lib/hiprt/2.5/$(get_libdir)/libhiprt64.so\"|" \
-i extern/hipew/src/hiprtew.cc || die
}
src_configure() {
@@ -533,6 +542,8 @@ src_configure() {
-DWITH_CYCLES_ONEAPI_BINARIES="$(usex oneapi "$(usex cycles-bin-kernels)")"
-DWITH_CYCLES_DEVICE_HIP="$(usex hip)"
-DWITH_CYCLES_HIP_BINARIES="$(usex hip "$(usex cycles-bin-kernels)")"
-DWITH_CYCLES_DEVICE_HIPRT="$(usex hip "$(usex hiprt)")"
-DWITH_CYCLES_HYDRA_RENDER_DELEGATE="no" # TODO: package Hydra
# -DWITH_CYCLES_STANDALONE=OFF
@@ -580,6 +591,13 @@ src_configure() {
-DCYCLES_HIP_BINARIES_ARCH="$(get_amdgpu_flags)"
)
if use hiprt; then
mycmakeargs+=(
-DHIPRT_ROOT_DIR="${ESYSROOT}/usr/lib/hiprt/2.5"
-DHIPRT_COMPILER_PARALLEL_JOBS="$(makeopts_jobs)"
)
fi
fi
if use optix; then
@@ -622,6 +640,7 @@ src_configure() {
use cuda && CYCLES_TEST_DEVICES+=( "CUDA" )
use optix && CYCLES_TEST_DEVICES+=( "OPTIX" )
use hip && CYCLES_TEST_DEVICES+=( "HIP" )
use hiprt && CYCLES_TEST_DEVICES+=( "HIP-RT" )
use oneapi && CYCLES_TEST_DEVICES+=( "ONEAPI" )
fi
mycmakeargs+=(

View File

@@ -36,6 +36,9 @@
<flag name="hip">
Build cycles renderer with AMD HIP support.
</flag>
<flag name="hiprt">
Enable AMD HIP GPU ray tracing acceleration via <pkg>dev-libs/hiprt</pkg>.
</flag>
<flag name="cycles">
Enable the Cycles raytracing render engine.
</flag>