GPU: fix Intel compatibility

This commit is contained in:
Carter Li
2022-09-17 00:35:07 +08:00
parent d5500ad4f7
commit bb3689b348
+9 -6
View File
@@ -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);