Fix removal of unsuitable devices when using only_fully_suitable selection

This commit is contained in:
Matthew Pohlmann 2022-07-07 22:52:17 -05:00 committed by Charles Giessen
parent e78a1822c1
commit 97734970f0

View File

@ -1235,8 +1235,8 @@ detail::Result<std::vector<PhysicalDevice>> PhysicalDeviceSelector::select_impl(
}); });
// Remove the partially suitable elements if they aren't desired // Remove the partially suitable elements if they aren't desired
if (selection == DeviceSelectionMode::only_fully_suitable) { if (selection == DeviceSelectionMode::only_fully_suitable && partition_index != physical_devices.end()) {
physical_devices.erase(partition_index, physical_devices.end() - 1); physical_devices.erase(partition_index, physical_devices.end());
} }
// Make the physical device ready to be used to create a Device from it // Make the physical device ready to be used to create a Device from it