mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-11-03 11:44:18 +01:00
GPU: clean up GPU index detection code
This commit is contained in:
@@ -28,7 +28,7 @@ typedef struct FFGPUMemory
|
||||
|
||||
typedef struct FFGPUResult
|
||||
{
|
||||
uint8_t index;
|
||||
uint32_t index;
|
||||
FFGPUType type;
|
||||
FFstrbuf vendor;
|
||||
FFstrbuf name;
|
||||
|
||||
@@ -65,5 +65,8 @@ const char* ffDetectAmdGpuInfo(const FFGpuDriverCondition* cond, FFGpuDriverResu
|
||||
if (result.type)
|
||||
*result.type = device->isAPU ? FF_GPU_TYPE_INTEGRATED : FF_GPU_TYPE_DISCRETE;
|
||||
|
||||
if (result.index)
|
||||
*result.type = (uint32_t) device->adlAdapterIndex;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ const char* ffGpuDetectMetal(FFlist* gpus)
|
||||
ffStrbufSetStatic(&gpu->platformApi, "Metal Common 1");
|
||||
|
||||
gpu->type = device.hasUnifiedMemory ? FF_GPU_TYPE_INTEGRATED : FF_GPU_TYPE_DISCRETE;
|
||||
gpu->index = (uint8_t)device.locationNumber;
|
||||
gpu->index = (uint32_t) device.locationNumber;
|
||||
#endif
|
||||
}
|
||||
return NULL;
|
||||
|
||||
@@ -37,7 +37,7 @@ typedef struct FFGpuDriverCondition
|
||||
// detect x if not NULL
|
||||
typedef struct FFGpuDriverResult
|
||||
{
|
||||
uint8_t* index;
|
||||
uint32_t* index;
|
||||
double* temp;
|
||||
FFGPUMemory* memory;
|
||||
uint32_t* coreCount;
|
||||
|
||||
@@ -138,7 +138,7 @@ const char *ffDetectMthreadsGpuInfo(const FFGpuDriverCondition *cond, FFGpuDrive
|
||||
{
|
||||
unsigned int value;
|
||||
if (mtmlData.ffmtmlDeviceGetIndex(device, &value) == MTML_SUCCESS)
|
||||
*result.index = (uint8_t)value;
|
||||
*result.index = value;
|
||||
}
|
||||
|
||||
if (result.temp)
|
||||
|
||||
@@ -111,9 +111,9 @@ const char* ffDetectNvidiaGpuInfo(const FFGpuDriverCondition* cond, FFGpuDriverR
|
||||
{
|
||||
unsigned int value;
|
||||
if (nvmlData.ffnvmlDeviceGetIndex(device, &value) == NVML_SUCCESS)
|
||||
*result.index = (uint8_t)value;
|
||||
*result.index = value;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (result.temp)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user