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) {
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);