mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-12-03 11:13:44 +01:00
Vulkan: If there are no GPUs available, fail properly instead of asserting.
Seen on an obscure x86-64 android device when running 32-bit binaries
This commit is contained in:
1 parent
686726533a
commit
356b25e3ce
1 file changed
+9
@@ -123,11 +123,20 @@ VkResult VulkanContext::CreateInstance(const char *app_name, int app_ver, uint32
|
||||
|
||||
uint32_t gpu_count = 1;
|
||||
res = vkEnumeratePhysicalDevices(instance_, &gpu_count, nullptr);
|
||||
if (gpu_count <= 0) {
|
||||
ELOG("Vulkan driver found but no supported GPU is available");
|
||||
init_error_ = "No Vulkan physical devices found";
|
||||
vkDestroyInstance(instance_, nullptr);
|
||||
instance_ = nullptr;
|
||||
return VK_ERROR_INITIALIZATION_FAILED;
|
||||
}
|
||||
|
||||
assert(gpu_count > 0);
|
||||
physical_devices_.resize(gpu_count);
|
||||
res = vkEnumeratePhysicalDevices(instance_, &gpu_count, physical_devices_.data());
|
||||
if (res != VK_SUCCESS) {
|
||||
init_error_ = "Failed to enumerate physical devices";
|
||||
vkDestroyInstance(instance_, nullptr);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user