Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: search for newer mangohud vulkan layers #965

Merged
merged 3 commits into from
Apr 2, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 17 additions & 3 deletions launcher/MangoHud.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,23 @@ QString getLibraryString()
}

for (QString vkLayer : vkLayerList) {
QString filePath = FS::PathCombine(vkLayer, "MangoHud.json");
if (!QFile::exists(filePath))
continue;
QStringList vkArchitectures = { "x86_64", "aarch64" };

QString filePath = "";
// prefer to use architecture specific vulkan layers
for (QString arch: vkArchitectures) {
QString tryPath = FS::PathCombine(vkLayer, QString("MangoHud.%1.json").arg(arch));
if (QFile::exists(tryPath)) {
filePath = tryPath;
}
}

if (filePath.isEmpty()) {
filePath = FS::PathCombine(vkLayer, "MangoHud.json");
// bail out if no mangohud layers are found
if (!QFile::exists(filePath))
continue;
}
getchoo marked this conversation as resolved.
Show resolved Hide resolved

auto conf = Json::requireDocument(filePath, vkLayer);
auto confObject = Json::requireObject(conf, vkLayer);
Expand Down