rhi: gl: Set the screen on the context, if possible
Take the screen from the window, if the window was specified. When it comes to Qt Quick, this is in fact required in order to make the behavior on par with Qt 5, see https://code.qt.io/cgit/qt/qtdeclarative.git/tree/src/quick/scenegraph/qsgthreadedrenderloop.cpp?h=5.15#n1336 try to mirror that in Qt 6 as well. There are still subtle differences between Qt 5 and Qt 6 in particular when qt_gl_global_share_context is set (do we set the screen from that or from the window?), for now leave that question unsettled. What exactly setting the screen on the context does is platform specific, and can become relevant with multi screen, multi GPU systems. Pick-to: 6.2 Change-Id: Icc90b8fea87bf1e34ecf1dec0702f4d3c411db00 Reviewed-by: Christian Strømme <christian.stromme@qt.io>
This commit is contained in:
parent
f9e9d21a11
commit
8043a1a75a
@ -484,6 +484,8 @@ bool QRhiGles2::create(QRhi::Flags flags)
|
||||
} else if (QOpenGLContext *shareContext = qt_gl_global_share_context()) {
|
||||
ctx->setShareContext(shareContext);
|
||||
ctx->setScreen(shareContext->screen());
|
||||
} else if (maybeWindow) {
|
||||
ctx->setScreen(maybeWindow->screen());
|
||||
}
|
||||
if (!ctx->create()) {
|
||||
qWarning("QRhiGles2: Failed to create context");
|
||||
|
Loading…
x
Reference in New Issue
Block a user