4949#include < string>
5050#include < algorithm>
5151
52- bool operator <(const LayersPathInfo& a, const LayersPathInfo& b) { return a.path .RelativePath () < b.path .RelativePath (); }
53-
54- bool Found (const std::vector<LayersPathInfo>& data, const Path& path) {
52+ bool Found (const std::vector<Path>& data, const Path& path) {
5553 for (std::size_t i = 0 , n = data.size (); i < n; ++i) {
56- if (data[i]. path == path) {
54+ if (data[i] == path) {
5755 return true ;
5856 }
5957 }
@@ -179,7 +177,7 @@ void Layer::FillPresetSettings(SettingDataSet& settings_data, const std::vector<
179177}
180178
181179LayerLoadStatus Layer::Load (const Path& full_path_to_file, LayerType type, bool request_validate_manifest,
182- const std::map<Path, LayerStatus>& layers_found, ConfiguratorMode configurator_mode) {
180+ ConfiguratorMode configurator_mode) {
183181 this ->type = type; // Set layer type, no way to know this from the json file
184182
185183 if (full_path_to_file.Empty ()) {
@@ -197,13 +195,6 @@ LayerLoadStatus Layer::Load(const Path& full_path_to_file, LayerType type, bool
197195 this ->manifest_path = full_path_to_file;
198196 this ->last_modified = full_path_to_file.LastModified ();
199197
200- auto it = layers_found.find (full_path_to_file.AbsolutePath ().c_str ());
201- if (it != layers_found.end ()) {
202- if (it->second .disabled && it->second .last_modified == this ->last_modified ) {
203- return LAYER_LOAD_FAILED;
204- }
205- }
206-
207198 // Convert the text to a JSON document & validate it.
208199 // It does need to be a valid json formatted file.
209200 QJsonParseError json_parse_error;
@@ -252,20 +243,15 @@ LayerLoadStatus Layer::Load(const Path& full_path_to_file, LayerType type, bool
252243
253244 this ->key = ReadStringValue (json_layer_object, " name" );
254245
255- if (this ->key == " VK_LAYER_LUNARG_override" ) {
246+ if (this ->key == " VK_LAYER_LUNARG_override" || !( this -> key . rfind ( " VK_ " , 0 ) == 0 ) ) {
256247 return LAYER_LOAD_IGNORED;
257248 }
258249
259250 this ->api_version = ReadVersionValue (json_layer_object, " api_version" );
260251
261252 JsonValidator validator;
262253
263- std::string cached_last_modified;
264- if (it != layers_found.end ()) {
265- cached_last_modified = it->second .last_modified ;
266- }
267- const bool should_validate = request_validate_manifest && ((last_modified != cached_last_modified) || !it->second .validated );
268- const bool is_valid = should_validate ? validator.Check (json_text) : true ;
254+ const bool is_valid = request_validate_manifest ? validator.Check (json_text) : true ;
269255
270256 if (!is_valid) {
271257 switch (configurator_mode) {
@@ -407,6 +393,14 @@ LayerLoadStatus Layer::Load(const Path& full_path_to_file, LayerType type, bool
407393 return this ->IsValid () ? LAYER_LOAD_ADDED : LAYER_LOAD_INVALID; // Not all JSON file are layer JSON valid
408394}
409395
396+ bool operator <(const Layer& layer_a, const Layer& layer_b) {
397+ if (layer_a.key == layer_b.key ) {
398+ return layer_a.api_version < layer_b.api_version ;
399+ } else {
400+ return layer_a.key < layer_b.key ;
401+ }
402+ }
403+
410404void CollectDefaultSettingData (const SettingMetaSet& meta_set, SettingDataSet& data_set) {
411405 for (std::size_t i = 0 , n = meta_set.size (); i < n; ++i) {
412406 SettingMeta* setting_meta = meta_set[i];
0 commit comments