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

qvulkanwindow repeatedly recreate swapchain

    XMLWordPrintable

Details

    • Windows
    • 149f178d3 (dev), daedbdbba (6.6), f42e84681 (tqtc/lts-6.5), e132f55ac (tqtc/lts-6.2)

    Description

      I read the code in qvulkanwindow.cpp and find swapchian will be recreated when

      if (q->size() * q->devicePixelRatio() != swapChainImageSize) {        
      recreateSwapChain();
      }

      in beginFrame(). However, in recreateSwapChain(), I find the swapChainImageSize will actually be changed to

      swapChainImageSize = QSize(bufferSize.width, bufferSize.height); 

      and bufferSize comes from

      VkExtent2D bufferSize = surfaceCaps.currentExtent; 

      So in some case, if bufferSize didn't match swapChainImageSize, it will be recreated again and again.

      In my case, this happened when my device devicePixelRatio()=1.5 and I use mouse change the window size. And the difference betwenn bufferSize and q->size() * q->devicePixelRatio() is actually just 1. 

      But when devicePixelRatio()=1 it didn't happen. I wonder is it caused by float problem?

      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
              zhangyushao Zunyu Zhang
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes