Qt: Fix HiDPI scaling on non-software renderers

This commit is contained in:
Cacodemon345
2025-03-30 21:03:46 +06:00
parent 512154e4a8
commit 8f94ccec80
6 changed files with 35 additions and 27 deletions

View File

@@ -970,17 +970,11 @@ VulkanRenderer2::startNextFrame()
m_devFuncs->vkCmdBindVertexBuffers(cb, 0, 1, &m_buf, &vbOffset);
VkViewport viewport;
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.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);