-
Notifications
You must be signed in to change notification settings - Fork 69
/
vulkanDeviceInfo.h
136 lines (124 loc) · 3.48 KB
/
vulkanDeviceInfo.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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
/*
*
* Vulkan hardware capability viewer
*
* Device information class
*
* Copyright (C) 2016-2024 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 VULKANDEVICEINFO_H
#define VULKANDEVICEINFO_H
#include <vector>
#include <assert.h>
#include <string>
#include <unordered_map>
#include <map>
#include <list>
#include <iostream>
#include <fstream>
#include <utility>
#include <QJsonDocument>
#include <QJsonObject>
#include <QJsonArray>
#include <QFile>
#include <QDebug>
#include "vulkan/vulkan.h"
#include "vulkanresources.h"
#include "vulkanLayerInfo.hpp"
#include "vulkanFormatInfo.hpp"
#include "vulkansurfaceinfo.hpp"
#include "VulkanDeviceInfoExtensions.h"
#include "VulkanContext.h"
#ifdef __ANDROID__
#include <sys/system_properties.h>
#endif
#ifdef VK_USE_PLATFORM_XCB_KHR
#include <QX11Info>
#endif
#include "vulkanandroid.h"
#if !defined(DISABLE_PROFILES)
#include "vulkan_profiles.hpp"
#endif
struct OSInfo
{
std::string name;
std::string version;
std::string architecture;
int32_t type{ -1 };
};
struct VulkanQueueFamilyInfo
{
VkQueueFamilyProperties properties;
VkBool32 supportsPresent;
};
struct VulkanProfileInfo
{
std::string profileName;
uint32_t specVersion;
bool supported = false;
};
class VulkanDeviceInfo: public VulkanDeviceInfoExtensions
{
private:
std::vector<VulkanLayerInfo> layers;
bool vulkanVersionSupported(uint32_t major, uint32_t minor);
bool extensionSupported(const char* extensionName);
#if defined(__ANDROID__)
std::string getSystemProperty(const char* propname);
#endif
public:
uint32_t id;
QVariantMap properties;
QVariantMap sparseProperties;
QVariantMap limits;
QVariantMap features;
std::map<std::string, std::string> platformdetails;
VkDevice dev = VK_NULL_HANDLE;
VkPhysicalDeviceProperties props;
VkPhysicalDeviceMemoryProperties memoryProperties;
VkPhysicalDeviceFeatures deviceFeatures;
QVariantMap core11Features;
QVariantMap core12Features;
QVariantMap core13Features;
bool hasSubgroupProperties = false;
bool hasFeaturModifyingTool = false;
QVariantMap subgroupProperties;
QVariantMap core11Properties;
QVariantMap core12Properties;
QVariantMap core13Properties;
std::vector<VulkanQueueFamilyInfo> queueFamilies;
std::vector<VulkanFormatInfo> formats;
VulkanSurfaceInfo surfaceInfo;
std::vector<VulkanProfileInfo> profiles;
OSInfo os;
QString appVersion;
QString reportVersion;
std::vector<VulkanLayerInfo> getLayers();
std::string getDriverVersion();
void readExtensions();
void readLayers();
void readSupportedFormats();
void readQueueFamilies();
void readPhysicalProperties();
void readPhysicalFeatures();
void readPhysicalLimits();
void readPhysicalMemoryProperties();
void readSurfaceInfo();
void readPlatformDetails();
void readProfiles();
QJsonObject toJson(QString submitter, QString comment);
};
#endif // VULKANDEVICEINFO_H