From 66982834301fb79d7b29990df6ada31deea5ccf2 Mon Sep 17 00:00:00 2001 From: Carter Li Date: Thu, 4 Jan 2024 10:29:02 +0800 Subject: [PATCH] GPU: fix vendor detection for asahi --- src/detection/gpu/gpu.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/detection/gpu/gpu.c b/src/detection/gpu/gpu.c index 435d687aa..66e11c805 100644 --- a/src/detection/gpu/gpu.c +++ b/src/detection/gpu/gpu.c @@ -73,15 +73,17 @@ const char* detectByOpenGL(FFlist* gpus) if (!gpu->vendor.length) { - if (ffStrbufContainS(&result.renderer, "Apple")) + if (ffStrbufContainS(&gpu->name, "Apple")) ffStrbufSetStatic(&gpu->vendor, FF_GPU_VENDOR_NAME_APPLE); - else if (ffStrbufContainS(&result.renderer, "Intel")) + else if (ffStrbufContainS(&gpu->name, "Intel")) ffStrbufSetStatic(&gpu->vendor, FF_GPU_VENDOR_NAME_INTEL); - else if (ffStrbufContainS(&result.renderer, "AMD") || ffStrbufContainS(&result.renderer, "ATI")) + else if (ffStrbufContainS(&gpu->name, "AMD") || ffStrbufContainS(&gpu->name, "ATI")) ffStrbufSetStatic(&gpu->vendor, FF_GPU_VENDOR_NAME_AMD); - else if (ffStrbufContainS(&result.renderer, "NVIDIA")) + else if (ffStrbufContainS(&gpu->name, "NVIDIA")) ffStrbufSetStatic(&gpu->vendor, FF_GPU_VENDOR_NAME_NVIDIA); } + if (ffStrbufEqualS(&gpu->vendor, FF_GPU_VENDOR_NAME_APPLE)) + gpu->type = FF_GPU_TYPE_INTEGRATED; } ffStrbufDestroy(&result.version);