unlink sync2 if not present (tentative fix for #418)

This commit is contained in:
psucien 2024-08-12 22:52:21 +02:00
parent 2ba3221fc9
commit a15a93997c
1 changed files with 7 additions and 1 deletions

View File

@ -317,7 +317,7 @@ bool Instance::CreateDevice() {
.nullDescriptor = true,
},
vk::PhysicalDeviceSynchronization2Features{
.synchronization2 = has_sync2,
.synchronization2 = true,
},
};
@ -328,12 +328,18 @@ bool Instance::CreateDevice() {
if (!robustness) {
device_chain.unlink<vk::PhysicalDeviceRobustness2FeaturesEXT>();
}
if (!has_sync2) {
device_chain.unlink<vk::PhysicalDeviceSynchronization2Features>();
}
try {
device = physical_device.createDeviceUnique(device_chain.get());
} catch (vk::ExtensionNotPresentError& err) {
LOG_CRITICAL(Render_Vulkan, "Some required extensions are not available {}", err.what());
return false;
} catch (vk::FeatureNotPresentError& err) {
LOG_CRITICAL(Render_Vulkan, "Some required features are not available {}", err.what());
return false;
}
VULKAN_HPP_DEFAULT_DISPATCHER.init(*device);