mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-07-08 08:40:55 +00:00
Add new checks for vkconfig, and detect after startup
* We check every couple of seconds for the vkconfig file (and then stop checking after warning) so that users are more likely to see the warning.
This commit is contained in:
@@ -574,34 +574,6 @@ int main(int argc, char *argv[])
|
||||
|
||||
GUIInvoke::init();
|
||||
|
||||
{
|
||||
QString homePath = QStandardPaths::writableLocation(QStandardPaths::HomeLocation);
|
||||
#if defined(Q_OS_WIN32)
|
||||
QString fn = homePath + lit("/AppData/Local/LunarG/vkconfig/override/");
|
||||
#else
|
||||
QString fn = homePath + lit("/.local/share/vulkan/implicit_layer.d/");
|
||||
#endif
|
||||
// documentation is unclear, mentions both these files so check both just in case
|
||||
QFileInfo vkconfigcheck1(fn + lit("VkLayerOverride.json"));
|
||||
QFileInfo vkconfigcheck2(fn + lit("VkLayer_Override.json"));
|
||||
// lower case might be used on linux
|
||||
QFileInfo vkconfigcheck3(fn + lit("VkLayer_override.json"));
|
||||
if((vkconfigcheck1.exists() && vkconfigcheck1.isFile()) ||
|
||||
(vkconfigcheck2.exists() && vkconfigcheck2.isFile()) ||
|
||||
(vkconfigcheck3.exists() && vkconfigcheck3.isFile()))
|
||||
{
|
||||
RDDialog::warning(
|
||||
NULL, tr("vkconfig detected - possible incompatibility"),
|
||||
tr("Configuration from 'vkconfig' tool detected.\n\n"
|
||||
"This program has caused problems in the past and it is \n"
|
||||
"strongly recommended that you disable it while using RenderDoc.\n\n"
|
||||
"If this program is not active check the path below for any leftover files:\n\n%1")
|
||||
.arg(fn));
|
||||
|
||||
qInfo() << "vkconfig detected and warned";
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
GlobalEnvironment env;
|
||||
#if defined(RENDERDOC_PLATFORM_LINUX)
|
||||
|
||||
@@ -227,6 +227,56 @@ MainWindow::MainWindow(ICaptureContext &ctx) : QMainWindow(NULL), ui(new Ui::Mai
|
||||
m_MessageTick.setInterval(175);
|
||||
m_MessageTick.start();
|
||||
|
||||
QTimer *vkconfigCheckTimer = new QTimer(this);
|
||||
QObject::connect(vkconfigCheckTimer, &QTimer::timeout, [vkconfigCheckTimer]() {
|
||||
QString homePath = QStandardPaths::writableLocation(QStandardPaths::HomeLocation);
|
||||
|
||||
// for some reason these paths have changed a lot so we have to check them all :(
|
||||
const QString basePaths[] = {
|
||||
#if defined(Q_OS_WIN32)
|
||||
lit("/AppData/Local/LunarG/vkconfig/override/"),
|
||||
lit("/AppData/Local/LunarG/vulkan/"),
|
||||
#else
|
||||
lit("/.local/share/vulkan/implicit_layer.d/"),
|
||||
lit("/.local/share/vulkan/loader_settings.d/"),
|
||||
#endif
|
||||
};
|
||||
|
||||
const QString filenames[] = {
|
||||
lit("VkLayerOverride.json"),
|
||||
lit("VkLayer_Override.json"),
|
||||
lit("VkLayer_override.json"),
|
||||
lit("vk_loader_settings.json"),
|
||||
};
|
||||
|
||||
for(const QString &path : basePaths)
|
||||
{
|
||||
for(const QString &fn : filenames)
|
||||
{
|
||||
QFileInfo vkconfigcheck(homePath + path + fn);
|
||||
|
||||
if(vkconfigcheck.exists() && vkconfigcheck.isFile())
|
||||
{
|
||||
RDDialog::warning(
|
||||
NULL, tr("vkconfig detected - possible incompatibility"),
|
||||
tr("Configuration from 'vkconfig' tool detected.\n\n"
|
||||
"This program has caused problems in the past and it is \n"
|
||||
"strongly recommended that you disable it while using RenderDoc.\n\n"
|
||||
"If this program is not active check the path below for any leftover files:\n\n%1")
|
||||
.arg(vkconfigcheck.absoluteFilePath()));
|
||||
|
||||
qInfo() << "vkconfig detected and warned";
|
||||
vkconfigCheckTimer->stop();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
vkconfigCheckTimer->setSingleShot(false);
|
||||
vkconfigCheckTimer->setInterval(2500);
|
||||
vkconfigCheckTimer->start();
|
||||
|
||||
m_RemoteProbeSemaphore.release();
|
||||
m_RemoteProbe = new LambdaThread([this]() {
|
||||
// fetch all device protocols to start them processing
|
||||
|
||||
Reference in New Issue
Block a user