diff options
author | Sefa Eyeoglu <contact@scrumplex.net> | 2023-04-02 17:55:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-02 17:55:19 +0200 |
commit | 0a9081cb878044ec70f40f46082a23c5e821b101 (patch) | |
tree | 253d8e0db44de1ef45259f0770b108e2b6b39506 | |
parent | eea1e3b80090994171f26b416dfb79dc7604121e (diff) | |
parent | 4055e34320e738753a6e8f5431790f078daf974b (diff) | |
download | PrismLauncher-0a9081cb878044ec70f40f46082a23c5e821b101.tar.gz PrismLauncher-0a9081cb878044ec70f40f46082a23c5e821b101.tar.bz2 PrismLauncher-0a9081cb878044ec70f40f46082a23c5e821b101.zip |
Merge pull request #965 from getchoo/update-manoghud-detection
-rw-r--r-- | launcher/MangoHud.cpp | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/launcher/MangoHud.cpp b/launcher/MangoHud.cpp index d635518e..90e48e29 100644 --- a/launcher/MangoHud.cpp +++ b/launcher/MangoHud.cpp @@ -19,6 +19,7 @@ #include <QStringList> #include <QDir> #include <QString> +#include <QSysInfo> #include <QtGlobal> #include "MangoHud.h" @@ -75,9 +76,27 @@ QString getLibraryString() } for (QString vkLayer : vkLayerList) { - QString filePath = FS::PathCombine(vkLayer, "MangoHud.json"); - if (!QFile::exists(filePath)) + // prefer to use architecture specific vulkan layers + QString currentArch = QSysInfo::currentCpuArchitecture(); + + if (currentArch == "arm64") { + currentArch = "aarch64"; + } + + QStringList manifestNames = { QString("MangoHud.%1.json").arg(currentArch), "MangoHud.json" }; + + QString filePath = ""; + for (QString manifestName : manifestNames) { + QString tryPath = FS::PathCombine(vkLayer, manifestName); + if (QFile::exists(tryPath)) { + filePath = tryPath; + break; + } + } + + if (filePath.isEmpty()) { continue; + } auto conf = Json::requireDocument(filePath, vkLayer); auto confObject = Json::requireObject(conf, vkLayer); |