mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-20 09:30:13 +01:00
zink: Fix building on macOS
This fixes building on macOS: Disable ZINK_USE_DMABUF on macOS, it is unsupported. Import vk_mvk_moltenvk.h for MVK_VERSION in zink_resource.c. Add additional build arguments (see meson.build) to build properly. To build on macOS, you will probably need to run: brew install bison llvm cmake libxext xquartz ninja xorgproto meson And you also need to setup meson with something like: -Dmoltenvk-dir=/Users/<Username>/VulkanSDK/<VersionNumber>/MoltenVK -Dc_std=c11 Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14255>
This commit is contained in:
parent
eca7b24e74
commit
cafca76fa2
2 changed files with 14 additions and 1 deletions
|
|
@ -426,6 +426,15 @@ if system_has_kms_drm and not with_platform_android
|
||||||
c_args += '-DVK_USE_PLATFORM_DISPLAY_KHR'
|
c_args += '-DVK_USE_PLATFORM_DISPLAY_KHR'
|
||||||
cpp_args += '-DVK_USE_PLATFORM_DISPLAY_KHR'
|
cpp_args += '-DVK_USE_PLATFORM_DISPLAY_KHR'
|
||||||
endif
|
endif
|
||||||
|
if host_machine.system() == 'darwin'
|
||||||
|
c_args += '-DVK_USE_PLATFORM_MACOS_MVK'
|
||||||
|
cpp_args += '-DVK_USE_PLATFORM_MACOS_MVK'
|
||||||
|
c_args += '-DVK_USE_PLATFORM_METAL_EXT'
|
||||||
|
cpp_args += '-DVK_USE_PLATFORM_METAL_EXT'
|
||||||
|
#macOS seems to need beta extensions to build for now:
|
||||||
|
c_args += '-DVK_ENABLE_BETA_EXTENSIONS'
|
||||||
|
cpp_args += '-DVK_ENABLE_BETA_EXTENSIONS'
|
||||||
|
endif
|
||||||
|
|
||||||
_egl = get_option('egl')
|
_egl = get_option('egl')
|
||||||
if _egl == 'true'
|
if _egl == 'true'
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@
|
||||||
#include "util/os_file.h"
|
#include "util/os_file.h"
|
||||||
#include "frontend/sw_winsys.h"
|
#include "frontend/sw_winsys.h"
|
||||||
|
|
||||||
#ifndef _WIN32
|
#if !defined(_WIN32) && !defined(__APPLE__)
|
||||||
#define ZINK_USE_DMABUF
|
#define ZINK_USE_DMABUF
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -58,6 +58,10 @@
|
||||||
#define DRM_FORMAT_MOD_LINEAR 0
|
#define DRM_FORMAT_MOD_LINEAR 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(__APPLE__)
|
||||||
|
// Source of MVK_VERSION
|
||||||
|
#include "MoltenVK/vk_mvk_moltenvk.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
equals_ivci(const void *a, const void *b)
|
equals_ivci(const void *a, const void *b)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue