From f85261855b30cf967158691a973f3e59852dbee7 Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Mon, 14 Nov 2016 11:37:06 -0800 Subject: media-libs/mesa: Add Vulkan support. Bug: https://bugs.gentoo.org/580148 --- media-libs/mesa/mesa-13.0.1.ebuild | 29 ++++++++++++++++++++++++++++- media-libs/mesa/mesa-9999.ebuild | 29 ++++++++++++++++++++++++++++- media-libs/mesa/metadata.xml | 1 + 3 files changed, 57 insertions(+), 2 deletions(-) (limited to 'media-libs') diff --git a/media-libs/mesa/mesa-13.0.1.ebuild b/media-libs/mesa/mesa-13.0.1.ebuild index c604a36ef957..664a022e69ba 100644 --- a/media-libs/mesa/mesa-13.0.1.ebuild +++ b/media-libs/mesa/mesa-13.0.1.ebuild @@ -45,7 +45,7 @@ done IUSE="${IUSE_VIDEO_CARDS} bindist +classic d3d9 debug +dri3 +egl +gallium +gbm gcrypt gles1 gles2 libressl +llvm nettle +nptl opencl osmesa pax_kernel openmax +openssl pic - selinux vaapi valgrind vdpau wayland xvmc xa kernel_FreeBSD" + selinux vaapi valgrind vdpau vulkan wayland xvmc xa kernel_FreeBSD" REQUIRED_USE=" || ( gcrypt libressl nettle openssl ) @@ -57,6 +57,7 @@ REQUIRED_USE=" gles2? ( egl ) vaapi? ( gallium ) vdpau? ( gallium ) + vulkan? ( || ( video_cards_i965 video_cards_radeonsi ) ) wayland? ( egl gbm ) xa? ( gallium ) video_cards_freedreno? ( gallium ) @@ -273,6 +274,11 @@ multilib_src_configure() { fi fi + if use vulkan; then + vulkan_enable video_cards_i965 intel + vulkan_enable video_cards_radeonsi radeon + fi + # x86 hardened pax_kernel needs glx-rts, bug 240956 if [[ ${ABI} == x86 ]]; then myconf+=" $(use_enable pax_kernel glx-read-only-text)" @@ -311,6 +317,7 @@ multilib_src_configure() { --enable-llvm-shared-libs \ --with-dri-drivers=${DRI_DRIVERS} \ --with-gallium-drivers=${GALLIUM_DRIVERS} \ + --with-vulkan-drivers=${VULKAN_DRIVERS} \ --with-sha1=$(usex nettle libnettle $(usex gcrypt libgcrypt libcrypto)) \ PYTHON2="${PYTHON}" \ ${myconf} @@ -383,6 +390,9 @@ multilib_src_install_all() { # Install config file for eselect mesa insinto /usr/share/mesa newins "${FILESDIR}/eselect-mesa.conf.9.2" eselect-mesa.conf + + # Mesa should not install these + rm "${ED}"/usr/include/vulkan/{vulkan.h,vk_platform.h} } multilib_src_test() { @@ -475,3 +485,20 @@ gallium_enable() { ;; esac } + +vulkan_enable() { + case $# in + # for enabling unconditionally + 1) + VULKAN_DRIVERS+=",$1" + ;; + *) + if use $1; then + shift + for i in $@; do + VULKAN_DRIVERS+=",${i}" + done + fi + ;; + esac +} diff --git a/media-libs/mesa/mesa-9999.ebuild b/media-libs/mesa/mesa-9999.ebuild index c604a36ef957..664a022e69ba 100644 --- a/media-libs/mesa/mesa-9999.ebuild +++ b/media-libs/mesa/mesa-9999.ebuild @@ -45,7 +45,7 @@ done IUSE="${IUSE_VIDEO_CARDS} bindist +classic d3d9 debug +dri3 +egl +gallium +gbm gcrypt gles1 gles2 libressl +llvm nettle +nptl opencl osmesa pax_kernel openmax +openssl pic - selinux vaapi valgrind vdpau wayland xvmc xa kernel_FreeBSD" + selinux vaapi valgrind vdpau vulkan wayland xvmc xa kernel_FreeBSD" REQUIRED_USE=" || ( gcrypt libressl nettle openssl ) @@ -57,6 +57,7 @@ REQUIRED_USE=" gles2? ( egl ) vaapi? ( gallium ) vdpau? ( gallium ) + vulkan? ( || ( video_cards_i965 video_cards_radeonsi ) ) wayland? ( egl gbm ) xa? ( gallium ) video_cards_freedreno? ( gallium ) @@ -273,6 +274,11 @@ multilib_src_configure() { fi fi + if use vulkan; then + vulkan_enable video_cards_i965 intel + vulkan_enable video_cards_radeonsi radeon + fi + # x86 hardened pax_kernel needs glx-rts, bug 240956 if [[ ${ABI} == x86 ]]; then myconf+=" $(use_enable pax_kernel glx-read-only-text)" @@ -311,6 +317,7 @@ multilib_src_configure() { --enable-llvm-shared-libs \ --with-dri-drivers=${DRI_DRIVERS} \ --with-gallium-drivers=${GALLIUM_DRIVERS} \ + --with-vulkan-drivers=${VULKAN_DRIVERS} \ --with-sha1=$(usex nettle libnettle $(usex gcrypt libgcrypt libcrypto)) \ PYTHON2="${PYTHON}" \ ${myconf} @@ -383,6 +390,9 @@ multilib_src_install_all() { # Install config file for eselect mesa insinto /usr/share/mesa newins "${FILESDIR}/eselect-mesa.conf.9.2" eselect-mesa.conf + + # Mesa should not install these + rm "${ED}"/usr/include/vulkan/{vulkan.h,vk_platform.h} } multilib_src_test() { @@ -475,3 +485,20 @@ gallium_enable() { ;; esac } + +vulkan_enable() { + case $# in + # for enabling unconditionally + 1) + VULKAN_DRIVERS+=",$1" + ;; + *) + if use $1; then + shift + for i in $@; do + VULKAN_DRIVERS+=",${i}" + done + fi + ;; + esac +} diff --git a/media-libs/mesa/metadata.xml b/media-libs/mesa/metadata.xml index ab07f8bae6e3..043aec22078c 100644 --- a/media-libs/mesa/metadata.xml +++ b/media-libs/mesa/metadata.xml @@ -28,6 +28,7 @@ disable optimized assembly code that is not PIC friendly Compile in valgrind memory hints Enable the VDPAU acceleration interface for the Gallium3D Video Layer. + Enable Vulkan drivers Enable support for dev-libs/wayland Enable the XA (X Acceleration) API for Gallium3D. Enable the XvMC acceleration interface for the Gallium3D Video Layer. -- cgit v1.2.3-65-gdbad