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: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28205>
This commit is contained in:
duncan.hopkins 2023-10-27 15:34:01 +01:00 committed by Marge Bot
parent 97b6851815
commit 0108bae30f

View File

@ -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