Better handling of device creation failure
This commit is contained in:
parent
8374d6cd68
commit
1d815e6ced
1 changed files with 6 additions and 5 deletions
|
|
@ -284,15 +284,16 @@ namespace vks
|
||||||
deviceCreateInfo.ppEnabledExtensionNames = deviceExtensions.data();
|
deviceCreateInfo.ppEnabledExtensionNames = deviceExtensions.data();
|
||||||
}
|
}
|
||||||
|
|
||||||
VkResult result = vkCreateDevice(physicalDevice, &deviceCreateInfo, nullptr, &logicalDevice);
|
this->enabledFeatures = enabledFeatures;
|
||||||
|
|
||||||
if (result == VK_SUCCESS)
|
VkResult result = vkCreateDevice(physicalDevice, &deviceCreateInfo, nullptr, &logicalDevice);
|
||||||
|
if (result != VK_SUCCESS)
|
||||||
{
|
{
|
||||||
// Create a default command pool for graphics command buffers
|
return result;
|
||||||
commandPool = createCommandPool(queueFamilyIndices.graphics);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this->enabledFeatures = enabledFeatures;
|
// Create a default command pool for graphics command buffers
|
||||||
|
commandPool = createCommandPool(queueFamilyIndices.graphics);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue