Merge branch 'master' of ssh://github.com/86Box/86Box

This commit is contained in:
RichardG867
2022-04-26 11:38:14 -03:00
3 changed files with 13 additions and 4 deletions

View File

@@ -1453,6 +1453,10 @@ void MainWindow::keyPressEvent(QKeyEvent* event)
{
if (send_keyboard_input && !(kbd_req_capture && !mouse_capture && !video_fullscreen))
{
// Windows keys in Qt have one-to-one mapping.
if (event->key() == Qt::Key_Super_L || event->key() == Qt::Key_Super_R) {
keyboard_input(1, event->key() == Qt::Key_Super_L ? 0x15B : 0x15C);
} else
#ifdef Q_OS_MACOS
processMacKeyboardInput(true, event);
#else
@@ -1480,6 +1484,9 @@ void MainWindow::keyReleaseEvent(QKeyEvent* event)
if (!send_keyboard_input)
return;
if (event->key() == Qt::Key_Super_L || event->key() == Qt::Key_Super_R) {
keyboard_input(0, event->key() == Qt::Key_Super_L ? 0x15B : 0x15C);
} else
#ifdef Q_OS_MACOS
processMacKeyboardInput(false, event);
#else

View File

@@ -964,10 +964,10 @@ void VulkanRenderer2::startNextFrame()
m_devFuncs->vkCmdBindVertexBuffers(cb, 0, 1, &m_buf, &vbOffset);
VkViewport viewport;
viewport.x = destination.x();
viewport.y = destination.y();
viewport.width = destination.width();
viewport.height = destination.height();
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();
viewport.minDepth = 0;
viewport.maxDepth = 1;
m_devFuncs->vkCmdSetViewport(cb, 0, 1, &viewport);

View File

@@ -797,6 +797,7 @@ VulkanWindowRenderer::VulkanWindowRenderer(QWidget* parent)
parentWidget = parent;
instance.setLayers(QByteArrayList() << "VK_LAYER_KHRONOS_validation");
instance.setExtensions(QByteArrayList() << "VK_EXT_debug_report");
instance.setApiVersion(QVersionNumber(1, 0));
if (!instance.create()) {
throw std::runtime_error("Could not create Vulkan instance");
}
@@ -808,6 +809,7 @@ VulkanWindowRenderer::VulkanWindowRenderer(QWidget* parent)
qDebug() << instance.layers();
setVulkanInstance(&instance);
setPhysicalDeviceIndex(0);
setPreferredColorFormats({VK_FORMAT_B8G8R8A8_UNORM, VK_FORMAT_R8G8B8A8_UNORM, VK_FORMAT_A8B8G8R8_UNORM_PACK32});
setFlags(Flag::PersistentResources);
buf_usage = std::vector<std::atomic_flag>(1);
buf_usage[0].clear();