From f03af5eff5c4a2191bca2e5ba09ca24012b7ebc3 Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Wed, 5 Apr 2023 11:29:52 +0100 Subject: [PATCH] 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. --- src/libkwineffects/kwinoffscreenquickview.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libkwineffects/kwinoffscreenquickview.cpp b/src/libkwineffects/kwinoffscreenquickview.cpp index 8932a04751..0825d19c13 100644 --- a/src/libkwineffects/kwinoffscreenquickview.cpp +++ b/src/libkwineffects/kwinoffscreenquickview.cpp @@ -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);