Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-119571

swap chain of vulkan is re-created repeatedly in Qt 6

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P1: Critical
    • None
    • 6.2.4, 6.3.2, 6.4.3, 6.5.3, 6.6.1
    • GUI: Vulkan
    • None
    • Windows

    Description

      When I stop resizing a QVulkanWindow, the swap chain of vulkan is still re-created repeatedly, and  the methods QVulkanWindowRenderer::initSwapChainResources(),  QVulkanWindowRenderer::releaseSwapChainResources() are invoked repeatedly. Such as the following output:

      qt.vulkan: Actual swap chain buffer count: 3 (supportsReadback=1)
      qt.vulkan: Allocating 2932736 bytes for transient image (memtype 0)
      void __cdecl Renderer::initSwapChainResources(void)
      qt.vulkan: Creating new swap chain of 3 buffers, size 853x639
      qt.vulkan: Releasing swapchain
      void __cdecl Renderer::releaseSwapChainResources(void)
      qt.vulkan: Actual swap chain buffer count: 3 (supportsReadback=1)
      qt.vulkan: Allocating 2932736 bytes for transient image (memtype 0)
      void __cdecl Renderer::initSwapChainResources(void)
      qt.vulkan: Creating new swap chain of 3 buffers, size 853x639
      qt.vulkan: Releasing swapchain
      void __cdecl Renderer::releaseSwapChainResources(void)

      Pay attention that, I output resize and expose events for QVulkanWindow intentionally to distinguish normal swap chain recreation when resizing actually happens, such as the code following:

       

      class VulkanWindow : public QVulkanWindow
      {
      public:
          QVulkanWindowRenderer *createRenderer() override
         

      {         return new Renderer(this);     }

      protected:
          void resizeEvent(QResizeEvent *ev) override
         

      {         qDebug() << Q_FUNC_INFO << ev->oldSize() << ev->size();         QVulkanWindow::resizeEvent(ev);     }

          void exposeEvent(QExposeEvent *ev) override
         

      {         qDebug() << Q_FUNC_INFO << isExposed();         QVulkanWindow::exposeEvent(ev);     }

      };

       

      With the log of output above, we can infer that those events do NOT occur when the swap chain continues to be re-created. Because the relevant output of resize and expose events not exist in the log.

       

      What's more, I tested the case with Qt 5.15.2, it works perfectly.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              lagocs Laszlo Agocs
              yanzhikai Zhikai Yan
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes