-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
VulkanDeviceInfoExtensions.h
96 lines (87 loc) · 3.01 KB
/
VulkanDeviceInfoExtensions.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/*
* Vulkan hardware capability viewer
*
* THIS HEADER IS AUTO-GENERATED, DO NOT CHANGE
* See https://github.com/SaschaWillems/VulkanCapsViewerGenerator for the generator
*
* Copyright (C) by Sascha Willems (www.saschawillems.de)
*
* This code is free software, you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License version 3 as published by the Free Software Foundation.
*
* Please review the following information to ensure the GNU Lesser
* General Public License version 3 requirements will be met:
* http://opensource.org/licenses/lgpl-3.0.html
*
* The code is distributed WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU LGPL 3.0 for more details.
*/
#ifndef VULKANDEVICEINFOEXTENSIONS_H
#define VULKANDEVICEINFOEXTENSIONS_H
#include <vector>
#include <string>
#include <QVariant>
#include "vulkan/vulkan.h"
#include "vulkanpfn.h"
#include "vulkanresources.h"
#ifdef __ANDROID__
#include <sys/system_properties.h>
#include "vulkanandroid.h"
#endif
struct Feature2 {
std::string name;
VkBool32 supported;
const char* extension;
Feature2(std::string n, VkBool32 supp, const char* ext) : name(n), supported(supp), extension(ext) {}
};
struct Property2 {
std::string name;
QVariant value;
const char* extension;
Property2(std::string n, QVariant val, const char* ext) : name(n), value(val), extension(ext) {}
};
class VulkanDeviceInfoExtensions
{
private:
VkPhysicalDeviceFeatures2 initDeviceFeatures2(void *pNext);
VkPhysicalDeviceProperties2 initDeviceProperties2(void * pNext);
template<typename T>
void pushProperty2(const char* extension, std::string name, T value) {
properties2.push_back(Property2(name, QVariant(value), extension));
};
template<typename T>
QVariantList arrayToQVariantList(T array, size_t size) {
QVariantList res;
for (size_t i = 0; i < size; i++) {
res.push_back(QVariant(array[i]));
}
return res;
};
void pushFeature2(const char* extension, std::string name, bool supported);
bool extensionSupported(const char* extensionName);
void readPhysicalFeatures_AMD();
void readPhysicalProperties_AMD();
void readPhysicalFeatures_ARM();
void readPhysicalFeatures_EXT();
void readPhysicalProperties_EXT();
void readPhysicalFeatures_HUAWEI();
void readPhysicalProperties_HUAWEI();
void readPhysicalFeatures_INTEL();
void readPhysicalFeatures_KHR();
void readPhysicalProperties_KHR();
void readPhysicalFeatures_NV();
void readPhysicalProperties_NV();
void readPhysicalProperties_NVX();
void readPhysicalFeatures_VALVE();
public:
const uint32_t vkHeaderVersion = 200;
std::vector<Feature2> features2;
std::vector<Property2> properties2;
std::vector<VkExtensionProperties> extensions;
VkPhysicalDevice device;
void readExtendedFeatures();
void readExtendedProperties();
};
#endif // VULKANDEVICEINFOEXTENSIONS_H