Skip to content

Commit 9959ca3

Browse files
Write the Enable Env Var in the loader log
Log the following message for each enabled layer. "This layer was enabled because Env Var <name> was set to Value <value>"
1 parent b032143 commit 9959ca3

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

loader/loader.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ struct activated_layer_info {
8282
char *library;
8383
bool is_implicit;
8484
char *disable_env;
85+
char *enable_name_env;
86+
char *enable_value_env;
8587
};
8688

8789
// thread safety lock for accessing global data structures such as "loader"
@@ -4695,6 +4697,8 @@ VkResult loader_create_instance_chain(const VkInstanceCreateInfo *pCreateInfo, c
46954697
activated_layers[num_activated_layers].is_implicit = !(layer_prop->type_flags & VK_LAYER_TYPE_FLAG_EXPLICIT_LAYER);
46964698
if (activated_layers[num_activated_layers].is_implicit) {
46974699
activated_layers[num_activated_layers].disable_env = layer_prop->disable_env_var.name;
4700+
activated_layers[num_activated_layers].enable_name_env = layer_prop->enable_env_var.name;
4701+
activated_layers[num_activated_layers].enable_value_env = layer_prop->enable_env_var.value;
46984702
}
46994703

47004704
loader_log(inst, VULKAN_LOADER_INFO_BIT | VULKAN_LOADER_LAYER_BIT, 0, "Insert instance layer \"%s\" (%s)",
@@ -4809,6 +4813,11 @@ VkResult loader_create_instance_chain(const VkInstanceCreateInfo *pCreateInfo, c
48094813
if (activated_layers[index].is_implicit) {
48104814
loader_log(inst, VULKAN_LOADER_LAYER_BIT, 0, " Disable Env Var: %s",
48114815
activated_layers[index].disable_env);
4816+
if (activated_layers[index].enable_name_env) {
4817+
loader_log(inst, VULKAN_LOADER_LAYER_BIT, 0,
4818+
" This layer was enabled because Env Var %s was set to Value %s",
4819+
activated_layers[index].enable_name_env, activated_layers[index].enable_value_env);
4820+
}
48124821
}
48134822
loader_log(inst, VULKAN_LOADER_LAYER_BIT, 0, " Manifest: %s", activated_layers[index].manifest);
48144823
loader_log(inst, VULKAN_LOADER_LAYER_BIT, 0, " Library: %s", activated_layers[index].library);

0 commit comments

Comments
 (0)