diff options
author | seth <getchoo@tuta.io> | 2023-03-31 20:09:26 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-31 20:09:26 +0000 |
commit | 3e3b92d4c1a93f1430b7d222622758d0da1f4ac8 (patch) | |
tree | b2c9cec7e06eec757a02efbd81375d56dafd9378 | |
parent | c7dc115365006a8bff8ca93a01a6df4134eb92e9 (diff) | |
download | PrismLauncher-3e3b92d4c1a93f1430b7d222622758d0da1f4ac8.tar.gz PrismLauncher-3e3b92d4c1a93f1430b7d222622758d0da1f4ac8.tar.bz2 PrismLauncher-3e3b92d4c1a93f1430b7d222622758d0da1f4ac8.zip |
chore: improve detection of newer vulkan layers
i've been scrump'd
Co-authored-by: Sefa Eyeoglu <contact@scrumplex.net>
Signed-off-by: seth <getchoo@tuta.io>
-rw-r--r-- | launcher/MangoHud.cpp | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/launcher/MangoHud.cpp b/launcher/MangoHud.cpp index 076d3064..890aca57 100644 --- a/launcher/MangoHud.cpp +++ b/launcher/MangoHud.cpp @@ -75,23 +75,20 @@ QString getLibraryString() } for (QString vkLayer : vkLayerList) { - QStringList vkArchitectures = { "x86_64", "aarch64" }; + // prefer to use architecture specific vulkan layers + QStringList manifestNames = { "MangoHud.x86_64.json", "MangoHud.aarch64.json", "MangoHud.json" }; QString filePath = ""; - // prefer to use architecture specific vulkan layers - for (QString arch: vkArchitectures) { - QString tryPath = FS::PathCombine(vkLayer, QString("MangoHud.%1.json").arg(arch)); + for (QString manifestName : manifestNames) { + QString tryPath = FS::PathCombine(vkLayer, manifestName); if (QFile::exists(tryPath)) { - filePath = tryPath; + filePath = tryPath; + break; } } - if (filePath.isEmpty()) { - filePath = FS::PathCombine(vkLayer, "MangoHud.json"); - // bail out if no mangohud layers are found - if (!QFile::exists(filePath)) - continue; - } + if (filePath.isEmpty()) + continue; auto conf = Json::requireDocument(filePath, vkLayer); auto confObject = Json::requireObject(conf, vkLayer); |