diff --git a/sys-libs/mesa/mesa-21.3.4.recipe b/sys-libs/mesa/mesa-21.3.6.recipe similarity index 82% rename from sys-libs/mesa/mesa-21.3.4.recipe rename to sys-libs/mesa/mesa-21.3.6.recipe index fefa33d00..43fbec202 100644 --- a/sys-libs/mesa/mesa-21.3.4.recipe +++ b/sys-libs/mesa/mesa-21.3.6.recipe @@ -4,11 +4,11 @@ specification. The OpenGL specification documents a system for rendering \ interactive 3D graphics. Mesa fills the role of the Haiku OpenGL kit \ providing 3D rendering to Haiku applications." HOMEPAGE="https://www.mesa3d.org/" -COPYRIGHT="1999-2021 Brian Paul" +COPYRIGHT="1999-2022 Brian Paul" LICENSE="MIT" -REVISION="2" +REVISION="1" SOURCE_URI="https://mesa.freedesktop.org/archive/mesa-${portVersion}.tar.xz" -CHECKSUM_SHA256="77104fd4a93bce69da3b0982f8ee88ba7c4fb98cfc491a669894339cdcd4a67d" +CHECKSUM_SHA256="96bb761fd546e9aa41d025fcc025225c5668443839dae21e3731959beb096736" SOURCE_DIR="mesa-${portVersion}" PATCHES="mesa-$portVersion.patchset" @@ -67,11 +67,23 @@ REQUIRES_swpipe=" lib:libLLVM_9$secondaryArchSuffix " +SUMMARY_lavapipe="Vulkan software rasteriser driver" +DESCRIPTION_lavapipe="Lavapipe is Mesa's software-based Vulkan 1.2 \ +implementation akin to LLVMpipe for OpenGL." + +PROVIDES_lavapipe=" + mesa${secondaryArchSuffix}_lavapipe = $portVersion + " +REQUIRES_lavapipe=" + lib:libLLVM_9$secondaryArchSuffix + " + BUILD_REQUIRES=" haiku${secondaryArchSuffix}_devel devel:libz$secondaryArchSuffix devel:libLLVM_9$secondaryArchSuffix devel:libexpat$secondaryArchSuffix + devel:libvulkan$secondaryArchSuffix " BUILD_PREREQUIRES=" python3$secondaryArchSuffix @@ -92,6 +104,7 @@ BUILD_PREREQUIRES=" defineDebugInfoPackage mesa$secondaryArchSuffix \ "${addOnsDir/mesa$secondaryArchSuffix/mesa${secondaryArchSuffix}_swpipe}/opengl/Software Pipe" \ + "${addOnsDir/mesa$secondaryArchSuffix/mesa${secondaryArchSuffix}_lavapipe}/vulkan/icd.d/libvulkan_lvp.so" \ "$libDir"/libEGL.so.$libVersion \ "$libDir"/libGL.so.$libVersion \ "$libDir"/libOSMesa.so.$libOSMesaVersion \ @@ -103,10 +116,15 @@ BUILD() fi mkdir -p build - meson build -Dosmesa=true -Degl=true -Dgallium-drivers=swrast \ + meson build \ + -Dosmesa=true \ + -Degl=true \ + -Dgallium-drivers=swrast \ + -Dvulkan-drivers=swrast \ + -Dvulkan-icd-dir=$addOnsDir/vulkan/icd.d \ --buildtype=debugoptimized \ --prefix=$prefix \ - --libdir=$libDir \ + --libdir=$libDir \ --includedir=$includeDir ninja -C build $jobArgs } @@ -122,6 +140,8 @@ INSTALL() mkdir -p $addOnsDir/opengl mv $(find $libDir -name 'libswpipe.so') \ "$addOnsDir/opengl/Software Pipe" + mv $libDir/libvulkan_lvp.so \ + "$addOnsDir/vulkan/icd.d" rm -rf $libDir/haiku # Set some nice version info @@ -130,6 +150,8 @@ INSTALL() setversion "$libDir/libEGL.so.1" -app $appVersion -long "Mesa EGL" setversion "$addOnsDir/opengl/Software Pipe" -app $appVersion -long \ "Gallium LLVM software pipe renderer" + setversion "$addOnsDir/vulkan/icd.d/libvulkan_lvp.so" -app $appVersion -long \ + "Vulkan software rasteriser driver" prepareInstalledDevelLibs \ libGL libEGL libOSMesa @@ -159,6 +181,10 @@ INSTALL() packageEntries swpipe \ "$addOnsDir/opengl/Software Pipe" + # lavapipe renderer package + packageEntries lavapipe \ + "$addOnsDir/vulkan/icd.d" + rmdir "$addOnsDir"/opengl } diff --git a/sys-libs/mesa/patches/mesa-21.3.4.patchset b/sys-libs/mesa/patches/mesa-21.3.6.patchset similarity index 78% rename from sys-libs/mesa/patches/mesa-21.3.4.patchset rename to sys-libs/mesa/patches/mesa-21.3.6.patchset index 2a8a62168..91deb1e09 100644 --- a/sys-libs/mesa/patches/mesa-21.3.4.patchset +++ b/sys-libs/mesa/patches/mesa-21.3.6.patchset @@ -1,4 +1,4 @@ -From 05376c1bbe6f9aa24f5daf40f328e3ebc5b4b483 Mon Sep 17 00:00:00 2001 +From 7adad87f6f7237a19ef486d66481fe9735dffcee Mon Sep 17 00:00:00 2001 From: Gerasim Troeglazov <3dEyes@gmail.com> Date: Sun, 8 Aug 2021 22:34:39 +1000 Subject: Fix build for Haiku @@ -106,7 +106,7 @@ index 013e8be..a80c2f7 100644 2.30.2 -From 6637bfad0cfd894584f267e9e32c88f40c175916 Mon Sep 17 00:00:00 2001 +From 01bf3fa56f3d9514229fadbd20164190f413d42f Mon Sep 17 00:00:00 2001 From: Gerasim Troeglazov <3dEyes@gmail.com> Date: Sun, 8 Aug 2021 22:35:54 +1000 Subject: Add any color_space support @@ -240,3 +240,52 @@ index 96f19ae..6939e53 100644 -- 2.30.2 + +From 5141f202c9784f42c5f9d16500adb8a99bb6e81c Mon Sep 17 00:00:00 2001 +From: X512 +Date: Mon, 7 Feb 2022 13:01:04 +0900 +Subject: osmesa: fix framebuffer leak on resize + +New `st_framebuffer_iface object` pointer value may be the same as recently +deleted so it will be not freed in `st_framebuffers_purge()`. Framebuffers +should be freed before new framebuffer will be added to list. + +diff --git a/src/gallium/frontends/osmesa/osmesa.c b/src/gallium/frontends/osmesa/osmesa.c +index 91a250d..9f08709 100644 +--- a/src/gallium/frontends/osmesa/osmesa.c ++++ b/src/gallium/frontends/osmesa/osmesa.c +@@ -786,6 +786,7 @@ OSMesaMakeCurrent(OSMesaContext osmesa, void *buffer, GLenum type, + osmesa->current_buffer->height != height)) { + osmesa_destroy_buffer(osmesa->current_buffer); + osmesa->current_buffer = NULL; ++ stapi->make_current(stapi, NULL, NULL, NULL); + } + + if (!osmesa->current_buffer) { +-- +2.30.2 + + +From d263cfa0f4dc6e2b37048d5d1dd4b16c329ae706 Mon Sep 17 00:00:00 2001 +From: X512 +Date: Mon, 7 Feb 2022 15:06:17 +0900 +Subject: Fix path for lavapipe module + + +diff --git a/src/gallium/targets/lavapipe/meson.build b/src/gallium/targets/lavapipe/meson.build +index 1648118..ddab474 100644 +--- a/src/gallium/targets/lavapipe/meson.build ++++ b/src/gallium/targets/lavapipe/meson.build +@@ -25,6 +25,9 @@ if with_platform_windows + module_dir = join_paths(get_option('prefix'), get_option('bindir')) + icd_file_name = 'vulkan_lvp.dll' + endif ++if with_platform_haiku ++ module_dir = './' ++endif + + lvp_icd = custom_target( + 'lvp_icd', +-- +2.30.2 +