Vulkan renderer: Take the dpi_scale option into account when setting up the videwport, fixes #5374.
This commit is contained in:
@@ -970,10 +970,17 @@ VulkanRenderer2::startNextFrame()
|
|||||||
m_devFuncs->vkCmdBindVertexBuffers(cb, 0, 1, &m_buf, &vbOffset);
|
m_devFuncs->vkCmdBindVertexBuffers(cb, 0, 1, &m_buf, &vbOffset);
|
||||||
|
|
||||||
VkViewport viewport;
|
VkViewport viewport;
|
||||||
viewport.x = destination.x() * m_window->devicePixelRatio();
|
if (dpi_scale) {
|
||||||
viewport.y = destination.y() * m_window->devicePixelRatio();
|
viewport.x = destination.x() * m_window->devicePixelRatio();
|
||||||
viewport.width = destination.width() * m_window->devicePixelRatio();
|
viewport.y = destination.y() * m_window->devicePixelRatio();
|
||||||
viewport.height = destination.height() * 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.minDepth = 0;
|
||||||
viewport.maxDepth = 1;
|
viewport.maxDepth = 1;
|
||||||
m_devFuncs->vkCmdSetViewport(cb, 0, 1, &viewport);
|
m_devFuncs->vkCmdSetViewport(cb, 0, 1, &viewport);
|
||||||
|
|||||||
Reference in New Issue
Block a user