DPI: VkSurfaceCapabilitiesKHR extents not matching Qt surface extents


#1

Hello,

When using high-DPI settings I noticed that the VkSurfaceCapabilitiesKHR currentExtent, minImageExtent and maxImageExtent are sometimes a pixel less in their dimensions than the computed value of Qt using AA_EnableHighDpiScaling ( QWindow::size() * QWindow::devicePixelRatio() ).
If I use Windows’ SetProcessDPIAware() instead then the dimensions seem to be fine.

For example:

width()=224
devicePixelRatio()=2.0
=> scaled width = 448
but currentExtent.width = 447

Why is Vk rounding down ? Is there a way to get the dpi scaling factor Vk is using ?

Best Regards, Megamouse


#2

Hm, what does GetClientRect return?


#3

GetClientRect returns the same values as Vk in this case.
So if I exchange the Qt width for the RECT width then it works fine.

I’m assuming this is a Qt bug.