Skip to content

Commit

Permalink
[merge] Merge pull request #392 from inexorgame/hanni/exceptions_cleanup
Browse files Browse the repository at this point in the history
[device|instance] Don't throw exception when it's not an error
  • Loading branch information
IAmNotHanni authored May 9, 2021
2 parents d31c4a4 + e4a7f73 commit 3295544
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/vulkan-renderer/wrapper/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ bool Device::is_extension_supported(const VkPhysicalDevice graphics_card, const
}

if (device_extension_count == 0) {
throw std::runtime_error("Error: No Vulkan device extensions available!");
spdlog::info("No Vulkan device extensions available!");
return false;
}

std::vector<VkExtensionProperties> device_extensions(device_extension_count);
Expand Down Expand Up @@ -78,7 +79,8 @@ bool Device::is_layer_supported(const VkPhysicalDevice graphics_card, const std:
}

if (device_layer_count == 0) {
throw std::runtime_error("Error: No Vulkan device extensions available!");
spdlog::info("No Vulkan device layers available!");
return false;
}

std::vector<VkLayerProperties> device_layers(device_layer_count);
Expand Down
6 changes: 4 additions & 2 deletions src/vulkan-renderer/wrapper/instance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ bool Instance::is_layer_supported(const std::string &layer_name) {
}

if (instance_layer_count == 0) {
throw std::runtime_error("Error: No Vulkan instance layers available!");
spdlog::info("No Vulkan instance layers available!");
return false;
}

std::vector<VkLayerProperties> instance_layers(instance_layer_count);
Expand All @@ -45,7 +46,8 @@ bool Instance::is_extension_supported(const std::string &extension_name) {
}

if (instance_extension_count == 0) {
throw std::runtime_error("Error: No Vulkan instance extensions available!");
spdlog::info("No Vulkan instance extensions available!");
return false;
}

std::vector<VkExtensionProperties> instance_extensions(instance_extension_count);
Expand Down

0 comments on commit 3295544

Please sign in to comment.