diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2020-06-22 16:25:16 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2020-06-22 19:07:17 +0200 |
commit | 9045b94d1ad7e945475d52bba152fdbdb36debbf (patch) | |
tree | 51adb75bdad3bf3b34d15eb22a3e56dfe17fac4b /src/quick/items/qquickwindow.cpp | |
parent | 0a1e4cc7ec7548f6273befff9cdddb0bc7a58961 (diff) |
Defer setting a QVulkanInstance on the window
...to createRhi(). There is no need for the VkInstance before that
point.
Change-Id: I87f4e8154e96409bccd7844f1bf80b957bb54d69
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'src/quick/items/qquickwindow.cpp')
-rw-r--r-- | src/quick/items/qquickwindow.cpp | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp index 5c7c39edf6..ddb39c3864 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -808,16 +808,10 @@ void QQuickWindowPrivate::init(QQuickWindow *c, QQuickRenderControl *control) q->setSurfaceType(windowManager ? windowManager->windowSurfaceType() : QSurface::OpenGLSurface); q->setFormat(sg->defaultSurfaceFormat()); -#if QT_CONFIG(vulkan) - // Normal QQuickWindows must get a QVulkanInstance automatically (it is - // created when the first window is constructed and is destroyed only on - // exit). With QQuickRenderControl however, no QVulkanInstance is created, - // because it must be under the application's control then (since the - // default instance we could create here would not be configurable by the - // application in any way, and that is not acceptable in advanced use cases). - if (!renderControl && q->surfaceType() == QSurface::VulkanSurface) - q->setVulkanInstance(QSGRhiSupport::defaultVulkanInstance()); -#endif + // When using Vulkan, associating a scenegraph-managed QVulkanInstance with + // the window (but only when not using renderControl) is deferred to + // QSGRhiSupport::createRhi(). This allows applications to set up their own + // QVulkanInstance and set that on the window, if they wish to. animationController.reset(new QQuickAnimatorController(q)); |