diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2020-09-09 11:41:36 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2020-09-10 13:28:07 +0200 |
commit | b48fe3d53af1be7d8d7d0bdc5a2bb4aba7894fdf (patch) | |
tree | 7ac364f0f420225a89fb0f5261c38e8e1b7d1860 | |
parent | f394d5873d01c6382022c9477f7938818284edda (diff) |
Move the sharegroup with the context to the render thread
...if the context does not have a share context, i.e. the
QOpenGLContextGroup was created together with the QOpenGLContext.
This is not applicable to Qt 6 where the context is created on the
render thread and so there is no moveToThread() for it.
Fixes: QTBUG-86524
Change-Id: Ida8b947548325ea2f7572cdb9373bbc90e4e7e4f
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
-rw-r--r-- | src/quick/scenegraph/qsgthreadedrenderloop.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/quick/scenegraph/qsgthreadedrenderloop.cpp b/src/quick/scenegraph/qsgthreadedrenderloop.cpp index 9b288029b4..1c72c4dba6 100644 --- a/src/quick/scenegraph/qsgthreadedrenderloop.cpp +++ b/src/quick/scenegraph/qsgthreadedrenderloop.cpp @@ -1344,6 +1344,8 @@ void QSGThreadedRenderLoop::handleExposure(QQuickWindow *window) QQuickWindowPrivate::get(w->window)->fireOpenGLContextCreated(w->thread->gl); w->thread->gl->moveToThread(w->thread); + if (!w->thread->gl->shareContext()) + w->thread->gl->shareGroup()->moveToThread(w->thread); qCDebug(QSG_LOG_RENDERLOOP, "- OpenGL context created"); w->thread->offscreenSurface = new QOffscreenSurface(); |