gallium: Only use Asahi's software path on macOS

On macOS, we don't have DRM or any real WSI, so Asahi has to pretend to be a
software rasterizer to load. On Linux, we do have DRM and proper WSI, so we
don't want that. For faking Asahi devices on Linux, we should use drm-shim
instead. This makes sure we don't accidentally load Asahi on non-M1 Linux.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15940>
This commit is contained in:
Alyssa Rosenzweig
2022-06-09 09:45:37 -04:00
committed by Alyssa Rosenzweig
parent db8ab52447
commit b575f5ed6c
2 changed files with 6 additions and 6 deletions

View File

@@ -30,7 +30,7 @@
#include "d3d12/d3d12_public.h"
#endif
#ifdef GALLIUM_ASAHI
#if defined(GALLIUM_ASAHI) && __APPLE__
#include "asahi/agx_public.h"
#endif
@@ -67,7 +67,7 @@ sw_screen_create_named(struct sw_winsys *winsys, const char *driver)
screen = d3d12_create_dxcore_screen(winsys, NULL);
#endif
#if defined(GALLIUM_ASAHI)
#if defined(GALLIUM_ASAHI) && __APPLE__
if (screen == NULL && strcmp(driver, "asahi") == 0)
screen = agx_screen_create(0, NULL, winsys);
#endif
@@ -85,7 +85,7 @@ sw_screen_create_vk(struct sw_winsys *winsys, bool sw_vk)
#if defined(GALLIUM_D3D12)
(sw_vk || only_sw) ? "" : "d3d12",
#endif
#if defined(GALLIUM_ASAHI)
#if defined(GALLIUM_ASAHI) && __APPLE__
(sw_vk || only_sw) ? "" : "asahi",
#endif
#if defined(GALLIUM_LLVMPIPE)

View File

@@ -21,7 +21,7 @@
#include "d3d12/d3d12_public.h"
#endif
#ifdef GALLIUM_ASAHI
#if defined(GALLIUM_ASAHI) && __APPLE__
#include "asahi/agx_public.h"
#endif
@@ -71,7 +71,7 @@ sw_screen_create_named(struct sw_winsys *winsys, const struct pipe_screen_config
screen = d3d12_create_dxcore_screen(winsys, NULL);
#endif
#if defined(GALLIUM_ASAHI)
#if defined(GALLIUM_ASAHI) && __APPLE__
if (screen == NULL && strcmp(driver, "asahi") == 0)
screen = agx_screen_create(0, NULL, winsys);
#endif
@@ -88,7 +88,7 @@ sw_screen_create_vk(struct sw_winsys *winsys, const struct pipe_screen_config *c
#if defined(GALLIUM_D3D12)
(sw_vk || only_sw) ? "" : "d3d12",
#endif
#if defined(GALLIUM_ASAHI)
#if defined(GALLIUM_ASAHI) && __APPLE__
(sw_vk || only_sw) ? "" : "asahi",
#endif
#if defined(GALLIUM_LLVMPIPE)