@@ -190,6 +190,7 @@ VkResult parse_layer_configurations(const struct loader_instance* inst, cJSON* s
190190
191191 uint32_t layer_configurations_count = loader_cJSON_GetArraySize (layer_configurations );
192192 if (layer_configurations_count == 0 ) {
193+ loader_settings -> layer_configurations_active = true;
193194 return VK_SUCCESS ;
194195 }
195196
@@ -214,6 +215,7 @@ VkResult parse_layer_configurations(const struct loader_instance* inst, cJSON* s
214215 goto out ;
215216 }
216217 }
218+ loader_settings -> layer_configurations_active = true;
217219out :
218220 if (res != VK_SUCCESS ) {
219221 if (loader_settings -> layer_configurations ) {
@@ -380,6 +382,7 @@ VkResult parse_device_configurations(const struct loader_instance* inst, cJSON*
380382
381383 uint32_t device_configuration_count = loader_cJSON_GetArraySize (device_configurations );
382384 if (device_configuration_count == 0 ) {
385+ loader_settings -> device_configurations_active = true;
383386 return VK_SUCCESS ;
384387 }
385388
@@ -407,6 +410,7 @@ VkResult parse_device_configurations(const struct loader_instance* inst, cJSON*
407410 }
408411 i ++ ;
409412 }
413+ loader_settings -> device_configurations_active = true;
410414out :
411415 if (res != VK_SUCCESS ) {
412416 if (loader_settings -> device_configurations ) {
@@ -582,8 +586,10 @@ bool check_if_settings_are_equal(loader_settings* a, loader_settings* b) {
582586 are_equal &= a -> settings_active == b -> settings_active ;
583587 are_equal &= a -> has_unordered_layer_location == b -> has_unordered_layer_location ;
584588 are_equal &= a -> debug_level == b -> debug_level ;
589+ are_equal &= a -> layer_configurations_active == b -> layer_configurations_active ;
585590 are_equal &= a -> layer_configuration_count == b -> layer_configuration_count ;
586591 are_equal &= a -> additional_driver_count == b -> additional_driver_count ;
592+ are_equal &= a -> device_configurations_active == b -> device_configurations_active ;
587593 are_equal &= a -> device_configuration_count == b -> device_configuration_count ;
588594 if (!are_equal ) return false;
589595 for (uint32_t i = 0 ; i < a -> layer_configuration_count && i < b -> layer_configuration_count ; i ++ ) {
@@ -614,18 +620,19 @@ void log_settings(const struct loader_instance* inst, loader_settings* settings)
614620 if (strlen (cmd_line_msg )) {
615621 loader_log (inst , VULKAN_LOADER_DEBUG_BIT , 0 , "Loader Settings Filters for Logging to Standard Error: %s" , cmd_line_msg );
616622 }
617-
618- loader_log (inst , VULKAN_LOADER_DEBUG_BIT , 0 , "Layer Configurations count = %d" , settings -> layer_configuration_count );
619- for (uint32_t i = 0 ; i < settings -> layer_configuration_count ; i ++ ) {
620- loader_log (inst , VULKAN_LOADER_DEBUG_BIT , 0 , "---- Layer Configuration [%d] ----" , i );
621- if (settings -> layer_configurations [i ].control != LOADER_SETTINGS_LAYER_UNORDERED_LAYER_LOCATION ) {
622- loader_log (inst , VULKAN_LOADER_DEBUG_BIT , 0 , "Name: %s" , settings -> layer_configurations [i ].name );
623- loader_log (inst , VULKAN_LOADER_DEBUG_BIT , 0 , "Path: %s" , settings -> layer_configurations [i ].path );
624- loader_log (inst , VULKAN_LOADER_DEBUG_BIT , 0 , "Layer Type: %s" ,
625- settings -> layer_configurations [i ].treat_as_implicit_manifest ? "Implicit" : "Explicit" );
623+ if (settings -> layer_configurations_active ) {
624+ loader_log (inst , VULKAN_LOADER_DEBUG_BIT , 0 , "Layer Configurations count = %d" , settings -> layer_configuration_count );
625+ for (uint32_t i = 0 ; i < settings -> layer_configuration_count ; i ++ ) {
626+ loader_log (inst , VULKAN_LOADER_DEBUG_BIT , 0 , "---- Layer Configuration [%d] ----" , i );
627+ if (settings -> layer_configurations [i ].control != LOADER_SETTINGS_LAYER_UNORDERED_LAYER_LOCATION ) {
628+ loader_log (inst , VULKAN_LOADER_DEBUG_BIT , 0 , "Name: %s" , settings -> layer_configurations [i ].name );
629+ loader_log (inst , VULKAN_LOADER_DEBUG_BIT , 0 , "Path: %s" , settings -> layer_configurations [i ].path );
630+ loader_log (inst , VULKAN_LOADER_DEBUG_BIT , 0 , "Layer Type: %s" ,
631+ settings -> layer_configurations [i ].treat_as_implicit_manifest ? "Implicit" : "Explicit" );
632+ }
633+ loader_log (inst , VULKAN_LOADER_DEBUG_BIT , 0 , "Control: %s" ,
634+ loader_settings_layer_control_to_string (settings -> layer_configurations [i ].control ));
626635 }
627- loader_log (inst , VULKAN_LOADER_DEBUG_BIT , 0 , "Control: %s" ,
628- loader_settings_layer_control_to_string (settings -> layer_configurations [i ].control ));
629636 }
630637 if (settings -> additional_driver_count > 0 ) {
631638 loader_log (inst , VULKAN_LOADER_DEBUG_BIT , 0 , "----" );
@@ -638,7 +645,7 @@ void log_settings(const struct loader_instance* inst, loader_settings* settings)
638645 loader_log (inst , VULKAN_LOADER_DEBUG_BIT , 0 , "Path: %s" , settings -> additional_drivers [i ].path );
639646 }
640647 }
641- if (settings -> device_configuration_count > 0 ) {
648+ if (settings -> device_configurations_active ) {
642649 loader_log (inst , VULKAN_LOADER_DEBUG_BIT , 0 , "----" );
643650 loader_log (inst , VULKAN_LOADER_DEBUG_BIT , 0 , "Device Configurations count = %d" , settings -> device_configuration_count );
644651 for (uint32_t i = 0 ; i < settings -> device_configuration_count ; i ++ ) {
@@ -844,8 +851,8 @@ VkResult get_loader_settings(const struct loader_instance* inst, loader_settings
844851
845852 // Only consider the settings active if there is at least one "setting" active.
846853 // Those are either logging, layers, additional_drivers, or device_configurations.
847- if (loader_settings -> debug_level != 0 || loader_settings -> layer_configuration_count != 0 ||
848- loader_settings -> additional_driver_count != 0 || loader_settings -> device_configuration_count != 0 ) {
854+ if (loader_settings -> debug_level != 0 || loader_settings -> layer_configurations_active ||
855+ loader_settings -> additional_driver_count != 0 || loader_settings -> device_configurations_active ) {
849856 loader_settings -> settings_file_path = settings_file_path ;
850857 settings_file_path = NULL ;
851858 loader_settings -> settings_active = true;
@@ -925,7 +932,7 @@ TEST_FUNCTION_EXPORT VkResult get_settings_layers(const struct loader_instance*
925932
926933 const loader_settings * settings = get_current_settings_and_lock (inst );
927934
928- if (NULL == settings || !settings -> settings_active ) {
935+ if (NULL == settings || !settings -> settings_active || ! settings -> layer_configurations_active ) {
929936 goto out ;
930937 }
931938
@@ -1275,7 +1282,7 @@ bool loader_settings_should_use_driver_environment_variables(const struct loader
12751282 if (NULL == settings || !settings -> settings_active ) {
12761283 goto out ;
12771284 }
1278- if (settings -> device_configuration_count > 0 ) {
1285+ if (settings -> device_configurations_active ) {
12791286 should_use = false;
12801287 }
12811288out :
0 commit comments