Skip to content

Commit

Permalink
mesa 22.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mmozeiko committed Sep 21, 2022
1 parent 3525b72 commit 47ea1a2
Show file tree
Hide file tree
Showing 6 changed files with 117 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1 @@
mesa.patch eol=lf
*.patch eol=lf
24 changes: 23 additions & 1 deletion .github/workflows/build-mesa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
release_name: ${{ steps.build.outputs.MESA_VERSION }}
body: |
[mesa ${{ steps.build.outputs.MESA_VERSION }} release notes](https://docs.mesa3d.org/relnotes/${{ steps.build.outputs.MESA_VERSION }}.html)
[llvm ${{ steps.build.outputs.LLVM_VERSION }} release notes](https://releases.llvm.org/${{ steps.build.outputs.LLVM_VERSION }}/docs/ReleaseNotes.html)
[llvm ${{ steps.build.outputs.LLVM_VERSION }} release notes](https://github.com/llvm/llvm-project/releases/tag/llvmorg-${{ steps.build.outputs.LLVM_VERSION }})
- name: upload llvmpipe
id: upload-llvmpipe
Expand All @@ -54,6 +54,17 @@ jobs:
asset_name: "mesa-osmesa-${{ steps.build.outputs.MESA_VERSION }}.zip"
asset_content_type: application/zip

- name: upload lavapipe
id: upload-lavapipe
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.release.outputs.upload_url }}
asset_path: "mesa-lavapipe-${{ steps.build.outputs.MESA_VERSION }}.zip"
asset_name: "mesa-lavapipe-${{ steps.build.outputs.MESA_VERSION }}.zip"
asset_content_type: application/zip

- name: upload d3d12
id: upload-d3d12
uses: actions/upload-release-asset@v1
Expand All @@ -64,3 +75,14 @@ jobs:
asset_path: "mesa-d3d12-${{ steps.build.outputs.MESA_VERSION }}.zip"
asset_name: "mesa-d3d12-${{ steps.build.outputs.MESA_VERSION }}.zip"
asset_content_type: application/zip

- name: upload zink
id: upload-zink
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.release.outputs.upload_url }}
asset_path: "mesa-zink-${{ steps.build.outputs.MESA_VERSION }}.zip"
asset_name: "mesa-zink-${{ steps.build.outputs.MESA_VERSION }}.zip"
asset_content_type: application/zip
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,18 @@ Builds are linked statically to their dependencies, just place necessary dll fil

Download binary builds as zip archive from [latest release][] page. It provides following builds:

* [llvmpipe][] - software implementation of opengl using llvm jit
* [osmesa][] - off-screen software rendering implementation using llvmpipe
* [d3d12][] - [Collabora & Microsoft][collabora] implementation of opengl using D3D12
* [llvmpipe][] - software implementation of OpenGL using llvm
* [osmesa][] - off-screen software rendering implementation of OpenGL using llvmpipe
* [d3d12][] - [Collabora & Microsoft][collabora] implementation of OpenGL using D3D12
* [zink][] - implementation of OpenGL using Vulkan
* lavapipe - software implementation of Vulkan using llvm

To build locally run `build.cmd` batch file, make sure you have installed all necessary dependencies (see the beginning of file).

[mesa]: https://www.mesa3d.org/
[llvmpipe]: https://docs.mesa3d.org/drivers/llvmpipe.html
[osmesa]: https://docs.mesa3d.org/osmesa.html
[d3d12]: https://docs.mesa3d.org/drivers/d3d12.html
[zink]: https://docs.mesa3d.org/drivers/zink.html
[collabora]: https://www.collabora.com/news-and-blog/news-and-events/introducing-opencl-and-opengl-on-directx.html
[latest release]: https://github.com/mmozeiko/build-mesa/releases/latest
51 changes: 45 additions & 6 deletions build.cmd
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
@echo off
setlocal enabledelayedexpansion

set LLVM_VERSION=14.0.3
set MESA_VERSION=22.1.0
set LLVM_VERSION=15.0.1
set MESA_VERSION=22.2.0

set PATH=%CD%\llvm\bin;%CD%\winflexbison;%PATH%

Expand Down Expand Up @@ -83,7 +83,12 @@ echo Downloading llvm
curl -sfL https://github.com/llvm/llvm-project/releases/download/llvmorg-%LLVM_VERSION%/llvm-%LLVM_VERSION%.src.tar.xz ^
| %SZIP% x -bb0 -txz -si -so ^
| %SZIP% x -bb0 -ttar -si -aoa 1>nul 2>nul
curl -sfL https://github.com/llvm/llvm-project/releases/download/llvmorg-%LLVM_VERSION%/cmake-%LLVM_VERSION%.src.tar.xz ^
| %SZIP% x -bb0 -txz -si -so ^
| %SZIP% x -bb0 -ttar -si -aoa 1>nul 2>nul
move llvm-%LLVM_VERSION%.src llvm.src
move cmake-%LLVM_VERSION%.src\Modules\* llvm.src\cmake\Modules\
rd /S /Q cmake-%LLVM_VERSION%.src 1>nul 2>nul

echo Downloading mesa
curl -sfL https://archive.mesa3d.org//mesa-%MESA_VERSION%.tar.xz ^
Expand Down Expand Up @@ -146,7 +151,7 @@ cmake ^
ninja -C llvm.build
ninja -C llvm.build install || exit /b 1

rem *** mesa llvmpipe ***
rem *** llvmpipe ***

rd /s /q mesa.build 1>nul 2>nul
meson setup ^
Expand All @@ -160,10 +165,11 @@ meson setup ^
-Dllvm=enabled ^
-Dplatforms=windows ^
-Dosmesa=true ^
-Dgallium-drivers=swrast || exit /b 1
-Dgallium-drivers=swrast ^
-Dvulkan-drivers=swrast || exit /b 1
ninja -C mesa.build install || exit /b 1

rem *** mesa d3d12 ***
rem *** d3d12 ***

rd /s /q mesa.build 1>nul 2>nul
meson setup ^
Expand All @@ -180,8 +186,26 @@ meson setup ^
-Dgallium-drivers=d3d12 || exit /b 1
ninja -C mesa.build install || exit /b 1

rem *** zink ***

rd /s /q mesa.build 1>nul 2>nul
git apply -p0 --directory=mesa.src mesa-zink.patch || exit /b 1
meson setup ^
mesa.build ^
mesa.src ^
--prefix="%CD%\mesa-zink" ^
--default-library=static ^
-Dbuildtype=release ^
-Db_ndebug=true ^
-Db_vscrt=mt ^
-Dllvm=disabled ^
-Dplatforms=windows ^
-Dosmesa=false ^
-Dgallium-drivers=zink || exit /b 1
ninja -C mesa.build install || exit /b 1

rem *** done ***
rem output is in mesa-d3d12 and mesa-llvmpipe folders
rem output is in mesa-llvmpipe, mesa-d3d12, mesa-zink folders

if "%GITHUB_WORKFLOW%" neq "" (
mkdir archive-llvmpipe
Expand All @@ -198,6 +222,15 @@ if "%GITHUB_WORKFLOW%" neq "" (
%SZIP% a -mx=9 ..\mesa-osmesa-%MESA_VERSION%.zip
popd

mkdir archive-lavapipe
pushd archive-lavapipe
copy /y ..\mesa-llvmpipe\bin\vulkan_lvp.dll .
python ..\mesa.src\src\vulkan\util\vk_icd_gen.py --api-version 1.1 --xml ..\mesa.src\src\vulkan\registry\vk.xml --lib-path vulkan_lvp.dll --out lvp_icd.x86_64.json
copy /y ..\mesa-llvmpipe\share\vulkan\icd.d\lvp_icd.x86_64.json .

%SZIP% a -mx=9 ..\mesa-lavapipe-%MESA_VERSION%.zip
popd

mkdir archive-d3d12
pushd archive-d3d12
copy /y ..\mesa-d3d12\bin\opengl32.dll .
Expand All @@ -209,6 +242,12 @@ if "%GITHUB_WORKFLOW%" neq "" (
%SZIP% a -mx=9 ..\mesa-d3d12-%MESA_VERSION%.zip
popd

mkdir archive-zink
pushd archive-zink
copy /y ..\mesa-zink\bin\opengl32.dll .
%SZIP% a -mx=9 ..\mesa-zink-%MESA_VERSION%.zip
popd

echo ::set-output name=LLVM_VERSION::%LLVM_VERSION%
echo ::set-output name=MESA_VERSION::%MESA_VERSION%
)
13 changes: 13 additions & 0 deletions mesa-zink.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git src/vulkan/util/meson.build src/vulkan/util/meson.build
index 8f232fa..ef64ab9 100644
--- src/vulkan/util/meson.build
+++ src/vulkan/util/meson.build
@@ -95,7 +95,7 @@ vk_extensions = custom_target(

libvulkan_util = static_library(
'vulkan_util',
- [files_vulkan_util, vk_dispatch_table, vk_enum_to_str, vk_extensions],
+ [files_vulkan_util, vk_enum_to_str, vk_extensions],
include_directories : [inc_include, inc_src, inc_gallium],
dependencies : [vulkan_wsi_deps, idep_mesautil, idep_nir_headers],
c_args : [c_msvc_compat_args],
49 changes: 29 additions & 20 deletions mesa.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git meson.build meson.build
index bd54e78..d1b3026 100644
index 250b528..5e9e617 100644
--- meson.build
+++ meson.build
@@ -1449,7 +1449,7 @@ if cc.links('int main() { return 0; }',
@@ -1523,7 +1523,7 @@ if cc.links('int main() { return 0; }',
args : '-Wl,--version-script=@0@'.format(
join_paths(meson.source_root(), 'build-support/conftest.map')),
name : 'version-script')
Expand All @@ -11,6 +11,15 @@ index bd54e78..d1b3026 100644
endif
with_ld_dynamic_list = false
if cc.links('int main() { return 0; }',
@@ -1710,7 +1710,7 @@ if dep_libudev.found()
pre_args += '-DHAVE_LIBUDEV'
endif

-llvm_modules = ['bitwriter', 'engine', 'mcdisassembler', 'mcjit', 'core', 'executionengine', 'scalaropts', 'transformutils', 'instcombine']
+llvm_modules = ['bitwriter', 'engine', 'mcdisassembler', 'mcjit', 'core', 'executionengine', 'scalaropts', 'transformutils', 'instcombine', 'passes']
llvm_optional_modules = ['coroutines']
if with_amd_vk or with_gallium_radeonsi or with_gallium_r600
llvm_modules += ['amdgpu', 'bitreader', 'ipo']
diff --git src/gallium/auxiliary/tgsi/tgsi_ureg.c src/gallium/auxiliary/tgsi/tgsi_ureg.c
index eedba34..06d8086 100644
--- src/gallium/auxiliary/tgsi/tgsi_ureg.c
Expand Down Expand Up @@ -51,24 +60,24 @@ index 8ffe752..825d05f 100644
/* glapi is statically linked: we can call the local destroy function. */
#ifdef _GLAPI_NO_EXPORTS
diff --git src/gallium/targets/libgl-gdi/meson.build src/gallium/targets/libgl-gdi/meson.build
index da7430c..b380e00 100644
index 7ddcd8a..8658196 100644
--- src/gallium/targets/libgl-gdi/meson.build
+++ src/gallium/targets/libgl-gdi/meson.build
@@ -40,6 +40,7 @@ libopengl32 = shared_library(
link_with : [
libgallium_wgl, libglapi_static, libglapi
libgallium_wgl, libglapi_bridge, libglapi
],
+ link_whole : [ libgallium_wgl ],
dependencies : [
idep_mesautil
],
diff --git src/gallium/targets/wgl/meson.build src/gallium/targets/wgl/meson.build
index 27afb1f..87037f4 100644
index 2999ee5..8b92387 100644
--- src/gallium/targets/wgl/meson.build
+++ src/gallium/targets/wgl/meson.build
@@ -30,10 +30,9 @@ else
wgl_def = 'gallium_wgl.def'
endif
@@ -30,10 +30,9 @@ wgl_def = custom_target(
'--compiler_id', cc.get_argument_syntax(), '--cpu_family', host_machine.cpu_family()]
)

-libgallium_wgl = shared_library(
+libgallium_wgl = static_library(
Expand All @@ -78,16 +87,16 @@ index 27afb1f..87037f4 100644
include_directories : [
inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_wgl, inc_gallium_winsys, inc_gallium_winsys_sw, inc_gallium_drivers,
],
diff --git src/gallium/winsys/d3d12/wgl/d3d12_wgl_public.h src/gallium/winsys/d3d12/wgl/d3d12_wgl_public.h
index a690ade..eb4bca6 100644
--- src/gallium/winsys/d3d12/wgl/d3d12_wgl_public.h
+++ src/gallium/winsys/d3d12/wgl/d3d12_wgl_public.h
@@ -33,7 +33,7 @@ extern "C" {
struct pipe_resource;
struct pipe_screen;
struct pipe_context;
-struct stw_winsys;
+struct sw_winsys;
diff --git src/util/futex.h src/util/futex.h
index 2a2a00c..5aff5ef 100644
--- src/util/futex.h
+++ src/util/futex.h
@@ -117,7 +117,7 @@ static inline int futex_wait(uint32_t *addr, int32_t value, const struct timespe
return futex(addr, FUTEX_WAIT, value, &tsrel, NULL);
}

-#elif defined(_WIN32) && !defined(WINDOWS_NO_FUTEX)
+#elif defined(_WIN32) && 0
#define UTIL_FUTEX_SUPPORTED 1

struct pipe_screen *
d3d12_wgl_create_screen(struct sw_winsys *winsys,
#include <windows.h>

0 comments on commit 47ea1a2

Please sign in to comment.