Skip to content

Commit 3295544

Browse files
authored
[merge] Merge pull request #392 from inexorgame/hanni/exceptions_cleanup
[device|instance] Don't throw exception when it's not an error
2 parents d31c4a4 + e4a7f73 commit 3295544

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/vulkan-renderer/wrapper/device.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ bool Device::is_extension_supported(const VkPhysicalDevice graphics_card, const
4646
}
4747

4848
if (device_extension_count == 0) {
49-
throw std::runtime_error("Error: No Vulkan device extensions available!");
49+
spdlog::info("No Vulkan device extensions available!");
50+
return false;
5051
}
5152

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

8081
if (device_layer_count == 0) {
81-
throw std::runtime_error("Error: No Vulkan device extensions available!");
82+
spdlog::info("No Vulkan device layers available!");
83+
return false;
8284
}
8385

8486
std::vector<VkLayerProperties> device_layers(device_layer_count);

src/vulkan-renderer/wrapper/instance.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ bool Instance::is_layer_supported(const std::string &layer_name) {
1919
}
2020

2121
if (instance_layer_count == 0) {
22-
throw std::runtime_error("Error: No Vulkan instance layers available!");
22+
spdlog::info("No Vulkan instance layers available!");
23+
return false;
2324
}
2425

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

4748
if (instance_extension_count == 0) {
48-
throw std::runtime_error("Error: No Vulkan instance extensions available!");
49+
spdlog::info("No Vulkan instance extensions available!");
50+
return false;
4951
}
5052

5153
std::vector<VkExtensionProperties> instance_extensions(instance_extension_count);

0 commit comments

Comments
 (0)