Don't abort if Vulkan is not available
This commit is contained in:
@@ -193,7 +193,7 @@ Kirigami.ApplicationWindow {
|
||||
text: Settings.flatpak ? i18n("Vulkan drivers cannot be found, you may need to run \"flatpak update\"") : i18n("Vulkan drivers cannot be found")
|
||||
type: Kirigami.MessageType.Warning
|
||||
showCloseButton: true
|
||||
visible: DashboardSettings.show_system_checks && VulkanInfo.type == VulkanInfo.SoftGPU
|
||||
visible: DashboardSettings.show_system_checks && (VulkanInfo.type == VulkanInfo.SoftGPU || VulkanInfo.type == VulkanInfo.NoGPU)
|
||||
}
|
||||
|
||||
Kirigami.InlineMessage {
|
||||
|
||||
@@ -24,14 +24,21 @@
|
||||
|
||||
vulkan_info::vulkan_info()
|
||||
{
|
||||
vk::raii::Context context;
|
||||
try
|
||||
{
|
||||
vk::raii::Context context;
|
||||
|
||||
vk::ApplicationInfo app_info{"WiVRn dashboard", 1, "No engine", 1, VK_API_VERSION_1_1};
|
||||
vk::InstanceCreateInfo instance_info{vk::InstanceCreateFlags{0}, &app_info};
|
||||
vk::raii::Instance vulkan{context, instance_info};
|
||||
vk::ApplicationInfo app_info{"WiVRn dashboard", 1, "No engine", 1, VK_API_VERSION_1_1};
|
||||
vk::InstanceCreateInfo instance_info{vk::InstanceCreateFlags{0}, &app_info};
|
||||
vk::raii::Instance vulkan{context, instance_info};
|
||||
|
||||
auto devices = vulkan.enumeratePhysicalDevices();
|
||||
set_info(choose_device(devices));
|
||||
auto devices = vulkan.enumeratePhysicalDevices();
|
||||
set_info(choose_device(devices));
|
||||
}
|
||||
catch (std::runtime_error & e)
|
||||
{
|
||||
qCritical() << "Failed to get vulkan info: " << e.what();
|
||||
}
|
||||
}
|
||||
|
||||
static vulkan_info::gpu_type cast_type(vk::PhysicalDeviceType type)
|
||||
|
||||
@@ -41,6 +41,7 @@ public:
|
||||
SoftGPU,
|
||||
VirtGPU,
|
||||
OtherGPU,
|
||||
NoGPU,
|
||||
};
|
||||
Q_ENUM(gpu_type)
|
||||
|
||||
@@ -51,8 +52,8 @@ public:
|
||||
|
||||
QString m_driverId;
|
||||
QString m_driverVersion;
|
||||
uint32_t m_driverVersionCode;
|
||||
gpu_type m_type;
|
||||
uint32_t m_driverVersionCode{};
|
||||
gpu_type m_type = NoGPU;
|
||||
|
||||
vk::raii::PhysicalDevice & choose_device(std::vector<vk::raii::PhysicalDevice> & devices);
|
||||
void set_info(vk::raii::PhysicalDevice & device);
|
||||
|
||||
Reference in New Issue
Block a user