vulkan: return an error if no physical devices found
This commit is contained in:
parent
bfc44f2b4e
commit
5acfa7d3d6
|
@ -190,9 +190,15 @@ bool VulkanContext::InitInstance(const char** extensions, uint32_t extensions_co
|
|||
#endif
|
||||
#endif
|
||||
|
||||
const auto devices = instance->enumeratePhysicalDevices();
|
||||
if (devices.empty())
|
||||
{
|
||||
ERROR_LOG(RENDERER, "Vulkan error: no physical devices found");
|
||||
return false;
|
||||
}
|
||||
|
||||
// Choose a discrete gpu if there's one, otherwise just pick the first one
|
||||
physicalDevice = nullptr;
|
||||
const auto devices = instance->enumeratePhysicalDevices();
|
||||
for (const auto& phyDev : devices)
|
||||
{
|
||||
vk::PhysicalDeviceProperties props;
|
||||
|
|
Loading…
Reference in New Issue