Skip to content

Commit 435e7f4

Browse files
dengkailrpavlik
authored andcommitted
OpenXR loader: fix for implicit/explicit api layer loading logic.
1 parent f66902f commit 435e7f4

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

src/loader/api_layer_interface.cpp

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -237,21 +237,23 @@ XrResult ApiLayerInterface::LoadApiLayers(const std::string& openxr_command, uin
237237
for (const auto& layer_name : enabled_explicit_api_layer_names) {
238238
bool found_this_layer = false;
239239

240-
for (auto it = explicit_layer_manifest_files.begin(); it != explicit_layer_manifest_files.end();) {
241-
bool erased_layer_manifest_file = false;
242-
243-
if (layers_already_found.count(layer_name) > 0) {
244-
found_this_layer = true;
245-
} else if (layer_name == (*it)->LayerName()) {
246-
found_this_layer = true;
247-
layers_already_found.insert(layer_name);
248-
enabled_layer_manifest_files_in_init_order.push_back(std::move(*it));
249-
it = explicit_layer_manifest_files.erase(it);
250-
erased_layer_manifest_file = true;
251-
}
240+
if (layers_already_found.count(layer_name) > 0) {
241+
found_this_layer = true;
242+
} else {
243+
for (auto it = explicit_layer_manifest_files.begin(); it != explicit_layer_manifest_files.end();) {
244+
bool erased_layer_manifest_file = false;
245+
246+
if (layer_name == (*it)->LayerName()) {
247+
found_this_layer = true;
248+
layers_already_found.insert(layer_name);
249+
enabled_layer_manifest_files_in_init_order.push_back(std::move(*it));
250+
it = explicit_layer_manifest_files.erase(it);
251+
erased_layer_manifest_file = true;
252+
}
252253

253-
if (!erased_layer_manifest_file) {
254-
it++;
254+
if (!erased_layer_manifest_file) {
255+
it++;
256+
}
255257
}
256258
}
257259

0 commit comments

Comments
 (0)