Merge pull request #2308 from Cacodemon345/newqt2
vulkan: HiDPI and brightness fixes
This commit is contained in:
@@ -964,10 +964,10 @@ void 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();
|
viewport.x = destination.x() * m_window->devicePixelRatio();
|
||||||
viewport.y = destination.y();
|
viewport.y = destination.y() * m_window->devicePixelRatio();
|
||||||
viewport.width = destination.width();
|
viewport.width = destination.width() * m_window->devicePixelRatio();
|
||||||
viewport.height = destination.height();
|
viewport.height = destination.height() * m_window->devicePixelRatio();
|
||||||
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);
|
||||||
|
@@ -797,6 +797,7 @@ VulkanWindowRenderer::VulkanWindowRenderer(QWidget* parent)
|
|||||||
parentWidget = parent;
|
parentWidget = parent;
|
||||||
instance.setLayers(QByteArrayList() << "VK_LAYER_KHRONOS_validation");
|
instance.setLayers(QByteArrayList() << "VK_LAYER_KHRONOS_validation");
|
||||||
instance.setExtensions(QByteArrayList() << "VK_EXT_debug_report");
|
instance.setExtensions(QByteArrayList() << "VK_EXT_debug_report");
|
||||||
|
instance.setApiVersion(QVersionNumber(1, 0));
|
||||||
if (!instance.create()) {
|
if (!instance.create()) {
|
||||||
throw std::runtime_error("Could not create Vulkan instance");
|
throw std::runtime_error("Could not create Vulkan instance");
|
||||||
}
|
}
|
||||||
@@ -808,6 +809,7 @@ VulkanWindowRenderer::VulkanWindowRenderer(QWidget* parent)
|
|||||||
qDebug() << instance.layers();
|
qDebug() << instance.layers();
|
||||||
setVulkanInstance(&instance);
|
setVulkanInstance(&instance);
|
||||||
setPhysicalDeviceIndex(0);
|
setPhysicalDeviceIndex(0);
|
||||||
|
setPreferredColorFormats({VK_FORMAT_B8G8R8A8_UNORM, VK_FORMAT_R8G8B8A8_UNORM, VK_FORMAT_A8B8G8R8_UNORM_PACK32});
|
||||||
setFlags(Flag::PersistentResources);
|
setFlags(Flag::PersistentResources);
|
||||||
buf_usage = std::vector<std::atomic_flag>(1);
|
buf_usage = std::vector<std::atomic_flag>(1);
|
||||||
buf_usage[0].clear();
|
buf_usage[0].clear();
|
||||||
|
Reference in New Issue
Block a user