diff --git a/build.cmd b/build.cmd index a50c03a..9316f71 100644 --- a/build.cmd +++ b/build.cmd @@ -1,8 +1,8 @@ @echo off setlocal enabledelayedexpansion -set LLVM_VERSION=18.1.5 -set MESA_VERSION=24.0.7 +set LLVM_VERSION=18.1.7 +set MESA_VERSION=24.1.2 set PATH=%CD%\llvm\bin;%CD%\winflexbison;%PATH% @@ -94,7 +94,9 @@ curl -sfL https://archive.mesa3d.org/mesa-%MESA_VERSION%.tar.xz ^ | %SZIP% x -bb0 -txz -si -so ^ | %SZIP% x -bb0 -ttar -si -aoa 1>nul 2>nul move mesa-%MESA_VERSION% mesa.src +curl -sfLO https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29819.patch || exit /b 1 git apply -p0 --directory=mesa.src mesa.patch || exit /b 1 +git apply -p1 --directory=mesa.src 29819.patch || exit /b 1 echo Downloading win_flex_bison if not exist winflexbison ( @@ -192,6 +194,7 @@ ninja -C mesa.build install || exit /b 1 rem *** zink *** rd /s /q mesa.build 1>nul 2>nul +rem includes rebased changes from https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29806 git apply -p0 --directory=mesa.src mesa-zink.patch || exit /b 1 meson setup ^ mesa.build ^ diff --git a/mesa-zink.patch b/mesa-zink.patch index 39d3c72..7a90d2e 100644 --- a/mesa-zink.patch +++ b/mesa-zink.patch @@ -11,3 +11,22 @@ index 90ebfd6..9a6063d 100644 vk_struct_type_cast, vk_extensions], include_directories : [inc_include, inc_src], dependencies : [vulkan_wsi_deps, idep_mesautil, idep_nir_headers], +diff --git src/gallium/drivers/zink/zink_screen.c.org src/gallium/drivers/zink/zink_screen.c +index 9177e85..935d880 100644 +--- src/gallium/drivers/zink/zink_screen.c ++++ src/gallium/drivers/zink/zink_screen.c +@@ -3268,12 +3268,12 @@ zink_internal_create_screen(const struct pipe_screen_config *config, int64_t dev + + struct zink_screen *screen = rzalloc(NULL, struct zink_screen); + if (!screen) { +- if (!config->implicit_driver_load) ++ if (!config || !config->implicit_driver_load) + mesa_loge("ZINK: failed to allocate screen"); + return NULL; + } + +- screen->implicitly_loaded = config->implicit_driver_load; ++ screen->implicitly_loaded = config && config->implicit_driver_load; + screen->drm_fd = -1; + + glsl_type_singleton_init_or_ref(); diff --git a/mesa.patch b/mesa.patch index 07a85da..c97b85b 100644 --- a/mesa.patch +++ b/mesa.patch @@ -1,8 +1,8 @@ diff --git meson.build meson.build -index 250b528..5e9e617 100644 +index 6b22930..4af29b1 100644 --- meson.build +++ meson.build -@@ -634,7 +634,7 @@ if with_gallium_kmsro and (with_platform_x11 and not with_dri3) +@@ -582,7 +582,7 @@ if with_gallium_kmsro and (with_platform_x11 and not with_dri3) endif dep_dxheaders = null_dep @@ -11,16 +11,17 @@ index 250b528..5e9e617 100644 dep_dxheaders = dependency('directx-headers', required : false) if not dep_dxheaders.found() dep_dxheaders = dependency('DirectX-Headers', -@@ -1541,7 +1541,7 @@ if cc.links('int main() { return 0; }', - args : '-Wl,--dynamic-list=@0@'.format( - join_paths(meson.current_source_dir(), 'build-support/conftest.dyn')), - name : 'dynamic-list') -- with_ld_dynamic_list = true -+ with_ld_dynamic_list = false - endif - - ld_args_build_id = cc.get_supported_link_arguments('-Wl,--build-id=sha1') -@@ -1166,7 +1166,6 @@ if cc.get_argument_syntax() == 'msvc' +@@ -944,9 +944,6 @@ except: + import mako + assert Version(mako.__version__) >= Version("0.8.0") + ''', check: false) +-if has_mako.returncode() != 0 +- error('Python (3.x) mako module >= 0.8.0 required to build mesa.') +-endif + + if cc.get_id() == 'gcc' and cc.version().version_compare('< 4.4.6') + error('When using GCC, version 4.4.6 or later is required.') +@@ -1084,7 +1081,6 @@ if cc.get_argument_syntax() == 'msvc' '/wd5105', # macro expansion producing 'defined' has undefined behavior (winbase.h, need Windows SDK upgrade) '/we4020', # Error when passing the wrong number of parameters '/we4024', # Error when passing different type of parameter @@ -28,10 +29,19 @@ index 250b528..5e9e617 100644 '/Zc:__cplusplus', #Set __cplusplus macro to match the /std:c++ on the command line ] c_args += cc.get_supported_arguments(_trial) -@@ -1722,7 +1722,7 @@ if dep_libudev.found() +@@ -1519,7 +1515,7 @@ if cc.links('int main() { return 0; }', + args : '-Wl,--dynamic-list=@0@'.format( + join_paths(meson.current_source_dir(), 'build-support/conftest.dyn')), + name : 'dynamic-list') +- with_ld_dynamic_list = true ++ with_ld_dynamic_list = false + endif + + ld_args_build_id = cc.get_supported_link_arguments('-Wl,--build-id=sha1') +@@ -1716,7 +1712,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'] @@ -71,8 +81,8 @@ index 2999ee5..8b92387 100644 +++ src/gallium/targets/wgl/meson.build @@ -29,10 +29,9 @@ wgl_def = custom_target( ) - - gallium_wgl_name = get_option('gallium-windows-dll-name') + + gallium_wgl_name = get_option('gallium-wgl-dll-name') -libgallium_wgl = shared_library( +libgallium_wgl = static_library( gallium_wgl_name,