Qt: Work around broken drivers that don't allow backend switching

This commit is contained in:
spycrab 2018-02-02 15:35:03 +01:00
parent 1264daae9b
commit 7c5e464584
1 changed files with 14 additions and 0 deletions

View File

@ -575,7 +575,21 @@ void MainWindow::HideRenderWidget()
disconnect(Host::GetInstance(), &Host::RequestTitle, this, &MainWindow::setWindowTitle);
setWindowTitle(QString::fromStdString(Common::scm_rev_str));
}
// The following code works around a driver bug that would lead to Dolphin crashing when changing
// graphics backends (e.g. OpenGL to Vulkan). To avoid this the render widget is (safely) recreated
disconnect(m_render_widget, &RenderWidget::EscapePressed, this, &MainWindow::RequestStop);
disconnect(m_render_widget, &RenderWidget::Closed, this, &MainWindow::ForceStop);
m_render_widget->hide();
m_render_widget->removeEventFilter(this);
m_render_widget->deleteLater();
m_render_widget = new RenderWidget;
m_render_widget->installEventFilter(this);
connect(m_render_widget, &RenderWidget::EscapePressed, this, &MainWindow::RequestStop);
connect(m_render_widget, &RenderWidget::Closed, this, &MainWindow::ForceStop);
}
void MainWindow::ShowControllersWindow()