Refactor: move vulkan detection to own header

This commit is contained in:
Linus Dierheimer
2022-07-26 18:18:14 +02:00
parent 298bc10e5f
commit c7bf471e29
5 changed files with 29 additions and 23 deletions
+1
View File
@@ -1,4 +1,5 @@
#include "fastfetch.h"
#include "detection/vulkan.h"
#include <pthread.h>
+26
View File
@@ -0,0 +1,26 @@
#pragma once
#ifndef FF_INCLUDED_detection_vulkan
#define FF_INCLUDED_detection_vulkan
#include "fastfetch.h"
typedef struct FFGPUResult
{
FFstrbuf vendor;
FFstrbuf name;
FFstrbuf driver;
double temperature;
} FFGPUResult;
typedef struct FFVulkanResult
{
FFstrbuf driver;
FFstrbuf apiVersion;
FFstrbuf conformanceVersion;
FFlist devices; //List of FFGPUResult
} FFVulkanResult;
const FFVulkanResult* ffDetectVulkan(const FFinstance* instance);
#endif
-23
View File
@@ -173,22 +173,6 @@ typedef struct FFinstance
FFstate state;
} FFinstance;
typedef struct FFGPUResult
{
FFstrbuf vendor;
FFstrbuf name;
FFstrbuf driver;
double temperature;
} FFGPUResult;
typedef struct FFVulkanResult
{
FFstrbuf driver;
FFstrbuf apiVersion;
FFstrbuf conformanceVersion;
FFlist devices; //List of FFGPUResult
} FFVulkanResult;
//////////////////////
// Init functions //
//////////////////////
@@ -212,13 +196,6 @@ void ffLogoBuiltinPrint(FFinstance* instance);
void ffLogoBuiltinList();
void ffLogoBuiltinListAutocompletion();
/////////////////////////
// Detection functions //
/////////////////////////
//detection/vulkan.c
const FFVulkanResult* ffDetectVulkan(const FFinstance* instance);
//////////////////////
// Module functions //
//////////////////////
+1
View File
@@ -3,6 +3,7 @@
#include "common/caching.h"
#include "common/parsing.h"
#include "detection/temps.h"
#include "detection/vulkan.h"
#include <stdlib.h>
+1
View File
@@ -1,5 +1,6 @@
#include "fastfetch.h"
#include "common/printing.h"
#include "detection/vulkan.h"
#define FF_VULKAN_MODULE_NAME "Vulkan"
#define FF_VULKAN_NUM_FORMAT_ARGS 3