Qt: Tentative fix for renderer switching crash

This commit is contained in:
Vicki Pfau 2022-12-12 03:58:12 -08:00
parent 3d723d5cf4
commit 245f4b961a
2 changed files with 7 additions and 0 deletions

View File

@ -960,6 +960,11 @@ QOpenGLContext* PainterGL::shareContext() {
void PainterGL::updateFramebufferHandle() {
QOpenGLFunctions_Baseline* fn = m_gl->versionFunctions<QOpenGLFunctions_Baseline>();
fn->glFinish();
CoreController::Interrupter interrupter(m_context);
if (!m_context->hardwareAccelerated()) {
return;
}
enqueue(m_bridgeTexIn);
m_context->setFramebufferHandle(m_bridgeTexIn);
}

View File

@ -1107,6 +1107,8 @@ void Window::changeRenderer() {
if (!m_controller) {
return;
}
CoreController::Interrupter interrupter(m_controller);
if (m_config->getOption("hwaccelVideo").toInt() && m_display->supportsShaders() && m_controller->supportsFeature(CoreController::Feature::OPENGL)) {
std::shared_ptr<VideoProxy> proxy = m_display->videoProxy();
if (!proxy) {