summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-11-29 13:03:01 +0100
committerGitHub <noreply@github.com>2020-11-29 13:03:01 +0100
commitd1943f6a77c9a1832795c6e095d61d8d5b63a371 (patch)
treea3cf26992e8fa1b67b477d43d23fb2da76f93039
parentef2d1f6d19f861f0f4d9cf7c581795bc7f4016d8 (diff)
parentcc2097c79c13ee80a89589611f7db504e0d8ba32 (diff)
Merge pull request #38939 from hbina/vk_error_handling
Better error handling of vkEnumerateInstanceExtensionProperties
-rw-r--r--drivers/vulkan/vulkan_context.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/vulkan/vulkan_context.cpp b/drivers/vulkan/vulkan_context.cpp
index ecf9dac61b..855c8a2d68 100644
--- a/drivers/vulkan/vulkan_context.cpp
+++ b/drivers/vulkan/vulkan_context.cpp
@@ -216,7 +216,6 @@ Error VulkanContext::_create_validation_layers() {
}
Error VulkanContext::_initialize_extensions() {
- VkResult err;
uint32_t instance_extension_count = 0;
enabled_extension_count = 0;
@@ -226,13 +225,13 @@ Error VulkanContext::_initialize_extensions() {
VkBool32 platformSurfaceExtFound = 0;
memset(extension_names, 0, sizeof(extension_names));
- err = vkEnumerateInstanceExtensionProperties(nullptr, &instance_extension_count, nullptr);
- ERR_FAIL_COND_V(err, ERR_CANT_CREATE);
+ VkResult err = vkEnumerateInstanceExtensionProperties(nullptr, &instance_extension_count, nullptr);
+ ERR_FAIL_COND_V(err != VK_SUCCESS && err != VK_INCOMPLETE, ERR_CANT_CREATE);
if (instance_extension_count > 0) {
VkExtensionProperties *instance_extensions = (VkExtensionProperties *)malloc(sizeof(VkExtensionProperties) * instance_extension_count);
err = vkEnumerateInstanceExtensionProperties(nullptr, &instance_extension_count, instance_extensions);
- if (err) {
+ if (err != VK_SUCCESS && err != VK_INCOMPLETE) {
free(instance_extensions);
ERR_FAIL_V(ERR_CANT_CREATE);
}