Skip to content

Commit

Permalink
mesa 24.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
mmozeiko committed Jun 20, 2024
1 parent 403e930 commit f77741a
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 18 deletions.
7 changes: 5 additions & 2 deletions build.cmd
Original file line number Diff line number Diff line change
@@ -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%

Expand Down Expand Up @@ -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 (
Expand Down Expand Up @@ -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 ^
Expand Down
19 changes: 19 additions & 0 deletions mesa-zink.patch
Original file line number Diff line number Diff line change
Expand Up @@ -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();
42 changes: 26 additions & 16 deletions mesa.patch
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -11,27 +11,37 @@ 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
- '/we4189', # 'identifier' : local variable is initialized but not referenced
'/Zc:__cplusplus', #Set __cplusplus macro to match the /std:c++<version> 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']
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit f77741a

Please sign in to comment.