Qt: Tentative fix for renderer switching crash

This commit is contained in:
Vicki Pfau 2022-12-12 03:58:12 -08:00
parent 1127cf8b84
commit 4626cac9e8
2 changed files with 7 additions and 0 deletions

View File

@ -938,6 +938,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

@ -1061,6 +1061,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) {