Vulkan renderer: Take the dpi_scale option into account when setting up the videwport, fixes #5374.

This commit is contained in:
OBattler
2025-03-24 14:17:59 +01:00
parent 9c37eb9966
commit b4fdb6dcdc

View File

@@ -970,10 +970,17 @@ VulkanRenderer2::startNextFrame()
m_devFuncs->vkCmdBindVertexBuffers(cb, 0, 1, &m_buf, &vbOffset);
VkViewport viewport;
viewport.x = destination.x() * m_window->devicePixelRatio();
viewport.y = destination.y() * m_window->devicePixelRatio();
viewport.width = destination.width() * m_window->devicePixelRatio();
viewport.height = destination.height() * m_window->devicePixelRatio();
if (dpi_scale) {
viewport.x = destination.x() * m_window->devicePixelRatio();
viewport.y = destination.y() * m_window->devicePixelRatio();
viewport.width = destination.width() * m_window->devicePixelRatio();
viewport.height = destination.height() * m_window->devicePixelRatio();
} else {
viewport.x = destination.x();
viewport.y = destination.y();
viewport.width = destination.width();
viewport.height = destination.height();
}
viewport.minDepth = 0;
viewport.maxDepth = 1;
m_devFuncs->vkCmdSetViewport(cb, 0, 1, &viewport);