Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions loader/loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -2542,12 +2542,9 @@ void loader_get_fullpath(const char *file, const char *in_dirs, size_t out_size,
// for (dir = dirs_copy; *dir && (next_dir = loader_get_next_path(dir)); dir = next_dir) {
char *dir = dirs_copy;
char *next_dir = loader_get_next_path(dir);
while (*dir && next_dir) {
while (*dir && next_dir && out_fullpath) {
int path_concat_ret = snprintf(out_fullpath, out_size, "%s%c%s", dir, DIRECTORY_SYMBOL, file);
if (path_concat_ret < 0) {
continue;
}
if (loader_platform_file_exists(out_fullpath)) {
if (path_concat_ret >= 0 && loader_platform_file_exists(out_fullpath)) {
return;
}
dir = next_dir;
Expand Down Expand Up @@ -7785,6 +7782,7 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_EnumeratePhysicalDeviceGroups(
"terminator_EnumeratePhysicalDeviceGroups: Failed during dispatch call of \'EnumeratePhysicalDevices\' "
"to ICD %s to get plain phys dev count.",
icd_term->scanned_icd->lib_name);
icd_term = icd_term->next;
continue;
}
} else {
Expand All @@ -7795,6 +7793,7 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_EnumeratePhysicalDeviceGroups(
"terminator_EnumeratePhysicalDeviceGroups: Failed during dispatch call of "
"\'EnumeratePhysicalDeviceGroups\' to ICD %s to get count.",
icd_term->scanned_icd->lib_name);
icd_term = icd_term->next;
continue;
}
}
Expand Down
19 changes: 19 additions & 0 deletions tests/loader_regression_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2504,6 +2504,25 @@ TEST(EnumeratePhysicalDeviceGroups, CallThriceAddGroupInBetween) {
}
}

// A driver which fails the physical device count query must be skipped, not retried forever.
TEST(EnumeratePhysicalDeviceGroups, DriverWhichFailsCountQueryIsSkipped) {
FrameworkEnvironment env{};
// A 1.0 driver does not expose vkEnumeratePhysicalDeviceGroups, so the loader counts its groups with
// vkEnumeratePhysicalDevices instead.
auto& driver = env.add_icd(TEST_ICD_PATH_VERSION_2).set_min_icd_interface_version(5);
driver.add_and_get_physical_device("physical_device_0");

InstWrapper inst{env.vulkan_functions};
inst.create_info.set_api_version(VK_API_VERSION_1_1);
inst.CheckCreate();

driver.set_enum_physical_devices_return_code(VK_ERROR_INITIALIZATION_FAILED);

uint32_t returned_group_count = 0;
ASSERT_EQ(VK_ERROR_INITIALIZATION_FAILED, inst->vkEnumeratePhysicalDeviceGroups(inst, &returned_group_count, nullptr));
ASSERT_EQ(0U, returned_group_count);
}

// Start with 7 devices in 4 different groups, and then remove a group,
// querying vkEnumeratePhysicalDeviceGroups before and after the remove.
TEST(EnumeratePhysicalDeviceGroups, CallTwiceRemoveGroupInBetween) {
Expand Down
Loading