Skip to content

Commit c7bf471

Browse files
Refactor: move vulkan detection to own header
1 parent 298bc10 commit c7bf471

File tree

5 files changed

+29
-23
lines changed

5 files changed

+29
-23
lines changed

src/detection/vulkan.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include "fastfetch.h"
2+
#include "detection/vulkan.h"
23

34
#include <pthread.h>
45

src/detection/vulkan.h

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#pragma once
2+
3+
#ifndef FF_INCLUDED_detection_vulkan
4+
#define FF_INCLUDED_detection_vulkan
5+
6+
#include "fastfetch.h"
7+
8+
typedef struct FFGPUResult
9+
{
10+
FFstrbuf vendor;
11+
FFstrbuf name;
12+
FFstrbuf driver;
13+
double temperature;
14+
} FFGPUResult;
15+
16+
typedef struct FFVulkanResult
17+
{
18+
FFstrbuf driver;
19+
FFstrbuf apiVersion;
20+
FFstrbuf conformanceVersion;
21+
FFlist devices; //List of FFGPUResult
22+
} FFVulkanResult;
23+
24+
const FFVulkanResult* ffDetectVulkan(const FFinstance* instance);
25+
26+
#endif

src/fastfetch.h

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -173,22 +173,6 @@ typedef struct FFinstance
173173
FFstate state;
174174
} FFinstance;
175175

176-
typedef struct FFGPUResult
177-
{
178-
FFstrbuf vendor;
179-
FFstrbuf name;
180-
FFstrbuf driver;
181-
double temperature;
182-
} FFGPUResult;
183-
184-
typedef struct FFVulkanResult
185-
{
186-
FFstrbuf driver;
187-
FFstrbuf apiVersion;
188-
FFstrbuf conformanceVersion;
189-
FFlist devices; //List of FFGPUResult
190-
} FFVulkanResult;
191-
192176
//////////////////////
193177
// Init functions //
194178
//////////////////////
@@ -212,13 +196,6 @@ void ffLogoBuiltinPrint(FFinstance* instance);
212196
void ffLogoBuiltinList();
213197
void ffLogoBuiltinListAutocompletion();
214198

215-
/////////////////////////
216-
// Detection functions //
217-
/////////////////////////
218-
219-
//detection/vulkan.c
220-
const FFVulkanResult* ffDetectVulkan(const FFinstance* instance);
221-
222199
//////////////////////
223200
// Module functions //
224201
//////////////////////

src/modules/gpu.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include "common/caching.h"
44
#include "common/parsing.h"
55
#include "detection/temps.h"
6+
#include "detection/vulkan.h"
67

78
#include <stdlib.h>
89

src/modules/vulkan.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "fastfetch.h"
22
#include "common/printing.h"
3+
#include "detection/vulkan.h"
34

45
#define FF_VULKAN_MODULE_NAME "Vulkan"
56
#define FF_VULKAN_NUM_FORMAT_ARGS 3

0 commit comments

Comments
 (0)