From bb3689b3487ef19c606ba5ed8388eb7efed0420c Mon Sep 17 00:00:00 2001 From: Carter Li Date: Sat, 17 Sep 2022 00:35:07 +0800 Subject: [PATCH] GPU: fix Intel compatibility --- src/detection/gpu/gpu_apple.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/detection/gpu/gpu_apple.c b/src/detection/gpu/gpu_apple.c index b8a2b34e6..b0388c234 100644 --- a/src/detection/gpu/gpu_apple.c +++ b/src/detection/gpu/gpu_apple.c @@ -26,17 +26,20 @@ const char* ffDetectGPUImpl(FFlist* gpus, const FFinstance* instance) FFGPUResult* gpu = ffListAdd(gpus); - ffStrbufInit(&gpu->name); - ffCfDictGetString(properties, "model", &gpu->name); - - if (!ffCfDictGetInt(properties, "gpu-core-count", &gpu->coreCount)) - gpu->coreCount = FF_GPU_CORE_COUNT_UNSET; - ffStrbufInitA(&gpu->vendor, 0); ffStrbufInit(&gpu->driver); ffCfDictGetString(properties, "CFBundleIdentifier", &gpu->driver); + ffStrbufInit(&gpu->name); + //IOAccelerator returns model property for Apple Silicon, but not for Intel Iris GPUs. + //Still needs testing for AMD's + if(!ffCfDictGetString(properties, "model", &gpu->name) && gpu->driver.length > 0) + ffStrbufAppendS(&gpu->name, gpu->driver.chars + ffStrbufLastIndexC(&gpu->driver, '.') + 1); + + if(!ffCfDictGetInt(properties, "gpu-core-count", &gpu->coreCount)) + gpu->coreCount = FF_GPU_CORE_COUNT_UNSET; + gpu->temperature = FF_GPU_TEMP_UNSET; CFRelease(properties);