diff options
author | Marek Olšák <marek.olsak@amd.com> | 2023-01-26 22:29:19 -0500 |
---|---|---|
committer | Matt Turner <mattst88@gmail.com> | 2024-04-23 14:33:54 -0400 |
commit | 027ccc89b2ab83fdb9dbc42c9f5a31c175c7f554 (patch) | |
tree | a6ddf305e3ec79d11724deb11fc7081435ae579e | |
parent | f62e842e31e75311de225859b951b691501c32e8 (diff) |
egl: don't expose swrast device if swrast is not builtamber
This fixes piglit/egl_ext_device_base without swrast.
Reviewed-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
(cherry picked from commit 48e218b49d6bdfd167b755e3983bce4f14132347)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28885>
-rw-r--r-- | src/egl/main/egldevice.c | 8 | ||||
-rw-r--r-- | src/egl/meson.build | 4 |
2 files changed, 11 insertions, 1 deletions
diff --git a/src/egl/main/egldevice.c b/src/egl/main/egldevice.c index 9bc939f7d3d..ff479fa0691 100644 --- a/src/egl/main/egldevice.c +++ b/src/egl/main/egldevice.c @@ -332,7 +332,13 @@ _eglQueryDevicesEXT(EGLint max_devices, num_devs = _eglRefreshDeviceList(); devs = _eglGlobal.DeviceList; + +#ifdef GALLIUM_SOFTPIPE swrast = devs; +#else + swrast = NULL; + num_devs--; +#endif /* The first device is swrast. Start with the non-swrast device. */ devs = devs->Next; @@ -356,7 +362,7 @@ _eglQueryDevicesEXT(EGLint max_devices, } /* User requested the full device list, add the sofware device. */ - if (max_devices >= num_devs) { + if (max_devices >= num_devs && swrast) { assert(_eglDeviceSupports(swrast, _EGL_DEVICE_SOFTWARE)); devices[num_devs - 1] = swrast; } diff --git a/src/egl/meson.build b/src/egl/meson.build index b6f7d1cf3d4..809b6185954 100644 --- a/src/egl/meson.build +++ b/src/egl/meson.build @@ -27,6 +27,10 @@ link_for_egl = [] deps_for_egl = [] incs_for_egl = [inc_include, inc_src, inc_egl] +if with_gallium_softpipe + c_args_for_egl += '-DGALLIUM_SOFTPIPE' +endif + files_egl = files( 'main/eglapi.c', 'main/eglarray.c', |