Lines Matching defs:settings
24 #include "settings.h"
44 void free_loader_settings(const struct loader_instance* inst, loader_settings* settings) {
45 if (NULL != settings->layer_configurations) {
46 for (uint32_t i = 0; i < settings->layer_configuration_count; i++) {
47 free_layer_configuration(inst, &settings->layer_configurations[i]);
50 loader_instance_heap_free(inst, settings->layer_configurations);
51 loader_instance_heap_free(inst, settings->settings_file_path);
52 memset(settings, 0, sizeof(loader_settings));
272 void log_settings(const struct loader_instance* inst, loader_settings* settings) {
273 if (settings == NULL) {
276 loader_log(inst, VULKAN_LOADER_INFO_BIT, 0, "Using layer configurations found in loader settings from %s",
277 settings->settings_file_path);
279 loader_log(inst, VULKAN_LOADER_DEBUG_BIT, 0, "Layer Configurations count = %d", settings->layer_configuration_count);
280 for (uint32_t i = 0; i < settings->layer_configuration_count; i++) {
282 if (settings->layer_configurations[i].control != LOADER_SETTINGS_LAYER_UNORDERED_LAYER_LOCATION) {
283 loader_log(inst, VULKAN_LOADER_DEBUG_BIT, 0, "Name: %s", settings->layer_configurations[i].name);
284 loader_log(inst, VULKAN_LOADER_DEBUG_BIT, 0, "Path: %s", settings->layer_configurations[i].path);
287 loader_settings_layer_control_to_string(settings->layer_configurations[i].control));
328 cJSON* single_settings_object = loader_cJSON_GetObjectItem(json, "settings");
336 // Corresponds to the settings object that has no app keys
338 // Corresponds to the settings object which has a matching app key
351 global_settings_index = i; // use the first 'global' settings that has no app keys as the global one
380 // No app specific settings match - either use global settings or exit
383 goto out; // No global settings were found - exit
385 index_to_use = global_settings_index; // Global settings are present - use it
389 // Now get the actual settings object to use - already have it if there is only one settings object
390 // If there are multiple settings, just need to set single_settings_object to the desired settings object
440 // Determine if there exists a layer configuration indicating where to put layers not contained in the settings file
464 loader_settings settings = {0};
465 VkResult res = get_loader_settings(NULL, &settings);
470 if (!check_if_settings_are_equal(&settings, &global_loader_settings)) {
471 log_settings(NULL, &settings);
474 memcpy(&global_loader_settings, &settings, sizeof(loader_settings));
485 // Free out the global settings in case the process was loaded & unloaded
500 // Use this function to get the correct settings to use based on the context
501 // If inst is NULL - use the global settings and lock the mutex
502 // Else return the settings local to the instance - but do nto lock the mutex
505 return &inst->settings;
510 // Release the global settings lock if we are using the global settings - aka if inst is NULL
522 const loader_settings* settings = get_current_settings_and_lock(inst);
524 if (NULL == settings || !settings->settings_active) {
531 for (uint32_t i = 0; i < settings->layer_configuration_count; i++) {
532 loader_settings_layer_configuration* layer_config = &settings->layer_configurations[i];
535 // with the data required to compare it with layers not in the settings file (aka name and manifest path)
591 // If the manifest file found has a name that differs from the one in the settings, remove this layer from consideration
640 // Location to put layers that aren't known to the settings file
654 // No settings layers - just copy regular to output_layers - memset regular layers to prevent double frees
659 // No regular layers or has_unordered_layer_location is false - just copy settings to output_layers -
660 // memset settings layers to prevent double frees
672 // Insert the settings layers into output_layers up to unordered_layer_index
698 // Insert the rest of the settings layers into combined_layers from unordered_layer_index to the end
735 // Do not enable the layer if the settings have it set as off
739 // Force enable it based on settings