diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2020-07-14 13:10:03 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2020-07-28 13:03:57 +0200 |
commit | 5707573926bd7329fb468f519020b04197b245a1 (patch) | |
tree | 56f63a911af7ef90134c33573957b5485383731b /src/quick/scenegraph/qsgrenderloop.cpp | |
parent | ca62d2c81fb8a8e689393d8ea97f03cfa652e8b5 (diff) |
Fix multiple windows with Vulkan on basic render loop
No problems with threaded, but when using QSG_RENDER_LOOP=basic with
Vulkan we missed setting the Vulkan instance for the second, third, etc.
window.
The problem can be seen with the quick/window example, running it with
QSG_RHI_BACKEND=vulkan QSG_RENDER_LOOP=basic makes it fail. With the
patch it will function as expected.
Change-Id: I98e7cb5ff960200dadb2fcbc30f771f9a7d9a9ae
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'src/quick/scenegraph/qsgrenderloop.cpp')
-rw-r--r-- | src/quick/scenegraph/qsgrenderloop.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/quick/scenegraph/qsgrenderloop.cpp b/src/quick/scenegraph/qsgrenderloop.cpp index 9d1217edf9..0c1850f91f 100644 --- a/src/quick/scenegraph/qsgrenderloop.cpp +++ b/src/quick/scenegraph/qsgrenderloop.cpp @@ -517,6 +517,11 @@ void QSGGuiThreadRenderLoop::renderWindow(QQuickWindow *window) // QQuickWindowPrivate, do it now cd->rhi = rhi; + // Unlike the threaded render loop, we use the same rhi for all windows + // and so createRhi() is called only once. Certain initialization may + // need to be done on a per window basis still, so make sure it is done. + rhiSupport->prepareWindowForRhi(window); + QRhiSwapChain::Flags flags = QRhiSwapChain::UsedAsTransferSource; // may be used in a grab // QQ is always premul alpha. Decide based on alphaBufferSize in |