mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-28 15:53:51 +01:00
GPU: detect GPU index (#1267)
This commit is contained in:
@@ -322,6 +322,15 @@ void ffGenerateGPUJsonResult(FFGPUOptions* options, yyjson_mut_doc* doc, yyjson_
|
||||
FF_LIST_FOR_EACH(FFGPUResult, gpu, gpus)
|
||||
{
|
||||
yyjson_mut_val* obj = yyjson_mut_arr_add_obj(doc, arr);
|
||||
|
||||
if (gpu->index != FF_GPU_INDEX_UNSET){
|
||||
yyjson_mut_obj_add_uint(doc, obj, "index", (uint64_t)gpu->index);
|
||||
}
|
||||
else
|
||||
{
|
||||
yyjson_mut_obj_add_null(doc, obj, "index");
|
||||
}
|
||||
|
||||
if (gpu->coreCount != FF_GPU_CORE_COUNT_UNSET)
|
||||
yyjson_mut_obj_add_int(doc, obj, "coreCount", gpu->coreCount);
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user