#endif // _WIN32
}
-// log error from to library loading
-void loader_log_load_library_error(const struct loader_instance *inst, const char *filename) {
+// Handle error from to library loading
+void loader_handle_load_library_error(const struct loader_instance *inst, const char *filename,
+ enum loader_layer_library_status *lib_status) {
const char *error_message = loader_platform_open_library_error(filename);
// If the error is due to incompatible architecture (eg 32 bit vs 64 bit), report it with INFO level
// Discussed in Github issue 262 & 644
VkFlags err_flag = VULKAN_LOADER_ERROR_BIT;
if (strstr(error_message, "wrong ELF class:") != NULL || strstr(error_message, " with error 193") != NULL) {
err_flag = VULKAN_LOADER_INFO_BIT;
+ if (NULL != lib_status) {
+ *lib_status = LOADER_LAYER_LIB_ERROR_WRONG_BIT_TYPE;
+ }
+ } else if (NULL != lib_status) {
+ *lib_status = LOADER_LAYER_LIB_ERROR_FAILED_TO_LOAD;
}
loader_log(inst, err_flag, 0, error_message);
}
}
static VkResult loader_scanned_icd_add(const struct loader_instance *inst, struct loader_icd_tramp_list *icd_tramp_list,
- const char *filename, uint32_t api_version) {
+ const char *filename, uint32_t api_version, enum loader_layer_library_status *lib_status) {
loader_platform_dl_handle handle;
PFN_vkCreateInstance fp_create_inst;
PFN_vkEnumerateInstanceExtensionProperties fp_get_inst_ext_props;
handle = loader_platform_open_library(filename);
#endif
if (NULL == handle) {
- loader_log_load_library_error(inst, filename);
+ loader_handle_load_library_error(inst, filename, lib_status);
res = VK_ERROR_INCOMPATIBLE_DRIVER;
goto out;
}
continue;
}
VkResult icd_add_res = VK_SUCCESS;
- icd_add_res = loader_scanned_icd_add(inst, icd_tramp_list, fullpath, vers);
+ enum loader_layer_library_status lib_status;
+ icd_add_res = loader_scanned_icd_add(inst, icd_tramp_list, fullpath, vers, &lib_status);
if (VK_ERROR_OUT_OF_HOST_MEMORY == icd_add_res) {
res = icd_add_res;
goto out;
} else if (VK_SUCCESS != icd_add_res) {
- loader_log(inst, VULKAN_LOADER_ERROR_BIT | VULKAN_LOADER_DRIVER_BIT, 0,
- "loader_icd_scan: Failed to add ICD JSON %s. Skipping ICD JSON.", fullpath);
+ switch (lib_status) {
+ case LOADER_LAYER_LIB_NOT_LOADED:
+ case LOADER_LAYER_LIB_ERROR_FAILED_TO_LOAD:
+ loader_log(inst, VULKAN_LOADER_ERROR_BIT | VULKAN_LOADER_DRIVER_BIT, 0,
+ "loader_icd_scan: Failed loading library associated with ICD JSON %s.Ignoring this JSON",
+ fullpath);
+ break;
+ case LOADER_LAYER_LIB_ERROR_WRONG_BIT_TYPE: {
+ loader_log(inst, VULKAN_LOADER_INFO_BIT | VULKAN_LOADER_DRIVER_BIT, 0,
+ "Requested layer %s was wrong bit-type. Ignoring this JSON", fullpath);
+ break;
+ }
+ case LOADER_LAYER_LIB_SUCCESS_LOADED:
+ // Shouldn't be able to reach this but if it is, best to report a debug
+ loader_log(inst, VULKAN_LOADER_WARN_BIT | VULKAN_LOADER_DRIVER_BIT, 0,
+ "Shouldn't reach this. A valid version of requested ICD %s was loaded but something bad "
+ "happened afterwards.",
+ fullpath);
+ break;
+ }
cJSON_Delete(inst, json);
json = NULL;
continue;
static loader_platform_dl_handle loader_open_layer_file(const struct loader_instance *inst, const char *chain_type,
struct loader_layer_properties *prop) {
if ((prop->lib_handle = loader_platform_open_library(prop->lib_name)) == NULL) {
- loader_log_load_library_error(inst, prop->lib_name);
+ loader_handle_load_library_error(inst, prop->lib_name, &prop->lib_status);
} else {
+ prop->lib_status = LOADER_LAYER_LIB_SUCCESS_LOADED;
loader_log(inst, VULKAN_LOADER_DEBUG_BIT | VULKAN_LOADER_LAYER_BIT, 0, "Loading layer library %s", prop->lib_name);
}
}
strcpy(name, layer_env);
+ loader_log(inst, VULKAN_LOADER_WARN_BIT | VULKAN_LOADER_LAYER_BIT, 0,
+ "loader_add_environment_layers: Env Var %s defined and adding layers %s", env_name, name);
+
while (name && *name) {
next = loader_get_next_path(name);
res = loader_add_layer_name_to_list(inst, name, type_flags, source_list, target_list, expanded_target_list);
}
}
+ // Make sure each layer requested by the application was actually loaded
+ for (uint32_t exp = 0; exp < inst->expanded_activated_layer_list.count; ++exp) {
+ struct loader_layer_properties *exp_layer_prop = &inst->expanded_activated_layer_list.list[exp];
+ bool found = false;
+ for (uint32_t act = 0; act < num_activated_layers; ++act) {
+ if (!strcmp(activated_layers[act].name, exp_layer_prop->info.layerName)) {
+ found = true;
+ break;
+ }
+ }
+ // If it wasn't found, we want to at least log an error. However, if it was enabled by the application directly,
+ // we want to return a bad layer error.
+ if (!found) {
+ bool app_requested = false;
+ for (uint32_t act = 0; act < pCreateInfo->enabledLayerCount; ++act) {
+ if (!strcmp(pCreateInfo->ppEnabledLayerNames[act], exp_layer_prop->info.layerName)) {
+ app_requested = true;
+ break;
+ }
+ }
+ VkFlags log_flag = VULKAN_LOADER_LAYER_BIT;
+ char ending = '.';
+ if (app_requested) {
+ log_flag |= VULKAN_LOADER_ERROR_BIT;
+ ending = '!';
+ } else {
+ log_flag |= VULKAN_LOADER_INFO_BIT;
+ }
+ switch (exp_layer_prop->lib_status) {
+ case LOADER_LAYER_LIB_NOT_LOADED:
+ loader_log(inst, log_flag, 0, "Requested layer %s was not loaded%c", exp_layer_prop->info.layerName, ending);
+ break;
+ case LOADER_LAYER_LIB_ERROR_WRONG_BIT_TYPE: {
+ loader_log(inst, log_flag, 0, "Requested layer %s was wrong bit-type%c", exp_layer_prop->info.layerName,
+ ending);
+ break;
+ }
+ case LOADER_LAYER_LIB_ERROR_FAILED_TO_LOAD:
+ loader_log(inst, log_flag, 0, "Requested layer %s failed to load%c", exp_layer_prop->info.layerName, ending);
+ break;
+ case LOADER_LAYER_LIB_SUCCESS_LOADED:
+ // Shouldn't be able to reach this but if it is, best to report a debug
+ loader_log(inst, log_flag, 0,
+ "Shouldn't reach this. A valid version of requested layer %s was loaded but was not found in the "
+ "list of activated layers%c",
+ exp_layer_prop->info.layerName, ending);
+ break;
+ }
+ if (app_requested) {
+ return VK_ERROR_LAYER_NOT_PRESENT;
+ }
+ }
+ }
+
VkLoaderFeatureFlags feature_flags = 0;
#if defined(_WIN32)
feature_flags = windows_initialize_dxgi();
TEST(TryLoadWrongBinaries, WrongICD) {
FrameworkEnvironment env{};
env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2));
- env.add_icd(TestICDDetails(CURRENT_PLATFORM_DUMMY_BINARY).set_is_fake(true));
+ env.add_icd(TestICDDetails(CURRENT_PLATFORM_DUMMY_BINARY_WRONG_TYPE).set_is_fake(true));
env.get_test_icd().physical_devices.emplace_back("physical_device_0");
DebugUtilsLogger log{VK_DEBUG_UTILS_MESSAGE_SEVERITY_INFO_BIT_EXT};
ASSERT_EQ(driver_count, 1);
}
+TEST(TryLoadWrongBinaries, WrongExplicit) {
+ FrameworkEnvironment env{};
+ env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2));
+ env.get_test_icd().physical_devices.emplace_back("physical_device_0");
+
+ const char* layer_name = "DummyLayerExplicit";
+ env.add_fake_explicit_layer(
+ ManifestLayer{}.add_layer(
+ ManifestLayer::LayerDescription{}.set_name(layer_name).set_lib_path(CURRENT_PLATFORM_DUMMY_BINARY_WRONG_TYPE)),
+ "dummy_test_layer.json");
+
+ uint32_t layer_count = 0;
+ ASSERT_EQ(env.vulkan_functions.vkEnumerateInstanceLayerProperties(&layer_count, nullptr), VK_SUCCESS);
+ ASSERT_EQ(layer_count, 1);
+
+ std::array<VkLayerProperties, 2> layer_props;
+ ASSERT_EQ(env.vulkan_functions.vkEnumerateInstanceLayerProperties(&layer_count, layer_props.data()), VK_SUCCESS);
+ ASSERT_EQ(layer_count, 1);
+
+ DebugUtilsLogger log{VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT};
+ InstWrapper inst{env.vulkan_functions};
+ inst.create_info.add_layer(layer_name);
+ FillDebugUtilsCreateDetails(inst.create_info, log);
+
+ // Explicit layer not found should generate a VK_ERROR_LAYER_NOT_PRESENT error message.
+ inst.CheckCreate(VK_ERROR_LAYER_NOT_PRESENT);
+
+ // Should get an error message for the explicit layer
+#ifndef __APPLE__
+ ASSERT_TRUE(log.find(std::string("Requested layer ") + std::string(layer_name) + std::string(" was wrong bit-type!")));
+#else // __APPLE__
+ // Apple only throws a wrong library type of error
+ ASSERT_TRUE(log.find(std::string("Requested layer ") + std::string(layer_name) + std::string(" failed to load!")));
+#endif // __APPLE__
+}
+
+TEST(TryLoadWrongBinaries, WrongImplicit) {
+ FrameworkEnvironment env{};
+ env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2));
+ env.get_test_icd().physical_devices.emplace_back("physical_device_0");
+
+ const char* layer_name = "DummyLayerImplicit0";
+ env.add_fake_implicit_layer(ManifestLayer{}.add_layer(ManifestLayer::LayerDescription{}
+ .set_name(layer_name)
+ .set_lib_path(CURRENT_PLATFORM_DUMMY_BINARY_WRONG_TYPE)
+ .set_disable_environment("DISABLE_ENV")),
+ "dummy_test_layer.json");
+
+ uint32_t layer_count = 0;
+ ASSERT_EQ(env.vulkan_functions.vkEnumerateInstanceLayerProperties(&layer_count, nullptr), VK_SUCCESS);
+ ASSERT_EQ(layer_count, 1);
+
+ std::array<VkLayerProperties, 1> layer_props;
+ ASSERT_EQ(env.vulkan_functions.vkEnumerateInstanceLayerProperties(&layer_count, layer_props.data()), VK_SUCCESS);
+ ASSERT_EQ(layer_count, 1);
+
+ DebugUtilsLogger log{VK_DEBUG_UTILS_MESSAGE_SEVERITY_INFO_BIT_EXT};
+ InstWrapper inst{env.vulkan_functions};
+ FillDebugUtilsCreateDetails(inst.create_info, log);
+
+ // We don't want to return VK_ERROR_LAYER_NOT_PRESENT for missing implicit layers because it's not the
+ // application asking for them.
+ inst.CheckCreate(VK_SUCCESS);
+
+#ifndef __APPLE__
+ // Should get an info message for the bad implicit layer
+ ASSERT_TRUE(log.find(std::string("Requested layer ") + std::string(layer_name) + std::string(" was wrong bit-type.")));
+#else // __APPLE__
+ // Apple only throws a wrong library type of error
+ ASSERT_TRUE(log.find(std::string("Requested layer ") + std::string(layer_name) + std::string(" failed to load.")));
+#endif // __APPLE__
+}
+
TEST(TryLoadWrongBinaries, WrongExplicitAndImplicit) {
FrameworkEnvironment env{};
env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2));
env.get_test_icd().physical_devices.emplace_back("physical_device_0");
const char* layer_name_0 = "DummyLayerExplicit";
- auto layer_0 = ManifestLayer{}.add_layer(
- ManifestLayer::LayerDescription{}.set_name(layer_name_0).set_lib_path(CURRENT_PLATFORM_DUMMY_BINARY));
+ env.add_fake_explicit_layer(
+ ManifestLayer{}.add_layer(
+ ManifestLayer::LayerDescription{}.set_name(layer_name_0).set_lib_path(CURRENT_PLATFORM_DUMMY_BINARY_WRONG_TYPE)),
+ "dummy_test_layer_0.json");
+ const char* layer_name_1 = "DummyLayerImplicit";
+ env.add_fake_implicit_layer(ManifestLayer{}.add_layer(ManifestLayer::LayerDescription{}
+ .set_name(layer_name_1)
+ .set_lib_path(CURRENT_PLATFORM_DUMMY_BINARY_WRONG_TYPE)
+ .set_disable_environment("DISABLE_ENV")),
+ "dummy_test_layer_1.json");
+
+ uint32_t layer_count = 0;
+ ASSERT_EQ(env.vulkan_functions.vkEnumerateInstanceLayerProperties(&layer_count, nullptr), VK_SUCCESS);
+ ASSERT_EQ(layer_count, 2);
+
+ std::array<VkLayerProperties, 2> layer_props;
+ ASSERT_EQ(env.vulkan_functions.vkEnumerateInstanceLayerProperties(&layer_count, layer_props.data()), VK_SUCCESS);
+ ASSERT_EQ(layer_count, 2);
- auto layer_loc_0 = env.explicit_layer_folder.write_manifest("dummy_test_layer_0.json", layer_0.get_manifest_str());
- env.platform_shim->add_manifest(ManifestCategory::explicit_layer, layer_loc_0);
+ DebugUtilsLogger log{VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT | VK_DEBUG_UTILS_MESSAGE_SEVERITY_INFO_BIT_EXT};
+ InstWrapper inst{env.vulkan_functions};
+ inst.create_info.add_layer(layer_name_0);
+ FillDebugUtilsCreateDetails(inst.create_info, log);
+
+ // Explicit layer not found should generate a VK_ERROR_LAYER_NOT_PRESENT error message.
+ inst.CheckCreate(VK_ERROR_LAYER_NOT_PRESENT);
+#ifndef __APPLE__
+ // Should get error messages for both (the explicit is second and we don't want the implicit to return before the explicit
+ // triggers a failure during vkCreateInstance)
+ ASSERT_TRUE(log.find(std::string("Requested layer ") + std::string(layer_name_0) + std::string(" was wrong bit-type!")));
+ ASSERT_TRUE(log.find(std::string("Requested layer ") + std::string(layer_name_1) + std::string(" was wrong bit-type.")));
+#else // __APPLE__
+ // Apple only throws a wrong library type of error
+ ASSERT_TRUE(log.find(std::string("Requested layer ") + std::string(layer_name_0) + std::string(" failed to load!")));
+ ASSERT_TRUE(log.find(std::string("Requested layer ") + std::string(layer_name_1) + std::string(" failed to load.")));
+#endif // __APPLE__
+}
+
+TEST(TryLoadWrongBinaries, WrongExplicitAndImplicitErrorOnly) {
+ FrameworkEnvironment env{};
+ env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2));
+ env.get_test_icd().physical_devices.emplace_back("physical_device_0");
+
+ const char* layer_name_0 = "DummyLayerExplicit";
+ env.add_fake_explicit_layer(
+ ManifestLayer{}.add_layer(
+ ManifestLayer::LayerDescription{}.set_name(layer_name_0).set_lib_path(CURRENT_PLATFORM_DUMMY_BINARY_WRONG_TYPE)),
+ "dummy_test_layer_0.json");
const char* layer_name_1 = "DummyLayerImplicit";
- auto layer_1 = ManifestLayer{}.add_layer(ManifestLayer::LayerDescription{}
- .set_name(layer_name_1)
- .set_lib_path(CURRENT_PLATFORM_DUMMY_BINARY)
- .set_disable_environment("DISABLE_ENV"));
+ env.add_fake_implicit_layer(ManifestLayer{}.add_layer(ManifestLayer::LayerDescription{}
+ .set_name(layer_name_1)
+ .set_lib_path(CURRENT_PLATFORM_DUMMY_BINARY_WRONG_TYPE)
+ .set_disable_environment("DISABLE_ENV")),
+ "dummy_test_layer_1.json");
- auto layer_loc_1 = env.implicit_layer_folder.write_manifest("dummy_test_layer_1.json", layer_1.get_manifest_str());
- env.platform_shim->add_manifest(ManifestCategory::implicit_layer, layer_loc_1);
+ uint32_t layer_count = 0;
+ ASSERT_EQ(env.vulkan_functions.vkEnumerateInstanceLayerProperties(&layer_count, nullptr), VK_SUCCESS);
+ ASSERT_EQ(layer_count, 2);
+
+ std::array<VkLayerProperties, 2> layer_props;
+ ASSERT_EQ(env.vulkan_functions.vkEnumerateInstanceLayerProperties(&layer_count, layer_props.data()), VK_SUCCESS);
+ ASSERT_EQ(layer_count, 2);
+
+ DebugUtilsLogger log{VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT};
+ InstWrapper inst{env.vulkan_functions};
+ inst.create_info.add_layer(layer_name_0);
+ FillDebugUtilsCreateDetails(inst.create_info, log);
+
+ // Explicit layer not found should generate a VK_ERROR_LAYER_NOT_PRESENT error message.
+ inst.CheckCreate(VK_ERROR_LAYER_NOT_PRESENT);
+
+#ifndef __APPLE__
+ // Should not get an error messages for either
+ ASSERT_TRUE(log.find(std::string("Requested layer ") + std::string(layer_name_0) + std::string(" was wrong bit-type!")));
+ ASSERT_FALSE(log.find(std::string("Requested layer ") + std::string(layer_name_1) + std::string(" was wrong bit-type.")));
+#else // __APPLE__
+ // Apple only throws a wrong library type of error
+ ASSERT_TRUE(log.find(std::string("Requested layer ") + std::string(layer_name_0) + std::string(" failed to load!")));
+ ASSERT_FALSE(log.find(std::string("Requested layer ") + std::string(layer_name_1) + std::string(" failed to load.")));
+#endif // __APPLE__
+}
+
+TEST(TryLoadWrongBinaries, BadExplicit) {
+ FrameworkEnvironment env{};
+ env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2));
+ env.get_test_icd().physical_devices.emplace_back("physical_device_0");
+
+ const char* layer_name = "DummyLayerExplicit";
+ env.add_fake_explicit_layer(
+ ManifestLayer{}.add_layer(
+ ManifestLayer::LayerDescription{}.set_name(layer_name).set_lib_path(CURRENT_PLATFORM_DUMMY_BINARY_BAD)),
+ "dummy_test_layer.json");
+
+ uint32_t layer_count = 0;
+ ASSERT_EQ(env.vulkan_functions.vkEnumerateInstanceLayerProperties(&layer_count, nullptr), VK_SUCCESS);
+ ASSERT_EQ(layer_count, 1);
+
+ std::array<VkLayerProperties, 2> layer_props;
+ ASSERT_EQ(env.vulkan_functions.vkEnumerateInstanceLayerProperties(&layer_count, layer_props.data()), VK_SUCCESS);
+ ASSERT_EQ(layer_count, 1);
+
+ DebugUtilsLogger log{VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT};
+ InstWrapper inst{env.vulkan_functions};
+ inst.create_info.add_layer(layer_name);
+ FillDebugUtilsCreateDetails(inst.create_info, log);
+
+ // Explicit layer not found should generate a VK_ERROR_LAYER_NOT_PRESENT error message.
+ inst.CheckCreate(VK_ERROR_LAYER_NOT_PRESENT);
+
+ // Should get an error message for the bad explicit
+ ASSERT_TRUE(log.find(std::string("Requested layer ") + std::string(layer_name) + std::string(" failed to load!")));
+}
+
+TEST(TryLoadWrongBinaries, BadImplicit) {
+ FrameworkEnvironment env{};
+ env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2));
+ env.get_test_icd().physical_devices.emplace_back("physical_device_0");
+
+ const char* layer_name = "DummyLayerImplicit0";
+ env.add_fake_implicit_layer(ManifestLayer{}.add_layer(ManifestLayer::LayerDescription{}
+ .set_name(layer_name)
+ .set_lib_path(CURRENT_PLATFORM_DUMMY_BINARY_BAD)
+ .set_disable_environment("DISABLE_ENV")),
+ "dummy_test_layer.json");
+
+ uint32_t layer_count = 0;
+ ASSERT_EQ(env.vulkan_functions.vkEnumerateInstanceLayerProperties(&layer_count, nullptr), VK_SUCCESS);
+ ASSERT_EQ(layer_count, 1);
+
+ std::array<VkLayerProperties, 1> layer_props;
+ ASSERT_EQ(env.vulkan_functions.vkEnumerateInstanceLayerProperties(&layer_count, layer_props.data()), VK_SUCCESS);
+ ASSERT_EQ(layer_count, 1);
+
+ DebugUtilsLogger log{VK_DEBUG_UTILS_MESSAGE_SEVERITY_INFO_BIT_EXT};
+ InstWrapper inst{env.vulkan_functions};
+ FillDebugUtilsCreateDetails(inst.create_info, log);
+
+ // We don't want to return VK_ERROR_LAYER_NOT_PRESENT for missing implicit layers because it's not the
+ // application asking for them.
+ inst.CheckCreate(VK_SUCCESS);
+
+ // Should get an info message for the bad implicit
+ ASSERT_TRUE(log.find(std::string("Requested layer ") + std::string(layer_name) + std::string(" failed to load.")));
+}
+
+TEST(TryLoadWrongBinaries, BadExplicitAndImplicit) {
+ FrameworkEnvironment env{};
+ env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2));
+ env.get_test_icd().physical_devices.emplace_back("physical_device_0");
+
+ const char* layer_name_0 = "DummyLayerExplicit";
+ env.add_fake_explicit_layer(
+ ManifestLayer{}.add_layer(
+ ManifestLayer::LayerDescription{}.set_name(layer_name_0).set_lib_path(CURRENT_PLATFORM_DUMMY_BINARY_BAD)),
+ "dummy_test_layer_0.json");
+ const char* layer_name_1 = "DummyLayerImplicit0";
+ env.add_fake_implicit_layer(ManifestLayer{}.add_layer(ManifestLayer::LayerDescription{}
+ .set_name(layer_name_1)
+ .set_lib_path(CURRENT_PLATFORM_DUMMY_BINARY_BAD)
+ .set_disable_environment("DISABLE_ENV")),
+ "dummy_test_layer_1.json");
uint32_t layer_count = 0;
ASSERT_EQ(env.vulkan_functions.vkEnumerateInstanceLayerProperties(&layer_count, nullptr), VK_SUCCESS);
ASSERT_EQ(env.vulkan_functions.vkEnumerateInstanceLayerProperties(&layer_count, layer_props.data()), VK_SUCCESS);
ASSERT_EQ(layer_count, 2);
+ DebugUtilsLogger log{VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT | VK_DEBUG_UTILS_MESSAGE_SEVERITY_INFO_BIT_EXT};
InstWrapper inst{env.vulkan_functions};
- inst.create_info.add_layer(layer_name_0).add_layer(layer_name_1);
- // "According to all known laws of aviation, there is no way that this should return VK_SUCCESS"
- // This by accounts *should* return VK_ERROR_LAYER_NOT_PRESENT but due to a confluence of bad choices and backwards
- // compatibility guarantee, returns VK_SUCCESS.
- // REASON: To be able to 'load' a library in either 32 or 64 bit apps, the loader will just try to load both and ignore
- // whichever library didn't match the current architecture. Because of this, the loader actually just flat out ignores
- // errors and pretends they didn't load at all.
- // TODO: add 32/64 bit field to layer manifests so that this issue doesn't occur, then implement logic to make the loader
- // smart enough to tell when a layer that failed to load was due to the old behavior or not. (eg, don't report an error if
- // a layer with the same name successfully loaded)
- inst.CheckCreate();
+ inst.create_info.add_layer(layer_name_0);
+ FillDebugUtilsCreateDetails(inst.create_info, log);
+
+ // Explicit layer not found should generate a VK_ERROR_LAYER_NOT_PRESENT error message.
+ inst.CheckCreate(VK_ERROR_LAYER_NOT_PRESENT);
+
+ // Apple only throws a wrong library type of error
+ ASSERT_TRUE(log.find(std::string("Requested layer ") + std::string(layer_name_0) + std::string(" failed to load!")));
+ ASSERT_TRUE(log.find(std::string("Requested layer ") + std::string(layer_name_1) + std::string(" failed to load.")));
}
TEST_F(EnumeratePhysicalDeviceGroups, OneCall) {