effects: Do not call RHI QQuickRenderControl methods when using software rendering

As per the docs:
Note: This function does not need to be, and must not be, called when
using the software adaptation of Qt Quick.

This sets up RHI on the render control, which in turn sets RHI on the
window, which shouldn't exist when using software rendering.

BUG: 482663
BUG: 486078
This commit is contained in:
David Edmundson 2024-06-04 08:33:19 +00:00
parent fd746b46e5
commit 8c149bb6b7

View file

@ -96,7 +96,7 @@ OffscreenQuickView::OffscreenQuickView(ExportMode exportMode, bool alpha)
if (!usingGl) {
qCDebug(LIBKWINEFFECTS) << "QtQuick Software rendering mode detected";
d->m_useBlit = true;
d->m_renderControl->initialize();
// explicilty do not call QQuickRenderControl::initialize, see Qt docs
} else {
QSurfaceFormat format;
format.setOption(QSurfaceFormat::ResetNotification);
@ -238,10 +238,14 @@ void OffscreenQuickView::update()
}
d->m_renderControl->polishItems();
d->m_renderControl->beginFrame();
if (usingGl) {
d->m_renderControl->beginFrame();
}
d->m_renderControl->sync();
d->m_renderControl->render();
d->m_renderControl->endFrame();
if (usingGl) {
d->m_renderControl->endFrame();
}
if (usingGl) {
QQuickOpenGLUtils::resetOpenGLState();