mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-11-06 13:14:21 +01:00
GPU: support JSON config
This commit is contained in:
@@ -36,7 +36,7 @@ const FFlist* ffDetectGPU(const FFinstance* instance)
|
||||
{
|
||||
FF_DETECTION_INTERNAL_GUARD(FFlist,
|
||||
ffListInit(&result, sizeof(FFGPUResult));
|
||||
if(instance->config.gpuForceVulkan || ffDetectGPUImpl(&result, instance) != NULL)
|
||||
if(instance->config.gpu.forceVulkan || ffDetectGPUImpl(&result, instance) != NULL)
|
||||
{
|
||||
const FFVulkanResult* vulkan = ffDetectVulkan(instance);
|
||||
result = vulkan->gpus;
|
||||
|
||||
@@ -14,13 +14,6 @@ extern const char* FF_GPU_VENDOR_NAME_AMD;
|
||||
extern const char* FF_GPU_VENDOR_NAME_INTEL;
|
||||
extern const char* FF_GPU_VENDOR_NAME_NVIDIA;
|
||||
|
||||
typedef enum FFGpuType
|
||||
{
|
||||
FF_GPU_TYPE_UNKNOWN,
|
||||
FF_GPU_TYPE_INTEGRATED,
|
||||
FF_GPU_TYPE_DISCRETE,
|
||||
} FFGpuType;
|
||||
|
||||
typedef struct FFGPUMemory
|
||||
{
|
||||
uint64_t total;
|
||||
@@ -29,7 +22,7 @@ typedef struct FFGPUMemory
|
||||
|
||||
typedef struct FFGPUResult
|
||||
{
|
||||
FFGpuType type;
|
||||
FFGPUType type;
|
||||
FFstrbuf vendor;
|
||||
FFstrbuf name;
|
||||
FFstrbuf driver;
|
||||
|
||||
@@ -99,7 +99,7 @@ const char* ffDetectGPUImpl(FFlist* gpus, const FFinstance* instance)
|
||||
if(ffCfDictGetInt(properties, CFSTR("gpu-core-count"), &gpu->coreCount))
|
||||
gpu->coreCount = FF_GPU_CORE_COUNT_UNSET;
|
||||
|
||||
if(instance->config.gpuTemp)
|
||||
if(instance->config.gpu.temp)
|
||||
gpu->temperature = detectGpuTemp(&gpu->name);
|
||||
else
|
||||
gpu->temperature = FF_GPU_TEMP_UNSET;
|
||||
|
||||
@@ -216,7 +216,7 @@ static void pciHandleDevice(const FFinstance* instance, FFlist* results, PCIData
|
||||
gpu->coreCount = FF_GPU_CORE_COUNT_UNSET;
|
||||
|
||||
gpu->temperature = FF_GPU_TEMP_UNSET;
|
||||
if(instance->config.gpuTemp)
|
||||
if(instance->config.gpu.temp)
|
||||
pciDetectTemperatur(gpu, device);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user