Check for duplicates before adding layer

If an application decided to enable an implicit layer, it would result in the
layer properties being stored twice in the activated layer list. Simply not
adding the layer if it already is in the list prevents the duplication.
This commit is contained in:
Charles Giessen 2022-01-12 16:55:12 -06:00 committed by Charles Giessen
parent e9b2008c15
commit 4b8046ef7e

View File

@ -856,6 +856,11 @@ static VkResult loader_add_layer_names_to_list(const struct loader_instance *ins
continue;
}
// Make sure the layer isn't already in the output_list, skip adding it if it is.
if (loader_find_layer_name_in_list(source_name, output_list)) {
continue;
}
// If not a meta-layer, simply add it.
if (0 == (layer_prop->type_flags & VK_LAYER_TYPE_FLAG_META_LAYER)) {
loader_add_layer_properties_to_list(inst, output_list, 1, layer_prop);