From 0108bae30f5f5deba8e430766dc3465bda82d309 Mon Sep 17 00:00:00 2001 From: "duncan.hopkins" Date: Fri, 27 Oct 2023 15:34:01 +0100 Subject: [PATCH] apple: Meson defines GLX_USE_APPLE to allow for Gallium drivers to work on MacOS. By default, on MacOS, MESA will build a version that does not run the Gallium drivers on MacOS. GLX_USE_APPLE must be defined to switch the code over to using the Gallium drivers. GLX_USE_APPLE will be defined if any Gallium driver other than just SWRast is requested. The default behaviour, due to default values, always asks for SWRast. This logic leaves the default behaviour alone but allows the Gallium drivers to be actived without extra parameters. Part-of: --- meson.build | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/meson.build b/meson.build index 686d5225deb..f6abd9165b8 100644 --- a/meson.build +++ b/meson.build @@ -860,6 +860,12 @@ if with_platform_x11 pre_args += '-DGLX_USE_DRM' elif with_dri_platform == 'apple' pre_args += '-DGLX_USE_APPLEGL' + # Check to see if more than just the default 'swrast' is required + if (not with_gallium_softpipe) or 1 < gallium_drivers.length() + # Switch the MacOS code from "forwarding to the OpenGL.framework" mode + # and into actual Gallium Driver mode + pre_args += '-DGLX_USE_APPLE' + endif elif with_dri_platform == 'windows' pre_args += '-DGLX_USE_WINDOWSGL' endif