libkwineffects: Set format on the main OffscreenQuickView

When showing the window RHI will realise the window has no underlying
platform window and create a temporary offscreen surface, different from
the offscreen surface we'll eventually be rendering into. This will use
the format of the main window.

If this offscreen surface format does not match the format of the
context we can fail in makeCurrent calls.
This commit is contained in:
David Edmundson 2023-04-05 11:29:52 +01:00
parent e68e92bcbd
commit f03af5eff5

View file

@ -105,6 +105,8 @@ OffscreenQuickView::OffscreenQuickView(QObject *parent, ExportMode exportMode)
format.setDepthBufferSize(16);
format.setStencilBufferSize(8);
d->m_view->setFormat(format);
auto shareContext = QOpenGLContext::globalShareContext();
d->m_glcontext.reset(new QOpenGLContext);
d->m_glcontext->setShareContext(shareContext);