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>
This commit is contained in:
seth 2023-03-31 20:09:26 +00:00 committed by GitHub
parent c7dc115365
commit 3e3b92d4c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -75,23 +75,20 @@ QString getLibraryString()
} }
for (QString vkLayer : vkLayerList) { 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 = ""; QString filePath = "";
// prefer to use architecture specific vulkan layers for (QString manifestName : manifestNames) {
for (QString arch: vkArchitectures) { QString tryPath = FS::PathCombine(vkLayer, manifestName);
QString tryPath = FS::PathCombine(vkLayer, QString("MangoHud.%1.json").arg(arch));
if (QFile::exists(tryPath)) { if (QFile::exists(tryPath)) {
filePath = tryPath; filePath = tryPath;
break;
} }
} }
if (filePath.isEmpty()) { if (filePath.isEmpty())
filePath = FS::PathCombine(vkLayer, "MangoHud.json"); continue;
// bail out if no mangohud layers are found
if (!QFile::exists(filePath))
continue;
}
auto conf = Json::requireDocument(filePath, vkLayer); auto conf = Json::requireDocument(filePath, vkLayer);
auto confObject = Json::requireObject(conf, vkLayer); auto confObject = Json::requireObject(conf, vkLayer);