GPU: detect supported platform graphic API version

This commit is contained in:
李通洲
2023-12-29 15:12:41 +08:00
parent 0284f6bfd1
commit c1f511c8f2
12 changed files with 210 additions and 136 deletions
+6
View File
@@ -6,6 +6,8 @@
#include <IOKit/graphics/IOGraphicsLib.h>
const char* ffGpuDetectMetal(FFlist* gpus);
static double detectGpuTemp(const FFstrbuf* gpuName)
{
double result = 0;
@@ -55,6 +57,8 @@ const char* ffDetectGPUImpl(const FFGPUOptions* options, FFlist* gpus)
gpu->dedicated.total = gpu->dedicated.used = gpu->shared.total = gpu->shared.used = FF_GPU_VMEM_SIZE_UNSET;
gpu->type = FF_GPU_TYPE_UNKNOWN;
gpu->frequency = FF_GPU_FREQUENCY_UNSET;
IORegistryEntryGetRegistryEntryID(registryEntry, &gpu->deviceId);
ffStrbufInitStatic(&gpu->platformApi, "Metal");
ffStrbufInit(&gpu->driver); // Ok for both Apple and Intel
ffCfDictGetString(properties, CFSTR("CFBundleIdentifier"), &gpu->driver);
@@ -103,5 +107,7 @@ const char* ffDetectGPUImpl(const FFGPUOptions* options, FFlist* gpus)
}
IOObjectRelease(iterator);
ffGpuDetectMetal(gpus);
return NULL;
}