MCPcopy Create free account
hub / github.com/LunarG/VulkanTools / LoadLayer

Method LoadLayer

vkconfig_core/layer_manager.cpp:641–671  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

639}
640
641LayerLoadStatus LayerManager::LoadLayer(const QJsonObject &json_layer_object, const Path &layer_path, LayerType type,
642 Version file_format_version, LayerDescriptor descriptor) {
643 Layer layer;
644 layer.type = type;
645 layer.manifest_path = layer_path;
646 layer.file_format_version = file_format_version;
647 layer.descriptor = descriptor;
648
649 LayerLoadStatus status = layer.Load(json_layer_object);
650 if (status == LAYER_LOAD_INVALID || status == LAYER_LOAD_IGNORED) {
651 return status;
652 }
653
654 Layer *duplicated_layer = this->Find(layer.GetId(), false);
655 if (duplicated_layer != nullptr) {
656 if (duplicated_layer->descriptor.removed) {
657 duplicated_layer->descriptor.removed = false;
658 duplicated_layer->descriptor.enabled = true;
659 } else if (duplicated_layer->descriptor.last_modified != layer.descriptor.last_modified) {
660 // Reload when the manifest was updated
661 LayerLoadStatus reloaded_status = duplicated_layer->Load(json_layer_object);
662 status = reloaded_status == LAYER_LOAD_ADDED ? LAYER_LOAD_RELOADED : reloaded_status;
663 } else {
664 status = LAYER_LOAD_UNMODIFIED;
665 }
666 } else {
667 this->available_layers.push_back(layer);
668 }
669
670 return status;
671}
672
673void LayerManager::RemoveLayer(LayerId id) {
674 Layer *layer = this->Find(id, false);

Callers 1

LoadLayersMethod · 0.95

Calls 3

FindMethod · 0.95
GetIdMethod · 0.80
LoadMethod · 0.45

Tested by

no test coverage detected