-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
vulkanDeviceInfo.h
121 lines (110 loc) · 3.15 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
/*
*
* Vulkan hardware capability viewer
*
* Device information class
*
* Copyright (C) 2016-2021 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 "vulkanpfn.h"
#ifdef __ANDROID__
#include <sys/system_properties.h>
#endif
#ifdef VK_USE_PLATFORM_XCB_KHR
#include <QX11Info>
#endif
#include "vulkanandroid.h"
struct OSInfo
{
std::string name;
std::string version;
std::string architecture;
};
struct VulkanQueueFamilyInfo
{
VkQueueFamilyProperties properties;
VkBool32 supportsPresent;
};
class VulkanDeviceInfo: public VulkanDeviceInfoExtensions
{
private:
std::vector<VulkanLayerInfo> layers;
bool vulkan_1_1();
bool vulkan_1_2();
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;
bool hasSubgroupProperties = false;
QVariantMap subgroupProperties;
QVariantMap core11Properties;
QVariantMap core12Properties;
std::vector<VulkanQueueFamilyInfo> queueFamilies;
std::vector<VulkanFormatInfo> formats;
VulkanSurfaceInfo surfaceInfo;
OSInfo os;
QString appVersion;
QString reportVersion;
std::vector<VulkanLayerInfo> getLayers();
std::string getDriverVersion();
void readExtensions();
void readLayers();
void readSupportedFormats();
void readQueueFamilies(VkSurfaceKHR surface);
void readPhysicalProperties();
void readPhysicalFeatures();
void readPhysicalLimits();
void readPhysicalMemoryProperties();
void readSurfaceInfo(VkSurfaceKHR surface, std::string surfaceExtension);
void readPlatformDetails();
QJsonObject toJson(QString submitter, QString comment);
};
#endif // VULKANDEVICEINFO_H