Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
6.5.3
-
None
-
-
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
- is duplicated by
-
QTBUG-119571 swap chain of vulkan is re-created repeatedly in Qt 6
- Closed