mirror of
https://github.com/skyline-emu/skyline.git
synced 2025-01-10 20:19:24 +01:00
Check for no Vulkan physical devices
Due to broken drivers, it's possible to find no Vulkan physical devices but this can lead to a cryptic segfault. This explicitly checks for it instead and throws an exception which will be emitted into logcat thus can be easily caught.
This commit is contained in:
parent
f882b613bc
commit
45d0558d00
@ -213,7 +213,10 @@ namespace skyline::gpu {
|
||||
}
|
||||
|
||||
static vk::raii::PhysicalDevice CreatePhysicalDevice(const vk::raii::Instance &instance) {
|
||||
return std::move(vk::raii::PhysicalDevices(instance).front()); // We just select the first device as we aren't expecting multiple GPUs
|
||||
auto devices{vk::raii::PhysicalDevices(instance)};
|
||||
if (devices.empty())
|
||||
throw exception("No Vulkan physical devices found");
|
||||
return std::move(devices.front()); // We just select the first device as we aren't expecting multiple GPUs
|
||||
}
|
||||
|
||||
static vk::raii::Device CreateDevice(const vk::raii::Context &context,
|
||||
|
Loading…
x
Reference in New Issue
Block a user