mirror of
https://gitee.com/openharmony/third_party_vulkan-loader
synced 2024-11-28 01:40:51 +00:00
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:
parent
e9b2008c15
commit
4b8046ef7e
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user