mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-12 10:22:12 +02:00
Vulkan: try fixing #456
This commit is contained in:
@@ -37,6 +37,7 @@ typedef struct FFGPUResult
|
||||
int coreCount;
|
||||
FFGPUMemory dedicated;
|
||||
FFGPUMemory shared;
|
||||
uint32_t vulkanDeviceId; // Only used for vulkan
|
||||
} FFGPUResult;
|
||||
|
||||
const FFlist* ffDetectGPU(const FFinstance* instance);
|
||||
|
||||
@@ -176,8 +176,17 @@ static const char* detectVulkan(const FFinstance* instance, FFVulkanResult* resu
|
||||
if(physicalDeviceProperties.properties.deviceType == VK_PHYSICAL_DEVICE_TYPE_CPU)
|
||||
continue;
|
||||
|
||||
// #456
|
||||
FF_LIST_FOR_EACH(FFGPUResult, gpu, result->gpus)
|
||||
{
|
||||
if (gpu->vulkanDeviceId == physicalDeviceProperties.properties.deviceID)
|
||||
goto next;
|
||||
}
|
||||
|
||||
FFGPUResult* gpu = ffListAdd(&result->gpus);
|
||||
|
||||
gpu->vulkanDeviceId = physicalDeviceProperties.properties.deviceID;
|
||||
|
||||
ffStrbufInit(&gpu->name);
|
||||
ffStrbufAppendS(&gpu->name, physicalDeviceProperties.properties.deviceName);
|
||||
|
||||
@@ -215,6 +224,9 @@ static const char* detectVulkan(const FFinstance* instance, FFVulkanResult* resu
|
||||
//No way to detect those using vulkan
|
||||
gpu->coreCount = FF_GPU_CORE_COUNT_UNSET;
|
||||
gpu->temperature = FF_GPU_TEMP_UNSET;
|
||||
|
||||
next:
|
||||
continue;
|
||||
}
|
||||
|
||||
//If the highest device version is lower than the instance version, use it as our vulkan version
|
||||
|
||||
Reference in New Issue
Block a user